UNPKG

@ordercloud/react-sdk

Version:

This is a developer library for OrderCloud developers utilizing React for their frontend development. It is essentially a wrapper for Tanstack query, which provides a lot of good functionality out of the box for background refreshes, request de-duplicatio

1,615 lines (1,582 loc) 60.7 kB
import { AccessToken } from 'ordercloud-javascript-sdk'; import { Address } from 'ordercloud-javascript-sdk'; import { ApiRole } from 'ordercloud-javascript-sdk'; import { CellContext } from '@tanstack/react-table'; import { DecodedToken } from 'ordercloud-javascript-sdk'; import { DefaultError } from '@tanstack/react-query'; import { FC } from 'react'; import { IOrderCloudContext as IOrderCloudContext_2 } from '..'; import { LineItem } from 'ordercloud-javascript-sdk'; import { ListPage } from 'ordercloud-javascript-sdk'; import { ListPageWithFacets } from 'ordercloud-javascript-sdk'; import { OpenAPIV3 } from 'openapi-types'; import { OrderCloudError } from 'ordercloud-javascript-sdk'; import { OrderShipMethodSelection } from 'ordercloud-javascript-sdk'; import { OrderStatus } from 'ordercloud-javascript-sdk'; import { PartialDeep } from 'ordercloud-javascript-sdk'; import { PaymentType } from 'ordercloud-javascript-sdk'; import { PriceMarkupType } from 'ordercloud-javascript-sdk'; import { PropsWithChildren } from 'react'; import { QueryClient } from '@tanstack/react-query'; import { QueryKey } from '@tanstack/react-query'; import { RequiredDeep } from 'ordercloud-javascript-sdk'; import { SdkConfiguration } from 'ordercloud-javascript-sdk'; import { SubscriptionInterval } from 'ordercloud-javascript-sdk'; import { UseFormProps } from 'react-hook-form'; import { UseFormReturn } from 'react-hook-form'; import { UseMutateAsyncFunction } from '@tanstack/react-query'; import { UseMutationOptions } from '@tanstack/react-query'; import { UseMutationResult } from '@tanstack/react-query'; import { UseQueryOptions } from '@tanstack/react-query'; import { UseQueryResult } from '@tanstack/react-query'; export declare const currencyFormats: { [resourceID: string]: ICurrencyData; }; declare interface CurrencyValues { languageType: string; currencyType: string; } declare interface ExpressionModels { label: string; path: string; properties: PromotionProperty[]; } declare interface ICurrencyData { currencyProperties: Array<string>; dependencies?: Array<string>; renderCurrencyInputs(tableRow?: unknown, params?: Array<string>): CurrencyValues; } export declare interface IOpenIdConnectConfig { /** * The ID of the [OpenID connect configuration](https://ordercloud.io/api-reference/authentication-and-authorization/open-id-connects/create) * that should be targeted for authentication */ id: string; /** * An **optional** array of roles that will be requested when authenticating. * If excluded, the token generated will contain any roles assigned to the user. * Unless you have a specific reason for limiting roles, we recommend omitting this option. */ roles?: string[]; /** * An **optional** OrderCloud clientId to authenticate against. * By default, will use `clientId` at the root of the provider settings. */ clientId?: string; /** * An **optional** path to redirect the user to after returning from the identity provider. * See [here](https://ordercloud.io/knowledge-base/sso-via-openid-connect#deep-linking) for more information * call `setAppStartPath(openIdConnectConfigId)` to change this value at runtime. */ appStartPath?: string; /** * **optional** query parameters passed along to the `AuthorizationEndpoint`. * See [here](https://ordercloud.io/knowledge-base/sso-via-openid-connect) for more information * call `setCustomParams(openIdConnectConfigId)` to change this value at runtime. */ customParams?: string; } export declare interface IOpenIdConnectSettings { /** * Enables or disables OpenID Connect authentication. * * Set to `true` to activate OIDC support in your application. If `false`, all OIDC logic * (such as login redirects and token handling) will be disabled, even if configs are defined. */ enabled: boolean; /** * An array of OpenID Connect configuration objects. * Each defines the settings required to authenticate against a specific identity provider. * At least one configuration must be provided. */ configs: IOpenIdConnectConfig[]; /** * True will automatically redirect the user to the * first openIdConnect config stored if the token is expired, or invalid. * This is a simplified use case. For more control, or when you need to * handle multiple identity providers set this to false and handle redirect on your * own by calling `loginWithOpenIdConnect` */ autoRedirect?: boolean; /** * The name of the query parameter under which the ordercloud access token will be stored under after successful login. * This will vary based on your [OpenIdConnect.AppStartUrl](https://ordercloud.io/api-reference/authentication-and-authorization/open-id-connects/create). * For example if your `AppStartUrl` is `https://my-buyer-application.com/login?token={0}` then the value should be `token` */ accessTokenQueryParamName: string; /** * The **optional** name of the query parameter under which the ordercloud refresh token will be stored * under after successful login. This will vary based on your [OpenIdConnect.AppStartUrl](https://ordercloud.io/api-reference/authentication-and-authorization/open-id-connects/create). * For example if your `AppStartUrl` is `https://my-buyer-application.com/login?token={0}&refresh={3}` then the value should be `refresh` */ refreshTokenQueryParamName?: string; /** * The **optional** name of the query parameter under which the idp access token will be stored * under after successful login. This will vary based on your [OpenIdConnect.AppStartUrl](https://ordercloud.io/api-reference/authentication-and-authorization/open-id-connects/create). * For example if your `AppStartUrl` is `https://my-buyer-application.com/login?token={0}&idptoken={1}` then the value should be `idptoken` */ idpAccessTokenQueryParamName?: string; /** * An **optional** path to redirect the user to after returning from the identity provider. * See [here](https://ordercloud.io/knowledge-base/sso-via-openid-connect#deep-linking) for more information * This global setting will be used if not overridden by the `appStartPath` in the individual OpenID Connect configurations. * Call `setAppStartPath()` to change this value at runtime. */ appStartPath?: string; /** * **optional** query parameters passed along to the `AuthorizationEndpoint`. * See [here](https://ordercloud.io/knowledge-base/sso-via-openid-connect) for more information * This global setting will be used if not overridden by the `customParams` in the individual OpenID Connect configurations. * Call `setCustomParams()` to change this value at runtime. */ customParams?: string; } export declare interface IOrderCloudContext { /** * Signifies when a valid token is available. * This will block all auth queries by default, mutation interaction will * be blocked by the login modal. */ isAuthenticated: boolean; /** * Signifies when an authenticated user is registered. */ isLoggedIn: boolean; /** * Clears all tokens from the OrderCloud JS SDK and conditionally will * get a new anonymous token based on allowAnonymous */ logout: () => void; /** * authenticates using the configured client ID and username / password */ login: (username: string, password: string, rememberMe?: boolean) => Promise<AccessToken>; /** * authenticates using the configured OpenID Connect settings */ loginWithOpenIdConnect: (openIdConnectId: string, options?: { appStartPath?: string; customParams?: string; }) => void; /** * authenticates using the provided OrderCloud access token */ setToken: (accessToken: string) => void; /** * Signifies when authorization is in a loading state */ authLoading: boolean; /** * If anonymous, this will retrieve a new anon token, useful for anonymous * users who want to submit more than one order. * @returns empty promise */ newAnonSession: () => Promise<void>; baseApiUrl: string; clientId: string; scope?: ApiRole[]; customScope?: string[]; allowAnonymous: boolean; defaultErrorHandler?: (error: OrderCloudError, context: IOrderCloudErrorContext) => void; token?: string; idpToken?: string; xpSchemas?: OpenAPIV3.SchemaObject; autoApplyPromotions?: boolean; currencyDefaults: { currencyCode: string; language: string; }; } export declare interface IOrderCloudErrorContext extends Omit<IOrderCloudContext, "defaultErrorHandler"> { } export declare interface IOrderCloudOperationObject extends OpenAPIV3.OperationObject { verb: string; path: string; } export declare interface IOrderCloudProvider { baseApiUrl: string; clientId: string; scope?: ApiRole[]; customScope?: string[]; allowAnonymous: boolean; openIdConnect?: IOpenIdConnectSettings; xpSchemas?: OpenAPIV3.SchemaObject; autoApplyPromotions?: boolean; configurationOverrides?: Omit<SdkConfiguration, 'baseApiUrl' | 'clientID'>; currencyDefaults?: { currencyCode: string; language: string; }; defaultErrorHandler?: (error: OrderCloudError, context: Omit<IOrderCloudContext, "defaultErrorHandler">) => void; } export declare const OrderCloudProvider: FC<PropsWithChildren<IOrderCloudProvider>>; export declare const parseToken: (token: string) => DecodedToken; declare type PromotionProperty = [string, OpenAPIV3.SchemaObject]; export declare const queryClient: QueryClient; declare type ServiceListOptions = { [key: string]: ServiceListOptions | string | undefined; }; export declare function useAuthMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(options: UseOcMutationOptions<TData, TError, TVariables, TContext>): UseMutationResult<TData, TError, TVariables, TContext>; export declare function useAuthQuery<TQueryFnData = unknown, TError = OrderCloudError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseOcQueryOptions<TQueryFnData, TError, TData, TQueryKey>, onError?: (error: OrderCloudError) => void): UseQueryResult<TData, TError>; export declare const useColumns: (resourceId: string, sortOrder?: string[], cellCallback?: (info: CellContext<unknown, unknown>, properties: OpenAPIV3.SchemaObject, resourceId: string) => JSX.Element) => { properties: { [name: string]: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject; } | undefined; assignmentProperties: { [name: string]: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject; } | undefined; requiredParameters: any; columnHeaders: string[] | undefined; dynamicColumns: any; }; export declare function useDeleteAssignment<TData = unknown>(resource: string, operationInclusion?: string, parameters?: { [key: string]: string; }, mutationOptions?: Omit<UseOcMutationOptions<TData>, "mutationKey">): UseMutationResult<void, OrderCloudError>; export declare function useDeleteOcResource<TData>(resource: string, parameters?: { [key: string]: string; }, mutationOptions?: Omit<UseOcMutationOptions<TData>, "mutationKey">): UseMutationResult<void, OrderCloudError>; export declare const useHasAccess: (resource?: string) => { allowed: boolean; isAdmin: boolean; }; export declare function useListAssignments<TData>(resource: string, operationInclusion?: string, listOptions?: ServiceListOptions, parameters?: { [key: string]: string; }, queryOptions?: Omit<UseOcQueryOptions, "queryKey">): UseQueryResult<RequiredDeep<ListPage<TData>>, OrderCloudError>; export declare function useMutateAssignment<TData>(resource: string, operationInclusion?: string, parameters?: { [key: string]: string; }, mutationOptions?: Omit<UseOcMutationOptions<TData>, "mutationKey">): UseMutationResult<void, OrderCloudError>; export declare function useMutateOcResource<TData>(resource: string, parameters?: { [key: string]: string; }, mutationOptions?: Omit<UseOcMutationOptions<TData>, "mutationKey">, isNew?: boolean): UseMutationResult<RequiredDeep<TData>, OrderCloudError>; export declare const useOcForm: (resource: string, initialValues?: { parameters?: { [key: string]: unknown; }; body?: { [key: string]: unknown; }; }, isAssignment?: boolean, operationInclusion?: string, props?: UseFormProps) => { methods: UseFormReturn<any, any, undefined>; resourceSchema: any; }; declare type UseOcMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> = Omit<UseMutationOptions<TData, TError, TVariables, TContext>, 'enable'> & { disabled?: boolean; }; declare type UseOcQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'enabled'> & { disabled?: boolean; }; export declare function useOcResourceGet<TData>(resource: string, parameters?: { [key: string]: string; }, queryOptions?: Omit<UseOcQueryOptions, "queryKey">): UseQueryResult<RequiredDeep<TData>, OrderCloudError>; export declare function useOcResourceList<TData>(resource: string, listOptions?: ServiceListOptions, parameters?: { [key: string]: string; }, queryOptions?: Omit<UseOcQueryOptions, "queryKey">): UseQueryResult<RequiredDeep<ListPage<TData>>, OrderCloudError>; export declare function useOcResourceListWithFacets<TData>(resource: string, listOptions?: ServiceListOptions, parameters?: { [key: string]: string; }, queryOptions?: Omit<UseOcQueryOptions, "queryKey">): UseQueryResult<RequiredDeep<ListPageWithFacets<TData>>, OrderCloudError>; export declare const useOrderCloudContext: () => IOrderCloudContext_2; export declare function usePromoExpressions(): { models: ExpressionModels[]; fields: { name: string; label: string; type: "array" | OpenAPIV3.NonArraySchemaObjectType | undefined; inputType: string; valueEditorType: string; modelPath: string; }[]; options: { value: string; label: string; }[]; } | { models: null; fields: null; options: null; }; export declare const useShopper: () => { orderWorksheet: { Order: { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }; LineItems: { ID: string; ProductID: string; Quantity: number; readonly BundleItemID: string; readonly IsBundle: boolean; readonly DateAdded: string; readonly QuantityShipped: number; UnitPrice: number; readonly PromotionDiscount: number; readonly LineTotal: number; readonly LineSubtotal: number; CostCenter: string; DateNeeded: string; ShippingAccount: string; ShippingAddressID: string; ShipFromAddressID: string; readonly Product: { ID: string; Name: string; Description: string; Returnable: boolean; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; ParentID: string; xp: any; }; readonly Variant: { ID: string; Name: string; Description: string; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; xp: any; }; readonly ShippingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly ShipFromAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly SupplierID: string; InventoryRecordID: string; readonly PriceScheduleID: string; readonly IsOnSale: boolean; readonly PriceOverridden: boolean; Specs: { SpecID: string; readonly Name: string; OptionID: string; Value: string; PriceMarkupType: PriceMarkupType; PriceMarkup: number; }[]; readonly IncomingOrderID: string; readonly OutgoingOrderID: string; readonly InvitationID: string; xp: any; }[]; OrderPromotions: { readonly Amount: number; readonly LineItemID: string; readonly AmountOverridden: boolean; readonly DateApplied: string; ID: string; LineItemLevel: boolean; Code: string; Name: string; RedemptionLimit: number; RedemptionLimitPerUser: number; readonly RedemptionCount: number; QuantityLimitPerOrder: number; ItemLimitPerOrder: number; ItemSortBy: string; Description: string; FinePrint: string; StartDate: string; ExpirationDate: string; EligibleExpression: string; ValueExpression: string; CanCombine: boolean; AllowAllBuyers: boolean; OwnerID: string; AutoApply: boolean; Active: boolean; UseIntegration: boolean; Priority: number; xp: any; }[]; Subscription: { ID: string; Frequency: number; Interval: SubscriptionInterval; NextOrderDate: string; readonly LastOrderDate: string; readonly NotificationDate: string; readonly DateCreated: string; EndDate: string; Active: boolean; FromCompanyID: string; FromUserID: string; ToCompanyID: string; Payment: { Type: PaymentType; CreditCardID: string; SpendingAccountID: string; }; BillingAddressID: string; ShippingAddressID: string; xp: any; }; ShipEstimateResponse: { ShipEstimates: { ID: string; xp: any; SelectedShipMethodID: string; ShipEstimateItems: { LineItemID: string; Quantity: number; }[]; ShipMethods: { ID: string; Name: string; Cost: number; EstimatedTransitDays: number; xp: any; }[]; }[]; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderCalculateResponse: { LineItemOverrides: { LineItemID: string; UnitPrice: number; Product: { ID: string; Name: string; Description: string; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; Returnable: boolean; xp: any; }; PromotionOverrides: { PromotionID: string; Amount: number; }[]; InventoryRecordID: string; Remove: boolean; }[]; ShippingTotal: number; TaxTotal: number; FeeTotal: number; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitForApprovalResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderApprovedResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; SubscriptionIntegrationResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; } | undefined; worksheetLoading: boolean; refreshWorksheet: () => Promise<void>; addCartLineItem: UseMutateAsyncFunction< { ID: string; ProductID: string; Quantity: number; readonly BundleItemID: string; readonly IsBundle: boolean; readonly DateAdded: string; readonly QuantityShipped: number; UnitPrice: number; readonly PromotionDiscount: number; readonly LineTotal: number; readonly LineSubtotal: number; CostCenter: string; DateNeeded: string; ShippingAccount: string; ShippingAddressID: string; ShipFromAddressID: string; readonly Product: { ID: string; Name: string; Description: string; Returnable: boolean; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; ParentID: string; xp: any; }; readonly Variant: { ID: string; Name: string; Description: string; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; xp: any; }; readonly ShippingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly ShipFromAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly SupplierID: string; InventoryRecordID: string; readonly PriceScheduleID: string; readonly IsOnSale: boolean; readonly PriceOverridden: boolean; Specs: { SpecID: string; readonly Name: string; OptionID: string; Value: string; PriceMarkupType: PriceMarkupType; PriceMarkup: number; }[]; readonly IncomingOrderID: string; readonly OutgoingOrderID: string; readonly InvitationID: string; xp: any; }, unknown, LineItem<any, any, any, any, any>, unknown>; patchCartLineItem: UseMutateAsyncFunction< { ID: string; ProductID: string; Quantity: number; readonly BundleItemID: string; readonly IsBundle: boolean; readonly DateAdded: string; readonly QuantityShipped: number; UnitPrice: number; readonly PromotionDiscount: number; readonly LineTotal: number; readonly LineSubtotal: number; CostCenter: string; DateNeeded: string; ShippingAccount: string; ShippingAddressID: string; ShipFromAddressID: string; readonly Product: { ID: string; Name: string; Description: string; Returnable: boolean; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; ParentID: string; xp: any; }; readonly Variant: { ID: string; Name: string; Description: string; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; xp: any; }; readonly ShippingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly ShipFromAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly SupplierID: string; InventoryRecordID: string; readonly PriceScheduleID: string; readonly IsOnSale: boolean; readonly PriceOverridden: boolean; Specs: { SpecID: string; readonly Name: string; OptionID: string; Value: string; PriceMarkupType: PriceMarkupType; PriceMarkup: number; }[]; readonly IncomingOrderID: string; readonly OutgoingOrderID: string; readonly InvitationID: string; xp: any; }, unknown, { ID: string; lineItem: PartialDeep<LineItem>; }, unknown>; deleteCartLineItem: UseMutateAsyncFunction<void, unknown, string, unknown>; setShippingAddress: UseMutateAsyncFunction< { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }, unknown, Address<any>, unknown>; setShippingAddressByID: UseMutateAsyncFunction< { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }, unknown, string, unknown>; estimateShipping: UseMutateAsyncFunction< { Order: { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }; LineItems: { ID: string; ProductID: string; Quantity: number; readonly BundleItemID: string; readonly IsBundle: boolean; readonly DateAdded: string; readonly QuantityShipped: number; UnitPrice: number; readonly PromotionDiscount: number; readonly LineTotal: number; readonly LineSubtotal: number; CostCenter: string; DateNeeded: string; ShippingAccount: string; ShippingAddressID: string; ShipFromAddressID: string; readonly Product: { ID: string; Name: string; Description: string; Returnable: boolean; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; ParentID: string; xp: any; }; readonly Variant: { ID: string; Name: string; Description: string; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; xp: any; }; readonly ShippingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly ShipFromAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly SupplierID: string; InventoryRecordID: string; readonly PriceScheduleID: string; readonly IsOnSale: boolean; readonly PriceOverridden: boolean; Specs: { SpecID: string; readonly Name: string; OptionID: string; Value: string; PriceMarkupType: PriceMarkupType; PriceMarkup: number; }[]; readonly IncomingOrderID: string; readonly OutgoingOrderID: string; readonly InvitationID: string; xp: any; }[]; OrderPromotions: { readonly Amount: number; readonly LineItemID: string; readonly AmountOverridden: boolean; readonly DateApplied: string; ID: string; LineItemLevel: boolean; Code: string; Name: string; RedemptionLimit: number; RedemptionLimitPerUser: number; readonly RedemptionCount: number; QuantityLimitPerOrder: number; ItemLimitPerOrder: number; ItemSortBy: string; Description: string; FinePrint: string; StartDate: string; ExpirationDate: string; EligibleExpression: string; ValueExpression: string; CanCombine: boolean; AllowAllBuyers: boolean; OwnerID: string; AutoApply: boolean; Active: boolean; UseIntegration: boolean; Priority: number; xp: any; }[]; Subscription: { ID: string; Frequency: number; Interval: SubscriptionInterval; NextOrderDate: string; readonly LastOrderDate: string; readonly NotificationDate: string; readonly DateCreated: string; EndDate: string; Active: boolean; FromCompanyID: string; FromUserID: string; ToCompanyID: string; Payment: { Type: PaymentType; CreditCardID: string; SpendingAccountID: string; }; BillingAddressID: string; ShippingAddressID: string; xp: any; }; ShipEstimateResponse: { ShipEstimates: { ID: string; xp: any; SelectedShipMethodID: string; ShipEstimateItems: { LineItemID: string; Quantity: number; }[]; ShipMethods: { ID: string; Name: string; Cost: number; EstimatedTransitDays: number; xp: any; }[]; }[]; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderCalculateResponse: { LineItemOverrides: { LineItemID: string; UnitPrice: number; Product: { ID: string; Name: string; Description: string; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; Returnable: boolean; xp: any; }; PromotionOverrides: { PromotionID: string; Amount: number; }[]; InventoryRecordID: string; Remove: boolean; }[]; ShippingTotal: number; TaxTotal: number; FeeTotal: number; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitForApprovalResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderApprovedResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; SubscriptionIntegrationResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; }, unknown, void, unknown>; selectShipMethods: UseMutateAsyncFunction< { Order: { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }; LineItems: { ID: string; ProductID: string; Quantity: number; readonly BundleItemID: string; readonly IsBundle: boolean; readonly DateAdded: string; readonly QuantityShipped: number; UnitPrice: number; readonly PromotionDiscount: number; readonly LineTotal: number; readonly LineSubtotal: number; CostCenter: string; DateNeeded: string; ShippingAccount: string; ShippingAddressID: string; ShipFromAddressID: string; readonly Product: { ID: string; Name: string; Description: string; Returnable: boolean; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; ParentID: string; xp: any; }; readonly Variant: { ID: string; Name: string; Description: string; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; xp: any; }; readonly ShippingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly ShipFromAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; readonly SupplierID: string; InventoryRecordID: string; readonly PriceScheduleID: string; readonly IsOnSale: boolean; readonly PriceOverridden: boolean; Specs: { SpecID: string; readonly Name: string; OptionID: string; Value: string; PriceMarkupType: PriceMarkupType; PriceMarkup: number; }[]; readonly IncomingOrderID: string; readonly OutgoingOrderID: string; readonly InvitationID: string; xp: any; }[]; OrderPromotions: { readonly Amount: number; readonly LineItemID: string; readonly AmountOverridden: boolean; readonly DateApplied: string; ID: string; LineItemLevel: boolean; Code: string; Name: string; RedemptionLimit: number; RedemptionLimitPerUser: number; readonly RedemptionCount: number; QuantityLimitPerOrder: number; ItemLimitPerOrder: number; ItemSortBy: string; Description: string; FinePrint: string; StartDate: string; ExpirationDate: string; EligibleExpression: string; ValueExpression: string; CanCombine: boolean; AllowAllBuyers: boolean; OwnerID: string; AutoApply: boolean; Active: boolean; UseIntegration: boolean; Priority: number; xp: any; }[]; Subscription: { ID: string; Frequency: number; Interval: SubscriptionInterval; NextOrderDate: string; readonly LastOrderDate: string; readonly NotificationDate: string; readonly DateCreated: string; EndDate: string; Active: boolean; FromCompanyID: string; FromUserID: string; ToCompanyID: string; Payment: { Type: PaymentType; CreditCardID: string; SpendingAccountID: string; }; BillingAddressID: string; ShippingAddressID: string; xp: any; }; ShipEstimateResponse: { ShipEstimates: { ID: string; xp: any; SelectedShipMethodID: string; ShipEstimateItems: { LineItemID: string; Quantity: number; }[]; ShipMethods: { ID: string; Name: string; Cost: number; EstimatedTransitDays: number; xp: any; }[]; }[]; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderCalculateResponse: { LineItemOverrides: { LineItemID: string; UnitPrice: number; Product: { ID: string; Name: string; Description: string; QuantityMultiplier: number; ShipWeight: number; ShipHeight: number; ShipWidth: number; ShipLength: number; DefaultSupplierID: string; Returnable: boolean; xp: any; }; PromotionOverrides: { PromotionID: string; Amount: number; }[]; InventoryRecordID: string; Remove: boolean; }[]; ShippingTotal: number; TaxTotal: number; FeeTotal: number; HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderSubmitForApprovalResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; OrderApprovedResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; SubscriptionIntegrationResponse: { HttpStatusCode: number; UnhandledErrorBody: string; xp: any; Succeeded: boolean; }; }, unknown, OrderShipMethodSelection, unknown>; setBillingAddress: UseMutateAsyncFunction< { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: string; }; readonly DateCreated: string; readonly LastActive: string; readonly PasswordLastSetDate: string; }; FromCompanyID: string; ToCompanyID: string; FromUserID: string; BillingAddressID: string; readonly BillingAddress: { ID: string; readonly DateCreated: string; CompanyName: string; FirstName: string; LastName: string; Street1: string; Street2: string; City: string; State: string; Zip: string; Country: string; Phone: string; AddressName: string; xp: any; }; ShippingAddressID: string; Comments: string; readonly LineItemCount: number; readonly Status: OrderStatus; readonly DateCreated: string; readonly DateSubmitted: string; readonly DateApproved: string; readonly DateDeclined: string; readonly DateCanceled: string; readonly DateCompleted: string; readonly LastUpdated: string; readonly Subtotal: number; ShippingCost: number; TaxCost: number; Gratuity: number; readonly Fees: number; readonly PromotionDiscount: number; readonly Currency: string; readonly Total: number; readonly IsSubmitted: boolean; readonly SubscriptionID: string; xp: any; }, unknown, Address<any>, unknown>; setBillingAddressByID: UseMutateAsyncFunction< { ID: string; readonly FromUser: { ID: string; readonly CompanyID: string; Username: string; Password: string; FirstName: string; LastName: string; Email: string; Phone: string; TermsAccepted: string; Active: boolean; xp: any; readonly AvailableRoles: string[]; readonly Locale: { ID: string; OwnerID: string; Currency: string; Language: str