{"version":3,"sources":["../../src/loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.ts","../../src/loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.http.ts","../../src/loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.public.ts","../../src/loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.context.ts"],"sourcesContent":["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 ambassadorWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutDiscount from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.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/** A loyalty checkout discount represents a discount applied to a checkout using loyalty rewards, coupons, or referral rewards. */\nexport interface LoyaltyCheckoutDiscount\n  extends LoyaltyCheckoutDiscountDiscountOneOf {\n  /**\n   * ID of the loyalty reward used for this discount.\n   * @format GUID\n   */\n  rewardId?: string;\n  /**\n   * ID of the loyalty coupon used for this discount.\n   * @format GUID\n   */\n  loyaltyCouponId?: string;\n  /**\n   * ID of the referral reward used for this discount.\n   * @format GUID\n   */\n  referralRewardId?: string;\n  /**\n   * Loyalty checkout discount ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string;\n  /**\n   * ID of the checkout this discount is applied to.\n   * @format GUID\n   */\n  checkoutId?: string;\n  /**\n   * Current status of the discount.\n   * @readonly\n   */\n  status?: DiscountStatusWithLiterals;\n  /**\n   * The type of discount applied.\n   * @readonly\n   */\n  discountType?: DiscountTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface LoyaltyCheckoutDiscountDiscountOneOf {\n  /**\n   * ID of the loyalty reward used for this discount.\n   * @format GUID\n   */\n  rewardId?: string;\n  /**\n   * ID of the loyalty coupon used for this discount.\n   * @format GUID\n   */\n  loyaltyCouponId?: string;\n  /**\n   * ID of the referral reward used for this discount.\n   * @format GUID\n   */\n  referralRewardId?: string;\n}\n\nexport enum DiscountStatus {\n  /** Status is unknown or not specified. */\n  UNKNOWN = 'UNKNOWN',\n  /** Discount has been applied to the checkout. */\n  APPLIED = 'APPLIED',\n  /** Discount application is in progress. */\n  IN_PROGRESS = 'IN_PROGRESS',\n  /** Discount has been successfully completed. */\n  COMPLETED = 'COMPLETED',\n  /** Discount has been refunded. */\n  REFUNDED = 'REFUNDED',\n  /** Attempt to refund the discount failed. */\n  FAILED_TO_REFUND = 'FAILED_TO_REFUND',\n  /** Discount was refunded due to a timeout. */\n  REFUNDED_DUE_TO_TIMEOUT = 'REFUNDED_DUE_TO_TIMEOUT',\n  /** Discount was refunded due to manual removal. */\n  REFUNDED_DUE_TO_MANUAL_DISCOUNT_REMOVAL = 'REFUNDED_DUE_TO_MANUAL_DISCOUNT_REMOVAL',\n  /** Discount is scheduled for refund. */\n  SCHEDULED_FOR_REFUND = 'SCHEDULED_FOR_REFUND',\n  /** Discount wasn't used. */\n  UNUSED = 'UNUSED',\n}\n\n/** @enumType */\nexport type DiscountStatusWithLiterals =\n  | DiscountStatus\n  | 'UNKNOWN'\n  | 'APPLIED'\n  | 'IN_PROGRESS'\n  | 'COMPLETED'\n  | 'REFUNDED'\n  | 'FAILED_TO_REFUND'\n  | 'REFUNDED_DUE_TO_TIMEOUT'\n  | 'REFUNDED_DUE_TO_MANUAL_DISCOUNT_REMOVAL'\n  | 'SCHEDULED_FOR_REFUND'\n  | 'UNUSED';\n\nexport enum DiscountType {\n  /** Discount type is unknown or not specified. */\n  UNKNOWN = 'UNKNOWN',\n  /** A discount from a flexible reward. */\n  DISCOUNT_AMOUNT = 'DISCOUNT_AMOUNT',\n  /** A discount from a redeemed loyalty program coupon. */\n  LOYALTY_COUPON = 'LOYALTY_COUPON',\n  /** A discount from a coupon reward that hasn't yet been redeemed. */\n  COUPON_REWARD = 'COUPON_REWARD',\n  /** A discount from a referral reward. */\n  REFERRAL_REWARD = 'REFERRAL_REWARD',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n  | DiscountType\n  | 'UNKNOWN'\n  | 'DISCOUNT_AMOUNT'\n  | 'LOYALTY_COUPON'\n  | 'COUPON_REWARD'\n  | 'REFERRAL_REWARD';\n\nexport interface DiscountRefundedDueToManualDiscountRemoval {\n  /** Loyalty checkout discount refunded due to manual removal. */\n  discount?: LoyaltyCheckoutDiscount;\n}\n\nexport interface DiscountRefundedDueToTimeout {\n  /** Loyalty checkout discount refunded due to timeout. */\n  discount?: LoyaltyCheckoutDiscount;\n}\n\nexport interface DiscountScheduledForRefund {\n  /** Loyalty checkout discount scheduled for refund. */\n  discount?: LoyaltyCheckoutDiscount;\n}\n\n/** Request to apply a discount to a checkout. */\nexport interface ApplyDiscountToCheckoutRequest\n  extends ApplyDiscountToCheckoutRequestDiscountOneOf {\n  /** Unredeemed loyalty reward discount. */\n  reward?: Reward;\n  /** Loyalty coupon discount. */\n  loyaltyCoupon?: LoyaltyCoupon;\n  /** Referral reward discount. */\n  referralReward?: ReferralReward;\n  /**\n   * ID of the checkout to apply the discount to.\n   * @format GUID\n   */\n  checkoutId: string;\n}\n\n/** @oneof */\nexport interface ApplyDiscountToCheckoutRequestDiscountOneOf {\n  /** Unredeemed loyalty reward discount. */\n  reward?: Reward;\n  /** Loyalty coupon discount. */\n  loyaltyCoupon?: LoyaltyCoupon;\n  /** Referral reward discount. */\n  referralReward?: ReferralReward;\n}\n\nexport interface Reward {\n  /**\n   * ID of the loyalty reward to be used for this discount.\n   * @format GUID\n   */\n  _id?: string;\n  /**\n   * Number of points to spend for this reward.\n   * For example, if the reward is 10 points = $1, then 35 points would give a $3.50 discount.\n   *\n   * >**Note:** Only relevant when using a flexible type reward. Depending on how your loyalty program is set up, there may be a minimum number of points you must spend.\n   * @min 1\n   * @max 9999999\n   */\n  pointsToSpend?: number | null;\n  /**\n   * Revision number, which increments by 1 each time a reward is updated.\n   * To prevent conflicting changes, the current `revision` must be passed when updating a reward.\n   */\n  revision?: string;\n}\n\nexport interface LoyaltyCoupon {\n  /**\n   * ID of the loyalty coupon to be used for this discount.\n   * @format GUID\n   */\n  _id?: string;\n  /**\n   * Revision of the coupon object. Incremented by 1 each time the coupon object is updated.\n   * Pass the latest `revision` when updating to prevent conflicting changes.\n   */\n  revision?: string;\n}\n\nexport interface ReferralReward {\n  /**\n   * Referral reward discount ID.\n   * @format GUID\n   */\n  _id?: string;\n  /**\n   * Revision of the referral object. Incremented by 1 each time the referral object is updated.\n   * Pass the latest `revision` when updating to prevent conflicting changes.\n   */\n  revision?: string;\n}\n\n/** Response after applying a discount to a checkout. */\nexport interface ApplyDiscountToCheckoutResponse {\n  /** The applied loyalty checkout discount. */\n  discount?: LoyaltyCheckoutDiscount;\n}\n\nexport interface QueryLoyaltyCheckoutDiscountsRequest {\n  /**\n   * Filter object.\n   *\n   * See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language) for more information.\n   */\n  query: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n  /**\n   * Cursor paging options.\n   *\n   * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n   */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object.\n   *\n   * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object.\n   *\n   * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n   * @maxSize 5\n   */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n  /**\n   * Cursor paging options.\n   *\n   * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n   */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 512\n   */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrderWithLiterals;\n  /**\n   * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n   * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n   *\n   * If multiple filters are provided, they are combined with AND operator.\n   *\n   * Example:\n   * Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n   * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n   * { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] }\n   * @internal\n   * @maxSize 10\n   */\n  selectItemsBy?: Record<string, any>[] | null;\n  /**\n   * Origin point for geo-distance sorting on a GEO field\n   * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).\n   */\n  origin?: AddressLocation;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface AddressLocation {\n  /** Address latitude. */\n  latitude?: number | null;\n  /** Address longitude. */\n  longitude?: number | null;\n}\n\nexport interface CursorPaging {\n  /**\n   * Maximum number of items to return in the results.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * Pass the relevant cursor token 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\n/** Response from querying loyalty checkout discounts. */\nexport interface QueryLoyaltyCheckoutDiscountsResponse {\n  /** List of loyalty checkout discounts matching the query. */\n  loyaltyCheckoutDiscounts?: LoyaltyCheckoutDiscount[];\n  /** Paging metadata for the response. */\n  pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n  /** Number of items returned in current page. */\n  count?: number | null;\n  /** Cursor strings that point to the next page, previous page, or both. */\n  cursors?: Cursors;\n  /**\n   * Whether there are more pages to retrieve following the current page.\n   *\n   * + `true`: Another page of results can be retrieved.\n   * + `false`: This is the last page.\n   */\n  hasNext?: boolean | null;\n  /**\n   * Total number of items matching the filter.\n   * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n   * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n   * @internal\n   */\n  total?: number | null;\n}\n\nexport interface Cursors {\n  /**\n   * Cursor string pointing to the next page in the list of results.\n   * @maxLength 16000\n   */\n  next?: string | null;\n  /**\n   * Cursor pointing to the previous page in the list of results.\n   * @maxLength 16000\n   */\n  prev?: 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 Empty {}\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/**\n * Applies a discount to a checkout.\n *\n * You can apply one of the following discounts, which are exchanged for loyalty points: `reward`, `loyaltyCoupon`, or `referralReward`.\n * @param checkoutId - ID of the checkout to apply the discount to.\n * @public\n * @requiredField checkoutId\n * @permissionId LOYALTY.REDEEM_OWN_COUPON\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Response after applying a discount to a checkout.\n * @fqn wix.loyalty.checkoutexchange.v1.LoyaltyCheckoutExchange.ApplyDiscountToCheckout\n */\nexport async function applyDiscountToCheckout(\n  checkoutId: string,\n  options?: ApplyDiscountToCheckoutOptions\n): Promise<\n  NonNullablePaths<\n    ApplyDiscountToCheckoutResponse,\n    | `discount.rewardId`\n    | `discount.loyaltyCouponId`\n    | `discount.referralRewardId`\n    | `discount._id`\n    | `discount.checkoutId`\n    | `discount.status`\n    | `discount.discountType`,\n    3\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    checkoutId: checkoutId,\n    reward: options?.reward,\n    loyaltyCoupon: options?.loyaltyCoupon,\n    referralReward: options?.referralReward,\n  });\n\n  const reqOpts =\n    ambassadorWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutDiscount.applyDiscountToCheckout(\n      payload\n    );\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          checkoutId: '$[0]',\n          reward: '$[1].reward',\n          loyaltyCoupon: '$[1].loyaltyCoupon',\n          referralReward: '$[1].referralReward',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['checkoutId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ApplyDiscountToCheckoutOptions\n  extends ApplyDiscountToCheckoutOptionsDiscountOneOf {\n  /** Unredeemed loyalty reward discount. */\n  reward?: Reward;\n  /** Loyalty coupon discount. */\n  loyaltyCoupon?: LoyaltyCoupon;\n  /** Referral reward discount. */\n  referralReward?: ReferralReward;\n}\n\n/** @oneof */\nexport interface ApplyDiscountToCheckoutOptionsDiscountOneOf {\n  /** Unredeemed loyalty reward discount. */\n  reward?: Reward;\n  /** Loyalty coupon discount. */\n  loyaltyCoupon?: LoyaltyCoupon;\n  /** Referral reward discount. */\n  referralReward?: ReferralReward;\n}\n\n/**\n * Creates a query to retrieve a list of checkout discounts.\n *\n * The `queryLoyaltyCheckoutDiscount()` method builds a query to retrieve a list of checkout discounts and returns a `LoyaltyCheckoutDiscountQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyCheckoutDiscountQueryBuilder` methods onto the query. `LoyaltyCheckoutDiscountQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyCheckoutDiscount()` returns.\n *\n * `queryLoyaltyCheckoutDiscount()` runs with these `LoyaltyCheckoutDiscountQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods that are chained to `queryLoyaltyCheckoutDiscount()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('checkoutId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by checkout ID.\n * @public\n * @permissionId LOYALTY.QUERY_CHECKOUT_DISCOUNTS\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @fqn wix.loyalty.checkoutexchange.v1.LoyaltyCheckoutExchange.QueryLoyaltyCheckoutDiscounts\n */\nexport function queryLoyaltyCheckoutDiscounts(): LoyaltyCheckoutDiscountsQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    LoyaltyCheckoutDiscount,\n    'CURSOR',\n    QueryLoyaltyCheckoutDiscountsRequest,\n    QueryLoyaltyCheckoutDiscountsResponse\n  >({\n    func: async (payload: QueryLoyaltyCheckoutDiscountsRequest) => {\n      const reqOpts =\n        ambassadorWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutDiscount.queryLoyaltyCheckoutDiscounts(\n          payload\n        );\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: (\n      query: QueryLoyaltyCheckoutDiscountsRequest['query']\n    ) => {\n      const args = [query, {}] as [\n        QueryLoyaltyCheckoutDiscountsRequest['query'],\n        {}\n      ];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({\n      data,\n    }: HttpResponse<QueryLoyaltyCheckoutDiscountsResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.loyaltyCheckoutDiscounts,\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 LoyaltyCheckoutDiscountsQueryResult extends QueryCursorResult {\n  items: LoyaltyCheckoutDiscount[];\n  query: LoyaltyCheckoutDiscountsQueryBuilder;\n  next: () => Promise<LoyaltyCheckoutDiscountsQueryResult>;\n  prev: () => Promise<LoyaltyCheckoutDiscountsQueryResult>;\n}\n\nexport interface LoyaltyCheckoutDiscountsQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (\n    propertyName: 'checkoutId' | 'status',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ne: (\n    propertyName: 'checkoutId' | 'status',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ge: (\n    propertyName: 'checkoutId',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  gt: (\n    propertyName: 'checkoutId',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  le: (\n    propertyName: 'checkoutId',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  lt: (\n    propertyName: 'checkoutId',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `string`.\n   * @param string - String to compare against. Case-insensitive.\n   */\n  startsWith: (\n    propertyName: 'checkoutId',\n    value: string\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  in: (\n    propertyName: 'checkoutId' | 'status',\n    value: any\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  exists: (\n    propertyName: 'checkoutId' | 'status',\n    value: boolean\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (\n    ...propertyNames: Array<'checkoutId' | 'status'>\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (\n    ...propertyNames: Array<'checkoutId' | 'status'>\n  ) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => LoyaltyCheckoutDiscountsQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => LoyaltyCheckoutDiscountsQueryBuilder;\n  find: () => Promise<LoyaltyCheckoutDiscountsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.loyalty.checkoutexchange.v1.LoyaltyCheckoutExchange.QueryLoyaltyCheckoutDiscounts\n * @requiredField query\n * @returns Response from querying loyalty checkout discounts.\n */\nexport async function typedQueryLoyaltyCheckoutDiscounts(\n  query: LoyaltyCheckoutDiscountQuery\n): Promise<\n  NonNullablePaths<\n    QueryLoyaltyCheckoutDiscountsResponse,\n    | `loyaltyCheckoutDiscounts`\n    | `loyaltyCheckoutDiscounts.${number}.rewardId`\n    | `loyaltyCheckoutDiscounts.${number}.loyaltyCouponId`\n    | `loyaltyCheckoutDiscounts.${number}.referralRewardId`\n    | `loyaltyCheckoutDiscounts.${number}._id`\n    | `loyaltyCheckoutDiscounts.${number}.checkoutId`\n    | `loyaltyCheckoutDiscounts.${number}.status`\n    | `loyaltyCheckoutDiscounts.${number}.discountType`,\n    4\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 =\n    ambassadorWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutDiscount.queryLoyaltyCheckoutDiscounts(\n      payload\n    );\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 LoyaltyCheckoutDiscountQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: ['checkoutId', 'status'];\n      operators: '*';\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n  LoyaltyCheckoutDiscount,\n  LoyaltyCheckoutDiscountQuerySpec\n>;\nexport type LoyaltyCheckoutDiscountQuery = {\n  /** \n  Cursor paging options.\n\n  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).  \n  */\n  cursorPaging?: {\n    /** \n  Maximum number of items to return in the results. \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  Pass the relevant cursor token 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.\n\n  Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object.\n\n  Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting). \n  @maxSize: 5 \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 512 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order.  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n    /** \n  When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n  a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n\n  If multiple filters are provided, they are combined with AND operator.\n\n  Example:\n  Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n  and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n  { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] } \n  @internal: undefined,\n  @maxSize: 10 \n  */\n    selectItemsBy?:\n      | NonNullable<\n          CommonQueryWithEntityContext['sort']\n        >[number]['selectItemsBy']\n      | null;\n    /** \n  Origin point for geo-distance sorting on a GEO field\n  results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  \n  */\n    origin?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['origin'];\n  }[];\n};\n\nexport const utils = {\n  query: /*#__PURE__*/ createQueryUtils<\n    LoyaltyCheckoutDiscount,\n    LoyaltyCheckoutDiscountQuerySpec,\n    LoyaltyCheckoutDiscountQuery\n  >(),\n};\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\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 resolveWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutExchangeUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/loyalty-checkout-exchange',\n        destPath: '',\n      },\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    'bo._base_domain_': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/loyalty-checkout-exchange',\n        destPath: '/api',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/loyalty-checkout-exchange',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_checkout-exchange';\n\n/**\n * Applies a discount to a checkout.\n *\n * You can apply one of the following discounts, which are exchanged for loyalty points: `reward`, `loyaltyCoupon`, or `referralReward`.\n */\nexport function applyDiscountToCheckout(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __applyDiscountToCheckout({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.loyalty.checkoutexchange.v1.loyalty_checkout_discount',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.loyalty.checkoutexchange.v1.LoyaltyCheckoutExchange.ApplyDiscountToCheckout',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutExchangeUrl({\n        protoPath: '/v1/loyalty-checkout-discount',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __applyDiscountToCheckout;\n}\n\n/**\n * Creates a query to retrieve a list of checkout discounts.\n *\n * The `queryLoyaltyCheckoutDiscount()` method builds a query to retrieve a list of checkout discounts and returns a `LoyaltyCheckoutDiscountQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyCheckoutDiscountQueryBuilder` methods onto the query. `LoyaltyCheckoutDiscountQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyCheckoutDiscount()` returns.\n *\n * `queryLoyaltyCheckoutDiscount()` runs with these `LoyaltyCheckoutDiscountQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods that are chained to `queryLoyaltyCheckoutDiscount()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('checkoutId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by checkout ID.\n */\nexport function queryLoyaltyCheckoutDiscounts(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __queryLoyaltyCheckoutDiscounts({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKFloatToRESTFloat,\n        paths: [\n          { path: 'query.sort.origin.latitude' },\n          { path: 'query.sort.origin.longitude' },\n        ],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.loyalty.checkoutexchange.v1.loyalty_checkout_discount',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.loyalty.checkoutexchange.v1.LoyaltyCheckoutExchange.QueryLoyaltyCheckoutDiscounts',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixLoyaltyCheckoutexchangeV1LoyaltyCheckoutExchangeUrl({\n        protoPath: '/v1/loyalty-checkout-discounts/query',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n    };\n\n    return metadata;\n  }\n\n  return __queryLoyaltyCheckoutDiscounts;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  ApplyDiscountToCheckoutOptions,\n  ApplyDiscountToCheckoutResponse,\n  LoyaltyCheckoutDiscountQuery,\n  LoyaltyCheckoutDiscountsQueryBuilder,\n  QueryLoyaltyCheckoutDiscountsResponse,\n  applyDiscountToCheckout as universalApplyDiscountToCheckout,\n  queryLoyaltyCheckoutDiscounts as universalQueryLoyaltyCheckoutDiscounts,\n  typedQueryLoyaltyCheckoutDiscounts as universalTypedQueryLoyaltyCheckoutDiscounts,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function applyDiscountToCheckout(\n  httpClient: HttpClient\n): ApplyDiscountToCheckoutSignature {\n  return (checkoutId: string, options?: ApplyDiscountToCheckoutOptions) =>\n    universalApplyDiscountToCheckout(\n      checkoutId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ApplyDiscountToCheckoutSignature {\n  /**\n   * Applies a discount to a checkout.\n   *\n   * You can apply one of the following discounts, which are exchanged for loyalty points: `reward`, `loyaltyCoupon`, or `referralReward`.\n   * @param - ID of the checkout to apply the discount to.\n   * @returns Response after applying a discount to a checkout.\n   */\n  (checkoutId: string, options?: ApplyDiscountToCheckoutOptions): Promise<\n    NonNullablePaths<\n      ApplyDiscountToCheckoutResponse,\n      | `discount.rewardId`\n      | `discount.loyaltyCouponId`\n      | `discount.referralRewardId`\n      | `discount._id`\n      | `discount.checkoutId`\n      | `discount.status`\n      | `discount.discountType`,\n      3\n    >\n  >;\n}\n\nexport function queryLoyaltyCheckoutDiscounts(\n  httpClient: HttpClient\n): QueryLoyaltyCheckoutDiscountsSignature {\n  return () =>\n    universalQueryLoyaltyCheckoutDiscounts(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryLoyaltyCheckoutDiscountsSignature {\n  /**\n   * Creates a query to retrieve a list of checkout discounts.\n   *\n   * The `queryLoyaltyCheckoutDiscount()` method builds a query to retrieve a list of checkout discounts and returns a `LoyaltyCheckoutDiscountQueryBuilder` object.\n   *\n   * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n   *\n   * You can refine the query by chaining `LoyaltyCheckoutDiscountQueryBuilder` methods onto the query. `LoyaltyCheckoutDiscountQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyCheckoutDiscount()` returns.\n   *\n   * `queryLoyaltyCheckoutDiscount()` runs with these `LoyaltyCheckoutDiscountQueryBuilder` defaults, which you can override:\n   *\n   * - `limit(50)`\n   * - `descending(\"_createdDate\")`\n   *\n   * The methods that are chained to `queryLoyaltyCheckoutDiscount()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('checkoutId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by checkout ID.\n   */\n  (): LoyaltyCheckoutDiscountsQueryBuilder;\n}\n\nexport function typedQueryLoyaltyCheckoutDiscounts(\n  httpClient: HttpClient\n): TypedQueryLoyaltyCheckoutDiscountsSignature {\n  return (query: LoyaltyCheckoutDiscountQuery) =>\n    universalTypedQueryLoyaltyCheckoutDiscounts(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQueryLoyaltyCheckoutDiscountsSignature {\n  /** @returns Response from querying loyalty checkout discounts. */\n  (query: LoyaltyCheckoutDiscountQuery): Promise<\n    NonNullablePaths<\n      QueryLoyaltyCheckoutDiscountsResponse,\n      | `loyaltyCheckoutDiscounts`\n      | `loyaltyCheckoutDiscounts.${number}.rewardId`\n      | `loyaltyCheckoutDiscounts.${number}.loyaltyCouponId`\n      | `loyaltyCheckoutDiscounts.${number}.referralRewardId`\n      | `loyaltyCheckoutDiscounts.${number}._id`\n      | `loyaltyCheckoutDiscounts.${number}.checkoutId`\n      | `loyaltyCheckoutDiscounts.${number}.status`\n      | `loyaltyCheckoutDiscounts.${number}.discountType`,\n      4\n    >\n  >;\n}\n\nexport {\n  AccountInfo,\n  ActionEvent,\n  AddressLocation,\n  ApplyDiscountToCheckoutOptions,\n  ApplyDiscountToCheckoutOptionsDiscountOneOf,\n  ApplyDiscountToCheckoutRequest,\n  ApplyDiscountToCheckoutRequestDiscountOneOf,\n  ApplyDiscountToCheckoutResponse,\n  CursorPaging,\n  CursorPagingMetadata,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Cursors,\n  DiscountRefundedDueToManualDiscountRemoval,\n  DiscountRefundedDueToTimeout,\n  DiscountScheduledForRefund,\n  DiscountStatus,\n  DiscountType,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  LoyaltyCheckoutDiscount,\n  LoyaltyCheckoutDiscountDiscountOneOf,\n  LoyaltyCheckoutDiscountQuerySpec,\n  LoyaltyCheckoutDiscountsQueryBuilder,\n  LoyaltyCheckoutDiscountsQueryResult,\n  LoyaltyCoupon,\n  MessageEnvelope,\n  QueryLoyaltyCheckoutDiscountsRequest,\n  QueryLoyaltyCheckoutDiscountsResponse,\n  ReferralReward,\n  RestoreInfo,\n  Reward,\n  SortOrder,\n  Sorting,\n  WebhookIdentityType,\n  utils,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\n","import {\n  applyDiscountToCheckout as publicApplyDiscountToCheckout,\n  queryLoyaltyCheckoutDiscounts as publicQueryLoyaltyCheckoutDiscounts,\n  typedQueryLoyaltyCheckoutDiscounts as publicTypedQueryLoyaltyCheckoutDiscounts,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.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  LoyaltyCheckoutDiscountQuery,\n  LoyaltyCheckoutDiscountsQueryBuilder,\n  typedQueryLoyaltyCheckoutDiscounts as universalTypedQueryLoyaltyCheckoutDiscounts,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\n\nfunction customQueryLoyaltyCheckoutDiscounts(httpClient: HttpClient) {\n  const router = /*#__PURE__*/ createQueryOverloadRouter({\n    builderQueryFunction: () =>\n      publicQueryLoyaltyCheckoutDiscounts(httpClient)(),\n    typedQueryFunction: (query: LoyaltyCheckoutDiscountQuery) =>\n      publicTypedQueryLoyaltyCheckoutDiscounts(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): LoyaltyCheckoutDiscountsQueryBuilder;\n  function overloadedQuery(\n    query: LoyaltyCheckoutDiscountQuery\n  ): ReturnType<typeof universalTypedQueryLoyaltyCheckoutDiscounts>;\n  function overloadedQuery(query?: LoyaltyCheckoutDiscountQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const applyDiscountToCheckout: MaybeContext<\n  BuildRESTFunction<typeof publicApplyDiscountToCheckout> &\n    typeof publicApplyDiscountToCheckout\n> = /*#__PURE__*/ createRESTModule(publicApplyDiscountToCheckout);\nexport const queryLoyaltyCheckoutDiscounts: MaybeContext<\n  BuildRESTFunction<typeof customQueryLoyaltyCheckoutDiscounts> &\n    typeof customQueryLoyaltyCheckoutDiscounts\n> = /*#__PURE__*/ createRESTModule(customQueryLoyaltyCheckoutDiscounts);\n\nexport {\n  DiscountStatus,\n  DiscountType,\n  SortOrder,\n  WebhookIdentityType,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\nexport {\n  LoyaltyCheckoutDiscount,\n  LoyaltyCheckoutDiscountDiscountOneOf,\n  DiscountRefundedDueToManualDiscountRemoval,\n  DiscountRefundedDueToTimeout,\n  DiscountScheduledForRefund,\n  ApplyDiscountToCheckoutRequest,\n  ApplyDiscountToCheckoutRequestDiscountOneOf,\n  Reward,\n  LoyaltyCoupon,\n  ReferralReward,\n  ApplyDiscountToCheckoutResponse,\n  QueryLoyaltyCheckoutDiscountsRequest,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Sorting,\n  AddressLocation,\n  CursorPaging,\n  QueryLoyaltyCheckoutDiscountsResponse,\n  CursorPagingMetadata,\n  Cursors,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  Empty,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  ApplyDiscountToCheckoutOptions,\n  ApplyDiscountToCheckoutOptionsDiscountOneOf,\n  LoyaltyCheckoutDiscountsQueryResult,\n  LoyaltyCheckoutDiscountsQueryBuilder,\n  LoyaltyCheckoutDiscountQuerySpec,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\nexport { utils } from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\nexport {\n  DiscountStatusWithLiterals,\n  DiscountTypeWithLiterals,\n  SortOrderWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  CommonQueryWithEntityContext,\n  LoyaltyCheckoutDiscountQuery,\n} from './loyalty-checkoutexchange-v1-loyalty-checkout-discount-checkout-exchange.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,8DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;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nBC,oCAAyC,UAAU,EAAE,KAAK;AAAA,IAC5D,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA2C;AAClE,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,2BAGK,iCAAiBA,wBAA6B;AACzD,IAAMF,iCAGK,iCAAiB,mCAAmC;","names":["transformPaths","DiscountStatus","DiscountType","SortOrder","WebhookIdentityType","applyDiscountToCheckout","queryLoyaltyCheckoutDiscounts","applyDiscountToCheckout","queryLoyaltyCheckoutDiscounts","typedQueryLoyaltyCheckoutDiscounts","queryLoyaltyCheckoutDiscounts","typedQueryLoyaltyCheckoutDiscounts","applyDiscountToCheckout"]}