{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_ecom_tips@1.0.56/index.ts","/npm/@wix/auto_sdk_ecom_tips@1.0.56/src/tips-v1-tip-tips.universal.ts","/npm/@wix/auto_sdk_ecom_tips@1.0.56/src/tips-v1-tip-tips.http.ts","/npm/@wix/auto_sdk_ecom_tips@1.0.56/src/tips-v1-tip-tips.public.ts","/npm/@wix/auto_sdk_ecom_tips@1.0.56/src/tips-v1-tip-tips.context.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,aAAA,IAAA,aAAA,QAAA,IAAA,QAAA,UAAA,IAAA,UAAA,OAAA,IAAA,OAAA,QAAA,IAAA,QAAA,oBAAA,IAAA,oBAAA,2BAAA,IAAA,4BAAA,qBAAA,IAAA,sBAAA,gBAAA,IAAA,iBAAA,aAAA,IAAA,cAAA,WAAA,IAAA,YAAA,sBAAA,IAAA,uBAAA,mBAAA,IAAA,oBAAA,cAAA,IAAA,eAAA,0BAAA,IAAA,2BAAA,gBAAA,IAAA,iBAAA,MAAA,IAAA,QAAA,OAAA,QAAA,aAAA,eCAA,IAAA,uBAAoD,QAAA,oCACpD,qBAA6B,QAAA,kCAC7B,8BAGO,QAAA,2CCLP,oBAAkC,QAAA,iCAClC,iBAAqD,QAAA,8CACrD,kBAAqD,QAAA,8CACrD,uBAA+B,QAAA,oDAC/B,qBAA2B,QAAA,iCAI3B,SAAS,kCACP,GAyDA,SAAO,qBAAA,YAAW,OAAO,OAAO,EAAM,CAAE,iBAvDf,CACvB,uBAAwB,CACtB,CACE,QAAS,qBACT,SAAU,KAGd,EAAG,CACD,CACE,QAAS,qBACT,SAAU,KAGd,kBAAmB,CACjB,CACE,QAAS,QACT,SAAU,KAGd,qBAAsB,CACpB,CACE,QAAS,qBACT,SAAU,KAGd,qBAAsB,CACpB,CACE,QAAS,gBACT,SAAU,YAEZ,CACE,QAAS,qBACT,SAAU,KAGd,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B,CAGF,CAEO,IAAM,aAEK,EAAA,qBAAA,kBAAiB,aACtB,kBAEK,EAAA,qBAAA,kBAAiB,kBACtB,uBAGK,EAAA,qBAAA,kBAAiB,uBACtB,eAEK,EAAA,qBAAA,kBAAiB,eACtB,kBAEK,EAAA,qBAAA,kBAAiB,kBACtB,gBAEK,EAAA,qBAAA,kBAAiB,gBACtB,qBAGK,EAAA,qBAAA,kBAAiB,qBACtB,6BAGK,EAAA,qBAAA,kBAAiB,6BACtB,4BAGK,EAAA,qBAAA,kBAAiB,4BACtB,wBAGK,EAAA,qBAAA,kBAAiB","file":"/npm/@wix/auto_sdk_ecom_tips@1.0.56/build/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@wix/auto_sdk_ecom_tips@1.0.56/build/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export * from './src/tips-v1-tip-tips.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n  HttpClient,\n  HttpResponse,\n  NonNullablePaths,\n  QuerySpec,\n  Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixTipsV1Tip from './tips-v1-tip-tips.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/**\n * A tip holds information about how much a customer has tipped, how the tip is\n * distributed among staff, and the associated order’s line item subtotal.\n */\nexport interface Tip {\n  /**\n   * ID of the tip. Identical to the `code` of the related `order.additionalFee`.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Subtotal of all line items from the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object))\n   * that's related to the tip. In the response of\n   * Preview Tip, there is no related eCommerce order. Then, value of this field corresponds to\n   * the sum of all line item prices passed in the request.\n   * @readonly\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  lineItemSubtotal?: string | null;\n  /**\n   * Total amount of the tip.\n   *\n   * Min: `0.00`\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  amount?: string | null;\n  /**\n   * Details about how the tip is shared among staff. Available only if at least\n   * one staff member receives part of the tip, and it's not entirely allocated to\n   * the business.\n   *\n   * Max: 50 distributions\n   * @maxSize 50\n   */\n  distributions?: TipDistribution[];\n  /**\n   * Undistributed tip amount. Calculated as the difference between `tip.amount`\n   * and the sum of all `tip.tipDistributions.amount` values.\n   *\n   * Min: `0.01`\n   * @readonly\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gt:0, maxScale:2 }\n   */\n  undistributedAmount?: string | null;\n}\n\nexport interface TipDistribution {\n  /**\n   * ID of the tip distribution.\n   * @readonly\n   * @format GUID\n   */\n  _id?: string | null;\n  /**\n   * ID of the tip associated with the distribution. Matches the corresponding\n   * `order.additionalFee.code`.\n   * @readonly\n   * @format GUID\n   */\n  tipId?: string | null;\n  /** Information about the business staff receiving the tip distribution. */\n  staff?: Staff;\n  /**\n   * Amount of the tip distribution.\n   *\n   * Min: `0.00`\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  amount?: string | null;\n  /**\n   * Details about the related line items from the\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   * Max: 10 `lineItemInfo` objects\n   * @maxSize 12\n   */\n  lineItemInfo?: LineItemInfo[];\n  /**\n   * Details of how the customer is charged for the tip. Available only if the\n   * transaction ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/order-transactions/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-transactions/order-transactions-object))\n   * has been created.\n   */\n  transaction?: Transaction;\n  /**\n   * ID of the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object))\n   * associated with the tip distribution. Identical for all distributions that\n   * belong to the same tip.\n   * @readonly\n   * @format GUID\n   */\n  orderId?: string | null;\n  /**\n   * Date and time the distribution was created in\n   * `YYYY-MM-DDThh:mm:ss.sssZ` format.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /** Information about who created the tip distributions. */\n  source?: SourceWithLiterals;\n}\n\nexport interface CommonIdentificationData\n  extends CommonIdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor who hasn't logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor who has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user. For example, the site owner or a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /**\n   * ID of the contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.\n   * See the Contacts API for additional details.\n   * @format GUID\n   */\n  contactId?: string | null;\n}\n\n/** @oneof */\nexport interface CommonIdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor who hasn't logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor who has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user. For example, the site owner or a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum IdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n  | IdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface Staff {\n  /**\n   * ID of the staff receiving the tip. Matches `staffMemberId` if available, or\n   * `identificationData.wixUserId` if not.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Staff name. Matches `staffMember.name` if the staff is a\n   * Bookings staff member,\n   * or the contact's\n   * `info.name` if not. See the Bookings Staff Members API and the Contacts API for additional details.\n   *\n   * Max: 500 characters\n   * @maxLength 500\n   * @readonly\n   */\n  name?: string | null;\n  /**\n   * ID of the staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object)).\n   * Available only if the staff is a staff member and not a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   * @format GUID\n   */\n  staffMemberId?: string | null;\n  /**\n   * Identification data. Available only if the staff is a\n   * contact on the Wix site. See the Contacts API for additional details.\n   *\n   * Note that not all site collaborators qualify as\n   * staff members ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object)).\n   */\n  identificationData?: CommonIdentificationData;\n}\n\nexport interface LineItemInfo {\n  /**\n   * IDs of the line items associated with the tip.\n   *\n   * Min: 1 character <br/>\n   * Max: 100 characters\n   * @minLength 1\n   * @maxLength 100\n   */\n  lineItemId?: string | null;\n  /**\n   * Information about the line item and the corresponding catalog. Catalogs\n   * include Wix Bookings and Wix Stores.\n   */\n  catalogReference?: CatalogReference;\n  /**\n   * Price of the line item.\n   *\n   * Min: `0.00`\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  price?: string | null;\n  /**\n   * Name of the line item, which is identical to:\n   * + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores)).\n   * + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings)).\n   *\n   * Min: 1 character  <br/>\n   * Max: 200 characters\n   * @minLength 1\n   * @maxLength 200\n   */\n  name?: string | null;\n  /**\n   * Quantity of the line item.\n   *\n   * Min: `1` <br/>\n   * Max: `100000` (one hundred thousand)\n   * @min 1\n   * @max 100000\n   */\n  quantity?: number | null;\n}\n\nexport interface CatalogReference {\n  /**\n   * ID of the line item within its catalog, corresponding to:\n   * + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores)).\n   * + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings)).\n   * @format GUID\n   */\n  catalogItemId?: string | null;\n  /**\n   * ID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix))\n   * to which the catalog belongs.\n   *\n   * Supported app IDs:\n   * + [Wix Tips](https://www.wix.com/app-market/wix-tips): `\"869a50c8-dd38-4324-b201-e33dc0747a5f\"`\n   * + [Wix Stores](https://www.wix.com/app-market/wix-stores): `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n   * + [Wix Bookings](https://www.wix.com/app-market/bookings): `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n   * + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `\"13e8d036-5516-6104-b456-c8466db39542\"`\n   * @format GUID\n   */\n  appId?: string | null;\n}\n\nexport interface Transaction {\n  /**\n   * ID of the transaction that's associated with the tip distribution.\n   * @format GUID\n   */\n  _id?: string | null;\n  /**\n   * Date and time the transaction was created in `YYYY-MM-DDThh:mm:ss.sssZ`\n   * format. Isn't identical to the time the customer was actually charged.\n   */\n  date?: Date | null;\n}\n\nexport enum Source {\n  /** There is no information about who created the tip distributions. */\n  UNKNOWN_SOURCE = 'UNKNOWN_SOURCE',\n  /** The customer added the tip distributions via an external payment terminal. */\n  POS = 'POS',\n  /** The customer added the tip distributions during an online eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)). */\n  WEB = 'WEB',\n  /** The business added the tip distributions on behalf of the customer in the site's dashboard. */\n  DASHBOARD = 'DASHBOARD',\n}\n\n/** @enumType */\nexport type SourceWithLiterals =\n  | Source\n  | 'UNKNOWN_SOURCE'\n  | 'POS'\n  | 'WEB'\n  | 'DASHBOARD';\n\nexport interface PreviewTipRequest {\n  /**\n   * Information about the line items to preview the tip for.\n   *\n   * Min: 1 line item\n   * Max: 50 line items\n   * @minSize 1\n   * @maxSize 50\n   */\n  lineItemInfo: LineItemInfo[];\n  /**\n   * Information about how to calculate the total tip amount and the distribution\n   * amounts.\n   */\n  tipChoice: TipChoice;\n  /**\n   * ID of the tip settings used to preview the tip. If you don't provide a\n   * `tipSettingsId`, the `staffDistributionMethod` is based on the site's\n   * default tip settings.\n   * @format GUID\n   */\n  tipSettingsId?: string | null;\n  /**\n   * ID of draft order. If provided, we'll take overridden data from the draft.\n   * @format GUID\n   */\n  draftOrderId?: string | null;\n}\n\nexport interface TipChoice {\n  /**\n   * Value of the tip choice.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  value?: string | null;\n  /** Type of the tip choice. */\n  tipType?: TipTypeWithLiterals;\n}\n\nexport enum TipType {\n  /** There is no information about the tip type. */\n  UNKNOWN_TIP_TYPE = 'UNKNOWN_TIP_TYPE',\n  /** The tip is calculated as a percentage of the subtotal of associated line items. */\n  PERCENTAGE = 'PERCENTAGE',\n  /** The tip is a fixed value, pre-configured from the relevant settings presets. */\n  AMOUNT = 'AMOUNT',\n  /** The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values. */\n  CUSTOM = 'CUSTOM',\n}\n\n/** @enumType */\nexport type TipTypeWithLiterals =\n  | TipType\n  | 'UNKNOWN_TIP_TYPE'\n  | 'PERCENTAGE'\n  | 'AMOUNT'\n  | 'CUSTOM';\n\nexport interface PreviewTipResponse {\n  /** Tip. */\n  tip?: Tip;\n}\n\nexport interface GetTipByOrderIdRequest {\n  /**\n   * ID of the order to retrieve the tip for.\n   * @format GUID\n   */\n  orderId: string | null;\n}\n\nexport interface GetTipByOrderIdResponse {\n  /** Retrieved tip. */\n  tip?: Tip;\n}\n\nexport interface GetTipByDraftOrderIdRequest {\n  /**\n   * ID of the [draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction) to retrieve the tip for.\n   * @format GUID\n   */\n  draftOrderId: string | null;\n}\n\nexport interface GetTipByDraftOrderIdResponse {\n  /** Retrieved tip. */\n  tip?: Tip;\n}\n\nexport interface GetTipChoiceRequest {\n  /**\n   * ID of the purchase flow that's associated with the\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   * The purchase flow ID is a persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n   * @format GUID\n   */\n  purchaseFlowId: string | null;\n}\n\nexport interface GetTipChoiceResponse {\n  /** Tip choice that's currently selected for the given purchase flow. */\n  tipChoice?: TipChoice;\n}\n\nexport interface UpdateTipChoiceRequest {\n  /**\n   * Tip choice to select for the purchase flow. The call fails if you provide a\n   * value for `tipChoice.tipType` that doesn't match the relevant tip settings\n   * configuration. For example:\n   * + `AMOUNT` when `tipSettings.tipType` isn't `AMOUNT`.\n   * + `PERCENTAGE` when `tipSettings.tipType` isn't `PERCENTAGE`.\n   * + `CUSTOM` when `tipSettings.allowCustomTip` is `false`.\n   */\n  tipChoice: TipChoice;\n  /**\n   * ID of the purchase flow that's associated with the\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   *\n   * The purchase flow ID is a persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n   * @format GUID\n   */\n  purchaseFlowId: string | null;\n}\n\nexport interface UpdateTipChoiceResponse {\n  /**\n   * Tip choice currently selected in the\n   * eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction))\n   * for the given purchase flow.\n   */\n  tipChoice?: TipChoice;\n}\n\nexport interface SetTipOnOrderRequest\n  extends SetTipOnOrderRequestIdentifierOneOf {\n  /**\n   * ID of the order for which to set the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /** Tip to set on the order. */\n  tip: Tip;\n}\n\n/** @oneof */\nexport interface SetTipOnOrderRequestIdentifierOneOf {\n  /**\n   * ID of the order for which to set the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface SetTipOnOrderResponse {\n  /** Set tip. */\n  tip?: Tip;\n  /** Information about the order on which the tip was set. */\n  orderInfo?: OrderInfo;\n}\n\nexport interface OrderInfo extends OrderInfoIdentifierOneOf {\n  /**\n   * Order ID.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /**\n   * ID of the order's additional fee that's associated with the tip.\n   * @format GUID\n   */\n  additionalFeeId?: string | null;\n  /** Price of the order's additional fee that's associated with the tip. */\n  additionalFeePrice?: Price;\n}\n\n/** @oneof */\nexport interface OrderInfoIdentifierOneOf {\n  /**\n   * Order ID.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface Price {\n  /**\n   * Amount of the additional fee that's associated with the tip.\n   * @decimalValue options { gte:0, lte:1000000000000000, maxScale:2 }\n   */\n  amount?: string;\n  /**\n   * Amount formatted with currency symbol.\n   *\n   * Max: 100 characters\n   * @readonly\n   * @maxLength 100\n   */\n  formattedAmount?: string;\n}\n\nexport interface RemoveTipFromOrderRequest\n  extends RemoveTipFromOrderRequestIdentifierOneOf {\n  /**\n   * ID of the order from which to remove the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/** @oneof */\nexport interface RemoveTipFromOrderRequestIdentifierOneOf {\n  /**\n   * ID of the order from which to remove the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface RemoveTipFromOrderResponse {\n  /** Information about the order from which the tip was removed. */\n  orderInfo?: OrderInfo;\n}\n\nexport interface CreateTipDistributionsRequest {\n  /**\n   * Tip distributions to create.\n   *\n   * Min: 1 distribution <br/>\n   * Max: 50 distributions\n   * @minSize 1\n   * @maxSize 50\n   */\n  tipDistributions?: TipDistribution[];\n  /**\n   * ID of the tip for which to create distributions.\n   * @format GUID\n   */\n  tipId?: string | null;\n}\n\nexport interface CreateTipDistributionsResponse {\n  /**\n   * ID of the tip for which the distributions were created.\n   * @format GUID\n   * @readonly\n   */\n  tipId?: string | null;\n  /** Created tip distributions. */\n  tipDistributions?: TipDistribution[];\n}\n\nexport interface DeleteTipDistributionsRequest\n  extends DeleteTipDistributionsRequestDeleteByOneOf {\n  /**\n   * ID of the tip for which to delete all associated tip distributions.\n   * @format GUID\n   */\n  tipId?: string | null;\n  /**\n   * ID of the order for which to delete all associated tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/** @oneof */\nexport interface DeleteTipDistributionsRequestDeleteByOneOf {\n  /**\n   * ID of the tip for which to delete all associated tip distributions.\n   * @format GUID\n   */\n  tipId?: string | null;\n  /**\n   * ID of the order for which to delete all associated tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface DeleteTipDistributionsResponse {}\n\nexport interface AddTipDistributionsToOrderRequest\n  extends AddTipDistributionsToOrderRequestIdentifierOneOf {\n  /**\n   * ID of the [order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/introduction) for which to add tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /**\n   * Tip distributions to add to the order.\n   * @minSize 1\n   * @maxSize 50\n   */\n  tipDistributions: TipDistribution[];\n}\n\n/** @oneof */\nexport interface AddTipDistributionsToOrderRequestIdentifierOneOf {\n  /**\n   * ID of the [order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/introduction) for which to add tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface AddTipDistributionsToOrderResponse {\n  /** Tip distributions that were added to the order. */\n  tipDistributions?: TipDistribution[];\n  /** Information about the order to which the tip distributions were added. */\n  orderInfo?: OrderInfo;\n}\n\nexport interface QueryTipDistributionsRequest {\n  /** WQL expression. */\n  query: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object in the following format:\n   * `\"filter\" : {\n   * \"fieldName1\": \"value1\",\n   * \"fieldName2\":{\"$operator\":\"value2\"}\n   * }`\n   * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object in the following format:\n   * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n   * @maxSize 4\n   */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 50\n   */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n  /**\n   * Number of items to load.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * You can get the relevant cursor token\n   * from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   * @maxLength 16000\n   */\n  cursor?: string | null;\n}\n\nexport interface QueryTipDistributionsResponse {\n  /** Retrieved tip distributions. */\n  tipDistributions?: TipDistribution[];\n  /** Paging metadata. */\n  pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  cursors?: Cursors;\n  /**\n   * Indicates if there are more results after the current page.\n   * If `true`, another page of results can be retrieved.\n   * If `false`, this is the last page.\n   */\n  hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n  /**\n   * Cursor pointing to next page in the list of results.\n   * @maxLength 16000\n   */\n  next?: string | null;\n  /**\n   * Cursor pointing to previous page in the list of results.\n   * @maxLength 16000\n   */\n  prev?: string | null;\n}\n\nexport interface SumTipDistributionAmountsRequest {\n  /**\n   * Filter object in the following format:\n   * `\"filter\" : {\n   * \"fieldName1\": \"value1\",\n   * \"fieldName2\":{\"$operator\":\"value2\"}\n   * }`\n   * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n   */\n  filter: Record<string, any> | null;\n}\n\nexport interface SumTipDistributionAmountsResponse {\n  /**\n   * Total amount of tip distributions matching the filter.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gte:0, maxScale:2 }\n   */\n  totalAmount?: string | null;\n}\n\nexport interface ApplyTipDistributionsRequest {\n  /**\n   * ID of the tip for which all tip distributions are applied to the order.\n   * @format GUID\n   */\n  tipId?: string | null;\n  /**\n   * ID of the order for which to apply all tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /** Whether to query by order ID or tip ID. */\n  queryBy?: QueryByWithLiterals;\n}\n\nexport enum QueryBy {\n  UNKNOWN_QUERY_BY = 'UNKNOWN_QUERY_BY',\n  ORDER = 'ORDER',\n  TIP = 'TIP',\n}\n\n/** @enumType */\nexport type QueryByWithLiterals =\n  | QueryBy\n  | 'UNKNOWN_QUERY_BY'\n  | 'ORDER'\n  | 'TIP';\n\nexport interface ApplyTipDistributionsResponse {\n  /** Applied tip distributions. */\n  tipDistributions?: TipDistribution[];\n}\n\nexport interface PublishTipDistributionsCreatedEventRequest {\n  /**\n   * The tip distributions that will be published on the event.\n   * @maxSize 100\n   */\n  tipDistributions?: TipDistribution[];\n  /**\n   * The tip ID of the distributions\n   * @format GUID\n   */\n  tipId?: string | null;\n  /**\n   * The order ID that the tip is connected to\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\nexport interface PublishTipDistributionsCreatedEventResponse {}\n\nexport interface TipDistributionsCreated {\n  /**\n   * ID of the tip to which the distribution belongs.\n   * @format GUID\n   */\n  tipId?: string | null;\n  /**\n   * Created tip distributions.\n   *\n   * Min: 1 tip distribution\n   * Max: 100 tip distributions\n   * @maxSize 100\n   */\n  tipDistributions?: TipDistribution[];\n  /**\n   * The order ID that the tip is connected to.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /**\n   * The undistributed tip amount.\n   * @format DECIMAL_VALUE\n   * @decimalValue options { gt:0, maxScale:2 }\n   */\n  undistributedAmount?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type PreviewTipApplicationErrors =\n  | {\n      code?: 'TIP_SETTINGS_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'CATALOG_ITEMS_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type GetTipByOrderIdApplicationErrors =\n  | {\n      code?: 'ORDER_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'TIP_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type GetTipByDraftOrderIdApplicationErrors =\n  | {\n      code?: 'DRAFT_ORDER_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'TIP_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type GetTipChoiceApplicationErrors = {\n  code?: 'PERSON_IDENTITY_NOT_FOUND';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type UpdateTipChoiceApplicationErrors = {\n  code?: 'PERSON_IDENTITY_NOT_FOUND';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type SetTipOnOrderApplicationErrors = {\n  code?: 'INVALID_TIP';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type RemoveTipFromOrderApplicationErrors = {\n  code?: 'CANNOT_REMOVE_PAID_TIP_DISTRIBUTION';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type AddTipDistributionsToOrderApplicationErrors =\n  | {\n      code?: 'ORDER_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'DRAFT_ORDER_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'ORDER_IS_ALREADY_EDITED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'ORDER_CANNOT_BE_EDITED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PARTIALLY_OR_FULLY_REFUNDED_ORDER_CANNOT_BE_EDITED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'FAILED_SETTING_TIP_ON_ORDER';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'FAILED_DELETING_TIP_FROM_ORDER';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'FAILED_COMMITING_TIP_ON_ORDER';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'INVALID_TIP_DISTRIBUTION';\n      description?: string;\n      data?: Record<string, any>;\n    };\n\n/**\n * Previews a tip for a list of line items.\n *\n *\n * If you provide the Wix Bookings app ID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix))\n * as `lineItemInfo.catalogReference.appId`, the response includes tip\n * distributions for each associated\n * Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object)).\n *\n * If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is\n * based on the site's default tip settings.\n * @param lineItemInfo - Information about the line items to preview the tip for.\n *\n * Min: 1 line item\n * Max: 50 line items\n * @public\n * @requiredField lineItemInfo\n * @requiredField lineItemInfo.catalogReference.appId\n * @requiredField lineItemInfo.catalogReference.catalogItemId\n * @requiredField lineItemInfo.price\n * @requiredField options.tipChoice\n * @requiredField options.tipChoice.tipType\n * @requiredField options.tipChoice.value\n * @param options - Options to use when previewing a tip.\n * @permissionId WIX_TIPS.TIP_PREVIEW\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.PreviewTip\n */\nexport async function previewTip(\n  lineItemInfo: NonNullablePaths<\n    LineItemInfo,\n    `catalogReference.appId` | `catalogReference.catalogItemId` | `price`,\n    3\n  >[],\n  options?: NonNullablePaths<\n    PreviewTipOptions,\n    `tipChoice` | `tipChoice.tipType` | `tipChoice.value`,\n    3\n  >\n): Promise<\n  NonNullablePaths<\n    PreviewTipResponse,\n    | `tip.distributions`\n    | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tip.distributions.${number}.staff.identificationData.memberId`\n    | `tip.distributions.${number}.staff.identificationData.wixUserId`\n    | `tip.distributions.${number}.staff.identificationData.appId`\n    | `tip.distributions.${number}.source`,\n    7\n  > & {\n    __applicationErrorsType?: PreviewTipApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    lineItemInfo: lineItemInfo,\n    tipChoice: options?.tipChoice,\n    tipSettingsId: options?.tipSettingsId,\n    draftOrderId: options?.draftOrderId,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.previewTip(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          lineItemInfo: '$[0]',\n          tipChoice: '$[1].tipChoice',\n          tipSettingsId: '$[1].tipSettingsId',\n          draftOrderId: '$[1].draftOrderId',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['lineItemInfo', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface PreviewTipOptions {\n  /**\n   * Information about how to calculate the total tip amount and the distribution\n   * amounts.\n   */\n  tipChoice: TipChoice;\n  /**\n   * ID of the tip settings used to preview the tip. If you don't provide a\n   * `tipSettingsId`, the `staffDistributionMethod` is based on the site's\n   * default tip settings.\n   * @format GUID\n   */\n  tipSettingsId?: string | null;\n  /**\n   * ID of draft order. If provided, we'll take overridden data from the draft.\n   * @format GUID\n   */\n  draftOrderId?: string | null;\n}\n\n/**\n * Retrieves the tip that's associated with an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n * @param orderId - ID of the order to retrieve the tip for.\n * @public\n * @requiredField orderId\n * @permissionId WIX_TIPS.TIP_READ\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.GetTipByOrderId\n */\nexport async function getTipByOrderId(orderId: string): Promise<\n  NonNullablePaths<\n    GetTipByOrderIdResponse,\n    | `tip.distributions`\n    | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tip.distributions.${number}.staff.identificationData.memberId`\n    | `tip.distributions.${number}.staff.identificationData.wixUserId`\n    | `tip.distributions.${number}.staff.identificationData.appId`\n    | `tip.distributions.${number}.source`,\n    7\n  > & {\n    __applicationErrorsType?: GetTipByOrderIdApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ orderId: orderId });\n\n  const reqOpts = ambassadorWixTipsV1Tip.getTipByOrderId(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { orderId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['orderId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves the tip that's associated with an [eCommerce draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction).\n * @param draftOrderId - ID of the [draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction) to retrieve the tip for.\n * @public\n * @requiredField draftOrderId\n * @permissionId WIX_TIPS.TIP_READ\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.GetTipByDraftOrderId\n */\nexport async function getTipByDraftOrderId(draftOrderId: string): Promise<\n  NonNullablePaths<\n    GetTipByDraftOrderIdResponse,\n    | `tip.distributions`\n    | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tip.distributions.${number}.staff.identificationData.memberId`\n    | `tip.distributions.${number}.staff.identificationData.wixUserId`\n    | `tip.distributions.${number}.staff.identificationData.appId`\n    | `tip.distributions.${number}.source`,\n    7\n  > & {\n    __applicationErrorsType?: GetTipByDraftOrderIdApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    draftOrderId: draftOrderId,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.getTipByDraftOrderId(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { draftOrderId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['draftOrderId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n * If the customer hasn't yet selected a tip choice, the response is empty.\n *\n * Please refer to the Sample Flows for more information.\n * @param purchaseFlowId - ID of the purchase flow that's associated with the\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n * The purchase flow ID is a persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n * @public\n * @requiredField purchaseFlowId\n * @permissionId WIX_TIPS.TIP_GET_CHOICE\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.GetTipChoice\n */\nexport async function getTipChoice(purchaseFlowId: string): Promise<\n  NonNullablePaths<GetTipChoiceResponse, `tipChoice.tipType`, 3> & {\n    __applicationErrorsType?: GetTipChoiceApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    purchaseFlowId: purchaseFlowId,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.getTipChoice(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { purchaseFlowId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['purchaseFlowId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Updates the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n *\n * Please refer to the Sample Flows for more information.\n * @param tipChoice - Tip choice to select for the purchase flow. The call fails if you provide a\n * value for `tipChoice.tipType` that doesn't match the relevant tip settings\n * configuration. For example:\n * + `AMOUNT` when `tipSettings.tipType` isn't `AMOUNT`.\n * + `PERCENTAGE` when `tipSettings.tipType` isn't `PERCENTAGE`.\n * + `CUSTOM` when `tipSettings.allowCustomTip` is `false`.\n * @public\n * @requiredField options\n * @requiredField options.purchaseFlowId\n * @requiredField tipChoice\n * @param options - Options to use when updating a tip choice.\n * @permissionId WIX_TIPS.TIP_UPDATE_CHOICE\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.UpdateTipChoice\n */\nexport async function updateTipChoice(\n  tipChoice: TipChoice,\n  options: NonNullablePaths<UpdateTipChoiceOptions, `purchaseFlowId`, 2>\n): Promise<\n  NonNullablePaths<UpdateTipChoiceResponse, `tipChoice.tipType`, 3> & {\n    __applicationErrorsType?: UpdateTipChoiceApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    tipChoice: tipChoice,\n    purchaseFlowId: options?.purchaseFlowId,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.updateTipChoice(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          tipChoice: '$[0]',\n          purchaseFlowId: '$[1].purchaseFlowId',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['tipChoice', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface UpdateTipChoiceOptions {\n  /**\n   * ID of the purchase flow that's associated with the\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   *\n   * The purchase flow ID is a persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n   * @format GUID\n   */\n  purchaseFlowId: string | null;\n}\n\n/**\n * Creates or updates a tip on an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, an `additionalFee` is added. If a tip is already\n * present, the existing `additionalFee` is replaced.\n *\n * If you specify `tip.distributions.transaction`, that distribution\n * amount can't be changed in the future. Then, you also can't remove any of the\n * other distributions.\n *\n * The call fails if:\n * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n * + The total tip amount is zero or negative.\n * + The sum of all tip distribution amounts and `undistributedAmount` doesn't match the total tip amount.\n * + You omit `tip.distributions` with an existing `transaction`.\n * @public\n * @requiredField options\n * @requiredField options.identifier\n * @requiredField options.tip\n * @requiredField options.tip.distributions.transaction._id\n * @requiredField options.tip.distributions.transaction.date\n * @param options - Options to use when setting a tip on an order.\n * @permissionId WIX_TIPS.TIP_SET\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.SetTipOnOrder\n */\nexport async function setTipOnOrder(\n  options: NonNullablePaths<\n    SetTipOnOrderOptions,\n    | `tip`\n    | `tip.distributions.${number}.transaction._id`\n    | `tip.distributions.${number}.transaction.date`,\n    6\n  >\n): Promise<\n  NonNullablePaths<\n    SetTipOnOrderResponse,\n    | `tip.distributions`\n    | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tip.distributions.${number}.staff.identificationData.memberId`\n    | `tip.distributions.${number}.staff.identificationData.wixUserId`\n    | `tip.distributions.${number}.staff.identificationData.appId`\n    | `tip.distributions.${number}.source`\n    | `orderInfo.additionalFeePrice.amount`\n    | `orderInfo.additionalFeePrice.formattedAmount`,\n    7\n  > & {\n    __applicationErrorsType?: SetTipOnOrderApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    orderId: options?.orderId,\n    tip: options?.tip,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.setTipOnOrder(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { orderId: '$[0].orderId', tip: '$[0].tip' },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface SetTipOnOrderOptions\n  extends SetTipOnOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the order for which to set the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /** Tip to set on the order. */\n  tip: Tip;\n}\n\n/** @oneof */\nexport interface SetTipOnOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the order for which to set the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/**\n * Removes a tip from an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, the call succeeds and the response contains an\n * empty `OrderInfo` object.\n *\n * The call fails if the customer has already been charged for at least one of\n * the associated tip distributions.\n * @public\n * @requiredField options\n * @requiredField options.identifier\n * @param options - Options to use when removing a tip from an order.\n * @permissionId WIX_TIPS.TIP_REMOVE\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.RemoveTipFromOrder\n */\nexport async function removeTipFromOrder(\n  options: RemoveTipFromOrderOptions\n): Promise<\n  NonNullablePaths<\n    RemoveTipFromOrderResponse,\n    | `orderInfo.additionalFeePrice.amount`\n    | `orderInfo.additionalFeePrice.formattedAmount`,\n    4\n  > & {\n    __applicationErrorsType?: RemoveTipFromOrderApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    orderId: options?.orderId,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.removeTipFromOrder(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { orderId: '$[0].orderId' },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface RemoveTipFromOrderOptions\n  extends RemoveTipFromOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the order from which to remove the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/** @oneof */\nexport interface RemoveTipFromOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the order from which to remove the tip.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/**\n * Adds tip distributions to an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, an `additionalFee` is added and the total tip\n * amount is equal to the sum of all distribution amounts. If a tip is already\n * present, the existing `additionalFee` is replaced and the total tip amount is\n * increased by the sum of the new tip distributions.\n *\n * The call fails if:\n * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n * + Any of the tip distribution amounts is zero or negative.\n * @public\n * @requiredField options\n * @requiredField options.identifier\n * @requiredField options.tipDistributions\n * @requiredField options.tipDistributions.transaction._id\n * @requiredField options.tipDistributions.transaction.date\n * @param options - Options to use when adding tip distributions to an order.\n * @permissionId WIX_TIPS.TIP_DISTRIBUTION_ADD\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.AddTipDistributionsToOrder\n */\nexport async function addTipDistributionsToOrder(\n  options: NonNullablePaths<\n    AddTipDistributionsToOrderOptions,\n    | `tipDistributions`\n    | `tipDistributions.${number}.transaction._id`\n    | `tipDistributions.${number}.transaction.date`,\n    5\n  >\n): Promise<\n  NonNullablePaths<\n    AddTipDistributionsToOrderResponse,\n    | `tipDistributions`\n    | `tipDistributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tipDistributions.${number}.staff.identificationData.memberId`\n    | `tipDistributions.${number}.staff.identificationData.wixUserId`\n    | `tipDistributions.${number}.staff.identificationData.appId`\n    | `tipDistributions.${number}.source`\n    | `orderInfo.additionalFeePrice.amount`\n    | `orderInfo.additionalFeePrice.formattedAmount`,\n    6\n  > & {\n    __applicationErrorsType?: AddTipDistributionsToOrderApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    orderId: options?.orderId,\n    tipDistributions: options?.tipDistributions,\n  });\n\n  const reqOpts = ambassadorWixTipsV1Tip.addTipDistributionsToOrder(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          orderId: '$[0].orderId',\n          tipDistributions: '$[0].tipDistributions',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface AddTipDistributionsToOrderOptions\n  extends AddTipDistributionsToOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the [order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/introduction) for which to add tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n  /**\n   * Tip distributions to add to the order.\n   * @minSize 1\n   * @maxSize 50\n   */\n  tipDistributions: TipDistribution[];\n}\n\n/** @oneof */\nexport interface AddTipDistributionsToOrderOptionsIdentifierOneOf {\n  /**\n   * ID of the [order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/introduction) for which to add tip distributions.\n   * @format GUID\n   */\n  orderId?: string | null;\n}\n\n/**\n * Creates a query to retrieve a list of tip distributions.\n *\n * The `queryTipDistributions()` function builds a query to retrieve a list of tip distributions and returns a `TipDistributionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-builder/find) function.\n *\n * You can refine the query by chaining `TipDistributionsQueryBuilder` functions onto the query. `TipDistributionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipDistributions()` returns.\n *\n * `queryTipDistributions()` runs with the following `TipDistributionsQueryBuilder` default that you can override:\n *\n * + `limit` is `50`\n *\n * The functions that are chained to `queryTipDistributions()` are applied in the order they are called. For example, if you apply `ascending(\"transaction.transactionDate\")` and then `ascending(\"staff.id\")`, the results are sorted first by the `\"transaction.transactionDate\"`, and then, if there are multiple results with the same `\"transaction.transactionDate\"`, the items are sorted by `\"staff.id\"`.\n *\n * When setting a date filter remember to use\n * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).\n *\n * The following `TipDistributionsQueryBuilder` functions are supported for the `queryTipDistributions()` function. For a full description of the tip distributions object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-result/items) property in `TipDistributionsQueryResult`.\n *\n * @public\n * @permissionId WIX_TIPS.TIP_DISTRIBUTION_READ\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.QueryTipDistributions\n */\nexport function queryTipDistributions(): TipDistributionsQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    Tip,\n    'CURSOR',\n    QueryTipDistributionsRequest,\n    QueryTipDistributionsResponse\n  >({\n    func: async (payload: QueryTipDistributionsRequest) => {\n      const reqOpts = ambassadorWixTipsV1Tip.queryTipDistributions(payload);\n\n      sideEffects?.onSiteCall?.();\n      try {\n        const result = await httpClient.request(reqOpts);\n        sideEffects?.onSuccess?.(result);\n        return result;\n      } catch (err) {\n        sideEffects?.onError?.(err);\n        throw err;\n      }\n    },\n    requestTransformer: (query: QueryTipDistributionsRequest['query']) => {\n      const args = [query, {}] as [QueryTipDistributionsRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({\n      data,\n    }: HttpResponse<QueryTipDistributionsResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.tipDistributions,\n        pagingMetadata: transformedData?.pagingMetadata,\n      };\n    },\n    errorTransformer: (err: unknown) => {\n      const transformedError = sdkTransformError(err, {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      });\n\n      throw transformedError;\n    },\n    pagingMethod: 'CURSOR',\n    transformationPaths: {},\n  });\n}\n\ninterface QueryCursorResult {\n  cursors: Cursors;\n  hasNext: () => boolean;\n  hasPrev: () => boolean;\n  length: number;\n  pageSize: number;\n}\n\nexport interface TipDistributionsQueryResult extends QueryCursorResult {\n  items: TipDistribution[];\n  query: TipDistributionsQueryBuilder;\n  next: () => Promise<TipDistributionsQueryResult>;\n  prev: () => Promise<TipDistributionsQueryResult>;\n}\n\nexport interface TipDistributionsQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ne: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ge: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  gt: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  le: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  lt: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `string`.\n   * @param string - String to compare against. Case-insensitive.\n   */\n  startsWith: (\n    propertyName: '_id',\n    value: string\n  ) => TipDistributionsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `values`.\n   * @param values - List of values to compare against.\n   */\n  hasSome: (propertyName: '_id', value: any[]) => TipDistributionsQueryBuilder;\n  in: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder;\n  exists: (propertyName: '_id', value: boolean) => TipDistributionsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (...propertyNames: Array<'_id'>) => TipDistributionsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (...propertyNames: Array<'_id'>) => TipDistributionsQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => TipDistributionsQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => TipDistributionsQueryBuilder;\n  find: () => Promise<TipDistributionsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.tips.tip.v1.TipsService.QueryTipDistributions\n * @requiredField query\n */\nexport async function typedQueryTipDistributions(\n  query: TipQuery\n): Promise<\n  NonNullablePaths<\n    QueryTipDistributionsResponse,\n    | `tipDistributions`\n    | `tipDistributions.${number}.staff.identificationData.anonymousVisitorId`\n    | `tipDistributions.${number}.staff.identificationData.memberId`\n    | `tipDistributions.${number}.staff.identificationData.wixUserId`\n    | `tipDistributions.${number}.staff.identificationData.appId`\n    | `tipDistributions.${number}.source`,\n    6\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n  const reqOpts = ambassadorWixTipsV1Tip.queryTipDistributions(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['query']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface TipQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: ['_id'];\n      operators: '*';\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Tip, TipQuerySpec>;\nexport type TipQuery = {\n  /** \n  Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  \n  */\n  cursorPaging?: {\n    /** \n  Number of items to load. \n  @max: 100 \n  */\n    limit?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n      | null;\n    /** \n  Pointer to the next or previous page in the list of results.\n\n  You can get the relevant cursor token\n  from the `pagingMetadata` object in the previous call's response.\n  Not relevant for the first request. \n  @maxLength: 16000 \n  */\n    cursor?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n      | null;\n  };\n  /** \n  Filter object in the following format:\n  `\"filter\" : {\n  \"fieldName1\": \"value1\",\n  \"fieldName2\":{\"$operator\":\"value2\"}\n  }`\n  Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object in the following format:\n  `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n  @maxSize: 4 \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 50 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order.  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n  }[];\n};\n\nexport const utils = {\n  query: {\n    ...createQueryUtils<Tip, TipQuerySpec, TipQuery>(),\n  },\n};\n\n/**\n * Sums tip distribution amounts, given the provided filtering.\n * @param filter - Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n * @public\n * @requiredField filter\n * @permissionId WIX_TIPS.TIP_DISTRIBUTION_READ\n * @applicableIdentity APP\n * @fqn wix.tips.tip.v1.TipsService.SumTipDistributionAmounts\n */\nexport async function sumTipDistributionAmounts(\n  filter: Record<string, any>\n): Promise<SumTipDistributionAmountsResponse> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ filter: filter });\n\n  const reqOpts = ambassadorWixTipsV1Tip.sumTipDistributionAmounts(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { filter: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['filter']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixTipsTipV1TipsServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/tips',\n        destPath: '',\n      },\n    ],\n    'apps._base_domain_': [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/tips/v1/tips',\n        destPath: '/v1/tips',\n      },\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/tips-service',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tips';\n\n/**\n * Previews a tip for a list of line items.\n *\n *\n * If you provide the Wix Bookings app ID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix))\n * as `lineItemInfo.catalogReference.appId`, the response includes tip\n * distributions for each associated\n * Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object)).\n *\n * If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is\n * based on the site's default tip settings.\n */\nexport function previewTip(payload: object): RequestOptionsFactory<any> {\n  function __previewTip({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.PreviewTip',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/preview',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tip.distributions.createdDate' },\n              { path: 'tip.distributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __previewTip;\n}\n\n/**\n * Retrieves the tip that's associated with an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n */\nexport function getTipByOrderId(payload: object): RequestOptionsFactory<any> {\n  function __getTipByOrderId({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'GET' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.GetTipByOrderId',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/order/{orderId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tip.distributions.createdDate' },\n              { path: 'tip.distributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getTipByOrderId;\n}\n\n/** Retrieves the tip that's associated with an [eCommerce draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction). */\nexport function getTipByDraftOrderId(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __getTipByDraftOrderId({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'GET' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.GetTipByDraftOrderId',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/draft-order/{draftOrderId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tip.distributions.createdDate' },\n              { path: 'tip.distributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getTipByDraftOrderId;\n}\n\n/**\n * Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n * If the customer hasn't yet selected a tip choice, the response is empty.\n *\n * Please refer to the Sample Flows for more information.\n */\nexport function getTipChoice(payload: object): RequestOptionsFactory<any> {\n  function __getTipChoice({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'GET' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.GetTipChoice',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/choice/{purchaseFlowId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __getTipChoice;\n}\n\n/**\n * Updates the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n *\n * Please refer to the Sample Flows for more information.\n */\nexport function updateTipChoice(payload: object): RequestOptionsFactory<any> {\n  function __updateTipChoice({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'PATCH' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.UpdateTipChoice',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/choice',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __updateTipChoice;\n}\n\n/**\n * Creates or updates a tip on an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, an `additionalFee` is added. If a tip is already\n * present, the existing `additionalFee` is replaced.\n *\n * If you specify `tip.distributions.transaction`, that distribution\n * amount can't be changed in the future. Then, you also can't remove any of the\n * other distributions.\n *\n * The call fails if:\n * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n * + The total tip amount is zero or negative.\n * + The sum of all tip distribution amounts and `undistributedAmount` doesn't match the total tip amount.\n * + You omit `tip.distributions` with an existing `transaction`.\n */\nexport function setTipOnOrder(payload: object): RequestOptionsFactory<any> {\n  function __setTipOnOrder({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [\n          { path: 'tip.distributions.createdDate' },\n          { path: 'tip.distributions.transaction.date' },\n        ],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.SetTipOnOrder',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/set',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tip.distributions.createdDate' },\n              { path: 'tip.distributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __setTipOnOrder;\n}\n\n/**\n * Removes a tip from an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, the call succeeds and the response contains an\n * empty `OrderInfo` object.\n *\n * The call fails if the customer has already been charged for at least one of\n * the associated tip distributions.\n */\nexport function removeTipFromOrder(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __removeTipFromOrder({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.RemoveTipFromOrder',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/remove',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __removeTipFromOrder;\n}\n\n/**\n * Adds tip distributions to an\n * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n *\n *\n * If no tip exists on the order, an `additionalFee` is added and the total tip\n * amount is equal to the sum of all distribution amounts. If a tip is already\n * present, the existing `additionalFee` is replaced and the total tip amount is\n * increased by the sum of the new tip distributions.\n *\n * The call fails if:\n * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n * + Any of the tip distribution amounts is zero or negative.\n */\nexport function addTipDistributionsToOrder(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __addTipDistributionsToOrder({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [\n          { path: 'tipDistributions.createdDate' },\n          { path: 'tipDistributions.transaction.date' },\n        ],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.AddTipDistributionsToOrder',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/tip-distributions/add',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tipDistributions.createdDate' },\n              { path: 'tipDistributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __addTipDistributionsToOrder;\n}\n\n/**\n * Creates a query to retrieve a list of tip distributions.\n *\n * The `queryTipDistributions()` function builds a query to retrieve a list of tip distributions and returns a `TipDistributionsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-builder/find) function.\n *\n * You can refine the query by chaining `TipDistributionsQueryBuilder` functions onto the query. `TipDistributionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipDistributions()` returns.\n *\n * `queryTipDistributions()` runs with the following `TipDistributionsQueryBuilder` default that you can override:\n *\n * + `limit` is `50`\n *\n * The functions that are chained to `queryTipDistributions()` are applied in the order they are called. For example, if you apply `ascending(\"transaction.transactionDate\")` and then `ascending(\"staff.id\")`, the results are sorted first by the `\"transaction.transactionDate\"`, and then, if there are multiple results with the same `\"transaction.transactionDate\"`, the items are sorted by `\"staff.id\"`.\n *\n * When setting a date filter remember to use\n * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).\n *\n * The following `TipDistributionsQueryBuilder` functions are supported for the `queryTipDistributions()` function. For a full description of the tip distributions object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-result/items) property in `TipDistributionsQueryResult`.\n *\n */\nexport function queryTipDistributions(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __queryTipDistributions({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.QueryTipDistributions',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/tip-distributions/query',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'tipDistributions.createdDate' },\n              { path: 'tipDistributions.transaction.date' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __queryTipDistributions;\n}\n\n/** Sums tip distribution amounts, given the provided filtering. */\nexport function sumTipDistributionAmounts(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __sumTipDistributionAmounts({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.v1.tip',\n      method: 'POST' as any,\n      methodFqn: 'wix.tips.tip.v1.TipsService.SumTipDistributionAmounts',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixTipsTipV1TipsServiceUrl({\n        protoPath: '/v1/tips/tip-distributions/sum-amounts',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __sumTipDistributionAmounts;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  AddTipDistributionsToOrderApplicationErrors,\n  AddTipDistributionsToOrderOptions,\n  AddTipDistributionsToOrderResponse,\n  GetTipByDraftOrderIdApplicationErrors,\n  GetTipByDraftOrderIdResponse,\n  GetTipByOrderIdApplicationErrors,\n  GetTipByOrderIdResponse,\n  GetTipChoiceApplicationErrors,\n  GetTipChoiceResponse,\n  LineItemInfo,\n  PreviewTipApplicationErrors,\n  PreviewTipOptions,\n  PreviewTipResponse,\n  QueryTipDistributionsResponse,\n  RemoveTipFromOrderApplicationErrors,\n  RemoveTipFromOrderOptions,\n  RemoveTipFromOrderResponse,\n  SetTipOnOrderApplicationErrors,\n  SetTipOnOrderOptions,\n  SetTipOnOrderResponse,\n  SumTipDistributionAmountsResponse,\n  TipChoice,\n  TipDistributionsQueryBuilder,\n  TipQuery,\n  UpdateTipChoiceApplicationErrors,\n  UpdateTipChoiceOptions,\n  UpdateTipChoiceResponse,\n  addTipDistributionsToOrder as universalAddTipDistributionsToOrder,\n  getTipByDraftOrderId as universalGetTipByDraftOrderId,\n  getTipByOrderId as universalGetTipByOrderId,\n  getTipChoice as universalGetTipChoice,\n  previewTip as universalPreviewTip,\n  queryTipDistributions as universalQueryTipDistributions,\n  removeTipFromOrder as universalRemoveTipFromOrder,\n  setTipOnOrder as universalSetTipOnOrder,\n  sumTipDistributionAmounts as universalSumTipDistributionAmounts,\n  typedQueryTipDistributions as universalTypedQueryTipDistributions,\n  updateTipChoice as universalUpdateTipChoice,\n} from './tips-v1-tip-tips.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function previewTip(httpClient: HttpClient): PreviewTipSignature {\n  return (\n    lineItemInfo: NonNullablePaths<\n      LineItemInfo,\n      `catalogReference.appId` | `catalogReference.catalogItemId` | `price`,\n      3\n    >[],\n    options?: NonNullablePaths<\n      PreviewTipOptions,\n      `tipChoice` | `tipChoice.tipType` | `tipChoice.value`,\n      3\n    >\n  ) =>\n    universalPreviewTip(\n      lineItemInfo,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface PreviewTipSignature {\n  /**\n   * Previews a tip for a list of line items.\n   *\n   *\n   * If you provide the Wix Bookings app ID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix))\n   * as `lineItemInfo.catalogReference.appId`, the response includes tip\n   * distributions for each associated\n   * Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object)).\n   *\n   * If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is\n   * based on the site's default tip settings.\n   * @param - Information about the line items to preview the tip for.\n   *\n   * Min: 1 line item\n   * Max: 50 line items\n   * @param - Options to use when previewing a tip.\n   */\n  (\n    lineItemInfo: NonNullablePaths<\n      LineItemInfo,\n      `catalogReference.appId` | `catalogReference.catalogItemId` | `price`,\n      3\n    >[],\n    options?: NonNullablePaths<\n      PreviewTipOptions,\n      `tipChoice` | `tipChoice.tipType` | `tipChoice.value`,\n      3\n    >\n  ): Promise<\n    NonNullablePaths<\n      PreviewTipResponse,\n      | `tip.distributions`\n      | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tip.distributions.${number}.staff.identificationData.memberId`\n      | `tip.distributions.${number}.staff.identificationData.wixUserId`\n      | `tip.distributions.${number}.staff.identificationData.appId`\n      | `tip.distributions.${number}.source`,\n      7\n    > & {\n      __applicationErrorsType?: PreviewTipApplicationErrors;\n    }\n  >;\n}\n\nexport function getTipByOrderId(\n  httpClient: HttpClient\n): GetTipByOrderIdSignature {\n  return (orderId: string) =>\n    universalGetTipByOrderId(\n      orderId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetTipByOrderIdSignature {\n  /**\n   * Retrieves the tip that's associated with an\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   * @param - ID of the order to retrieve the tip for.\n   */\n  (orderId: string): Promise<\n    NonNullablePaths<\n      GetTipByOrderIdResponse,\n      | `tip.distributions`\n      | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tip.distributions.${number}.staff.identificationData.memberId`\n      | `tip.distributions.${number}.staff.identificationData.wixUserId`\n      | `tip.distributions.${number}.staff.identificationData.appId`\n      | `tip.distributions.${number}.source`,\n      7\n    > & {\n      __applicationErrorsType?: GetTipByOrderIdApplicationErrors;\n    }\n  >;\n}\n\nexport function getTipByDraftOrderId(\n  httpClient: HttpClient\n): GetTipByDraftOrderIdSignature {\n  return (draftOrderId: string) =>\n    universalGetTipByDraftOrderId(\n      draftOrderId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetTipByDraftOrderIdSignature {\n  /**\n   * Retrieves the tip that's associated with an [eCommerce draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction).\n   * @param - ID of the [draft order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/introduction) to retrieve the tip for.\n   */\n  (draftOrderId: string): Promise<\n    NonNullablePaths<\n      GetTipByDraftOrderIdResponse,\n      | `tip.distributions`\n      | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tip.distributions.${number}.staff.identificationData.memberId`\n      | `tip.distributions.${number}.staff.identificationData.wixUserId`\n      | `tip.distributions.${number}.staff.identificationData.appId`\n      | `tip.distributions.${number}.source`,\n      7\n    > & {\n      __applicationErrorsType?: GetTipByDraftOrderIdApplicationErrors;\n    }\n  >;\n}\n\nexport function getTipChoice(httpClient: HttpClient): GetTipChoiceSignature {\n  return (purchaseFlowId: string) =>\n    universalGetTipChoice(\n      purchaseFlowId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetTipChoiceSignature {\n  /**\n   * Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n   * If the customer hasn't yet selected a tip choice, the response is empty.\n   *\n   * Please refer to the Sample Flows for more information.\n   * @param - ID of the purchase flow that's associated with the\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   * The purchase flow ID is a persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n   */\n  (purchaseFlowId: string): Promise<\n    NonNullablePaths<GetTipChoiceResponse, `tipChoice.tipType`, 3> & {\n      __applicationErrorsType?: GetTipChoiceApplicationErrors;\n    }\n  >;\n}\n\nexport function updateTipChoice(\n  httpClient: HttpClient\n): UpdateTipChoiceSignature {\n  return (\n    tipChoice: TipChoice,\n    options: NonNullablePaths<UpdateTipChoiceOptions, `purchaseFlowId`, 2>\n  ) =>\n    universalUpdateTipChoice(\n      tipChoice,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdateTipChoiceSignature {\n  /**\n   * Updates the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction)).\n   *\n   * Please refer to the Sample Flows for more information.\n   * @param - Tip choice to select for the purchase flow. The call fails if you provide a\n   * value for `tipChoice.tipType` that doesn't match the relevant tip settings\n   * configuration. For example:\n   * + `AMOUNT` when `tipSettings.tipType` isn't `AMOUNT`.\n   * + `PERCENTAGE` when `tipSettings.tipType` isn't `PERCENTAGE`.\n   * + `CUSTOM` when `tipSettings.allowCustomTip` is `false`.\n   * @param - Options to use when updating a tip choice.\n   */\n  (\n    tipChoice: TipChoice,\n    options: NonNullablePaths<UpdateTipChoiceOptions, `purchaseFlowId`, 2>\n  ): Promise<\n    NonNullablePaths<UpdateTipChoiceResponse, `tipChoice.tipType`, 3> & {\n      __applicationErrorsType?: UpdateTipChoiceApplicationErrors;\n    }\n  >;\n}\n\nexport function setTipOnOrder(httpClient: HttpClient): SetTipOnOrderSignature {\n  return (\n    options: NonNullablePaths<\n      SetTipOnOrderOptions,\n      | `tip`\n      | `tip.distributions.${number}.transaction._id`\n      | `tip.distributions.${number}.transaction.date`,\n      6\n    >\n  ) =>\n    universalSetTipOnOrder(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface SetTipOnOrderSignature {\n  /**\n   * Creates or updates a tip on an\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   *\n   * If no tip exists on the order, an `additionalFee` is added. If a tip is already\n   * present, the existing `additionalFee` is replaced.\n   *\n   * If you specify `tip.distributions.transaction`, that distribution\n   * amount can't be changed in the future. Then, you also can't remove any of the\n   * other distributions.\n   *\n   * The call fails if:\n   * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n   * + The total tip amount is zero or negative.\n   * + The sum of all tip distribution amounts and `undistributedAmount` doesn't match the total tip amount.\n   * + You omit `tip.distributions` with an existing `transaction`.\n   * @param - Options to use when setting a tip on an order.\n   */\n  (\n    options: NonNullablePaths<\n      SetTipOnOrderOptions,\n      | `tip`\n      | `tip.distributions.${number}.transaction._id`\n      | `tip.distributions.${number}.transaction.date`,\n      6\n    >\n  ): Promise<\n    NonNullablePaths<\n      SetTipOnOrderResponse,\n      | `tip.distributions`\n      | `tip.distributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tip.distributions.${number}.staff.identificationData.memberId`\n      | `tip.distributions.${number}.staff.identificationData.wixUserId`\n      | `tip.distributions.${number}.staff.identificationData.appId`\n      | `tip.distributions.${number}.source`\n      | `orderInfo.additionalFeePrice.amount`\n      | `orderInfo.additionalFeePrice.formattedAmount`,\n      7\n    > & {\n      __applicationErrorsType?: SetTipOnOrderApplicationErrors;\n    }\n  >;\n}\n\nexport function removeTipFromOrder(\n  httpClient: HttpClient\n): RemoveTipFromOrderSignature {\n  return (options: RemoveTipFromOrderOptions) =>\n    universalRemoveTipFromOrder(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface RemoveTipFromOrderSignature {\n  /**\n   * Removes a tip from an\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   *\n   * If no tip exists on the order, the call succeeds and the response contains an\n   * empty `OrderInfo` object.\n   *\n   * The call fails if the customer has already been charged for at least one of\n   * the associated tip distributions.\n   * @param - Options to use when removing a tip from an order.\n   */\n  (options: RemoveTipFromOrderOptions): Promise<\n    NonNullablePaths<\n      RemoveTipFromOrderResponse,\n      | `orderInfo.additionalFeePrice.amount`\n      | `orderInfo.additionalFeePrice.formattedAmount`,\n      4\n    > & {\n      __applicationErrorsType?: RemoveTipFromOrderApplicationErrors;\n    }\n  >;\n}\n\nexport function addTipDistributionsToOrder(\n  httpClient: HttpClient\n): AddTipDistributionsToOrderSignature {\n  return (\n    options: NonNullablePaths<\n      AddTipDistributionsToOrderOptions,\n      | `tipDistributions`\n      | `tipDistributions.${number}.transaction._id`\n      | `tipDistributions.${number}.transaction.date`,\n      5\n    >\n  ) =>\n    universalAddTipDistributionsToOrder(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface AddTipDistributionsToOrderSignature {\n  /**\n   * Adds tip distributions to an\n   * eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object)).\n   *\n   *\n   * If no tip exists on the order, an `additionalFee` is added and the total tip\n   * amount is equal to the sum of all distribution amounts. If a tip is already\n   * present, the existing `additionalFee` is replaced and the total tip amount is\n   * increased by the sum of the new tip distributions.\n   *\n   * The call fails if:\n   * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`.\n   * + Any of the tip distribution amounts is zero or negative.\n   * @param - Options to use when adding tip distributions to an order.\n   */\n  (\n    options: NonNullablePaths<\n      AddTipDistributionsToOrderOptions,\n      | `tipDistributions`\n      | `tipDistributions.${number}.transaction._id`\n      | `tipDistributions.${number}.transaction.date`,\n      5\n    >\n  ): Promise<\n    NonNullablePaths<\n      AddTipDistributionsToOrderResponse,\n      | `tipDistributions`\n      | `tipDistributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tipDistributions.${number}.staff.identificationData.memberId`\n      | `tipDistributions.${number}.staff.identificationData.wixUserId`\n      | `tipDistributions.${number}.staff.identificationData.appId`\n      | `tipDistributions.${number}.source`\n      | `orderInfo.additionalFeePrice.amount`\n      | `orderInfo.additionalFeePrice.formattedAmount`,\n      6\n    > & {\n      __applicationErrorsType?: AddTipDistributionsToOrderApplicationErrors;\n    }\n  >;\n}\n\nexport function queryTipDistributions(\n  httpClient: HttpClient\n): QueryTipDistributionsSignature {\n  return () =>\n    universalQueryTipDistributions(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryTipDistributionsSignature {\n  /**\n   * Creates a query to retrieve a list of tip distributions.\n   *\n   * The `queryTipDistributions()` function builds a query to retrieve a list of tip distributions and returns a `TipDistributionsQueryBuilder` object.\n   *\n   * The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-builder/find) function.\n   *\n   * You can refine the query by chaining `TipDistributionsQueryBuilder` functions onto the query. `TipDistributionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipDistributions()` returns.\n   *\n   * `queryTipDistributions()` runs with the following `TipDistributionsQueryBuilder` default that you can override:\n   *\n   * + `limit` is `50`\n   *\n   * The functions that are chained to `queryTipDistributions()` are applied in the order they are called. For example, if you apply `ascending(\"transaction.transactionDate\")` and then `ascending(\"staff.id\")`, the results are sorted first by the `\"transaction.transactionDate\"`, and then, if there are multiple results with the same `\"transaction.transactionDate\"`, the items are sorted by `\"staff.id\"`.\n   *\n   * When setting a date filter remember to use\n   * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).\n   *\n   * The following `TipDistributionsQueryBuilder` functions are supported for the `queryTipDistributions()` function. For a full description of the tip distributions object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-result/items) property in `TipDistributionsQueryResult`.\n   *\n   */\n  (): TipDistributionsQueryBuilder;\n}\n\nexport function typedQueryTipDistributions(\n  httpClient: HttpClient\n): TypedQueryTipDistributionsSignature {\n  return (query: TipQuery) =>\n    universalTypedQueryTipDistributions(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQueryTipDistributionsSignature {\n  /** */\n  (query: TipQuery): Promise<\n    NonNullablePaths<\n      QueryTipDistributionsResponse,\n      | `tipDistributions`\n      | `tipDistributions.${number}.staff.identificationData.anonymousVisitorId`\n      | `tipDistributions.${number}.staff.identificationData.memberId`\n      | `tipDistributions.${number}.staff.identificationData.wixUserId`\n      | `tipDistributions.${number}.staff.identificationData.appId`\n      | `tipDistributions.${number}.source`,\n      6\n    >\n  >;\n}\n\nexport function sumTipDistributionAmounts(\n  httpClient: HttpClient\n): SumTipDistributionAmountsSignature {\n  return (filter: Record<string, any>) =>\n    universalSumTipDistributionAmounts(\n      filter,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface SumTipDistributionAmountsSignature {\n  /**\n   * Sums tip distribution amounts, given the provided filtering.\n   * @param - Filter object in the following format:\n   * `\"filter\" : {\n   * \"fieldName1\": \"value1\",\n   * \"fieldName2\":{\"$operator\":\"value2\"}\n   * }`\n   * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n   */\n  (filter: Record<string, any>): Promise<SumTipDistributionAmountsResponse>;\n}\n\nexport {\n  AccountInfo,\n  ActionEvent,\n  AddTipDistributionsToOrderOptions,\n  AddTipDistributionsToOrderOptionsIdentifierOneOf,\n  AddTipDistributionsToOrderRequest,\n  AddTipDistributionsToOrderRequestIdentifierOneOf,\n  AddTipDistributionsToOrderResponse,\n  ApplyTipDistributionsRequest,\n  ApplyTipDistributionsResponse,\n  CatalogReference,\n  CommonIdentificationData,\n  CommonIdentificationDataIdOneOf,\n  CreateTipDistributionsRequest,\n  CreateTipDistributionsResponse,\n  CursorPaging,\n  CursorPagingMetadata,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Cursors,\n  DeleteTipDistributionsRequest,\n  DeleteTipDistributionsRequestDeleteByOneOf,\n  DeleteTipDistributionsResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  GetTipByDraftOrderIdRequest,\n  GetTipByDraftOrderIdResponse,\n  GetTipByOrderIdRequest,\n  GetTipByOrderIdResponse,\n  GetTipChoiceRequest,\n  GetTipChoiceResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  IdentityType,\n  LineItemInfo,\n  MessageEnvelope,\n  OrderInfo,\n  OrderInfoIdentifierOneOf,\n  PreviewTipOptions,\n  PreviewTipRequest,\n  PreviewTipResponse,\n  Price,\n  PublishTipDistributionsCreatedEventRequest,\n  PublishTipDistributionsCreatedEventResponse,\n  QueryBy,\n  QueryTipDistributionsRequest,\n  QueryTipDistributionsResponse,\n  RemoveTipFromOrderOptions,\n  RemoveTipFromOrderOptionsIdentifierOneOf,\n  RemoveTipFromOrderRequest,\n  RemoveTipFromOrderRequestIdentifierOneOf,\n  RemoveTipFromOrderResponse,\n  RestoreInfo,\n  SetTipOnOrderOptions,\n  SetTipOnOrderOptionsIdentifierOneOf,\n  SetTipOnOrderRequest,\n  SetTipOnOrderRequestIdentifierOneOf,\n  SetTipOnOrderResponse,\n  SortOrder,\n  Sorting,\n  Source,\n  Staff,\n  SumTipDistributionAmountsRequest,\n  SumTipDistributionAmountsResponse,\n  Tip,\n  TipChoice,\n  TipDistribution,\n  TipDistributionsCreated,\n  TipDistributionsQueryBuilder,\n  TipDistributionsQueryResult,\n  TipQuerySpec,\n  TipType,\n  Transaction,\n  UpdateTipChoiceOptions,\n  UpdateTipChoiceRequest,\n  UpdateTipChoiceResponse,\n  WebhookIdentityType,\n  utils,\n} from './tips-v1-tip-tips.universal.js';\n","import {\n  previewTip as publicPreviewTip,\n  getTipByOrderId as publicGetTipByOrderId,\n  getTipByDraftOrderId as publicGetTipByDraftOrderId,\n  getTipChoice as publicGetTipChoice,\n  updateTipChoice as publicUpdateTipChoice,\n  setTipOnOrder as publicSetTipOnOrder,\n  removeTipFromOrder as publicRemoveTipFromOrder,\n  addTipDistributionsToOrder as publicAddTipDistributionsToOrder,\n  queryTipDistributions as publicQueryTipDistributions,\n  typedQueryTipDistributions as publicTypedQueryTipDistributions,\n  sumTipDistributionAmounts as publicSumTipDistributionAmounts,\n} from './tips-v1-tip-tips.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n  TipDistributionsQueryBuilder,\n  TipQuery,\n  typedQueryTipDistributions as universalTypedQueryTipDistributions,\n} from './tips-v1-tip-tips.universal.js';\n\nfunction customQueryTipDistributions(httpClient: HttpClient) {\n  const router = createQueryOverloadRouter({\n    builderQueryFunction: () => publicQueryTipDistributions(httpClient)(),\n    typedQueryFunction: (query: TipQuery) =>\n      publicTypedQueryTipDistributions(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): TipDistributionsQueryBuilder;\n  function overloadedQuery(\n    query: TipQuery\n  ): ReturnType<typeof universalTypedQueryTipDistributions>;\n  function overloadedQuery(query?: TipQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const previewTip: MaybeContext<\n  BuildRESTFunction<typeof publicPreviewTip> & typeof publicPreviewTip\n> = /*#__PURE__*/ createRESTModule(publicPreviewTip);\nexport const getTipByOrderId: MaybeContext<\n  BuildRESTFunction<typeof publicGetTipByOrderId> & typeof publicGetTipByOrderId\n> = /*#__PURE__*/ createRESTModule(publicGetTipByOrderId);\nexport const getTipByDraftOrderId: MaybeContext<\n  BuildRESTFunction<typeof publicGetTipByDraftOrderId> &\n    typeof publicGetTipByDraftOrderId\n> = /*#__PURE__*/ createRESTModule(publicGetTipByDraftOrderId);\nexport const getTipChoice: MaybeContext<\n  BuildRESTFunction<typeof publicGetTipChoice> & typeof publicGetTipChoice\n> = /*#__PURE__*/ createRESTModule(publicGetTipChoice);\nexport const updateTipChoice: MaybeContext<\n  BuildRESTFunction<typeof publicUpdateTipChoice> & typeof publicUpdateTipChoice\n> = /*#__PURE__*/ createRESTModule(publicUpdateTipChoice);\nexport const setTipOnOrder: MaybeContext<\n  BuildRESTFunction<typeof publicSetTipOnOrder> & typeof publicSetTipOnOrder\n> = /*#__PURE__*/ createRESTModule(publicSetTipOnOrder);\nexport const removeTipFromOrder: MaybeContext<\n  BuildRESTFunction<typeof publicRemoveTipFromOrder> &\n    typeof publicRemoveTipFromOrder\n> = /*#__PURE__*/ createRESTModule(publicRemoveTipFromOrder);\nexport const addTipDistributionsToOrder: MaybeContext<\n  BuildRESTFunction<typeof publicAddTipDistributionsToOrder> &\n    typeof publicAddTipDistributionsToOrder\n> = /*#__PURE__*/ createRESTModule(publicAddTipDistributionsToOrder);\nexport const sumTipDistributionAmounts: MaybeContext<\n  BuildRESTFunction<typeof publicSumTipDistributionAmounts> &\n    typeof publicSumTipDistributionAmounts\n> = /*#__PURE__*/ createRESTModule(publicSumTipDistributionAmounts);\nexport const queryTipDistributions: MaybeContext<\n  BuildRESTFunction<typeof customQueryTipDistributions> &\n    typeof customQueryTipDistributions\n> = /*#__PURE__*/ createRESTModule(customQueryTipDistributions);\n\nexport {\n  IdentityType,\n  Source,\n  TipType,\n  SortOrder,\n  QueryBy,\n  WebhookIdentityType,\n} from './tips-v1-tip-tips.universal.js';\nexport {\n  Tip,\n  TipDistribution,\n  CommonIdentificationData,\n  CommonIdentificationDataIdOneOf,\n  Staff,\n  LineItemInfo,\n  CatalogReference,\n  Transaction,\n  PreviewTipRequest,\n  TipChoice,\n  PreviewTipResponse,\n  GetTipByOrderIdRequest,\n  GetTipByOrderIdResponse,\n  GetTipByDraftOrderIdRequest,\n  GetTipByDraftOrderIdResponse,\n  GetTipChoiceRequest,\n  GetTipChoiceResponse,\n  UpdateTipChoiceRequest,\n  UpdateTipChoiceResponse,\n  SetTipOnOrderRequest,\n  SetTipOnOrderRequestIdentifierOneOf,\n  SetTipOnOrderResponse,\n  OrderInfo,\n  OrderInfoIdentifierOneOf,\n  Price,\n  RemoveTipFromOrderRequest,\n  RemoveTipFromOrderRequestIdentifierOneOf,\n  RemoveTipFromOrderResponse,\n  CreateTipDistributionsRequest,\n  CreateTipDistributionsResponse,\n  DeleteTipDistributionsRequest,\n  DeleteTipDistributionsRequestDeleteByOneOf,\n  DeleteTipDistributionsResponse,\n  AddTipDistributionsToOrderRequest,\n  AddTipDistributionsToOrderRequestIdentifierOneOf,\n  AddTipDistributionsToOrderResponse,\n  QueryTipDistributionsRequest,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Sorting,\n  CursorPaging,\n  QueryTipDistributionsResponse,\n  CursorPagingMetadata,\n  Cursors,\n  SumTipDistributionAmountsRequest,\n  SumTipDistributionAmountsResponse,\n  ApplyTipDistributionsRequest,\n  ApplyTipDistributionsResponse,\n  PublishTipDistributionsCreatedEventRequest,\n  PublishTipDistributionsCreatedEventResponse,\n  TipDistributionsCreated,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  PreviewTipOptions,\n  UpdateTipChoiceOptions,\n  SetTipOnOrderOptions,\n  SetTipOnOrderOptionsIdentifierOneOf,\n  RemoveTipFromOrderOptions,\n  RemoveTipFromOrderOptionsIdentifierOneOf,\n  AddTipDistributionsToOrderOptions,\n  AddTipDistributionsToOrderOptionsIdentifierOneOf,\n  TipDistributionsQueryResult,\n  TipDistributionsQueryBuilder,\n  TipQuerySpec,\n} from './tips-v1-tip-tips.universal.js';\nexport { utils } from './tips-v1-tip-tips.universal.js';\nexport {\n  IdentityTypeWithLiterals,\n  SourceWithLiterals,\n  TipTypeWithLiterals,\n  SortOrderWithLiterals,\n  QueryByWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  PreviewTipApplicationErrors,\n  GetTipByOrderIdApplicationErrors,\n  GetTipByDraftOrderIdApplicationErrors,\n  GetTipChoiceApplicationErrors,\n  UpdateTipChoiceApplicationErrors,\n  SetTipOnOrderApplicationErrors,\n  RemoveTipFromOrderApplicationErrors,\n  AddTipDistributionsToOrderApplicationErrors,\n  CommonQueryWithEntityContext,\n  TipQuery,\n} from './tips-v1-tip-tips.universal.js';\n"]}