@wix/auto_sdk_ecom_discount-rules 1.0.64 → 1.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../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":["export * from './src/ecom-discounts-v1-discount-rule-discount-rules.context.js';\n","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, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateDiscountRuleApplicationErrors,\n CreateDiscountRuleValidationErrors,\n DiscountRule,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleQuery,\n DiscountRuleUpdatedEnvelope,\n DiscountRulesQueryBuilder,\n QueryDiscountRulesResponse,\n UpdateDiscountRule,\n createDiscountRule as universalCreateDiscountRule,\n deleteDiscountRule as universalDeleteDiscountRule,\n getDiscountRule as universalGetDiscountRule,\n queryDiscountRules as universalQueryDiscountRules,\n typedQueryDiscountRules as universalTypedQueryDiscountRules,\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 (\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n ) =>\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 (\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n ): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n > & {\n __applicationErrorsType?: CreateDiscountRuleApplicationErrors;\n __validationErrorsType?: CreateDiscountRuleValidationErrors;\n }\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 NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\n >;\n}\n\nexport function updateDiscountRule(\n httpClient: HttpClient\n): UpdateDiscountRuleSignature {\n return (\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n ) =>\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 (\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n ): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\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 function typedQueryDiscountRules(\n httpClient: HttpClient\n): TypedQueryDiscountRulesSignature {\n return (query: DiscountRuleQuery) =>\n universalTypedQueryDiscountRules(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryDiscountRulesSignature {\n /** */\n (query: DiscountRuleQuery): Promise<\n NonNullablePaths<\n QueryDiscountRulesResponse,\n | `discountRules`\n | `discountRules.${number}.trigger.customTrigger._id`\n | `discountRules.${number}.trigger.customTrigger.appId`\n | `discountRules.${number}.trigger.triggerType`\n | `discountRules.${number}.status`\n | `discountRules.${number}.usageCount`,\n 6\n >\n >;\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 { path: 'modifiedFields.createdDate' },\n { path: 'modifiedFields.updatedDate' },\n { path: 'modifiedFields.activeTimeInfo.start' },\n { path: 'modifiedFields.activeTimeInfo.end' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'entity.discounts.values.percentage' },\n { path: 'modifiedFields.discounts.values.percentage' },\n ],\n },\n ])\n )\n)<DiscountRuleUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ActiveTimeInfo,\n Address,\n And,\n AppliedDiscount,\n AppliedDiscountRule,\n AppliedSubjectType,\n BaseEventMetadata,\n BuyXGetYInfo,\n BuyerInfo,\n CatalogItemFilter,\n CatalogReference,\n ContactSegments,\n ContactTags,\n CreateDiscountRuleRequest,\n CreateDiscountRuleResponse,\n CursorPaging,\n Cursors,\n Custom,\n CustomFilter,\n CustomerBuy,\n CustomerBuyConditionOneOf,\n CustomerEligibility,\n CustomerEligibilityOptionsOneOf,\n CustomerGet,\n DayOfWeek,\n DeleteDiscountRuleRequest,\n DeleteDiscountRuleResponse,\n Discount,\n DiscountConfig,\n DiscountDiscountOneOf,\n DiscountRule,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleName,\n DiscountRuleQuerySpec,\n DiscountRuleUpdatedEnvelope,\n DiscountRuleUsageLimitReached,\n DiscountRulesQueryBuilder,\n DiscountRulesQueryResult,\n DiscountSettings,\n DiscountTrigger,\n DiscountTriggerTriggerOneOf,\n DiscountType,\n Discounts,\n DomainEvent,\n DomainEventBodyOneOf,\n EligibilityType,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExtendedFields,\n GetAppliedDiscountsRequest,\n GetAppliedDiscountsResponse,\n GetDiscountRuleRequest,\n GetDiscountRuleResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n IndividualMembers,\n ItemQuantityRange,\n LineItem,\n MessageEnvelope,\n MultiCurrencyPrice,\n Or,\n PlatformPaging,\n PlatformPagingMetadata,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n QuantityBased,\n QueryDiscountRulesRequest,\n QueryDiscountRulesResponse,\n Recurrence,\n RestoreInfo,\n Scope,\n ScopeScopeItemsOneOf,\n ScopeType,\n ShippingInfo,\n SortOrder,\n Sorting,\n SpecificItemsInfo,\n Status,\n SubtotalRange,\n TagReference,\n TimeOfDay,\n TimeWindow,\n TriggerType,\n Type,\n UpdateDiscountRule,\n UpdateDiscountRuleRequest,\n UpdateDiscountRuleResponse,\n WebhookIdentityType,\n WeeklySchedule,\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 {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixEcomDiscountsV1DiscountRule from './ecom-discounts-v1-discount-rule-discount-rules.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface DiscountRule {\n /**\n * Discount rule ID.\n * @format GUID\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 /**\n * Discount rule name.\n * @minLength 1\n * @maxLength 50\n */\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?: StatusWithLiterals;\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 * Customer Eligibility info\n * @internal\n */\n customerEligibility?: CustomerEligibility;\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?: TriggerTypeWithLiterals;\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 * Customer Eligibility info\n * @internal\n */\n customerEligibility?: CustomerEligibility;\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 /**\n * Scope ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Scope type. */\n type?: ScopeTypeWithLiterals;\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\n/** @enumType */\nexport type ScopeTypeWithLiterals =\n | ScopeType\n | 'UNDEFINED_SCOPE'\n | 'CATALOG_ITEM'\n | 'CUSTOM_FILTER';\n\nexport interface CatalogItemFilter {\n /**\n * Catalog App ID. For example, the Wix Stores, Wix Bookings, or 3rd-party `appId`.\n * @format GUID\n */\n catalogAppId?: string;\n /**\n * ID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores.\n * @minLength 1\n * @maxLength 36\n * @maxSize 50\n */\n catalogItemIds?: string[];\n}\n\nexport interface CustomFilter {\n /**\n * Custom filter app ID, when relevant.\n * @format GUID\n */\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 /**\n * List of triggers to have an \"AND\" operator between their results.\n * @minSize 2\n * @maxSize 5\n */\n triggers?: DiscountTrigger[];\n}\n\nexport interface Or {\n /**\n * List of triggers to have an \"OR\" operator between their results.\n * @minSize 2\n * @maxSize 5\n */\n triggers?: DiscountTrigger[];\n}\n\nexport interface Custom {\n /**\n * Trigger ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * ID of the app that created the trigger.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface SubtotalRange {\n /**\n * Relevant scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @maxSize 50\n */\n scopes?: Scope[];\n /**\n * Minimum subtotal price (inclusive).\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n from?: string | null;\n /**\n * Maximum subtotal price (inclusive).\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n to?: string | null;\n}\n\nexport interface ItemQuantityRange {\n /**\n * Relevant scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @maxSize 50\n */\n scopes?: Scope[];\n /**\n * Minimum item quantity (inclusive).\n * @min 1\n */\n from?: number | null;\n /**\n * Maximum item quantity (inclusive).\n * @min 1\n */\n to?: number | null;\n}\n\nexport interface CustomerEligibility extends CustomerEligibilityOptionsOneOf {\n /** Information about specific members. */\n individualMembersInfo?: IndividualMembers;\n}\n\n/** @oneof */\nexport interface CustomerEligibilityOptionsOneOf {\n /** Information about specific members. */\n individualMembersInfo?: IndividualMembers;\n}\n\nexport enum EligibilityType {\n /** Eligibility type is not defined. */\n UNKNOWN_ELIGIBILITY_TYPE = 'UNKNOWN_ELIGIBILITY_TYPE',\n /** Only specific customers based on member id. */\n INDIVIDUAL_MEMBERS = 'INDIVIDUAL_MEMBERS',\n}\n\n/** @enumType */\nexport type EligibilityTypeWithLiterals =\n | EligibilityType\n | 'UNKNOWN_ELIGIBILITY_TYPE'\n | 'INDIVIDUAL_MEMBERS';\n\nexport interface ContactSegments {\n /**\n * Eligible segment ids.\n * @format GUID\n * @minSize 1\n * @maxSize 100\n */\n segmentIds?: string[];\n}\n\nexport interface ContactTags {\n /**\n * Eligible tag and label ids.\n * @minSize 1\n * @maxSize 100\n */\n tagReferences?: TagReference[];\n}\n\nexport interface TagReference {\n /**\n * Eligible tag id.\n * @maxLength 5\n */\n tagId?: string;\n /**\n * Eligible label id.\n * @maxLength 80\n */\n labelKey?: string;\n}\n\nexport interface IndividualMembers {\n /**\n * Eligible member ids.\n * @format GUID\n * @minSize 1\n * @maxSize 100\n */\n memberIds?: string[];\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\n/** @enumType */\nexport type TriggerTypeWithLiterals =\n | TriggerType\n | 'UNDEFINED'\n | 'AND'\n | 'SUBTOTAL_RANGE'\n | 'ITEM_QUANTITY_RANGE'\n | 'CUSTOM'\n | 'OR';\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 Recurrence {\n /** Weekly discount recurrence. */\n weeklySchedule?: WeeklySchedule;\n}\n\nexport enum DayOfWeek {\n UNKOWN_DAY_OF_WEEK = 'UNKOWN_DAY_OF_WEEK',\n /** Monday. */\n MON = 'MON',\n /** Tuesday. */\n TUE = 'TUE',\n /** Wednesday. */\n WED = 'WED',\n /** Thursday. */\n THU = 'THU',\n /** Friday. */\n FRI = 'FRI',\n /** Saturday. */\n SAT = 'SAT',\n /** Sunday. */\n SUN = 'SUN',\n}\n\n/** @enumType */\nexport type DayOfWeekWithLiterals =\n | DayOfWeek\n | 'UNKOWN_DAY_OF_WEEK'\n | 'MON'\n | 'TUE'\n | 'WED'\n | 'THU'\n | 'FRI'\n | 'SAT'\n | 'SUN';\n\nexport interface TimeOfDay {\n /**\n * Hours. Min: `0`. Max: `23`.\n * @max 23\n */\n hours?: number;\n /**\n * Minutes. Min: `0`. Max: `59`.\n * @max 59\n */\n minutes?: number;\n}\n\nexport interface TimeWindow {\n /** Day of week. */\n dayOfWeek?: DayOfWeekWithLiterals;\n /** Start time window during each recurrence. */\n startTime?: TimeOfDay;\n /** End time window during each recurrence. */\n endTime?: TimeOfDay;\n}\n\nexport interface WeeklySchedule {\n /**\n * A list of days with their respective active time ranges.\n * @minSize 1\n * @maxSize 100\n */\n timeWindows?: TimeWindow[];\n}\n\nexport interface Discounts {\n /**\n * Discounts.\n * @minSize 1\n * @maxSize 1\n */\n values?: Discount[];\n}\n\nexport interface Discount extends DiscountDiscountOneOf {\n /**\n * Percentage to discount from original price.\n * @min 0.1\n * @max 100\n */\n percentage?: number;\n /**\n * Amount to discount from original price.\n * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }\n */\n fixedAmount?: string;\n /**\n * Fixed price. Line item will be fixed to this price.\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n fixedPrice?: string;\n /** A special price is applied for a specific quantity of items. For example, 3 for $10. */\n quantityBased?: QuantityBased;\n /**\n * Discount target.\n *\n * + `\"SPECIFIC_ITEMS\"`: Discount applies to a specific set of items.\n */\n targetType?: TypeWithLiterals;\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?: DiscountTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface DiscountDiscountOneOf {\n /**\n * Percentage to discount from original price.\n * @min 0.1\n * @max 100\n */\n percentage?: number;\n /**\n * Amount to discount from original price.\n * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }\n */\n fixedAmount?: string;\n /**\n * Fixed price. Line item will be fixed to this price.\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n fixedPrice?: string;\n /** A special price is applied for a specific quantity of items. For example, 3 for $10. */\n quantityBased?: QuantityBased;\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\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNDEFINED' | 'SPECIFIC_ITEMS';\n\nexport interface SpecificItemsInfo {\n /**\n * All associated scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @minSize 1\n * @maxSize 50\n */\n scopes?: Scope[];\n}\n\n/** A special price is applied for a specific quantity of items. For example, 3 for $10. */\nexport interface QuantityBased {\n /**\n * list of discountConfig options.\n * @minSize 1\n * @maxSize 1\n */\n configurations?: DiscountConfig[];\n}\n\nexport interface DiscountConfig {\n /**\n * DiscountConfig ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * The number of items that must be added to the cart to be eligible for the discount (Represents X).\n * @min 2\n */\n quantity?: number;\n /**\n * The DiscountConfig price (Represents Amount).\n * @decimalValue options { gte:0, lte:1000000, maxScale:4 }\n */\n price?: string;\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 * Quantity based options for Buy X For Amount.\n * @documentationMaturity preview\n */\n QUANTITY_BASED = 'QUANTITY_BASED',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n | DiscountType\n | 'UNDEFINED'\n | 'PERCENTAGE'\n | 'FIXED_AMOUNT'\n | 'FIXED_PRICE'\n | 'QUANTITY_BASED';\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 * @min 1\n */\n limit?: number | null;\n}\n\nexport interface CustomerBuy extends CustomerBuyConditionOneOf {\n /**\n * Minimum number of items the customer must add to the cart to be eligible for a discount.\n * @min 1\n */\n minimumQuantity?: number;\n /**\n * Minimum price the customer must add to the cart to be eligible for a discount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\n minimumSpend?: string | null;\n /**\n * Scopes of the items that must be added to the cart to enable the discount.\n * @minSize 1\n * @maxSize 50\n */\n scopes?: Scope[];\n}\n\n/** @oneof */\nexport interface CustomerBuyConditionOneOf {\n /**\n * Minimum number of items the customer must add to the cart to be eligible for a discount.\n * @min 1\n */\n minimumQuantity?: number;\n /**\n * Minimum price the customer must add to the cart to be eligible for a discount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\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 * @min 1\n */\n quantity?: number;\n /**\n * Scopes of the items that will be discounted.\n * @minSize 1\n * @maxSize 50\n */\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/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'UNDEFINED'\n | 'LIVE'\n | 'EXPIRED'\n | 'PENDING';\n\n/** The discount settings */\nexport interface DiscountSettings {\n /** Discount applies to either `ALL_ITEMS`, or to the `LOWEST_PRICED_ITEM`. */\n appliesTo?: AppliedSubjectTypeWithLiterals;\n /**\n * Whether the discount will apply to subscriptions.\n *\n * Default: `false`\n */\n includeSubscription?: boolean | null;\n /**\n * Maximum total number of uses allowed for the discount rule.\n * @min 1\n * @max 2147483646\n */\n usageLimit?: number | null;\n /**\n * The usage limit per user per discount.\n * When not provided, this setting will not apply.\n * @min 1\n * @max 2147483646\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\n/** @enumType */\nexport type AppliedSubjectTypeWithLiterals =\n | AppliedSubjectType\n | 'UNDEFINED'\n | 'ALL_ITEMS'\n | 'LOWEST_PRICED_ITEM';\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 /**\n * ID of the discount rule to retrieve.\n * @format GUID\n */\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 /**\n * ID of the discount rule to delete.\n * @format GUID\n */\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 /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\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 /**\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\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 /**\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 GetAppliedDiscountsRequest {\n /**\n * Line items for which to check for discount rules.\n * @maxSize 1000\n */\n lineItems?: LineItem[];\n /**\n * Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n * @format GUID\n */\n purchaseFlowId?: string | null;\n /** Buyer Information */\n buyerInfo?: BuyerInfo;\n /** Shipping information. */\n shippingInfo?: ShippingInfo;\n /**\n * The business location ID to be used as the basis for some calculations.\n * Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).\n * @format GUID\n */\n businessLocationId?: string | null;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * Line item quantity.\n * @max 100000\n */\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 /**\n * Line item price.\n * @decimalValue options { gte:0 }\n */\n price?: string;\n /**\n * Additional ID for the item in the catalog.\n * This field provides an additional identifier for the item if your flow requires another ID as well as `catalogReference.catalogItemId`.\n * Can be used for membership validation.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\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 * @minLength 1\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 BuyerInfo {\n /**\n * Email of the customer.\n * @format EMAIL\n */\n buyerEmail?: string | null;\n /**\n * Member id of the customer.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ShippingInfo {\n /** Address (if applicable). */\n address?: Address;\n /**\n * Preferred shipping option code. For example, \"usps_std_overnight\".\n * @minLength 1\n * @maxLength 100\n */\n preferredShippingOptionCode?: string | null;\n}\n\nexport interface Address {\n /**\n * Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.\n * @format COUNTRY\n */\n country?: string | null;\n /**\n * Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.\n * @maxLength 50\n */\n subdivision?: string | null;\n /**\n * City name.\n * @maxLength 50\n */\n city?: string | null;\n}\n\nexport interface GetAppliedDiscountsResponse {\n /** All eligible discounts. */\n appliedDiscounts?: AppliedDiscount[];\n}\n\nexport interface AppliedDiscount {\n /** Discount type. */\n discountType?: TypeWithLiterals;\n /**\n * IDs of line items the discount applies to, in GUID format.\n * @format GUID\n * @maxSize 1000\n */\n lineItemIds?: string[];\n /** Applied discount rule. */\n appliedDiscountRule?: AppliedDiscountRule;\n}\n\nexport interface AppliedDiscountRule {\n /**\n * Applied discount rule ID.\n * @format GUID\n */\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?: DiscountTypeWithLiterals;\n}\n\nexport interface DiscountRuleName {\n /**\n * Original discount rule name (in site's default language).\n * @minLength 1\n * @maxLength 256\n */\n original?: string;\n /**\n * Translated discount rule name according to buyer language.\n *\n * Default: `original`\n * @minLength 1\n * @maxLength 500\n */\n translated?: string | null;\n}\n\nexport interface MultiCurrencyPrice {\n /**\n * Amount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\n amount?: string;\n /**\n * Converted amount.\n * @readonly\n * @decimalValue options { gte:0, lte:1000000000000000 }\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 /** 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 DiscountRuleUsageLimitReached {\n /** Discount Rule */\n rule?: DiscountRule;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\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/** @docsIgnore */\nexport type CreateDiscountRuleApplicationErrors =\n | {\n code?: 'MAX_DISCOUNT_RULES_REACHED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_QUANTITY_BASED_DISCOUNTS_REACHED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type CreateDiscountRuleValidationErrors =\n | {\n ruleName?: 'INVALID_ACTIVE_TIME_RANGE';\n }\n | {\n ruleName?: 'INVALID_EMPTY_DISCOUNT';\n }\n | {\n ruleName?: 'INVALID_DISCOUNT_TYPE';\n }\n | {\n ruleName?: 'MISSING_SUBTOTAL_RANGE';\n }\n | {\n ruleName?: 'MISSING_ITEM_QUANTITY_RANGE';\n }\n | {\n ruleName?: 'INVALID_SUBTOTAL_RANGE';\n }\n | {\n ruleName?: 'INVALID_ITEM_QUANTITY_RANGE';\n }\n | {\n ruleName?: 'INVALID_TARGET_TYPE_FIELD';\n }\n | {\n ruleName?: 'OPERATOR_TOO_DEEPLY_NESTED';\n }\n | {\n ruleName?: 'INVALID_SCOPE_TYPE';\n }\n | {\n ruleName?: 'INVALID_TRIGGER_TYPE';\n }\n | {\n ruleName?: 'INVALID_SETTINGS_SUBJECT_TYPE';\n }\n | {\n ruleName?: 'INVALID_CUSTOMER_BUY_CONDITION';\n }\n | {\n ruleName?: 'INVALID_SCOPE';\n };\n\nexport interface BaseEventMetadata {\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}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 modifiedFields: Record<string, any>;\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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 * @applicableIdentity APP\n * @returns Discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.CreateDiscountRule\n */\nexport async function createDiscountRule(\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n > & {\n __applicationErrorsType?: CreateDiscountRuleApplicationErrors;\n __validationErrorsType?: CreateDiscountRuleValidationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 * @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<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 * @applicableIdentity APP\n * @returns Updated discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.UpdateDiscountRule\n */\nexport async function updateDiscountRule(\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\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 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 * @format GUID\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 /**\n * Discount rule name.\n * @minLength 1\n * @maxLength 50\n */\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?: StatusWithLiterals;\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 * @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 * @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(\n transformPaths(data, [])\n );\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 | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 gt: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 le: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 lt: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\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\n/**\n * @hidden\n * @fqn com.wix.ecom.discounts.DiscountRuleService.QueryDiscountRules\n * @requiredField query\n */\nexport async function typedQueryDiscountRules(\n query: DiscountRuleQuery\n): Promise<\n NonNullablePaths<\n QueryDiscountRulesResponse,\n | `discountRules`\n | `discountRules.${number}.trigger.customTrigger._id`\n | `discountRules.${number}.trigger.customTrigger.appId`\n | `discountRules.${number}.trigger.triggerType`\n | `discountRules.${number}.status`\n | `discountRules.${number}.usageCount`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts =\n ambassadorWixEcomDiscountsV1DiscountRule.queryDiscountRules(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DiscountRuleQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'active',\n 'activeTimeInfo.end',\n 'activeTimeInfo.start',\n 'name',\n 'revision'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n DiscountRule,\n DiscountRuleQuerySpec\n>;\nexport type DiscountRuleQuery = {\n /** \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 */\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 filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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};\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 '*.dev.wix-code.com': [\n {\n srcPath: '/ecom/discounts/v1/discount-rules',\n destPath: '/v1/discount-rules',\n },\n ],\n _: [\n {\n srcPath: '/ecom/discounts/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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 typedQueryDiscountRules as publicTypedQueryDiscountRules,\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 {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n DiscountRuleQuery,\n DiscountRulesQueryBuilder,\n typedQueryDiscountRules as universalTypedQueryDiscountRules,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\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\nfunction customQueryDiscountRules(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryDiscountRules(httpClient)(),\n typedQueryFunction: (query: DiscountRuleQuery) =>\n publicTypedQueryDiscountRules(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): DiscountRulesQueryBuilder;\n function overloadedQuery(\n query: DiscountRuleQuery\n ): ReturnType<typeof universalTypedQueryDiscountRules>;\n function overloadedQuery(query?: DiscountRuleQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\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 customQueryDiscountRules> &\n typeof customQueryDiscountRules\n> = /*#__PURE__*/ createRESTModule(customQueryDiscountRules);\n/**\n * Triggered when a discount rule is created.\n */\nexport const onDiscountRuleCreated: BuildEventDefinition<\n typeof publicOnDiscountRuleCreated\n> &\n typeof publicOnDiscountRuleCreated = createEventModule(\n publicOnDiscountRuleCreated\n);\n/**\n * Triggered when a discount rule is deleted.\n */\nexport const onDiscountRuleDeleted: BuildEventDefinition<\n typeof publicOnDiscountRuleDeleted\n> &\n typeof publicOnDiscountRuleDeleted = createEventModule(\n publicOnDiscountRuleDeleted\n);\n/**\n * Triggered when a discount rule is updated.\n */\nexport const onDiscountRuleUpdated: BuildEventDefinition<\n typeof publicOnDiscountRuleUpdated\n> &\n typeof publicOnDiscountRuleUpdated = createEventModule(\n publicOnDiscountRuleUpdated\n);\n\nexport {\n ScopeType,\n EligibilityType,\n TriggerType,\n DayOfWeek,\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 CustomerEligibility,\n CustomerEligibilityOptionsOneOf,\n ContactSegments,\n ContactTags,\n TagReference,\n IndividualMembers,\n ActiveTimeInfo,\n Recurrence,\n TimeOfDay,\n TimeWindow,\n WeeklySchedule,\n Discounts,\n Discount,\n DiscountDiscountOneOf,\n SpecificItemsInfo,\n QuantityBased,\n DiscountConfig,\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 BuyerInfo,\n ShippingInfo,\n Address,\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 BaseEventMetadata,\n EventMetadata,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleUpdatedEnvelope,\n UpdateDiscountRule,\n DiscountRulesQueryResult,\n DiscountRulesQueryBuilder,\n DiscountRuleQuerySpec,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\nexport {\n ScopeTypeWithLiterals,\n EligibilityTypeWithLiterals,\n TriggerTypeWithLiterals,\n DayOfWeekWithLiterals,\n TypeWithLiterals,\n DiscountTypeWithLiterals,\n StatusWithLiterals,\n AppliedSubjectTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateDiscountRuleApplicationErrors,\n CreateDiscountRuleValidationErrors,\n CommonQueryWithEntityContext,\n DiscountRuleQuery,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,gBAA6C;AAC7C,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACJ9D,6BAAo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;AAAA,UACrC,EAAE,MAAM,sCAAsC;AAAA,UAC9C,EAAE,MAAM,oCAAoC;AAAA,QAC9C;AAAA,MACF;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qCAAqC;AAAA,UAC7C,EAAE,MAAM,6CAA6C;AAAA,QACvD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA+B;;;AG3U/B,IAAAC,uBAAiC;AACjC,sCAAkC;AAOlC,iCAA0C;AAU1C,SAAS,yBAAyB,YAAwB;AACxD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,MAAMC,oBAAyB,UAAU,EAAE;AAAA,IACjE,oBAAoB,CAAC,UACnBC,yBAA8B,UAAU,EAAE,KAAK;AAAA,IACjD,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAAgC;AACvD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAML,sBAGK,2DAAiB,wBAAwB;AAIpD,IAAMM,6BAG0B;AAAA,EACrC;AACF;AAIO,IAAMC,6BAG0B;AAAA,EACrC;AACF;AAIO,IAAMC,6BAG0B;AAAA,EACrC;AACF;","names":["createDiscountRule","deleteDiscountRule","getDiscountRule","onDiscountRuleCreated","onDiscountRuleDeleted","onDiscountRuleUpdated","queryDiscountRules","updateDiscountRule","import_rename_all_nested_keys","import_float","import_timestamp","import_transform_paths","import_float","import_timestamp","import_rest_modules","payload","import_transform_paths","ScopeType","EligibilityType","TriggerType","DayOfWeek","Type","DiscountType","Status","AppliedSubjectType","SortOrder","WebhookIdentityType","createDiscountRule","sdkTransformError","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","typedQueryDiscountRules","import_rest_modules","queryDiscountRules","typedQueryDiscountRules","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","onDiscountRuleCreated","onDiscountRuleDeleted","onDiscountRuleUpdated"]}
1
+ {"version":3,"sources":["../../index.ts","../../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":["export * from './src/ecom-discounts-v1-discount-rule-discount-rules.context.js';\n","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, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateDiscountRuleApplicationErrors,\n CreateDiscountRuleValidationErrors,\n DiscountRule,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleQuery,\n DiscountRuleUpdatedEnvelope,\n DiscountRulesQueryBuilder,\n QueryDiscountRulesResponse,\n UpdateDiscountRule,\n createDiscountRule as universalCreateDiscountRule,\n deleteDiscountRule as universalDeleteDiscountRule,\n getDiscountRule as universalGetDiscountRule,\n queryDiscountRules as universalQueryDiscountRules,\n typedQueryDiscountRules as universalTypedQueryDiscountRules,\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 (\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n ) =>\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 (\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n ): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n > & {\n __applicationErrorsType?: CreateDiscountRuleApplicationErrors;\n __validationErrorsType?: CreateDiscountRuleValidationErrors;\n }\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 NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\n >;\n}\n\nexport function updateDiscountRule(\n httpClient: HttpClient\n): UpdateDiscountRuleSignature {\n return (\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n ) =>\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 (\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n ): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\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 function typedQueryDiscountRules(\n httpClient: HttpClient\n): TypedQueryDiscountRulesSignature {\n return (query: DiscountRuleQuery) =>\n universalTypedQueryDiscountRules(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryDiscountRulesSignature {\n /** */\n (query: DiscountRuleQuery): Promise<\n NonNullablePaths<\n QueryDiscountRulesResponse,\n | `discountRules`\n | `discountRules.${number}.trigger.customTrigger._id`\n | `discountRules.${number}.trigger.customTrigger.appId`\n | `discountRules.${number}.trigger.triggerType`\n | `discountRules.${number}.status`\n | `discountRules.${number}.usageCount`,\n 6\n >\n >;\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 { path: 'modifiedFields.createdDate' },\n { path: 'modifiedFields.updatedDate' },\n { path: 'modifiedFields.activeTimeInfo.start' },\n { path: 'modifiedFields.activeTimeInfo.end' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'entity.discounts.values.percentage' },\n { path: 'modifiedFields.discounts.values.percentage' },\n ],\n },\n ])\n )\n)<DiscountRuleUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n ActiveTimeInfo,\n Address,\n And,\n AppliedDiscount,\n AppliedDiscountRule,\n AppliedSubjectType,\n BaseEventMetadata,\n BuyXGetYInfo,\n BuyerInfo,\n CatalogItemFilter,\n CatalogReference,\n ContactSegments,\n ContactTags,\n CreateDiscountRuleRequest,\n CreateDiscountRuleResponse,\n CursorPaging,\n Cursors,\n Custom,\n CustomFilter,\n CustomerBuy,\n CustomerBuyConditionOneOf,\n CustomerEligibility,\n CustomerEligibilityOptionsOneOf,\n CustomerGet,\n DayOfWeek,\n DeleteDiscountRuleRequest,\n DeleteDiscountRuleResponse,\n Discount,\n DiscountConfig,\n DiscountDiscountOneOf,\n DiscountRule,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleName,\n DiscountRuleQuerySpec,\n DiscountRuleUpdatedEnvelope,\n DiscountRuleUsageLimitReached,\n DiscountRulesQueryBuilder,\n DiscountRulesQueryResult,\n DiscountSettings,\n DiscountTrigger,\n DiscountTriggerTriggerOneOf,\n DiscountType,\n Discounts,\n DomainEvent,\n DomainEventBodyOneOf,\n EligibilityType,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExtendedFields,\n GetAppliedDiscountsRequest,\n GetAppliedDiscountsResponse,\n GetDiscountRuleRequest,\n GetDiscountRuleResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n IndividualMembers,\n ItemQuantityRange,\n LineItem,\n MessageEnvelope,\n MultiCurrencyPrice,\n Or,\n PlatformPaging,\n PlatformPagingMetadata,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n QuantityBased,\n QueryDiscountRulesRequest,\n QueryDiscountRulesResponse,\n Recurrence,\n RestoreInfo,\n Scope,\n ScopeScopeItemsOneOf,\n ScopeType,\n ShippingInfo,\n SortOrder,\n Sorting,\n SpecificItemsInfo,\n Status,\n SubtotalRange,\n TagReference,\n TimeOfDay,\n TimeWindow,\n TriggerType,\n Type,\n UpdateDiscountRule,\n UpdateDiscountRuleRequest,\n UpdateDiscountRuleResponse,\n WebhookIdentityType,\n WeeklySchedule,\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 {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixEcomDiscountsV1DiscountRule from './ecom-discounts-v1-discount-rule-discount-rules.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface DiscountRule {\n /**\n * Discount rule ID.\n * @format GUID\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 /**\n * Discount rule name.\n * @minLength 1\n * @maxLength 50\n */\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?: StatusWithLiterals;\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 * Customer Eligibility info\n * @internal\n */\n customerEligibility?: CustomerEligibility;\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?: TriggerTypeWithLiterals;\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 * Customer Eligibility info\n * @internal\n */\n customerEligibility?: CustomerEligibility;\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 /**\n * Scope ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /** Scope type. */\n type?: ScopeTypeWithLiterals;\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\n/** @enumType */\nexport type ScopeTypeWithLiterals =\n | ScopeType\n | 'UNDEFINED_SCOPE'\n | 'CATALOG_ITEM'\n | 'CUSTOM_FILTER';\n\nexport interface CatalogItemFilter {\n /**\n * Catalog App ID. For example, the Wix Stores, Wix Bookings, or 3rd-party `appId`.\n * @format GUID\n */\n catalogAppId?: string;\n /**\n * ID of the item within its Wix or 3rd-party catalog. For example, `productId` for Wix Stores.\n * @minLength 1\n * @maxLength 36\n * @maxSize 50\n */\n catalogItemIds?: string[];\n}\n\nexport interface CustomFilter {\n /**\n * Custom filter app ID, when relevant.\n * @format GUID\n */\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 /**\n * List of triggers to have an \"AND\" operator between their results.\n * @minSize 2\n * @maxSize 5\n */\n triggers?: DiscountTrigger[];\n}\n\nexport interface Or {\n /**\n * List of triggers to have an \"OR\" operator between their results.\n * @minSize 2\n * @maxSize 5\n */\n triggers?: DiscountTrigger[];\n}\n\nexport interface Custom {\n /**\n * Trigger ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * ID of the app that created the trigger.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface SubtotalRange {\n /**\n * Relevant scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @maxSize 50\n */\n scopes?: Scope[];\n /**\n * Minimum subtotal price (inclusive).\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n from?: string | null;\n /**\n * Maximum subtotal price (inclusive).\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n to?: string | null;\n}\n\nexport interface ItemQuantityRange {\n /**\n * Relevant scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @maxSize 50\n */\n scopes?: Scope[];\n /**\n * Minimum item quantity (inclusive).\n * @min 1\n */\n from?: number | null;\n /**\n * Maximum item quantity (inclusive).\n * @min 1\n */\n to?: number | null;\n}\n\nexport interface CustomerEligibility extends CustomerEligibilityOptionsOneOf {\n /** Information about specific members. */\n individualMembersInfo?: IndividualMembers;\n}\n\n/** @oneof */\nexport interface CustomerEligibilityOptionsOneOf {\n /** Information about specific members. */\n individualMembersInfo?: IndividualMembers;\n}\n\nexport enum EligibilityType {\n /** Eligibility type is not defined. */\n UNKNOWN_ELIGIBILITY_TYPE = 'UNKNOWN_ELIGIBILITY_TYPE',\n /** Only specific customers based on member id. */\n INDIVIDUAL_MEMBERS = 'INDIVIDUAL_MEMBERS',\n}\n\n/** @enumType */\nexport type EligibilityTypeWithLiterals =\n | EligibilityType\n | 'UNKNOWN_ELIGIBILITY_TYPE'\n | 'INDIVIDUAL_MEMBERS';\n\nexport interface ContactSegments {\n /**\n * Eligible segment ids.\n * @format GUID\n * @minSize 1\n * @maxSize 100\n */\n segmentIds?: string[];\n}\n\nexport interface ContactTags {\n /**\n * Eligible tag and label ids.\n * @minSize 1\n * @maxSize 100\n */\n tagReferences?: TagReference[];\n}\n\nexport interface TagReference {\n /**\n * Eligible tag id.\n * @maxLength 5\n */\n tagId?: string;\n /**\n * Eligible label id.\n * @maxLength 80\n */\n labelKey?: string;\n}\n\nexport interface IndividualMembers {\n /**\n * Eligible member ids.\n * @format GUID\n * @minSize 1\n * @maxSize 100\n */\n memberIds?: string[];\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\n/** @enumType */\nexport type TriggerTypeWithLiterals =\n | TriggerType\n | 'UNDEFINED'\n | 'AND'\n | 'SUBTOTAL_RANGE'\n | 'ITEM_QUANTITY_RANGE'\n | 'CUSTOM'\n | 'OR';\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 Recurrence {\n /** Weekly discount recurrence. */\n weeklySchedule?: WeeklySchedule;\n}\n\nexport enum DayOfWeek {\n UNKOWN_DAY_OF_WEEK = 'UNKOWN_DAY_OF_WEEK',\n /** Monday. */\n MON = 'MON',\n /** Tuesday. */\n TUE = 'TUE',\n /** Wednesday. */\n WED = 'WED',\n /** Thursday. */\n THU = 'THU',\n /** Friday. */\n FRI = 'FRI',\n /** Saturday. */\n SAT = 'SAT',\n /** Sunday. */\n SUN = 'SUN',\n}\n\n/** @enumType */\nexport type DayOfWeekWithLiterals =\n | DayOfWeek\n | 'UNKOWN_DAY_OF_WEEK'\n | 'MON'\n | 'TUE'\n | 'WED'\n | 'THU'\n | 'FRI'\n | 'SAT'\n | 'SUN';\n\nexport interface TimeOfDay {\n /**\n * Hours. Min: `0`. Max: `23`.\n * @max 23\n */\n hours?: number;\n /**\n * Minutes. Min: `0`. Max: `59`.\n * @max 59\n */\n minutes?: number;\n}\n\nexport interface TimeWindow {\n /** Day of week. */\n dayOfWeek?: DayOfWeekWithLiterals;\n /** Start time window during each recurrence. */\n startTime?: TimeOfDay;\n /** End time window during each recurrence. */\n endTime?: TimeOfDay;\n}\n\nexport interface WeeklySchedule {\n /**\n * A list of days with their respective active time ranges.\n * @minSize 1\n * @maxSize 100\n */\n timeWindows?: TimeWindow[];\n}\n\nexport interface Discounts {\n /**\n * Discounts.\n * @minSize 1\n * @maxSize 1\n */\n values?: Discount[];\n}\n\nexport interface Discount extends DiscountDiscountOneOf {\n /**\n * Percentage to discount from original price.\n * @min 0.1\n * @max 100\n */\n percentage?: number;\n /**\n * Amount to discount from original price.\n * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }\n */\n fixedAmount?: string;\n /**\n * Fixed price. Line item will be fixed to this price.\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n fixedPrice?: string;\n /** A special price is applied for a specific quantity of items. For example, 3 for $10. */\n quantityBased?: QuantityBased;\n /**\n * Discount target.\n *\n * + `\"SPECIFIC_ITEMS\"`: Discount applies to a specific set of items.\n */\n targetType?: TypeWithLiterals;\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?: DiscountTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface DiscountDiscountOneOf {\n /**\n * Percentage to discount from original price.\n * @min 0.1\n * @max 100\n */\n percentage?: number;\n /**\n * Amount to discount from original price.\n * @decimalValue options { gt:0, lte:1000000000000000, maxScale:4 }\n */\n fixedAmount?: string;\n /**\n * Fixed price. Line item will be fixed to this price.\n * @decimalValue options { gte:0, lte:1000000000000000, maxScale:4 }\n */\n fixedPrice?: string;\n /** A special price is applied for a specific quantity of items. For example, 3 for $10. */\n quantityBased?: QuantityBased;\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\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNDEFINED' | 'SPECIFIC_ITEMS';\n\nexport interface SpecificItemsInfo {\n /**\n * All associated scopes for `\"SPECIFIC_ITEMS\"` target type.\n * @minSize 1\n * @maxSize 50\n */\n scopes?: Scope[];\n}\n\n/** A special price is applied for a specific quantity of items. For example, 3 for $10. */\nexport interface QuantityBased {\n /**\n * list of discountConfig options.\n * @minSize 1\n * @maxSize 1\n */\n configurations?: DiscountConfig[];\n}\n\nexport interface DiscountConfig {\n /**\n * DiscountConfig ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * The number of items that must be added to the cart to be eligible for the discount (Represents X).\n * @min 2\n */\n quantity?: number;\n /**\n * The DiscountConfig price (Represents Amount).\n * @decimalValue options { gte:0, lte:1000000, maxScale:4 }\n */\n price?: string;\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 * Quantity based options for Buy X For Amount.\n * @documentationMaturity preview\n */\n QUANTITY_BASED = 'QUANTITY_BASED',\n}\n\n/** @enumType */\nexport type DiscountTypeWithLiterals =\n | DiscountType\n | 'UNDEFINED'\n | 'PERCENTAGE'\n | 'FIXED_AMOUNT'\n | 'FIXED_PRICE'\n | 'QUANTITY_BASED';\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 * @min 1\n */\n limit?: number | null;\n}\n\nexport interface CustomerBuy extends CustomerBuyConditionOneOf {\n /**\n * Minimum number of items the customer must add to the cart to be eligible for a discount.\n * @min 1\n */\n minimumQuantity?: number;\n /**\n * Minimum price the customer must add to the cart to be eligible for a discount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\n minimumSpend?: string | null;\n /**\n * Scopes of the items that must be added to the cart to enable the discount.\n * @minSize 1\n * @maxSize 50\n */\n scopes?: Scope[];\n}\n\n/** @oneof */\nexport interface CustomerBuyConditionOneOf {\n /**\n * Minimum number of items the customer must add to the cart to be eligible for a discount.\n * @min 1\n */\n minimumQuantity?: number;\n /**\n * Minimum price the customer must add to the cart to be eligible for a discount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\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 * @min 1\n */\n quantity?: number;\n /**\n * Scopes of the items that will be discounted.\n * @minSize 1\n * @maxSize 50\n */\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/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'UNDEFINED'\n | 'LIVE'\n | 'EXPIRED'\n | 'PENDING';\n\n/** The discount settings */\nexport interface DiscountSettings {\n /** Discount applies to either `ALL_ITEMS`, or to the `LOWEST_PRICED_ITEM`. */\n appliesTo?: AppliedSubjectTypeWithLiterals;\n /**\n * Whether the discount will apply to subscriptions.\n *\n * Default: `false`\n */\n includeSubscription?: boolean | null;\n /**\n * Maximum total number of uses allowed for the discount rule.\n * @min 1\n * @max 2147483646\n */\n usageLimit?: number | null;\n /**\n * The usage limit per user per discount.\n * When not provided, this setting will not apply.\n * @min 1\n * @max 2147483646\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\n/** @enumType */\nexport type AppliedSubjectTypeWithLiterals =\n | AppliedSubjectType\n | 'UNDEFINED'\n | 'ALL_ITEMS'\n | 'LOWEST_PRICED_ITEM';\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 /**\n * ID of the discount rule to retrieve.\n * @format GUID\n */\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 /**\n * ID of the discount rule to delete.\n * @format GUID\n */\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 /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\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 /**\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\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 /**\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 GetAppliedDiscountsRequest {\n /**\n * Line items for which to check for discount rules.\n * @maxSize 1000\n */\n lineItems?: LineItem[];\n /**\n * Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n * @format GUID\n */\n purchaseFlowId?: string | null;\n /** Buyer Information */\n buyerInfo?: BuyerInfo;\n /** Shipping information. */\n shippingInfo?: ShippingInfo;\n /**\n * The business location ID to be used as the basis for some calculations.\n * Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).\n * @format GUID\n */\n businessLocationId?: string | null;\n}\n\nexport interface LineItem {\n /**\n * Line item ID.\n * @minLength 1\n * @maxLength 100\n */\n _id?: string;\n /**\n * Line item quantity.\n * @max 100000\n */\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 /**\n * Line item price.\n * @decimalValue options { gte:0 }\n */\n price?: string;\n /**\n * Additional ID for the item in the catalog.\n * This field provides an additional identifier for the item if your flow requires another ID as well as `catalogReference.catalogItemId`.\n * Can be used for membership validation.\n * @minLength 1\n * @maxLength 36\n */\n rootCatalogItemId?: string | null;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\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 * @minLength 1\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 BuyerInfo {\n /**\n * Email of the customer.\n * @format EMAIL\n */\n buyerEmail?: string | null;\n /**\n * Member id of the customer.\n * @format GUID\n */\n memberId?: string | null;\n}\n\nexport interface ShippingInfo {\n /** Address (if applicable). */\n address?: Address;\n /**\n * Preferred shipping option code. For example, \"usps_std_overnight\".\n * @minLength 1\n * @maxLength 100\n */\n preferredShippingOptionCode?: string | null;\n}\n\nexport interface Address {\n /**\n * Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.\n * @format COUNTRY\n */\n country?: string | null;\n /**\n * Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.\n * @maxLength 50\n */\n subdivision?: string | null;\n /**\n * City name.\n * @maxLength 50\n */\n city?: string | null;\n}\n\nexport interface GetAppliedDiscountsResponse {\n /** All eligible discounts. */\n appliedDiscounts?: AppliedDiscount[];\n}\n\nexport interface AppliedDiscount {\n /** Discount type. */\n discountType?: TypeWithLiterals;\n /**\n * IDs of line items the discount applies to, in GUID format.\n * @format GUID\n * @maxSize 1000\n */\n lineItemIds?: string[];\n /** Applied discount rule. */\n appliedDiscountRule?: AppliedDiscountRule;\n}\n\nexport interface AppliedDiscountRule {\n /**\n * Applied discount rule ID.\n * @format GUID\n */\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?: DiscountTypeWithLiterals;\n}\n\nexport interface DiscountRuleName {\n /**\n * Original discount rule name (in site's default language).\n * @minLength 1\n * @maxLength 256\n */\n original?: string;\n /**\n * Translated discount rule name according to buyer language.\n *\n * Default: `original`\n * @minLength 1\n * @maxLength 500\n */\n translated?: string | null;\n}\n\nexport interface MultiCurrencyPrice {\n /**\n * Amount.\n * @decimalValue options { gte:0, lte:1000000000000000 }\n */\n amount?: string;\n /**\n * Converted amount.\n * @readonly\n * @decimalValue options { gte:0, lte:1000000000000000 }\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 /** 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 DiscountRuleUsageLimitReached {\n /** Discount Rule */\n rule?: DiscountRule;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\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/** @docsIgnore */\nexport type CreateDiscountRuleApplicationErrors =\n | {\n code?: 'MAX_DISCOUNT_RULES_REACHED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MAX_QUANTITY_BASED_DISCOUNTS_REACHED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type CreateDiscountRuleValidationErrors =\n | {\n ruleName?: 'INVALID_ACTIVE_TIME_RANGE';\n }\n | {\n ruleName?: 'INVALID_EMPTY_DISCOUNT';\n }\n | {\n ruleName?: 'INVALID_DISCOUNT_TYPE';\n }\n | {\n ruleName?: 'MISSING_SUBTOTAL_RANGE';\n }\n | {\n ruleName?: 'MISSING_ITEM_QUANTITY_RANGE';\n }\n | {\n ruleName?: 'INVALID_SUBTOTAL_RANGE';\n }\n | {\n ruleName?: 'INVALID_ITEM_QUANTITY_RANGE';\n }\n | {\n ruleName?: 'INVALID_TARGET_TYPE_FIELD';\n }\n | {\n ruleName?: 'OPERATOR_TOO_DEEPLY_NESTED';\n }\n | {\n ruleName?: 'INVALID_SCOPE_TYPE';\n }\n | {\n ruleName?: 'INVALID_TRIGGER_TYPE';\n }\n | {\n ruleName?: 'INVALID_SETTINGS_SUBJECT_TYPE';\n }\n | {\n ruleName?: 'INVALID_CUSTOMER_BUY_CONDITION';\n }\n | {\n ruleName?: 'INVALID_SCOPE';\n };\n\nexport interface BaseEventMetadata {\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}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 /** @hidden */\n modifiedFields: Record<string, any>;\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 Manage Stores\n * @permissionScopeId SCOPE.STORES.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 * @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService\n * @slug 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 * @applicableIdentity APP\n * @returns Discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.CreateDiscountRule\n */\nexport async function createDiscountRule(\n discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`, 2>\n): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n > & {\n __applicationErrorsType?: CreateDiscountRuleApplicationErrors;\n __validationErrorsType?: CreateDiscountRuleValidationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 * @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<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 * @applicableIdentity APP\n * @returns Updated discount rule.\n * @fqn com.wix.ecom.discounts.DiscountRuleService.UpdateDiscountRule\n */\nexport async function updateDiscountRule(\n _id: string,\n discountRule: NonNullablePaths<UpdateDiscountRule, `revision`, 2>\n): Promise<\n NonNullablePaths<\n DiscountRule,\n | `trigger.and.triggers`\n | `trigger.or.triggers`\n | `trigger.customTrigger._id`\n | `trigger.customTrigger.appId`\n | `trigger.subtotalRange.scopes`\n | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId`\n | `trigger.subtotalRange.scopes.${number}.customFilter.appId`\n | `trigger.subtotalRange.scopes.${number}._id`\n | `trigger.subtotalRange.scopes.${number}.type`\n | `trigger.itemQuantityRange.scopes`\n | `trigger.triggerType`\n | `discounts.values`\n | `discounts.values.${number}.percentage`\n | `discounts.values.${number}.fixedAmount`\n | `discounts.values.${number}.fixedPrice`\n | `discounts.values.${number}.targetType`\n | `discounts.values.${number}.discountType`\n | `status`\n | `usageCount`,\n 7\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 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 * @format GUID\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 /**\n * Discount rule name.\n * @minLength 1\n * @maxLength 50\n */\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?: StatusWithLiterals;\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 * @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 * @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(\n transformPaths(data, [])\n );\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 | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 gt: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 le: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\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 lt: (\n propertyName:\n | '_id'\n | 'revision'\n | '_createdDate'\n | '_updatedDate'\n | 'name'\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\n/**\n * @hidden\n * @fqn com.wix.ecom.discounts.DiscountRuleService.QueryDiscountRules\n * @requiredField query\n */\nexport async function typedQueryDiscountRules(\n query: DiscountRuleQuery\n): Promise<\n NonNullablePaths<\n QueryDiscountRulesResponse,\n | `discountRules`\n | `discountRules.${number}.trigger.customTrigger._id`\n | `discountRules.${number}.trigger.customTrigger.appId`\n | `discountRules.${number}.trigger.triggerType`\n | `discountRules.${number}.status`\n | `discountRules.${number}.usageCount`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts =\n ambassadorWixEcomDiscountsV1DiscountRule.queryDiscountRules(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DiscountRuleQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: [\n '_createdDate',\n '_id',\n '_updatedDate',\n 'active',\n 'activeTimeInfo.end',\n 'activeTimeInfo.start',\n 'name',\n 'revision'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n DiscountRule,\n DiscountRuleQuerySpec\n>;\nexport type DiscountRuleQuery = {\n /** \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 */\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 filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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};\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 '*.dev.wix-code.com': [\n {\n srcPath: '/ecom/discounts/v1/discount-rules',\n destPath: '/v1/discount-rules',\n },\n ],\n _: [\n {\n srcPath: '/ecom/discounts/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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 typedQueryDiscountRules as publicTypedQueryDiscountRules,\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 {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n DiscountRuleQuery,\n DiscountRulesQueryBuilder,\n typedQueryDiscountRules as universalTypedQueryDiscountRules,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\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\nfunction customQueryDiscountRules(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryDiscountRules(httpClient)(),\n typedQueryFunction: (query: DiscountRuleQuery) =>\n publicTypedQueryDiscountRules(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): DiscountRulesQueryBuilder;\n function overloadedQuery(\n query: DiscountRuleQuery\n ): ReturnType<typeof universalTypedQueryDiscountRules>;\n function overloadedQuery(query?: DiscountRuleQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\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 customQueryDiscountRules> &\n typeof customQueryDiscountRules\n> = /*#__PURE__*/ createRESTModule(customQueryDiscountRules);\n/**\n * Triggered when a discount rule is created.\n */\nexport const onDiscountRuleCreated: BuildEventDefinition<\n typeof publicOnDiscountRuleCreated\n> &\n typeof publicOnDiscountRuleCreated = createEventModule(\n publicOnDiscountRuleCreated\n);\n/**\n * Triggered when a discount rule is deleted.\n */\nexport const onDiscountRuleDeleted: BuildEventDefinition<\n typeof publicOnDiscountRuleDeleted\n> &\n typeof publicOnDiscountRuleDeleted = createEventModule(\n publicOnDiscountRuleDeleted\n);\n/**\n * Triggered when a discount rule is updated.\n */\nexport const onDiscountRuleUpdated: BuildEventDefinition<\n typeof publicOnDiscountRuleUpdated\n> &\n typeof publicOnDiscountRuleUpdated = createEventModule(\n publicOnDiscountRuleUpdated\n);\n\nexport {\n ScopeType,\n EligibilityType,\n TriggerType,\n DayOfWeek,\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 CustomerEligibility,\n CustomerEligibilityOptionsOneOf,\n ContactSegments,\n ContactTags,\n TagReference,\n IndividualMembers,\n ActiveTimeInfo,\n Recurrence,\n TimeOfDay,\n TimeWindow,\n WeeklySchedule,\n Discounts,\n Discount,\n DiscountDiscountOneOf,\n SpecificItemsInfo,\n QuantityBased,\n DiscountConfig,\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 BuyerInfo,\n ShippingInfo,\n Address,\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 BaseEventMetadata,\n EventMetadata,\n DiscountRuleCreatedEnvelope,\n DiscountRuleDeletedEnvelope,\n DiscountRuleUpdatedEnvelope,\n UpdateDiscountRule,\n DiscountRulesQueryResult,\n DiscountRulesQueryBuilder,\n DiscountRuleQuerySpec,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\nexport {\n ScopeTypeWithLiterals,\n EligibilityTypeWithLiterals,\n TriggerTypeWithLiterals,\n DayOfWeekWithLiterals,\n TypeWithLiterals,\n DiscountTypeWithLiterals,\n StatusWithLiterals,\n AppliedSubjectTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateDiscountRuleApplicationErrors,\n CreateDiscountRuleValidationErrors,\n CommonQueryWithEntityContext,\n DiscountRuleQuery,\n} from './ecom-discounts-v1-discount-rule-discount-rules.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,gBAA6C;AAC7C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AAqB;AAAA,UAC7B,EAAE,MAAM,6BAA6B;AAAA,UACrC,EAAE,MAAM,6BAA6B;AAAA,UACrC,EAAE,MAAM,sCAAsC;AAAA,UAC9C,EAAE,MAAM,oCAAoC;AAAA,QAC9C;AAAA,MACF;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qCAAqC;AAAA,UAC7C,EAAE,MAAM,6CAA6C;AAAA,QACvD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA+B;;;AG3U/B,IAAAC,uBAAiC;AACjC,sCAAkC;AAOlC,iCAA0C;AAU1C,SAAS,yBAAyB,YAAwB;AACxD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,MAAMC,oBAAyB,UAAU,EAAE;AAAA,IACjE,oBAAoB,CAAC,UACnBC,yBAA8B,UAAU,EAAE,KAAK;AAAA,IACjD,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAAgC;AACvD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,mBAEK,2DAAiBA,gBAAqB;AACjD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAML,sBAGK,2DAAiB,wBAAwB;AAIpD,IAAMM,6BAG0B;AAAA,EACrC;AACF;AAIO,IAAMC,6BAG0B;AAAA,EACrC;AACF;AAIO,IAAMC,6BAG0B;AAAA,EACrC;AACF;","names":["createDiscountRule","deleteDiscountRule","getDiscountRule","onDiscountRuleCreated","onDiscountRuleDeleted","onDiscountRuleUpdated","queryDiscountRules","updateDiscountRule","import_rename_all_nested_keys","import_float","import_timestamp","import_transform_paths","import_float","import_timestamp","import_rest_modules","payload","import_transform_paths","ScopeType","EligibilityType","TriggerType","DayOfWeek","Type","DiscountType","Status","AppliedSubjectType","SortOrder","WebhookIdentityType","createDiscountRule","sdkTransformError","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","queryDiscountRules","typedQueryDiscountRules","import_rest_modules","queryDiscountRules","typedQueryDiscountRules","createDiscountRule","getDiscountRule","updateDiscountRule","deleteDiscountRule","onDiscountRuleCreated","onDiscountRuleDeleted","onDiscountRuleUpdated"]}
@@ -1177,6 +1177,7 @@ declare function onDiscountRuleDeleted(handler: (event: DiscountRuleDeletedEnvel
1177
1177
  interface DiscountRuleUpdatedEnvelope {
1178
1178
  entity: DiscountRule;
1179
1179
  metadata: EventMetadata;
1180
+ /** @hidden */
1180
1181
  modifiedFields: Record<string, any>;
1181
1182
  }
1182
1183
  /**