{"version":3,"sources":["../../src/ecom-discounts-v1-discount-rule-discount-rules.public.ts","../../src/ecom-discounts-v1-discount-rule-discount-rules.universal.ts","../../src/ecom-discounts-v1-discount-rule-discount-rules.http.ts","../../src/ecom-discounts-v1-discount-rule-discount-rules.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient } from '@wix/sdk-types';\nimport {\n  DiscountRule,\n  DiscountRuleCreatedEnvelope,\n  DiscountRuleDeletedEnvelope,\n  DiscountRuleNonNullableFields,\n  DiscountRuleUpdatedEnvelope,\n  DiscountRulesQueryBuilder,\n  UpdateDiscountRule,\n  createDiscountRule as universalCreateDiscountRule,\n  deleteDiscountRule as universalDeleteDiscountRule,\n  getDiscountRule as universalGetDiscountRule,\n  queryDiscountRules as universalQueryDiscountRules,\n  updateDiscountRule as universalUpdateDiscountRule,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function createDiscountRule(\n  httpClient: HttpClient\n): CreateDiscountRuleSignature {\n  return (discountRule: DiscountRule) =>\n    universalCreateDiscountRule(\n      discountRule,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateDiscountRuleSignature {\n  /**\n   * Creates a new discount rule.\n   *\n   *\n   * The `createDiscountRule()` function returns a Promise that resolves to the new discount rule when it's created.\n   * @param - Discount rule info.\n   * @returns Discount rule.\n   */\n  (discountRule: DiscountRule): Promise<\n    DiscountRule & DiscountRuleNonNullableFields\n  >;\n}\n\nexport function getDiscountRule(\n  httpClient: HttpClient\n): GetDiscountRuleSignature {\n  return (discountRuleId: string) =>\n    universalGetDiscountRule(\n      discountRuleId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetDiscountRuleSignature {\n  /**\n   * Retrieves a discount rule.\n   *\n   *\n   * The `getDiscountRule()` function returns a Promise that resolves when the specified discount rule is retrieved.\n   * @param - ID of the discount rule to retrieve.\n   * @returns The requested discount rule.\n   */\n  (discountRuleId: string): Promise<\n    DiscountRule & DiscountRuleNonNullableFields\n  >;\n}\n\nexport function updateDiscountRule(\n  httpClient: HttpClient\n): UpdateDiscountRuleSignature {\n  return (_id: string | null, discountRule: UpdateDiscountRule) =>\n    universalUpdateDiscountRule(\n      _id,\n      discountRule,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdateDiscountRuleSignature {\n  /**\n   * Updates a discount rule's properties.\n   *\n   *\n   * The `updateDiscountRule()` function returns a Promise that resolves when the specified discount rule's properties are updated.\n   *\n   * Each time the discount rule is updated, `revision` increments by 1. The existing `revision` must be included when updating the discount rule. This ensures you're working with the latest discount rule information, and it prevents unintended overwrites.\n   * @param - Discount rule ID.\n   * @param - Discount rule info.\n   * @param - Discount rule info.\n   * @returns Updated discount rule.\n   */\n  (_id: string | null, discountRule: UpdateDiscountRule): Promise<\n    DiscountRule & DiscountRuleNonNullableFields\n  >;\n}\n\nexport function deleteDiscountRule(\n  httpClient: HttpClient\n): DeleteDiscountRuleSignature {\n  return (discountRuleId: string) =>\n    universalDeleteDiscountRule(\n      discountRuleId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface DeleteDiscountRuleSignature {\n  /**\n   * Deletes a discount rule.\n   *\n   *\n   * The `deleteDiscountRule()` function returns a Promise that resolves when the specified discount rule is deleted.\n   * @param - ID of the discount rule to delete.\n   */\n  (discountRuleId: string): Promise<void>;\n}\n\nexport function queryDiscountRules(\n  httpClient: HttpClient\n): QueryDiscountRulesSignature {\n  return () =>\n    universalQueryDiscountRules(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryDiscountRulesSignature {\n  /**\n   * Creates a query to retrieve a list of discount rules.\n   *\n   *\n   * The `queryDiscountRules()` function builds a query to retrieve a list of up to 100 discount rules, and returns a [`DiscountRulesQueryBuilder`](#discountrulesquerybuilder) object.\n   *\n   * The returned object contains the query definition which is typically used to run the query using the [`find()`](/discount-rules/discount-rules-query-builder/find) function.\n   *\n   * You can refine the query by chaining `DiscountRulesQueryBuilder` functions onto the query. `DiscountRulesQueryBuilder` functions enable you to sort, filter, and control the results queryDiscountRules() returns.\n   *\n   * By default, `queryDiscountRules()` sorts results by [`ascending(\"_id\")`](/discount-rules/discount-rules-query-builder/ascending) by default. This can be overridden.\n   *\n   * To learn how to query posts, refer to the table below.\n   *\n   * The following `DiscountRulesQueryBuilder` functions are supported for the `queryDiscountRules()` function. For a full description of the discount rule object, see the object returned for the [`items`](/discount-rules/discount-rules-query-result/items) property in the `DiscountRulesQueryResult`.\n   */\n  (): DiscountRulesQueryBuilder;\n}\n\nexport const onDiscountRuleCreated = EventDefinition(\n  'wix.ecom.discounts.v1.discount_rule_created',\n  true,\n  (event: DiscountRuleCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'entity.activeTimeInfo.start' },\n            { path: 'entity.activeTimeInfo.end' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n        {\n          transformFn: transformRESTFloatToSDKFloat,\n          paths: [{ path: 'entity.discounts.values.percentage' }],\n        },\n      ])\n    )\n)<DiscountRuleCreatedEnvelope>();\nexport const onDiscountRuleDeleted = EventDefinition(\n  'wix.ecom.discounts.v1.discount_rule_deleted',\n  true,\n  (event: DiscountRuleDeletedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'undefined.createdDate' },\n            { path: 'undefined.updatedDate' },\n            { path: 'undefined.activeTimeInfo.start' },\n            { path: 'undefined.activeTimeInfo.end' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n        {\n          transformFn: transformRESTFloatToSDKFloat,\n          paths: [{ path: 'undefined.discounts.values.percentage' }],\n        },\n      ])\n    )\n)<DiscountRuleDeletedEnvelope>();\nexport const onDiscountRuleUpdated = EventDefinition(\n  'wix.ecom.discounts.v1.discount_rule_updated',\n  true,\n  (event: DiscountRuleUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'entity.activeTimeInfo.start' },\n            { path: 'entity.activeTimeInfo.end' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n        {\n          transformFn: transformRESTFloatToSDKFloat,\n          paths: [{ path: 'entity.discounts.values.percentage' }],\n        },\n      ])\n    )\n)<DiscountRuleUpdatedEnvelope>();\n\nexport {\n  ActionEvent,\n  ActiveTimeInfo,\n  And,\n  AppliedDiscount,\n  AppliedDiscountRule,\n  AppliedSubjectType,\n  BaseEventMetadata,\n  BuyXGetYInfo,\n  CatalogItemFilter,\n  CatalogReference,\n  CreateDiscountRuleRequest,\n  CreateDiscountRuleResponse,\n  CreateDiscountRuleResponseNonNullableFields,\n  CursorPaging,\n  Cursors,\n  Custom,\n  CustomFilter,\n  CustomerBuy,\n  CustomerBuyConditionOneOf,\n  CustomerGet,\n  DeleteDiscountRuleRequest,\n  DeleteDiscountRuleResponse,\n  Discount,\n  DiscountDiscountOneOf,\n  DiscountRule,\n  DiscountRuleCreatedEnvelope,\n  DiscountRuleDeletedEnvelope,\n  DiscountRuleName,\n  DiscountRuleNonNullableFields,\n  DiscountRuleUpdatedEnvelope,\n  DiscountRuleUsageLimitReached,\n  DiscountRulesQueryBuilder,\n  DiscountRulesQueryResult,\n  DiscountSettings,\n  DiscountTrigger,\n  DiscountTriggerTriggerOneOf,\n  DiscountType,\n  Discounts,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  ExtendedFields,\n  GetAppliedDiscountsRequest,\n  GetAppliedDiscountsResponse,\n  GetDiscountRuleRequest,\n  GetDiscountRuleResponse,\n  GetDiscountRuleResponseNonNullableFields,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ItemQuantityRange,\n  LineItem,\n  MessageEnvelope,\n  MultiCurrencyPrice,\n  Or,\n  PlatformPaging,\n  PlatformPagingMetadata,\n  PlatformQuery,\n  PlatformQueryPagingMethodOneOf,\n  QueryDiscountRulesRequest,\n  QueryDiscountRulesResponse,\n  QueryDiscountRulesResponseNonNullableFields,\n  RestoreInfo,\n  Scope,\n  ScopeScopeItemsOneOf,\n  ScopeType,\n  SortOrder,\n  Sorting,\n  SpecificItemsInfo,\n  Status,\n  SubtotalRange,\n  TriggerType,\n  Type,\n  UpdateDiscountRule,\n  UpdateDiscountRuleRequest,\n  UpdateDiscountRuleResponse,\n  UpdateDiscountRuleResponseNonNullableFields,\n  WebhookIdentityType,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.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 { HttpClient, HttpResponse } from '@wix/sdk-types';\nimport * as ambassadorWixEcomDiscountsV1DiscountRule from './ecom-discounts-v1-discount-rule-discount-rules.http.js';\n// @ts-ignore\n\nexport interface DiscountRule {\n  /**\n   * Discount rule ID.\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the discount rule is updated.\n   * To prevent conflicting changes, the current `revision` must be passed when updating the discount rule.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date and time the discount rule was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the discount rule was last updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Whether the discount rule is active.\n   *\n   * Default: `true`\n   */\n  active?: boolean | null;\n  /** Discount rule name. */\n  name?: string | null;\n  /**\n   * Discount rule trigger.\n   * A set of conditions that must be met for the `discounts` to be applied.\n   * Not passing a trigger will cause the discount to always apply.\n   */\n  trigger?: DiscountTrigger;\n  /** Time frame in which the discount rule is active. */\n  activeTimeInfo?: ActiveTimeInfo;\n  /**\n   * List of discounts that are applied when one or more triggers are met.\n   *\n   * > **Notes:**\n   * >\n   * > + Currently, only 1 discount can be defined per discount rule.\n   * > + A discount rule can be applied on multiple items per cart.\n   * > + A discount rule can only be applied once per item.\n   */\n  discounts?: Discounts;\n  /**\n   * Discount rule status.\n   * Default: `UNDEFINED`\n   * @readonly\n   */\n  status?: Status;\n  /**\n   * Number of times the discount rule was used.\n   * @readonly\n   */\n  usageCount?: number;\n}\n\n/** DiscountTrigger - description of a set of conditions, that if met, will trigger the associated rule actions */\nexport interface DiscountTrigger extends DiscountTriggerTriggerOneOf {\n  /** Chain multiple triggers with the `and` operator. */\n  and?: And;\n  /** Chain multiple triggers with the `or` operator. */\n  or?: Or;\n  /** Custom trigger. */\n  customTrigger?: Custom;\n  /** Subtotal trigger range. */\n  subtotalRange?: SubtotalRange;\n  /** Item quantity trigger range. */\n  itemQuantityRange?: ItemQuantityRange;\n  /**\n   * Trigger type.\n   *\n   * + `\"AND\"`: Operator used for chaining multiple triggers. Currently 1 `\"AND\"` chain operator is supported.\n   * + `\"SUBTOTAL_RANGE\"`: Subtotal must be within the specified `subtotalRange` values.\n   * + `\"ITEM_QUANTITY_RANGE\"`: Quantity of items in scope must be within specified `itemQuantityRange` values.\n   * + `\"CUSTOM\"`: Custom trigger type defined in `customTrigger` object.\n   */\n  triggerType?: TriggerType;\n}\n\n/** @oneof */\nexport interface DiscountTriggerTriggerOneOf {\n  /** Chain multiple triggers with the `and` operator. */\n  and?: And;\n  /** Chain multiple triggers with the `or` operator. */\n  or?: Or;\n  /** Custom trigger. */\n  customTrigger?: Custom;\n  /** Subtotal trigger range. */\n  subtotalRange?: SubtotalRange;\n  /** Item quantity trigger range. */\n  itemQuantityRange?: ItemQuantityRange;\n}\n\n/**\n * This object represents a scope of catalog items. Examples:\n * 1. All catalog items of a specific app - type = CATALOG_ITEM, CatalogItemFilter with `catalog_app_id`\n * 2. Specific catalog item - type = CATALOG_ITEM, CatalogItemFilter with `catalog_app_id` + `catalog_item_ids`\n * 3. External catalog filter - type = CUSTOM_FILTER, CustomFilter with 'app_id' + 'params'\n */\nexport interface Scope extends ScopeScopeItemsOneOf {\n  /** Catalog item filter. Must be passed with `type.\"CATALOG_ITEM\"`. */\n  catalogItemFilter?: CatalogItemFilter;\n  /** Custom filter. Must be passed with `type.\"CATALOG_ITEM\"`. */\n  customFilter?: CustomFilter;\n  /** Scope ID. */\n  _id?: string;\n  /** Scope type. */\n  type?: ScopeType;\n}\n\n/** @oneof */\nexport interface ScopeScopeItemsOneOf {\n  /** Catalog item filter. Must be passed with `type.\"CATALOG_ITEM\"`. */\n  catalogItemFilter?: CatalogItemFilter;\n  /** Custom filter. Must be passed with `type.\"CATALOG_ITEM\"`. */\n  customFilter?: CustomFilter;\n}\n\nexport enum ScopeType {\n  UNDEFINED_SCOPE = 'UNDEFINED_SCOPE',\n  /** Specific catalog items */\n  CATALOG_ITEM = 'CATALOG_ITEM',\n  /** Specific items by custom filters */\n  CUSTOM_FILTER = 'CUSTOM_FILTER',\n}\n\nexport interface CatalogItemFilter {\n  /** Catalog App ID. For example, the Wix Stores, Wix Bookings, or 3rd-party `appId`. */\n  catalogAppId?: string;\n  /** ID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores. */\n  catalogItemIds?: string[];\n}\n\nexport interface CustomFilter {\n  /** Custom filter app ID, when relevant. */\n  appId?: string;\n  /**\n   * Custom filter in `{ \"key\": \"value\" }` form.\n   * For example, an array of `collectionIDs`:\n   * `{ [\"collectionId\": \"12345\"], [\"collectionId\": \"67890\"] }`.\n   */\n  params?: Record<string, any> | null;\n}\n\nexport interface And {\n  /** List of triggers to have an \"AND\" operator between their results. */\n  triggers?: DiscountTrigger[];\n}\n\nexport interface Or {\n  /** List of triggers to have an \"OR\" operator between their results. */\n  triggers?: DiscountTrigger[];\n}\n\nexport interface Custom {\n  /** Trigger ID. */\n  _id?: string;\n  /** ID of the app that created the trigger. */\n  appId?: string;\n}\n\nexport interface SubtotalRange {\n  /** Relevant scopes for `\"SPECIFIC_ITEMS\"` target type. */\n  scopes?: Scope[];\n  /** Minimum subtotal price (inclusive). */\n  from?: string | null;\n  /** Maximum subtotal price (inclusive). */\n  to?: string | null;\n}\n\nexport interface ItemQuantityRange {\n  /** Relevant scopes for `\"SPECIFIC_ITEMS\"` target type. */\n  scopes?: Scope[];\n  /** Minimum item quantity (inclusive). */\n  from?: number | null;\n  /** Maximum item quantity (inclusive). */\n  to?: number | null;\n}\n\nexport enum TriggerType {\n  UNDEFINED = 'UNDEFINED',\n  /** Operator used for chaining multiple triggers. Currently 1 `AND` chain operator is supported. */\n  AND = 'AND',\n  /** Subtotal must be within the specified `subtotalRange` values. */\n  SUBTOTAL_RANGE = 'SUBTOTAL_RANGE',\n  /** Quantity of items in scope must be within specified `itemQuantityRange` values. */\n  ITEM_QUANTITY_RANGE = 'ITEM_QUANTITY_RANGE',\n  /** Custom trigger type defined in `customTrigger` object. */\n  CUSTOM = 'CUSTOM',\n  /** Chain multiple triggers with OR operator */\n  OR = 'OR',\n}\n\nexport interface ActiveTimeInfo {\n  /** Date and time the discount rule is active **from**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. */\n  start?: Date | null;\n  /** Date and time the discount rule is active **till**, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. */\n  end?: Date | null;\n}\n\nexport interface Discounts {\n  /** Discounts. */\n  values?: Discount[];\n}\n\nexport interface Discount extends DiscountDiscountOneOf {\n  /** Percentage to discount from original price. */\n  percentage?: number;\n  /** Amount to discount from original price. */\n  fixedAmount?: string;\n  /** Fixed price. Line item will be fixed to this price. */\n  fixedPrice?: string;\n  /**\n   * Discount target.\n   *\n   * + `\"SPECIFIC_ITEMS\"`: Discount applies to a specific set of items.\n   */\n  targetType?: Type;\n  /** Data related to `\"SPECIFIC_ITEMS\"` target type. */\n  specificItemsInfo?: SpecificItemsInfo;\n  /**\n   * Discount type.\n   *\n   * + `\"PERCENTAGE\"`: Price is reduced by percentage value.\n   * + `\"FIXED_AMOUNT\"`: Price is reduced by fixed amount.\n   * + `\"FIXED_PRICE\"`: Price will be set to fixed amount.\n   */\n  discountType?: DiscountType;\n}\n\n/** @oneof */\nexport interface DiscountDiscountOneOf {\n  /** Percentage to discount from original price. */\n  percentage?: number;\n  /** Amount to discount from original price. */\n  fixedAmount?: string;\n  /** Fixed price. Line item will be fixed to this price. */\n  fixedPrice?: string;\n}\n\nexport enum Type {\n  /** Target type is not defined */\n  UNDEFINED = 'UNDEFINED',\n  /** Target type is a set of specific items */\n  SPECIFIC_ITEMS = 'SPECIFIC_ITEMS',\n}\n\nexport interface SpecificItemsInfo {\n  /** All associated scopes for `\"SPECIFIC_ITEMS\"` target type. */\n  scopes?: Scope[];\n}\n\nexport enum DiscountType {\n  UNDEFINED = 'UNDEFINED',\n  /** Price is reduced by percentage value. */\n  PERCENTAGE = 'PERCENTAGE',\n  /** Price is reduced by fixed amount. */\n  FIXED_AMOUNT = 'FIXED_AMOUNT',\n  /** Price will be set to fixed amount. */\n  FIXED_PRICE = 'FIXED_PRICE',\n}\n\nexport interface BuyXGetYInfo {\n  /** Information about which items must be in the cart (buy X) for the discount to apply (get Y). */\n  customerBuys?: CustomerBuy;\n  /** Information about which items will be discounted (get Y). */\n  customerGets?: CustomerGet;\n  /**\n   * The maximum number of times the 'buy X get Y' discount can be applied.\n   * For example, when the value of `limit` is `2`, with a \"2+1\" sale on all items, the following logic applies:\n   * + Buy 2 get 1, buy 3 get 1.\n   * + Buy 4 get 2, buy 6 get 2, buy 9 get 2, and so on.\n   */\n  limit?: number | null;\n}\n\nexport interface CustomerBuy extends CustomerBuyConditionOneOf {\n  /** Minimum number of items the customer must add to the cart to be eligible for a discount. */\n  minimumQuantity?: number;\n  /** Minimum price the customer must add to the cart to be eligible for a discount. */\n  minimumSpend?: string | null;\n  /** Scopes of the items that must be added to the cart to enable the discount. */\n  scopes?: Scope[];\n}\n\n/** @oneof */\nexport interface CustomerBuyConditionOneOf {\n  /** Minimum number of items the customer must add to the cart to be eligible for a discount. */\n  minimumQuantity?: number;\n  /** Minimum price the customer must add to the cart to be eligible for a discount. */\n  minimumSpend?: string | null;\n}\n\nexport interface CustomerGet {\n  /**\n   * Exact number of items in the cart that will be discounted.\n   * If the cart contains fewer items than the value of quantity, the discount will not apply.\n   */\n  quantity?: number;\n  /** Scopes of the items that will be discounted. */\n  scopes?: Scope[];\n}\n\nexport enum Status {\n  /** Rule status is not defined. */\n  UNDEFINED = 'UNDEFINED',\n  /** Rule status is live. */\n  LIVE = 'LIVE',\n  /** Rule status is expired, it might have been live in the past. */\n  EXPIRED = 'EXPIRED',\n  /** Rule status is pending, it might be live in the future. */\n  PENDING = 'PENDING',\n}\n\n/** The discount settings */\nexport interface DiscountSettings {\n  /** Discount applies to either `ALL_ITEMS`, or to the `LOWEST_PRICED_ITEM`. */\n  appliesTo?: AppliedSubjectType;\n  /**\n   * Whether the discount will apply to subscriptions.\n   *\n   * Default: `false`\n   */\n  includeSubscription?: boolean | null;\n  /** Maximum total number of uses allowed for the discount rule. */\n  usageLimit?: number | null;\n  /**\n   * The usage limit per user per discount.\n   * When not provided, this setting will not apply.\n   */\n  usageLimitPerUser?: number | null;\n}\n\n/** TODO: check if can be removed */\nexport enum AppliedSubjectType {\n  UNDEFINED = 'UNDEFINED',\n  /** Discount applies to all items at checkout. */\n  ALL_ITEMS = 'ALL_ITEMS',\n  /** Discount applies to the lowest priced item at checkout. */\n  LOWEST_PRICED_ITEM = 'LOWEST_PRICED_ITEM',\n}\n\nexport interface ExtendedFields {\n  /**\n   * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n   * The value of each key is structured according to the schema defined when the extended fields were configured.\n   *\n   * You can only access fields for which you have the appropriate permissions.\n   *\n   * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n   */\n  namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface CreateDiscountRuleRequest {\n  /** Discount rule info. */\n  discountRule: DiscountRule;\n}\n\nexport interface CreateDiscountRuleResponse {\n  /** Discount rule. */\n  discountRule?: DiscountRule;\n}\n\nexport interface GetDiscountRuleRequest {\n  /** ID of the discount rule to retrieve. */\n  discountRuleId: string;\n}\n\nexport interface GetDiscountRuleResponse {\n  /** The requested discount rule. */\n  discountRule?: DiscountRule;\n}\n\nexport interface UpdateDiscountRuleRequest {\n  /** Discount rule info. */\n  discountRule: DiscountRule;\n}\n\nexport interface UpdateDiscountRuleResponse {\n  /** Updated discount rule. */\n  discountRule?: DiscountRule;\n}\n\nexport interface DeleteDiscountRuleRequest {\n  /** ID of the discount rule to delete. */\n  discountRuleId: string;\n}\n\nexport interface DeleteDiscountRuleResponse {}\n\nexport interface QueryDiscountRulesRequest {\n  /** Query options. */\n  query?: PlatformQuery;\n}\n\nexport interface PlatformQuery extends PlatformQueryPagingMethodOneOf {\n  /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n  paging?: PlatformPaging;\n  /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n  /** Filter object. */\n  filter?: Record<string, any> | null;\n  /** Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface PlatformQueryPagingMethodOneOf {\n  /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n  paging?: PlatformPaging;\n  /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /** Name of the field to sort by. */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrder;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\nexport interface PlatformPaging {\n  /** Number of items to load. */\n  limit?: number | null;\n  /** Number of items to skip in the current sort order. */\n  offset?: number | null;\n}\n\nexport interface CursorPaging {\n  /** Maximum number of items to return in the results. */\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   */\n  cursor?: string | null;\n}\n\nexport interface QueryDiscountRulesResponse {\n  /** List of discount rules. */\n  discountRules?: DiscountRule[];\n  /** Details on the paged set of results returned. */\n  pagingMetadata?: PlatformPagingMetadata;\n}\n\nexport interface PlatformPagingMetadata {\n  /** The number of items returned in this response. */\n  count?: number | null;\n  /** The offset which was requested. Returned if offset paging was used. */\n  offset?: number | null;\n  /** The total number of items that match the query. Returned if offset paging was used. */\n  total?: number | null;\n  /** Cursors to navigate through result pages. Returned if cursor paging was used. */\n  cursors?: Cursors;\n}\n\nexport interface Cursors {\n  /** Cursor string pointing to the next page in the list of results. */\n  next?: string | null;\n  /** Cursor pointing to the previous page in the list of results. */\n  prev?: string | null;\n}\n\nexport interface GetAppliedDiscountsRequest {\n  /** Line items for which to check for discount rules. */\n  lineItems?: LineItem[];\n  /** Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order. */\n  purchaseFlowId?: string | null;\n}\n\nexport interface LineItem {\n  /** Line item ID. */\n  _id?: string;\n  /** Line item quantity. */\n  quantity?: number | null;\n  /** Catalog and item reference info. Learn more about [integrating Wix Stores products with Wix eCommerce](https://dev.wix.com/api/rest/wix-stores/catalog/ecommerce-integration). */\n  catalogReference?: CatalogReference;\n  /** Line item price. */\n  price?: string;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n  /** ID of the item within the catalog it belongs to. */\n  catalogItemId?: string;\n  /**\n   * ID of the app providing the catalog.\n   *\n   * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n   *\n   * For items from Wix catalogs, the following values always apply:\n   * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n   * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n   * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n   */\n  appId?: string;\n  /**\n   * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.\n   *\n   * For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).\n   */\n  options?: Record<string, any> | null;\n}\n\nexport interface GetAppliedDiscountsResponse {\n  /** All eligible discounts. */\n  appliedDiscounts?: AppliedDiscount[];\n}\n\nexport interface AppliedDiscount {\n  /** Discount type. */\n  discountType?: Type;\n  /** IDs of line items the discount applies to, in GUID format. */\n  lineItemIds?: string[];\n  /** Applied discount rule. */\n  appliedDiscountRule?: AppliedDiscountRule;\n}\n\nexport interface AppliedDiscountRule {\n  /** Applied discount rule ID. */\n  _id?: string;\n  /** Discount rule name. */\n  name?: DiscountRuleName;\n  /** Total amount reduced from all discounted line items. */\n  amount?: MultiCurrencyPrice;\n  /** Discount rule type. */\n  discountRuleType?: DiscountType;\n}\n\nexport interface DiscountRuleName {\n  /** Original discount rule name (in site's default language). */\n  original?: string;\n  /**\n   * Translated discount rule name according to buyer language.\n   *\n   * Default: `original`\n   */\n  translated?: string | null;\n}\n\nexport interface MultiCurrencyPrice {\n  /** Amount. */\n  amount?: string;\n  /**\n   * Converted amount.\n   * @readonly\n   */\n  convertedAmount?: string;\n  /**\n   * Amount formatted with currency symbol.\n   * @readonly\n   */\n  formattedAmount?: string;\n  /**\n   * Converted amount formatted with currency symbol.\n   * @readonly\n   */\n  formattedConvertedAmount?: string;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /**\n   * Unique event ID.\n   * Allows clients to ignore duplicate webhooks.\n   */\n  _id?: string;\n  /**\n   * Assumes actions are also always typed to an entity_type\n   * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n   */\n  entityFqdn?: string;\n  /**\n   * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n   * This is although the created/updated/deleted notion is duplication of the oneof types\n   * 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 defining the order of updates to the underlying entity.\n   * For example, given that some entity was updated at 16:00 and than again at 16:01,\n   * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n   * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n   * To do so, you will need to persist this number on your end, and compare the sequence number from the\n   * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\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 DiscountRuleUsageLimitReached {\n  /** Discount Rule */\n  rule?: DiscountRule;\n}\n\nexport interface MessageEnvelope {\n  /** App instance ID. */\n  instanceId?: string | null;\n  /** Event type. */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /** ID of a site visitor that has not logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor that has logged in to the site. */\n  memberId?: string;\n  /** ID of a Wix user (site owner, contributor, etc.). */\n  wixUserId?: string;\n  /** ID of an app. */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /** ID of a site visitor that has not logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor that has logged in to the site. */\n  memberId?: string;\n  /** ID of a Wix user (site owner, contributor, etc.). */\n  wixUserId?: string;\n  /** ID of an app. */\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\ninterface AndNonNullableFields {\n  triggers: DiscountTriggerNonNullableFields[];\n}\n\ninterface OrNonNullableFields {\n  triggers: DiscountTriggerNonNullableFields[];\n}\n\ninterface CustomNonNullableFields {\n  _id: string;\n  appId: string;\n}\n\ninterface CatalogItemFilterNonNullableFields {\n  catalogAppId: string;\n  catalogItemIds: string[];\n}\n\ninterface CustomFilterNonNullableFields {\n  appId: string;\n}\n\ninterface ScopeNonNullableFields {\n  catalogItemFilter?: CatalogItemFilterNonNullableFields;\n  customFilter?: CustomFilterNonNullableFields;\n  _id: string;\n  type: ScopeType;\n}\n\ninterface SubtotalRangeNonNullableFields {\n  scopes: ScopeNonNullableFields[];\n}\n\ninterface ItemQuantityRangeNonNullableFields {\n  scopes: ScopeNonNullableFields[];\n}\n\ninterface DiscountTriggerNonNullableFields {\n  and?: AndNonNullableFields;\n  or?: OrNonNullableFields;\n  customTrigger?: CustomNonNullableFields;\n  subtotalRange?: SubtotalRangeNonNullableFields;\n  itemQuantityRange?: ItemQuantityRangeNonNullableFields;\n  triggerType: TriggerType;\n}\n\ninterface SpecificItemsInfoNonNullableFields {\n  scopes: ScopeNonNullableFields[];\n}\n\ninterface CustomerBuyNonNullableFields {\n  minimumQuantity: number;\n  scopes: ScopeNonNullableFields[];\n}\n\ninterface CustomerGetNonNullableFields {\n  quantity: number;\n  scopes: ScopeNonNullableFields[];\n}\n\ninterface BuyXGetYInfoNonNullableFields {\n  customerBuys?: CustomerBuyNonNullableFields;\n  customerGets?: CustomerGetNonNullableFields;\n}\n\ninterface DiscountNonNullableFields {\n  percentage: number;\n  fixedAmount: string;\n  fixedPrice: string;\n  targetType: Type;\n  specificItemsInfo?: SpecificItemsInfoNonNullableFields;\n  discountType: DiscountType;\n  /** @internal */\n  buyXGetYInfo?: BuyXGetYInfoNonNullableFields;\n}\n\ninterface DiscountsNonNullableFields {\n  values: DiscountNonNullableFields[];\n}\n\ninterface DiscountSettingsNonNullableFields {\n  appliesTo: AppliedSubjectType;\n}\n\nexport interface DiscountRuleNonNullableFields {\n  trigger?: DiscountTriggerNonNullableFields;\n  discounts?: DiscountsNonNullableFields;\n  status: Status;\n  usageCount: number;\n  /** @internal */\n  settings?: DiscountSettingsNonNullableFields;\n}\n\nexport interface CreateDiscountRuleResponseNonNullableFields {\n  discountRule?: DiscountRuleNonNullableFields;\n}\n\nexport interface GetDiscountRuleResponseNonNullableFields {\n  discountRule?: DiscountRuleNonNullableFields;\n}\n\nexport interface UpdateDiscountRuleResponseNonNullableFields {\n  discountRule?: DiscountRuleNonNullableFields;\n}\n\nexport interface QueryDiscountRulesResponseNonNullableFields {\n  discountRules: DiscountRuleNonNullableFields[];\n}\n\nexport interface BaseEventMetadata {\n  /** App instance ID. */\n  instanceId?: string | null;\n  /** Event type. */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /**\n   * Unique event ID.\n   * Allows clients to ignore duplicate webhooks.\n   */\n  _id?: string;\n  /**\n   * Assumes actions are also always typed to an entity_type\n   * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n   */\n  entityFqdn?: string;\n  /**\n   * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n   * This is although the created/updated/deleted notion is duplication of the oneof types\n   * 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 defining the order of updates to the underlying entity.\n   * For example, given that some entity was updated at 16:00 and than again at 16:01,\n   * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n   * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n   * To do so, you will need to persist this number on your end, and compare the sequence number from the\n   * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\n   */\n  entityEventSequence?: string | null;\n}\n\nexport interface DiscountRuleCreatedEnvelope {\n  entity: DiscountRule;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a discount rule is created.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionId ECOM.DISCOUNT_RULES_READ\n * @webhook\n * @eventType wix.ecom.discounts.v1.discount_rule_created\n */\nexport declare function onDiscountRuleCreated(\n  handler: (event: DiscountRuleCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface DiscountRuleDeletedEnvelope {\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a discount rule is deleted.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionId ECOM.DISCOUNT_RULES_READ\n * @webhook\n * @eventType wix.ecom.discounts.v1.discount_rule_deleted\n */\nexport declare function onDiscountRuleDeleted(\n  handler: (event: DiscountRuleDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface DiscountRuleUpdatedEnvelope {\n  entity: DiscountRule;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a discount rule is updated.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionId ECOM.DISCOUNT_RULES_READ\n * @webhook\n * @eventType wix.ecom.discounts.v1.discount_rule_updated\n */\nexport declare function onDiscountRuleUpdated(\n  handler: (event: DiscountRuleUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a new discount rule.\n *\n *\n * The `createDiscountRule()` function returns a Promise that resolves to the new discount rule when it's created.\n * @param discountRule - Discount rule info.\n * @public\n * @requiredField discountRule\n * @requiredField discountRule.discounts\n * @requiredField discountRule.name\n * @permissionId ECOM.DISCOUNT_RULES_CREATE\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @applicableIdentity APP\n * @returns Discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.CreateDiscountRule\n */\nexport async function createDiscountRule(\n  discountRule: DiscountRule\n): Promise<DiscountRule & DiscountRuleNonNullableFields> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    discountRule: discountRule,\n  });\n\n  const reqOpts =\n    ambassadorWixEcomDiscountsV1DiscountRule.createDiscountRule(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.discountRule!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { discountRule: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['discountRule']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves a discount rule.\n *\n *\n * The `getDiscountRule()` function returns a Promise that resolves when the specified discount rule is retrieved.\n * @param discountRuleId - ID of the discount rule to retrieve.\n * @public\n * @requiredField discountRuleId\n * @permissionId ECOM.DISCOUNT_RULES_READ\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @applicableIdentity APP\n * @returns The requested discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.GetDiscountRule\n */\nexport async function getDiscountRule(\n  discountRuleId: string\n): Promise<DiscountRule & DiscountRuleNonNullableFields> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    discountRuleId: discountRuleId,\n  });\n\n  const reqOpts =\n    ambassadorWixEcomDiscountsV1DiscountRule.getDiscountRule(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.discountRule!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { discountRuleId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['discountRuleId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Updates a discount rule's properties.\n *\n *\n * The `updateDiscountRule()` function returns a Promise that resolves when the specified discount rule's properties are updated.\n *\n * Each time the discount rule is updated, `revision` increments by 1. The existing `revision` must be included when updating the discount rule. This ensures you're working with the latest discount rule information, and it prevents unintended overwrites.\n * @param _id - Discount rule ID.\n * @public\n * @requiredField _id\n * @requiredField discountRule\n * @requiredField discountRule.revision\n * @param discountRule - Discount rule info.\n * @param options - Discount rule info.\n * @permissionId ECOM.DISCOUNT_RULES_UPDATE\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @applicableIdentity APP\n * @returns Updated discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.UpdateDiscountRule\n */\nexport async function updateDiscountRule(\n  _id: string | null,\n  discountRule: UpdateDiscountRule\n): Promise<DiscountRule & DiscountRuleNonNullableFields> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    discountRule: { ...discountRule, id: _id },\n  });\n\n  const reqOpts =\n    ambassadorWixEcomDiscountsV1DiscountRule.updateDiscountRule(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.discountRule!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: { discountRule: '$[1]' },\n        explicitPathsToArguments: { 'discountRule.id': '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['_id', 'discountRule']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface UpdateDiscountRule {\n  /**\n   * Discount rule ID.\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the discount rule is updated.\n   * To prevent conflicting changes, the current `revision` must be passed when updating the discount rule.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date and time the discount rule was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the discount rule was last updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Whether the discount rule is active.\n   *\n   * Default: `true`\n   */\n  active?: boolean | null;\n  /** Discount rule name. */\n  name?: string | null;\n  /**\n   * Discount rule trigger.\n   * A set of conditions that must be met for the `discounts` to be applied.\n   * Not passing a trigger will cause the discount to always apply.\n   */\n  trigger?: DiscountTrigger;\n  /** Time frame in which the discount rule is active. */\n  activeTimeInfo?: ActiveTimeInfo;\n  /**\n   * List of discounts that are applied when one or more triggers are met.\n   *\n   * > **Notes:**\n   * >\n   * > + Currently, only 1 discount can be defined per discount rule.\n   * > + A discount rule can be applied on multiple items per cart.\n   * > + A discount rule can only be applied once per item.\n   */\n  discounts?: Discounts;\n  /**\n   * Discount rule status.\n   * Default: `UNDEFINED`\n   * @readonly\n   */\n  status?: Status;\n  /**\n   * Number of times the discount rule was used.\n   * @readonly\n   */\n  usageCount?: number;\n}\n\n/**\n * Deletes a discount rule.\n *\n *\n * The `deleteDiscountRule()` function returns a Promise that resolves when the specified discount rule is deleted.\n * @param discountRuleId - ID of the discount rule to delete.\n * @public\n * @requiredField discountRuleId\n * @permissionId ECOM.DISCOUNT_RULES_DELETE\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @applicableIdentity APP\n * @fqn com.wix.ecom.discounts.DiscountRuleService.DeleteDiscountRule\n */\nexport async function deleteDiscountRule(\n  discountRuleId: string\n): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    discountRuleId: discountRuleId,\n  });\n\n  const reqOpts =\n    ambassadorWixEcomDiscountsV1DiscountRule.deleteDiscountRule(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { discountRuleId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['discountRuleId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Creates a query to retrieve a list of discount rules.\n *\n *\n * The `queryDiscountRules()` function builds a query to retrieve a list of up to 100 discount rules, and returns a [`DiscountRulesQueryBuilder`](#discountrulesquerybuilder) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](/discount-rules/discount-rules-query-builder/find) function.\n *\n * You can refine the query by chaining `DiscountRulesQueryBuilder` functions onto the query. `DiscountRulesQueryBuilder` functions enable you to sort, filter, and control the results queryDiscountRules() returns.\n *\n * By default, `queryDiscountRules()` sorts results by [`ascending(\"_id\")`](/discount-rules/discount-rules-query-builder/ascending) by default. This can be overridden.\n *\n * To learn how to query posts, refer to the table below.\n *\n * The following `DiscountRulesQueryBuilder` functions are supported for the `queryDiscountRules()` function. For a full description of the discount rule object, see the object returned for the [`items`](/discount-rules/discount-rules-query-result/items) property in the `DiscountRulesQueryResult`.\n * @public\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionId ECOM.DISCOUNT_RULES_READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.discounts.DiscountRuleService.QueryDiscountRules\n */\nexport function queryDiscountRules(): DiscountRulesQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    DiscountRule,\n    'CURSOR',\n    QueryDiscountRulesRequest,\n    QueryDiscountRulesResponse\n  >({\n    func: async (payload: QueryDiscountRulesRequest) => {\n      const reqOpts =\n        ambassadorWixEcomDiscountsV1DiscountRule.queryDiscountRules(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: QueryDiscountRulesRequest['query']) => {\n      const args = [query, {}] as [QueryDiscountRulesRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({\n      data,\n    }: HttpResponse<QueryDiscountRulesResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(data);\n\n      return {\n        items: transformedData?.discountRules,\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 DiscountRulesQueryResult extends QueryCursorResult {\n  items: DiscountRule[];\n  query: DiscountRulesQueryBuilder;\n  next: () => Promise<DiscountRulesQueryResult>;\n  prev: () => Promise<DiscountRulesQueryResult>;\n}\n\nexport interface DiscountRulesQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ne: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ge: (\n    propertyName:\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  gt: (\n    propertyName:\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  le: (\n    propertyName:\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  lt: (\n    propertyName:\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\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' | 'name',\n    value: string\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `values`.\n   * @param values - List of values to compare against.\n   */\n  hasSome: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any[]\n  ) => DiscountRulesQueryBuilder;\n  in: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: any\n  ) => DiscountRulesQueryBuilder;\n  exists: (\n    propertyName:\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end',\n    value: boolean\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end'\n    >\n  ) => DiscountRulesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'revision'\n      | '_createdDate'\n      | '_updatedDate'\n      | 'active'\n      | 'name'\n      | 'activeTimeInfo.start'\n      | 'activeTimeInfo.end'\n    >\n  ) => DiscountRulesQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => DiscountRulesQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => DiscountRulesQueryBuilder;\n  find: () => Promise<DiscountRulesQueryResult>;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveComWixEcomDiscountsDiscountRuleServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/discount-rules-service',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/ecom/v1/discount-rules',\n        destPath: '/v1/discount-rules',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/ecom/v1/discount-rules',\n        destPath: '/v1/discount-rules',\n      },\n      {\n        srcPath: '/v1/discount-rules',\n        destPath: '/v1/discount-rules',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_discount-rules';\n\n/**\n * Creates a new discount rule.\n *\n *\n * The `createDiscountRule()` function returns a Promise that resolves to the new discount rule when it's created.\n */\nexport function createDiscountRule(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __createDiscountRule({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [\n          { path: 'discountRule.createdDate' },\n          { path: 'discountRule.updatedDate' },\n          { path: 'discountRule.activeTimeInfo.start' },\n          { path: 'discountRule.activeTimeInfo.end' },\n        ],\n      },\n      {\n        transformFn: transformSDKFloatToRESTFloat,\n        paths: [{ path: 'discountRule.discounts.values.percentage' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.ecom.discounts.v1.discount_rule',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wix.ecom.discounts.DiscountRuleService.CreateDiscountRule',\n      packageName: PACKAGE_NAME,\n      url: resolveComWixEcomDiscountsDiscountRuleServiceUrl({\n        protoPath: '/v1/discount-rules',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'discountRule.createdDate' },\n              { path: 'discountRule.updatedDate' },\n              { path: 'discountRule.activeTimeInfo.start' },\n              { path: 'discountRule.activeTimeInfo.end' },\n            ],\n          },\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [{ path: 'discountRule.discounts.values.percentage' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __createDiscountRule;\n}\n\n/**\n * Retrieves a discount rule.\n *\n *\n * The `getDiscountRule()` function returns a Promise that resolves when the specified discount rule is retrieved.\n */\nexport function getDiscountRule(payload: object): RequestOptionsFactory<any> {\n  function __getDiscountRule({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.discounts.v1.discount_rule',\n      method: 'GET' as any,\n      methodFqn: 'com.wix.ecom.discounts.DiscountRuleService.GetDiscountRule',\n      packageName: PACKAGE_NAME,\n      url: resolveComWixEcomDiscountsDiscountRuleServiceUrl({\n        protoPath: '/v1/discount-rules/{discountRuleId}',\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: 'discountRule.createdDate' },\n              { path: 'discountRule.updatedDate' },\n              { path: 'discountRule.activeTimeInfo.start' },\n              { path: 'discountRule.activeTimeInfo.end' },\n            ],\n          },\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [{ path: 'discountRule.discounts.values.percentage' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getDiscountRule;\n}\n\n/**\n * Updates a discount rule's properties.\n *\n *\n * The `updateDiscountRule()` function returns a Promise that resolves when the specified discount rule's properties are updated.\n *\n * Each time the discount rule is updated, `revision` increments by 1. The existing `revision` must be included when updating the discount rule. This ensures you're working with the latest discount rule information, and it prevents unintended overwrites.\n */\nexport function updateDiscountRule(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __updateDiscountRule({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKFieldMaskToRESTFieldMask,\n        paths: [{ path: 'mask' }],\n      },\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [\n          { path: 'discountRule.createdDate' },\n          { path: 'discountRule.updatedDate' },\n          { path: 'discountRule.activeTimeInfo.start' },\n          { path: 'discountRule.activeTimeInfo.end' },\n        ],\n      },\n      {\n        transformFn: transformSDKFloatToRESTFloat,\n        paths: [{ path: 'discountRule.discounts.values.percentage' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.ecom.discounts.v1.discount_rule',\n      method: 'PATCH' as any,\n      methodFqn:\n        'com.wix.ecom.discounts.DiscountRuleService.UpdateDiscountRule',\n      packageName: PACKAGE_NAME,\n      url: resolveComWixEcomDiscountsDiscountRuleServiceUrl({\n        protoPath: '/v1/discount-rules/{discountRule.id}',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'discountRule.createdDate' },\n              { path: 'discountRule.updatedDate' },\n              { path: 'discountRule.activeTimeInfo.start' },\n              { path: 'discountRule.activeTimeInfo.end' },\n            ],\n          },\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [{ path: 'discountRule.discounts.values.percentage' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __updateDiscountRule;\n}\n\n/**\n * Deletes a discount rule.\n *\n *\n * The `deleteDiscountRule()` function returns a Promise that resolves when the specified discount rule is deleted.\n */\nexport function deleteDiscountRule(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __deleteDiscountRule({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.discounts.v1.discount_rule',\n      method: 'DELETE' as any,\n      methodFqn:\n        'com.wix.ecom.discounts.DiscountRuleService.DeleteDiscountRule',\n      packageName: PACKAGE_NAME,\n      url: resolveComWixEcomDiscountsDiscountRuleServiceUrl({\n        protoPath: '/v1/discount-rules/{discountRuleId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __deleteDiscountRule;\n}\n\n/**\n * Creates a query to retrieve a list of discount rules.\n *\n *\n * The `queryDiscountRules()` function builds a query to retrieve a list of up to 100 discount rules, and returns a [`DiscountRulesQueryBuilder`](#discountrulesquerybuilder) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](/discount-rules/discount-rules-query-builder/find) function.\n *\n * You can refine the query by chaining `DiscountRulesQueryBuilder` functions onto the query. `DiscountRulesQueryBuilder` functions enable you to sort, filter, and control the results queryDiscountRules() returns.\n *\n * By default, `queryDiscountRules()` sorts results by [`ascending(\"_id\")`](/discount-rules/discount-rules-query-builder/ascending) by default. This can be overridden.\n *\n * To learn how to query posts, refer to the table below.\n *\n * The following `DiscountRulesQueryBuilder` functions are supported for the `queryDiscountRules()` function. For a full description of the discount rule object, see the object returned for the [`items`](/discount-rules/discount-rules-query-result/items) property in the `DiscountRulesQueryResult`.\n */\nexport function queryDiscountRules(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __queryDiscountRules({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.discounts.v1.discount_rule',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wix.ecom.discounts.DiscountRuleService.QueryDiscountRules',\n      packageName: PACKAGE_NAME,\n      url: resolveComWixEcomDiscountsDiscountRuleServiceUrl({\n        protoPath: '/v1/discount-rules/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: 'discountRules.createdDate' },\n              { path: 'discountRules.updatedDate' },\n              { path: 'discountRules.activeTimeInfo.start' },\n              { path: 'discountRules.activeTimeInfo.end' },\n            ],\n          },\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [{ path: 'discountRules.discounts.values.percentage' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __queryDiscountRules;\n}\n","import {\n  createDiscountRule as publicCreateDiscountRule,\n  getDiscountRule as publicGetDiscountRule,\n  updateDiscountRule as publicUpdateDiscountRule,\n  deleteDiscountRule as publicDeleteDiscountRule,\n  queryDiscountRules as publicQueryDiscountRules,\n} from './ecom-discounts-v1-discount-rule-discount-rules.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { onDiscountRuleCreated as publicOnDiscountRuleCreated } from './ecom-discounts-v1-discount-rule-discount-rules.public.js';\nimport { onDiscountRuleDeleted as publicOnDiscountRuleDeleted } from './ecom-discounts-v1-discount-rule-discount-rules.public.js';\nimport { onDiscountRuleUpdated as publicOnDiscountRuleUpdated } from './ecom-discounts-v1-discount-rule-discount-rules.public.js';\n\nexport const createDiscountRule: MaybeContext<\n  BuildRESTFunction<typeof publicCreateDiscountRule> &\n    typeof publicCreateDiscountRule\n> = /*#__PURE__*/ createRESTModule(publicCreateDiscountRule);\nexport const getDiscountRule: MaybeContext<\n  BuildRESTFunction<typeof publicGetDiscountRule> & typeof publicGetDiscountRule\n> = /*#__PURE__*/ createRESTModule(publicGetDiscountRule);\nexport const updateDiscountRule: MaybeContext<\n  BuildRESTFunction<typeof publicUpdateDiscountRule> &\n    typeof publicUpdateDiscountRule\n> = /*#__PURE__*/ createRESTModule(publicUpdateDiscountRule);\nexport const deleteDiscountRule: MaybeContext<\n  BuildRESTFunction<typeof publicDeleteDiscountRule> &\n    typeof publicDeleteDiscountRule\n> = /*#__PURE__*/ createRESTModule(publicDeleteDiscountRule);\nexport const queryDiscountRules: MaybeContext<\n  BuildRESTFunction<typeof publicQueryDiscountRules> &\n    typeof publicQueryDiscountRules\n> = /*#__PURE__*/ createRESTModule(publicQueryDiscountRules);\n/**\n * Triggered when a discount rule is created.\n */\nexport const onDiscountRuleCreated: ReturnType<\n  typeof createEventModule<typeof publicOnDiscountRuleCreated>\n> = createEventModule(publicOnDiscountRuleCreated);\n/**\n * Triggered when a discount rule is deleted.\n */\nexport const onDiscountRuleDeleted: ReturnType<\n  typeof createEventModule<typeof publicOnDiscountRuleDeleted>\n> = createEventModule(publicOnDiscountRuleDeleted);\n/**\n * Triggered when a discount rule is updated.\n */\nexport const onDiscountRuleUpdated: ReturnType<\n  typeof createEventModule<typeof publicOnDiscountRuleUpdated>\n> = createEventModule(publicOnDiscountRuleUpdated);\n\nexport {\n  ScopeType,\n  TriggerType,\n  Type,\n  DiscountType,\n  Status,\n  AppliedSubjectType,\n  SortOrder,\n  WebhookIdentityType,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\nexport {\n  DiscountRule,\n  DiscountTrigger,\n  DiscountTriggerTriggerOneOf,\n  Scope,\n  ScopeScopeItemsOneOf,\n  CatalogItemFilter,\n  CustomFilter,\n  And,\n  Or,\n  Custom,\n  SubtotalRange,\n  ItemQuantityRange,\n  ActiveTimeInfo,\n  Discounts,\n  Discount,\n  DiscountDiscountOneOf,\n  SpecificItemsInfo,\n  BuyXGetYInfo,\n  CustomerBuy,\n  CustomerBuyConditionOneOf,\n  CustomerGet,\n  DiscountSettings,\n  ExtendedFields,\n  CreateDiscountRuleRequest,\n  CreateDiscountRuleResponse,\n  GetDiscountRuleRequest,\n  GetDiscountRuleResponse,\n  UpdateDiscountRuleRequest,\n  UpdateDiscountRuleResponse,\n  DeleteDiscountRuleRequest,\n  DeleteDiscountRuleResponse,\n  QueryDiscountRulesRequest,\n  PlatformQuery,\n  PlatformQueryPagingMethodOneOf,\n  Sorting,\n  PlatformPaging,\n  CursorPaging,\n  QueryDiscountRulesResponse,\n  PlatformPagingMetadata,\n  Cursors,\n  GetAppliedDiscountsRequest,\n  LineItem,\n  CatalogReference,\n  GetAppliedDiscountsResponse,\n  AppliedDiscount,\n  AppliedDiscountRule,\n  DiscountRuleName,\n  MultiCurrencyPrice,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  Empty,\n  DiscountRuleUsageLimitReached,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  DiscountRuleNonNullableFields,\n  CreateDiscountRuleResponseNonNullableFields,\n  GetDiscountRuleResponseNonNullableFields,\n  UpdateDiscountRuleResponseNonNullableFields,\n  QueryDiscountRulesResponseNonNullableFields,\n  BaseEventMetadata,\n  EventMetadata,\n  DiscountRuleCreatedEnvelope,\n  DiscountRuleDeletedEnvelope,\n  DiscountRuleUpdatedEnvelope,\n  UpdateDiscountRule,\n  DiscountRulesQueryResult,\n  DiscountRulesQueryBuilder,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,gCAAAC,qCAAoC;AAC7C,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAmC;;;ACJ5C,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,iDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;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,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,C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AA,QACE,aAAaC;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,8BAA8B;AAAA,UACtC,EAAE,MAAM,4BAA4B;AAAA,UACpC,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,MACA;AAAA,QACE,aAAaC;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qCAAqC,CAAC;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA+B;;;AGvN/B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAM3B,IAAMC,sBAGK,iCAAiBA,mBAAwB;AACpD,IAAMC,mBAEK,iCAAiBA,gBAAqB;AACjD,IAAMC,sBAGK,iCAAiBA,mBAAwB;AACpD,IAAMC,sBAGK,iCAAiBA,mBAAwB;AACpD,IAAMC,sBAGK,iCAAiBA,mBAAwB;AAIpD,IAAMC,yBAET,kBAAkB,qBAA2B;AAI1C,IAAMC,yBAET,kBAAkB,qBAA2B;AAI1C,IAAMC,yBAET,kBAAkB,qBAA2B;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTFloatToSDKFloat","transformRESTTimestampToSDKTimestamp","transformPaths","payload","ScopeType","TriggerType","Type","DiscountType","Status","AppliedSubjectType","SortOrder","WebhookIdentityType","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","transformRESTFloatToSDKFloat","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","onDiscountRuleCreated","onDiscountRuleDeleted","onDiscountRuleUpdated"]}