@wix/auto_sdk_ecom_discount-rules 1.0.6 → 1.0.7
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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +36 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +271 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +123 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +98 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +76 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
- package/build/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.mts → cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +359 -0
- package/build/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +25 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +263 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +92 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +82 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +73 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
- package/build/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.ts → es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +328 -0
- package/build/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +36 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +271 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +123 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +98 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +76 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
- package/build/internal/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.ts → cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +359 -0
- package/build/internal/cjs/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.d.ts +25 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js +25 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.context.js.map +1 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.d.ts +48 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js +263 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.http.js.map +1 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.d.ts +23 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js +92 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.meta.js.map +1 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.d.ts +80 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js +82 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.public.js.map +1 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.d.ts +823 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js +73 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.types.js.map +1 -0
- package/build/internal/{ecom-discounts-v1-discount-rule-discount-rules.universal--1DNaPHt.d.mts → es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.d.ts} +258 -78
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js +328 -0
- package/build/internal/es/src/ecom-discounts-v1-discount-rule-discount-rules.universal.js.map +1 -0
- package/package.json +11 -12
- package/build/index.d.mts +0 -96
- package/build/index.d.ts +0 -96
- package/build/index.js +0 -606
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -567
- package/build/index.mjs.map +0 -1
- package/build/internal/index.d.mts +0 -96
- package/build/internal/index.d.ts +0 -96
- package/build/internal/index.js +0 -606
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -567
- package/build/internal/index.mjs.map +0 -1
- package/build/internal/meta.d.mts +0 -472
- package/build/internal/meta.d.ts +0 -472
- package/build/internal/meta.js +0 -352
- package/build/internal/meta.js.map +0 -1
- package/build/internal/meta.mjs +0 -321
- package/build/internal/meta.mjs.map +0 -1
- package/build/meta.d.mts +0 -472
- package/build/meta.d.ts +0 -472
- package/build/meta.js +0 -352
- package/build/meta.js.map +0 -1
- package/build/meta.mjs +0 -321
- package/build/meta.mjs.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
export interface DiscountRule {
|
|
2
3
|
/**
|
|
3
4
|
* Discount rule ID.
|
|
4
5
|
* @format GUID
|
|
@@ -64,7 +65,7 @@ interface DiscountRule {
|
|
|
64
65
|
usageCount?: number;
|
|
65
66
|
}
|
|
66
67
|
/** DiscountTrigger - description of a set of conditions, that if met, will trigger the associated rule actions */
|
|
67
|
-
interface DiscountTrigger extends DiscountTriggerTriggerOneOf {
|
|
68
|
+
export interface DiscountTrigger extends DiscountTriggerTriggerOneOf {
|
|
68
69
|
/** Chain multiple triggers with the `and` operator. */
|
|
69
70
|
and?: And;
|
|
70
71
|
/** Chain multiple triggers with the `or` operator. */
|
|
@@ -86,7 +87,7 @@ interface DiscountTrigger extends DiscountTriggerTriggerOneOf {
|
|
|
86
87
|
triggerType?: TriggerType;
|
|
87
88
|
}
|
|
88
89
|
/** @oneof */
|
|
89
|
-
interface DiscountTriggerTriggerOneOf {
|
|
90
|
+
export interface DiscountTriggerTriggerOneOf {
|
|
90
91
|
/** Chain multiple triggers with the `and` operator. */
|
|
91
92
|
and?: And;
|
|
92
93
|
/** Chain multiple triggers with the `or` operator. */
|
|
@@ -104,7 +105,7 @@ interface DiscountTriggerTriggerOneOf {
|
|
|
104
105
|
* 2. Specific catalog item - type = CATALOG_ITEM, CatalogItemFilter with `catalog_app_id` + `catalog_item_ids`
|
|
105
106
|
* 3. External catalog filter - type = CUSTOM_FILTER, CustomFilter with 'app_id' + 'params'
|
|
106
107
|
*/
|
|
107
|
-
interface Scope extends ScopeScopeItemsOneOf {
|
|
108
|
+
export interface Scope extends ScopeScopeItemsOneOf {
|
|
108
109
|
/** Catalog item filter. Must be passed with `type."CATALOG_ITEM"`. */
|
|
109
110
|
catalogItemFilter?: CatalogItemFilter;
|
|
110
111
|
/** Custom filter. Must be passed with `type."CATALOG_ITEM"`. */
|
|
@@ -119,20 +120,20 @@ interface Scope extends ScopeScopeItemsOneOf {
|
|
|
119
120
|
type?: ScopeType;
|
|
120
121
|
}
|
|
121
122
|
/** @oneof */
|
|
122
|
-
interface ScopeScopeItemsOneOf {
|
|
123
|
+
export interface ScopeScopeItemsOneOf {
|
|
123
124
|
/** Catalog item filter. Must be passed with `type."CATALOG_ITEM"`. */
|
|
124
125
|
catalogItemFilter?: CatalogItemFilter;
|
|
125
126
|
/** Custom filter. Must be passed with `type."CATALOG_ITEM"`. */
|
|
126
127
|
customFilter?: CustomFilter;
|
|
127
128
|
}
|
|
128
|
-
declare enum ScopeType {
|
|
129
|
+
export declare enum ScopeType {
|
|
129
130
|
UNDEFINED_SCOPE = "UNDEFINED_SCOPE",
|
|
130
131
|
/** Specific catalog items */
|
|
131
132
|
CATALOG_ITEM = "CATALOG_ITEM",
|
|
132
133
|
/** Specific items by custom filters */
|
|
133
134
|
CUSTOM_FILTER = "CUSTOM_FILTER"
|
|
134
135
|
}
|
|
135
|
-
interface CatalogItemFilter {
|
|
136
|
+
export interface CatalogItemFilter {
|
|
136
137
|
/**
|
|
137
138
|
* Catalog App ID. For example, the Wix Stores, Wix Bookings, or 3rd-party `appId`.
|
|
138
139
|
* @format GUID
|
|
@@ -146,7 +147,7 @@ interface CatalogItemFilter {
|
|
|
146
147
|
*/
|
|
147
148
|
catalogItemIds?: string[];
|
|
148
149
|
}
|
|
149
|
-
interface CustomFilter {
|
|
150
|
+
export interface CustomFilter {
|
|
150
151
|
/**
|
|
151
152
|
* Custom filter app ID, when relevant.
|
|
152
153
|
* @format GUID
|
|
@@ -159,7 +160,7 @@ interface CustomFilter {
|
|
|
159
160
|
*/
|
|
160
161
|
params?: Record<string, any> | null;
|
|
161
162
|
}
|
|
162
|
-
interface And {
|
|
163
|
+
export interface And {
|
|
163
164
|
/**
|
|
164
165
|
* List of triggers to have an "AND" operator between their results.
|
|
165
166
|
* @minSize 2
|
|
@@ -167,7 +168,7 @@ interface And {
|
|
|
167
168
|
*/
|
|
168
169
|
triggers?: DiscountTrigger[];
|
|
169
170
|
}
|
|
170
|
-
interface Or {
|
|
171
|
+
export interface Or {
|
|
171
172
|
/**
|
|
172
173
|
* List of triggers to have an "OR" operator between their results.
|
|
173
174
|
* @minSize 2
|
|
@@ -175,7 +176,7 @@ interface Or {
|
|
|
175
176
|
*/
|
|
176
177
|
triggers?: DiscountTrigger[];
|
|
177
178
|
}
|
|
178
|
-
interface Custom {
|
|
179
|
+
export interface Custom {
|
|
179
180
|
/**
|
|
180
181
|
* Trigger ID.
|
|
181
182
|
* @minLength 1
|
|
@@ -188,7 +189,7 @@ interface Custom {
|
|
|
188
189
|
*/
|
|
189
190
|
appId?: string;
|
|
190
191
|
}
|
|
191
|
-
interface SubtotalRange {
|
|
192
|
+
export interface SubtotalRange {
|
|
192
193
|
/**
|
|
193
194
|
* Relevant scopes for `"SPECIFIC_ITEMS"` target type.
|
|
194
195
|
* @maxSize 50
|
|
@@ -205,7 +206,7 @@ interface SubtotalRange {
|
|
|
205
206
|
*/
|
|
206
207
|
to?: string | null;
|
|
207
208
|
}
|
|
208
|
-
interface ItemQuantityRange {
|
|
209
|
+
export interface ItemQuantityRange {
|
|
209
210
|
/**
|
|
210
211
|
* Relevant scopes for `"SPECIFIC_ITEMS"` target type.
|
|
211
212
|
* @maxSize 50
|
|
@@ -222,7 +223,7 @@ interface ItemQuantityRange {
|
|
|
222
223
|
*/
|
|
223
224
|
to?: number | null;
|
|
224
225
|
}
|
|
225
|
-
declare enum TriggerType {
|
|
226
|
+
export declare enum TriggerType {
|
|
226
227
|
UNDEFINED = "UNDEFINED",
|
|
227
228
|
/** Operator used for chaining multiple triggers. Currently 1 `AND` chain operator is supported. */
|
|
228
229
|
AND = "AND",
|
|
@@ -235,13 +236,13 @@ declare enum TriggerType {
|
|
|
235
236
|
/** Chain multiple triggers with OR operator */
|
|
236
237
|
OR = "OR"
|
|
237
238
|
}
|
|
238
|
-
interface ActiveTimeInfo {
|
|
239
|
+
export interface ActiveTimeInfo {
|
|
239
240
|
/** 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. */
|
|
240
241
|
start?: Date | null;
|
|
241
242
|
/** 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. */
|
|
242
243
|
end?: Date | null;
|
|
243
244
|
}
|
|
244
|
-
interface Discounts {
|
|
245
|
+
export interface Discounts {
|
|
245
246
|
/**
|
|
246
247
|
* Discounts.
|
|
247
248
|
* @minSize 1
|
|
@@ -249,7 +250,7 @@ interface Discounts {
|
|
|
249
250
|
*/
|
|
250
251
|
values?: Discount[];
|
|
251
252
|
}
|
|
252
|
-
interface Discount extends DiscountDiscountOneOf {
|
|
253
|
+
export interface Discount extends DiscountDiscountOneOf {
|
|
253
254
|
/**
|
|
254
255
|
* Percentage to discount from original price.
|
|
255
256
|
* @min 0.1
|
|
@@ -284,7 +285,7 @@ interface Discount extends DiscountDiscountOneOf {
|
|
|
284
285
|
discountType?: DiscountType;
|
|
285
286
|
}
|
|
286
287
|
/** @oneof */
|
|
287
|
-
interface DiscountDiscountOneOf {
|
|
288
|
+
export interface DiscountDiscountOneOf {
|
|
288
289
|
/**
|
|
289
290
|
* Percentage to discount from original price.
|
|
290
291
|
* @min 0.1
|
|
@@ -302,13 +303,13 @@ interface DiscountDiscountOneOf {
|
|
|
302
303
|
*/
|
|
303
304
|
fixedPrice?: string;
|
|
304
305
|
}
|
|
305
|
-
declare enum Type {
|
|
306
|
+
export declare enum Type {
|
|
306
307
|
/** Target type is not defined */
|
|
307
308
|
UNDEFINED = "UNDEFINED",
|
|
308
309
|
/** Target type is a set of specific items */
|
|
309
310
|
SPECIFIC_ITEMS = "SPECIFIC_ITEMS"
|
|
310
311
|
}
|
|
311
|
-
interface SpecificItemsInfo {
|
|
312
|
+
export interface SpecificItemsInfo {
|
|
312
313
|
/**
|
|
313
314
|
* All associated scopes for `"SPECIFIC_ITEMS"` target type.
|
|
314
315
|
* @minSize 1
|
|
@@ -316,7 +317,7 @@ interface SpecificItemsInfo {
|
|
|
316
317
|
*/
|
|
317
318
|
scopes?: Scope[];
|
|
318
319
|
}
|
|
319
|
-
declare enum DiscountType {
|
|
320
|
+
export declare enum DiscountType {
|
|
320
321
|
UNDEFINED = "UNDEFINED",
|
|
321
322
|
/** Price is reduced by percentage value. */
|
|
322
323
|
PERCENTAGE = "PERCENTAGE",
|
|
@@ -325,7 +326,7 @@ declare enum DiscountType {
|
|
|
325
326
|
/** Price will be set to fixed amount. */
|
|
326
327
|
FIXED_PRICE = "FIXED_PRICE"
|
|
327
328
|
}
|
|
328
|
-
interface BuyXGetYInfo {
|
|
329
|
+
export interface BuyXGetYInfo {
|
|
329
330
|
/** Information about which items must be in the cart (buy X) for the discount to apply (get Y). */
|
|
330
331
|
customerBuys?: CustomerBuy;
|
|
331
332
|
/** Information about which items will be discounted (get Y). */
|
|
@@ -339,7 +340,7 @@ interface BuyXGetYInfo {
|
|
|
339
340
|
*/
|
|
340
341
|
limit?: number | null;
|
|
341
342
|
}
|
|
342
|
-
interface CustomerBuy extends CustomerBuyConditionOneOf {
|
|
343
|
+
export interface CustomerBuy extends CustomerBuyConditionOneOf {
|
|
343
344
|
/**
|
|
344
345
|
* Minimum number of items the customer must add to the cart to be eligible for a discount.
|
|
345
346
|
* @min 1
|
|
@@ -358,7 +359,7 @@ interface CustomerBuy extends CustomerBuyConditionOneOf {
|
|
|
358
359
|
scopes?: Scope[];
|
|
359
360
|
}
|
|
360
361
|
/** @oneof */
|
|
361
|
-
interface CustomerBuyConditionOneOf {
|
|
362
|
+
export interface CustomerBuyConditionOneOf {
|
|
362
363
|
/**
|
|
363
364
|
* Minimum number of items the customer must add to the cart to be eligible for a discount.
|
|
364
365
|
* @min 1
|
|
@@ -370,7 +371,7 @@ interface CustomerBuyConditionOneOf {
|
|
|
370
371
|
*/
|
|
371
372
|
minimumSpend?: string | null;
|
|
372
373
|
}
|
|
373
|
-
interface CustomerGet {
|
|
374
|
+
export interface CustomerGet {
|
|
374
375
|
/**
|
|
375
376
|
* Exact number of items in the cart that will be discounted.
|
|
376
377
|
* If the cart contains fewer items than the value of quantity, the discount will not apply.
|
|
@@ -384,7 +385,7 @@ interface CustomerGet {
|
|
|
384
385
|
*/
|
|
385
386
|
scopes?: Scope[];
|
|
386
387
|
}
|
|
387
|
-
declare enum Status {
|
|
388
|
+
export declare enum Status {
|
|
388
389
|
/** Rule status is not defined. */
|
|
389
390
|
UNDEFINED = "UNDEFINED",
|
|
390
391
|
/** Rule status is live. */
|
|
@@ -395,7 +396,7 @@ declare enum Status {
|
|
|
395
396
|
PENDING = "PENDING"
|
|
396
397
|
}
|
|
397
398
|
/** The discount settings */
|
|
398
|
-
interface DiscountSettings {
|
|
399
|
+
export interface DiscountSettings {
|
|
399
400
|
/** Discount applies to either `ALL_ITEMS`, or to the `LOWEST_PRICED_ITEM`. */
|
|
400
401
|
appliesTo?: AppliedSubjectType;
|
|
401
402
|
/**
|
|
@@ -419,14 +420,14 @@ interface DiscountSettings {
|
|
|
419
420
|
usageLimitPerUser?: number | null;
|
|
420
421
|
}
|
|
421
422
|
/** TODO: check if can be removed */
|
|
422
|
-
declare enum AppliedSubjectType {
|
|
423
|
+
export declare enum AppliedSubjectType {
|
|
423
424
|
UNDEFINED = "UNDEFINED",
|
|
424
425
|
/** Discount applies to all items at checkout. */
|
|
425
426
|
ALL_ITEMS = "ALL_ITEMS",
|
|
426
427
|
/** Discount applies to the lowest priced item at checkout. */
|
|
427
428
|
LOWEST_PRICED_ITEM = "LOWEST_PRICED_ITEM"
|
|
428
429
|
}
|
|
429
|
-
interface ExtendedFields {
|
|
430
|
+
export interface ExtendedFields {
|
|
430
431
|
/**
|
|
431
432
|
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
432
433
|
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
@@ -437,47 +438,47 @@ interface ExtendedFields {
|
|
|
437
438
|
*/
|
|
438
439
|
namespaces?: Record<string, Record<string, any>>;
|
|
439
440
|
}
|
|
440
|
-
interface CreateDiscountRuleRequest {
|
|
441
|
+
export interface CreateDiscountRuleRequest {
|
|
441
442
|
/** Discount rule info. */
|
|
442
443
|
discountRule: DiscountRule;
|
|
443
444
|
}
|
|
444
|
-
interface CreateDiscountRuleResponse {
|
|
445
|
+
export interface CreateDiscountRuleResponse {
|
|
445
446
|
/** Discount rule. */
|
|
446
447
|
discountRule?: DiscountRule;
|
|
447
448
|
}
|
|
448
|
-
interface GetDiscountRuleRequest {
|
|
449
|
+
export interface GetDiscountRuleRequest {
|
|
449
450
|
/**
|
|
450
451
|
* ID of the discount rule to retrieve.
|
|
451
452
|
* @format GUID
|
|
452
453
|
*/
|
|
453
454
|
discountRuleId: string;
|
|
454
455
|
}
|
|
455
|
-
interface GetDiscountRuleResponse {
|
|
456
|
+
export interface GetDiscountRuleResponse {
|
|
456
457
|
/** The requested discount rule. */
|
|
457
458
|
discountRule?: DiscountRule;
|
|
458
459
|
}
|
|
459
|
-
interface UpdateDiscountRuleRequest {
|
|
460
|
+
export interface UpdateDiscountRuleRequest {
|
|
460
461
|
/** Discount rule info. */
|
|
461
462
|
discountRule: DiscountRule;
|
|
462
463
|
}
|
|
463
|
-
interface UpdateDiscountRuleResponse {
|
|
464
|
+
export interface UpdateDiscountRuleResponse {
|
|
464
465
|
/** Updated discount rule. */
|
|
465
466
|
discountRule?: DiscountRule;
|
|
466
467
|
}
|
|
467
|
-
interface DeleteDiscountRuleRequest {
|
|
468
|
+
export interface DeleteDiscountRuleRequest {
|
|
468
469
|
/**
|
|
469
470
|
* ID of the discount rule to delete.
|
|
470
471
|
* @format GUID
|
|
471
472
|
*/
|
|
472
473
|
discountRuleId: string;
|
|
473
474
|
}
|
|
474
|
-
interface DeleteDiscountRuleResponse {
|
|
475
|
+
export interface DeleteDiscountRuleResponse {
|
|
475
476
|
}
|
|
476
|
-
interface QueryDiscountRulesRequest {
|
|
477
|
+
export interface QueryDiscountRulesRequest {
|
|
477
478
|
/** Query options. */
|
|
478
479
|
query?: PlatformQuery;
|
|
479
480
|
}
|
|
480
|
-
interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
481
|
+
export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
481
482
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
482
483
|
paging?: PlatformPaging;
|
|
483
484
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
@@ -488,13 +489,13 @@ interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
|
488
489
|
sort?: Sorting[];
|
|
489
490
|
}
|
|
490
491
|
/** @oneof */
|
|
491
|
-
interface PlatformQueryPagingMethodOneOf {
|
|
492
|
+
export interface PlatformQueryPagingMethodOneOf {
|
|
492
493
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
493
494
|
paging?: PlatformPaging;
|
|
494
495
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
495
496
|
cursorPaging?: CursorPaging;
|
|
496
497
|
}
|
|
497
|
-
interface Sorting {
|
|
498
|
+
export interface Sorting {
|
|
498
499
|
/**
|
|
499
500
|
* Name of the field to sort by.
|
|
500
501
|
* @maxLength 512
|
|
@@ -503,11 +504,11 @@ interface Sorting {
|
|
|
503
504
|
/** Sort order. */
|
|
504
505
|
order?: SortOrder;
|
|
505
506
|
}
|
|
506
|
-
declare enum SortOrder {
|
|
507
|
+
export declare enum SortOrder {
|
|
507
508
|
ASC = "ASC",
|
|
508
509
|
DESC = "DESC"
|
|
509
510
|
}
|
|
510
|
-
interface PlatformPaging {
|
|
511
|
+
export interface PlatformPaging {
|
|
511
512
|
/**
|
|
512
513
|
* Number of items to load.
|
|
513
514
|
* @max 100
|
|
@@ -516,7 +517,7 @@ interface PlatformPaging {
|
|
|
516
517
|
/** Number of items to skip in the current sort order. */
|
|
517
518
|
offset?: number | null;
|
|
518
519
|
}
|
|
519
|
-
interface CursorPaging {
|
|
520
|
+
export interface CursorPaging {
|
|
520
521
|
/**
|
|
521
522
|
* Maximum number of items to return in the results.
|
|
522
523
|
* @max 100
|
|
@@ -531,13 +532,13 @@ interface CursorPaging {
|
|
|
531
532
|
*/
|
|
532
533
|
cursor?: string | null;
|
|
533
534
|
}
|
|
534
|
-
interface QueryDiscountRulesResponse {
|
|
535
|
+
export interface QueryDiscountRulesResponse {
|
|
535
536
|
/** List of discount rules. */
|
|
536
537
|
discountRules?: DiscountRule[];
|
|
537
538
|
/** Details on the paged set of results returned. */
|
|
538
539
|
pagingMetadata?: PlatformPagingMetadata;
|
|
539
540
|
}
|
|
540
|
-
interface PlatformPagingMetadata {
|
|
541
|
+
export interface PlatformPagingMetadata {
|
|
541
542
|
/** The number of items returned in this response. */
|
|
542
543
|
count?: number | null;
|
|
543
544
|
/** The offset which was requested. Returned if offset paging was used. */
|
|
@@ -547,7 +548,7 @@ interface PlatformPagingMetadata {
|
|
|
547
548
|
/** Cursors to navigate through result pages. Returned if cursor paging was used. */
|
|
548
549
|
cursors?: Cursors;
|
|
549
550
|
}
|
|
550
|
-
interface Cursors {
|
|
551
|
+
export interface Cursors {
|
|
551
552
|
/**
|
|
552
553
|
* Cursor string pointing to the next page in the list of results.
|
|
553
554
|
* @maxLength 16000
|
|
@@ -559,7 +560,7 @@ interface Cursors {
|
|
|
559
560
|
*/
|
|
560
561
|
prev?: string | null;
|
|
561
562
|
}
|
|
562
|
-
interface GetAppliedDiscountsRequest {
|
|
563
|
+
export interface GetAppliedDiscountsRequest {
|
|
563
564
|
/**
|
|
564
565
|
* Line items for which to check for discount rules.
|
|
565
566
|
* @maxSize 1000
|
|
@@ -571,7 +572,7 @@ interface GetAppliedDiscountsRequest {
|
|
|
571
572
|
*/
|
|
572
573
|
purchaseFlowId?: string | null;
|
|
573
574
|
}
|
|
574
|
-
interface LineItem {
|
|
575
|
+
export interface LineItem {
|
|
575
576
|
/**
|
|
576
577
|
* Line item ID.
|
|
577
578
|
* @minLength 1
|
|
@@ -592,7 +593,7 @@ interface LineItem {
|
|
|
592
593
|
price?: string;
|
|
593
594
|
}
|
|
594
595
|
/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
|
|
595
|
-
interface CatalogReference {
|
|
596
|
+
export interface CatalogReference {
|
|
596
597
|
/**
|
|
597
598
|
* ID of the item within the catalog it belongs to.
|
|
598
599
|
* @minLength 1
|
|
@@ -618,11 +619,11 @@ interface CatalogReference {
|
|
|
618
619
|
*/
|
|
619
620
|
options?: Record<string, any> | null;
|
|
620
621
|
}
|
|
621
|
-
interface GetAppliedDiscountsResponse {
|
|
622
|
+
export interface GetAppliedDiscountsResponse {
|
|
622
623
|
/** All eligible discounts. */
|
|
623
624
|
appliedDiscounts?: AppliedDiscount[];
|
|
624
625
|
}
|
|
625
|
-
interface AppliedDiscount {
|
|
626
|
+
export interface AppliedDiscount {
|
|
626
627
|
/** Discount type. */
|
|
627
628
|
discountType?: Type;
|
|
628
629
|
/**
|
|
@@ -634,7 +635,7 @@ interface AppliedDiscount {
|
|
|
634
635
|
/** Applied discount rule. */
|
|
635
636
|
appliedDiscountRule?: AppliedDiscountRule;
|
|
636
637
|
}
|
|
637
|
-
interface AppliedDiscountRule {
|
|
638
|
+
export interface AppliedDiscountRule {
|
|
638
639
|
/**
|
|
639
640
|
* Applied discount rule ID.
|
|
640
641
|
* @format GUID
|
|
@@ -647,7 +648,7 @@ interface AppliedDiscountRule {
|
|
|
647
648
|
/** Discount rule type. */
|
|
648
649
|
discountRuleType?: DiscountType;
|
|
649
650
|
}
|
|
650
|
-
interface DiscountRuleName {
|
|
651
|
+
export interface DiscountRuleName {
|
|
651
652
|
/**
|
|
652
653
|
* Original discount rule name (in site's default language).
|
|
653
654
|
* @minLength 1
|
|
@@ -663,7 +664,7 @@ interface DiscountRuleName {
|
|
|
663
664
|
*/
|
|
664
665
|
translated?: string | null;
|
|
665
666
|
}
|
|
666
|
-
interface MultiCurrencyPrice {
|
|
667
|
+
export interface MultiCurrencyPrice {
|
|
667
668
|
/**
|
|
668
669
|
* Amount.
|
|
669
670
|
* @decimalValue options { gte:0, lte:1000000000000000 }
|
|
@@ -686,7 +687,7 @@ interface MultiCurrencyPrice {
|
|
|
686
687
|
*/
|
|
687
688
|
formattedConvertedAmount?: string;
|
|
688
689
|
}
|
|
689
|
-
interface DomainEvent extends DomainEventBodyOneOf {
|
|
690
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
690
691
|
createdEvent?: EntityCreatedEvent;
|
|
691
692
|
updatedEvent?: EntityUpdatedEvent;
|
|
692
693
|
deletedEvent?: EntityDeletedEvent;
|
|
@@ -729,19 +730,19 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
729
730
|
entityEventSequence?: string | null;
|
|
730
731
|
}
|
|
731
732
|
/** @oneof */
|
|
732
|
-
interface DomainEventBodyOneOf {
|
|
733
|
+
export interface DomainEventBodyOneOf {
|
|
733
734
|
createdEvent?: EntityCreatedEvent;
|
|
734
735
|
updatedEvent?: EntityUpdatedEvent;
|
|
735
736
|
deletedEvent?: EntityDeletedEvent;
|
|
736
737
|
actionEvent?: ActionEvent;
|
|
737
738
|
}
|
|
738
|
-
interface EntityCreatedEvent {
|
|
739
|
+
export interface EntityCreatedEvent {
|
|
739
740
|
entity?: string;
|
|
740
741
|
}
|
|
741
|
-
interface RestoreInfo {
|
|
742
|
+
export interface RestoreInfo {
|
|
742
743
|
deletedDate?: Date | null;
|
|
743
744
|
}
|
|
744
|
-
interface EntityUpdatedEvent {
|
|
745
|
+
export interface EntityUpdatedEvent {
|
|
745
746
|
/**
|
|
746
747
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
747
748
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -749,20 +750,20 @@ interface EntityUpdatedEvent {
|
|
|
749
750
|
*/
|
|
750
751
|
currentEntity?: string;
|
|
751
752
|
}
|
|
752
|
-
interface EntityDeletedEvent {
|
|
753
|
+
export interface EntityDeletedEvent {
|
|
753
754
|
/** Entity that was deleted */
|
|
754
755
|
deletedEntity?: string | null;
|
|
755
756
|
}
|
|
756
|
-
interface ActionEvent {
|
|
757
|
+
export interface ActionEvent {
|
|
757
758
|
body?: string;
|
|
758
759
|
}
|
|
759
|
-
interface Empty {
|
|
760
|
+
export interface Empty {
|
|
760
761
|
}
|
|
761
|
-
interface DiscountRuleUsageLimitReached {
|
|
762
|
+
export interface DiscountRuleUsageLimitReached {
|
|
762
763
|
/** Discount Rule */
|
|
763
764
|
rule?: DiscountRule;
|
|
764
765
|
}
|
|
765
|
-
interface MessageEnvelope {
|
|
766
|
+
export interface MessageEnvelope {
|
|
766
767
|
/**
|
|
767
768
|
* App instance ID.
|
|
768
769
|
* @format GUID
|
|
@@ -778,7 +779,7 @@ interface MessageEnvelope {
|
|
|
778
779
|
/** Stringify payload. */
|
|
779
780
|
data?: string;
|
|
780
781
|
}
|
|
781
|
-
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
782
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
782
783
|
/**
|
|
783
784
|
* ID of a site visitor that has not logged in to the site.
|
|
784
785
|
* @format GUID
|
|
@@ -803,7 +804,7 @@ interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
803
804
|
identityType?: WebhookIdentityType;
|
|
804
805
|
}
|
|
805
806
|
/** @oneof */
|
|
806
|
-
interface IdentificationDataIdOneOf {
|
|
807
|
+
export interface IdentificationDataIdOneOf {
|
|
807
808
|
/**
|
|
808
809
|
* ID of a site visitor that has not logged in to the site.
|
|
809
810
|
* @format GUID
|
|
@@ -825,14 +826,14 @@ interface IdentificationDataIdOneOf {
|
|
|
825
826
|
*/
|
|
826
827
|
appId?: string;
|
|
827
828
|
}
|
|
828
|
-
declare enum WebhookIdentityType {
|
|
829
|
+
export declare enum WebhookIdentityType {
|
|
829
830
|
UNKNOWN = "UNKNOWN",
|
|
830
831
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
831
832
|
MEMBER = "MEMBER",
|
|
832
833
|
WIX_USER = "WIX_USER",
|
|
833
834
|
APP = "APP"
|
|
834
835
|
}
|
|
835
|
-
interface BaseEventMetadata {
|
|
836
|
+
export interface BaseEventMetadata {
|
|
836
837
|
/**
|
|
837
838
|
* App instance ID.
|
|
838
839
|
* @format GUID
|
|
@@ -846,7 +847,7 @@ interface BaseEventMetadata {
|
|
|
846
847
|
/** The identification type and identity data. */
|
|
847
848
|
identity?: IdentificationData;
|
|
848
849
|
}
|
|
849
|
-
interface EventMetadata extends BaseEventMetadata {
|
|
850
|
+
export interface EventMetadata extends BaseEventMetadata {
|
|
850
851
|
/**
|
|
851
852
|
* Unique event ID.
|
|
852
853
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -884,18 +885,148 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
884
885
|
*/
|
|
885
886
|
entityEventSequence?: string | null;
|
|
886
887
|
}
|
|
887
|
-
interface DiscountRuleCreatedEnvelope {
|
|
888
|
+
export interface DiscountRuleCreatedEnvelope {
|
|
888
889
|
entity: DiscountRule;
|
|
889
890
|
metadata: EventMetadata;
|
|
890
891
|
}
|
|
891
|
-
|
|
892
|
+
/**
|
|
893
|
+
* Triggered when a discount rule is created.
|
|
894
|
+
* @permissionScope Manage Stores - all permissions
|
|
895
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
896
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
897
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
898
|
+
* @permissionScope Read Stores - all read permissions
|
|
899
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
900
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
901
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
902
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
903
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
904
|
+
* @permissionId ECOM.DISCOUNT_RULES_READ
|
|
905
|
+
* @webhook
|
|
906
|
+
* @eventType wix.ecom.discounts.v1.discount_rule_created
|
|
907
|
+
* @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService
|
|
908
|
+
* @slug created
|
|
909
|
+
*/
|
|
910
|
+
export declare function onDiscountRuleCreated(handler: (event: DiscountRuleCreatedEnvelope) => void | Promise<void>): void;
|
|
911
|
+
export interface DiscountRuleDeletedEnvelope {
|
|
892
912
|
metadata: EventMetadata;
|
|
893
913
|
}
|
|
894
|
-
|
|
914
|
+
/**
|
|
915
|
+
* Triggered when a discount rule is deleted.
|
|
916
|
+
* @permissionScope Manage Stores - all permissions
|
|
917
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
918
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
919
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
920
|
+
* @permissionScope Read Stores - all read permissions
|
|
921
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
922
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
923
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
924
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
925
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
926
|
+
* @permissionId ECOM.DISCOUNT_RULES_READ
|
|
927
|
+
* @webhook
|
|
928
|
+
* @eventType wix.ecom.discounts.v1.discount_rule_deleted
|
|
929
|
+
* @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService
|
|
930
|
+
* @slug deleted
|
|
931
|
+
*/
|
|
932
|
+
export declare function onDiscountRuleDeleted(handler: (event: DiscountRuleDeletedEnvelope) => void | Promise<void>): void;
|
|
933
|
+
export interface DiscountRuleUpdatedEnvelope {
|
|
895
934
|
entity: DiscountRule;
|
|
896
935
|
metadata: EventMetadata;
|
|
897
936
|
}
|
|
898
|
-
|
|
937
|
+
/**
|
|
938
|
+
* Triggered when a discount rule is updated.
|
|
939
|
+
* @permissionScope Manage Stores - all permissions
|
|
940
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
941
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
942
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
943
|
+
* @permissionScope Read Stores - all read permissions
|
|
944
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
945
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
946
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
947
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
948
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
949
|
+
* @permissionId ECOM.DISCOUNT_RULES_READ
|
|
950
|
+
* @webhook
|
|
951
|
+
* @eventType wix.ecom.discounts.v1.discount_rule_updated
|
|
952
|
+
* @serviceIdentifier com.wix.ecom.discounts.DiscountRuleService
|
|
953
|
+
* @slug updated
|
|
954
|
+
*/
|
|
955
|
+
export declare function onDiscountRuleUpdated(handler: (event: DiscountRuleUpdatedEnvelope) => void | Promise<void>): void;
|
|
956
|
+
type DiscountRuleNonNullablePaths = `trigger.and.triggers` | `trigger.or.triggers` | `trigger.customTrigger._id` | `trigger.customTrigger.appId` | `trigger.subtotalRange.scopes` | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogAppId` | `trigger.subtotalRange.scopes.${number}.catalogItemFilter.catalogItemIds` | `trigger.subtotalRange.scopes.${number}.customFilter.appId` | `trigger.subtotalRange.scopes.${number}._id` | `trigger.subtotalRange.scopes.${number}.type` | `trigger.itemQuantityRange.scopes` | `trigger.triggerType` | `discounts.values` | `discounts.values.${number}.percentage` | `discounts.values.${number}.fixedAmount` | `discounts.values.${number}.fixedPrice` | `discounts.values.${number}.targetType` | `discounts.values.${number}.specificItemsInfo.scopes` | `discounts.values.${number}.specificItemsInfo.scopes.${number}.catalogItemFilter.catalogAppId` | `discounts.values.${number}.specificItemsInfo.scopes.${number}.catalogItemFilter.catalogItemIds` | `discounts.values.${number}.specificItemsInfo.scopes.${number}.customFilter.appId` | `discounts.values.${number}.specificItemsInfo.scopes.${number}._id` | `discounts.values.${number}.specificItemsInfo.scopes.${number}.type` | `discounts.values.${number}.discountType` | `status` | `usageCount`;
|
|
957
|
+
/**
|
|
958
|
+
* Creates a new discount rule.
|
|
959
|
+
*
|
|
960
|
+
*
|
|
961
|
+
* The `createDiscountRule()` function returns a Promise that resolves to the new discount rule when it's created.
|
|
962
|
+
* @param discountRule - Discount rule info.
|
|
963
|
+
* @public
|
|
964
|
+
* @requiredField discountRule
|
|
965
|
+
* @requiredField discountRule.discounts
|
|
966
|
+
* @requiredField discountRule.name
|
|
967
|
+
* @permissionId ECOM.DISCOUNT_RULES_CREATE
|
|
968
|
+
* @permissionScope Manage Stores - all permissions
|
|
969
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
970
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
971
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
972
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
973
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
974
|
+
* @applicableIdentity APP
|
|
975
|
+
* @returns Discount rule.
|
|
976
|
+
* @fqn com.wix.ecom.discounts.DiscountRuleService.CreateDiscountRule
|
|
977
|
+
*/
|
|
978
|
+
export declare function createDiscountRule(discountRule: NonNullablePaths<DiscountRule, `discounts` | `name`>): Promise<NonNullablePaths<DiscountRule, DiscountRuleNonNullablePaths>>;
|
|
979
|
+
/**
|
|
980
|
+
* Retrieves a discount rule.
|
|
981
|
+
*
|
|
982
|
+
*
|
|
983
|
+
* The `getDiscountRule()` function returns a Promise that resolves when the specified discount rule is retrieved.
|
|
984
|
+
* @param discountRuleId - ID of the discount rule to retrieve.
|
|
985
|
+
* @public
|
|
986
|
+
* @requiredField discountRuleId
|
|
987
|
+
* @permissionId ECOM.DISCOUNT_RULES_READ
|
|
988
|
+
* @permissionScope Manage Stores - all permissions
|
|
989
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
990
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
991
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
992
|
+
* @permissionScope Read Stores - all read permissions
|
|
993
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
994
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
995
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
996
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
997
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
998
|
+
* @applicableIdentity APP
|
|
999
|
+
* @returns The requested discount rule.
|
|
1000
|
+
* @fqn com.wix.ecom.discounts.DiscountRuleService.GetDiscountRule
|
|
1001
|
+
*/
|
|
1002
|
+
export declare function getDiscountRule(discountRuleId: string): Promise<NonNullablePaths<DiscountRule, DiscountRuleNonNullablePaths>>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Updates a discount rule's properties.
|
|
1005
|
+
*
|
|
1006
|
+
*
|
|
1007
|
+
* The `updateDiscountRule()` function returns a Promise that resolves when the specified discount rule's properties are updated.
|
|
1008
|
+
*
|
|
1009
|
+
* 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.
|
|
1010
|
+
* @param _id - Discount rule ID.
|
|
1011
|
+
* @public
|
|
1012
|
+
* @requiredField _id
|
|
1013
|
+
* @requiredField discountRule
|
|
1014
|
+
* @requiredField discountRule.revision
|
|
1015
|
+
* @param discountRule - Discount rule info.
|
|
1016
|
+
* @param options - Discount rule info.
|
|
1017
|
+
* @permissionId ECOM.DISCOUNT_RULES_UPDATE
|
|
1018
|
+
* @permissionScope Manage Stores - all permissions
|
|
1019
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1020
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1021
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1022
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
1023
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1024
|
+
* @applicableIdentity APP
|
|
1025
|
+
* @returns Updated discount rule.
|
|
1026
|
+
* @fqn com.wix.ecom.discounts.DiscountRuleService.UpdateDiscountRule
|
|
1027
|
+
*/
|
|
1028
|
+
export declare function updateDiscountRule(_id: string, discountRule: NonNullablePaths<UpdateDiscountRule, `revision`>): Promise<NonNullablePaths<DiscountRule, DiscountRuleNonNullablePaths>>;
|
|
1029
|
+
export interface UpdateDiscountRule {
|
|
899
1030
|
/**
|
|
900
1031
|
* Discount rule ID.
|
|
901
1032
|
* @format GUID
|
|
@@ -960,6 +1091,56 @@ interface UpdateDiscountRule {
|
|
|
960
1091
|
*/
|
|
961
1092
|
usageCount?: number;
|
|
962
1093
|
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Deletes a discount rule.
|
|
1096
|
+
*
|
|
1097
|
+
*
|
|
1098
|
+
* The `deleteDiscountRule()` function returns a Promise that resolves when the specified discount rule is deleted.
|
|
1099
|
+
* @param discountRuleId - ID of the discount rule to delete.
|
|
1100
|
+
* @public
|
|
1101
|
+
* @requiredField discountRuleId
|
|
1102
|
+
* @permissionId ECOM.DISCOUNT_RULES_DELETE
|
|
1103
|
+
* @permissionScope Manage Stores - all permissions
|
|
1104
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1105
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1106
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1107
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
1108
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1109
|
+
* @applicableIdentity APP
|
|
1110
|
+
* @fqn com.wix.ecom.discounts.DiscountRuleService.DeleteDiscountRule
|
|
1111
|
+
*/
|
|
1112
|
+
export declare function deleteDiscountRule(discountRuleId: string): Promise<void>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Creates a query to retrieve a list of discount rules.
|
|
1115
|
+
*
|
|
1116
|
+
*
|
|
1117
|
+
* The `queryDiscountRules()` function builds a query to retrieve a list of up to 100 discount rules, and returns a [`DiscountRulesQueryBuilder`](#discountrulesquerybuilder) object.
|
|
1118
|
+
*
|
|
1119
|
+
* 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.
|
|
1120
|
+
*
|
|
1121
|
+
* 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.
|
|
1122
|
+
*
|
|
1123
|
+
* By default, `queryDiscountRules()` sorts results by [`ascending("_id")`](/discount-rules/discount-rules-query-builder/ascending) by default. This can be overridden.
|
|
1124
|
+
*
|
|
1125
|
+
* To learn how to query posts, refer to the table below.
|
|
1126
|
+
*
|
|
1127
|
+
* 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`.
|
|
1128
|
+
* @public
|
|
1129
|
+
* @permissionScope Manage Stores - all permissions
|
|
1130
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1131
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
1132
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
1133
|
+
* @permissionScope Read Stores - all read permissions
|
|
1134
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1135
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1136
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1137
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
1138
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1139
|
+
* @permissionId ECOM.DISCOUNT_RULES_READ
|
|
1140
|
+
* @applicableIdentity APP
|
|
1141
|
+
* @fqn com.wix.ecom.discounts.DiscountRuleService.QueryDiscountRules
|
|
1142
|
+
*/
|
|
1143
|
+
export declare function queryDiscountRules(): DiscountRulesQueryBuilder;
|
|
963
1144
|
interface QueryCursorResult {
|
|
964
1145
|
cursors: Cursors;
|
|
965
1146
|
hasNext: () => boolean;
|
|
@@ -967,13 +1148,13 @@ interface QueryCursorResult {
|
|
|
967
1148
|
length: number;
|
|
968
1149
|
pageSize: number;
|
|
969
1150
|
}
|
|
970
|
-
interface DiscountRulesQueryResult extends QueryCursorResult {
|
|
1151
|
+
export interface DiscountRulesQueryResult extends QueryCursorResult {
|
|
971
1152
|
items: DiscountRule[];
|
|
972
1153
|
query: DiscountRulesQueryBuilder;
|
|
973
1154
|
next: () => Promise<DiscountRulesQueryResult>;
|
|
974
1155
|
prev: () => Promise<DiscountRulesQueryResult>;
|
|
975
1156
|
}
|
|
976
|
-
interface DiscountRulesQueryBuilder {
|
|
1157
|
+
export interface DiscountRulesQueryBuilder {
|
|
977
1158
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
978
1159
|
* @param value - Value to compare against.
|
|
979
1160
|
*/
|
|
@@ -1018,5 +1199,4 @@ interface DiscountRulesQueryBuilder {
|
|
|
1018
1199
|
skipTo: (cursor: string) => DiscountRulesQueryBuilder;
|
|
1019
1200
|
find: () => Promise<DiscountRulesQueryResult>;
|
|
1020
1201
|
}
|
|
1021
|
-
|
|
1022
|
-
export { type GetAppliedDiscountsResponse as $, AppliedSubjectType as A, type BuyXGetYInfo as B, type CatalogItemFilter as C, type DiscountRule as D, type ExtendedFields as E, type UpdateDiscountRuleResponse as F, type GetDiscountRuleRequest as G, type DeleteDiscountRuleRequest as H, type ItemQuantityRange as I, type DeleteDiscountRuleResponse as J, type PlatformQueryPagingMethodOneOf as K, type Sorting as L, type PlatformPaging as M, type CursorPaging as N, type Or as O, type PlatformQuery as P, type QueryDiscountRulesRequest as Q, type QueryDiscountRulesResponse as R, ScopeType as S, TriggerType as T, type UpdateDiscountRule as U, type PlatformPagingMetadata as V, WebhookIdentityType as W, type Cursors as X, type GetAppliedDiscountsRequest as Y, type LineItem as Z, type CatalogReference as _, type DiscountRulesQueryBuilder as a, type AppliedDiscount as a0, type AppliedDiscountRule as a1, type DiscountRuleName as a2, type MultiCurrencyPrice as a3, type DomainEvent as a4, type DomainEventBodyOneOf as a5, type EntityCreatedEvent as a6, type RestoreInfo as a7, type EntityUpdatedEvent as a8, type EntityDeletedEvent as a9, type ActionEvent as aa, type Empty as ab, type DiscountRuleUsageLimitReached as ac, type MessageEnvelope as ad, type IdentificationData as ae, type IdentificationDataIdOneOf as af, type BaseEventMetadata as ag, type EventMetadata as ah, type DiscountRuleCreatedEnvelope as ai, type DiscountRuleDeletedEnvelope as aj, type DiscountRuleUpdatedEnvelope as ak, type DiscountRulesQueryResult as al, Type as b, DiscountType as c, Status as d, SortOrder as e, type DiscountTrigger as f, type DiscountTriggerTriggerOneOf as g, type Scope as h, type ScopeScopeItemsOneOf as i, type CustomFilter as j, type And as k, type Custom as l, type SubtotalRange as m, type ActiveTimeInfo as n, type Discounts as o, type Discount as p, type DiscountDiscountOneOf as q, type SpecificItemsInfo as r, type CustomerBuy as s, type CustomerBuyConditionOneOf as t, type CustomerGet as u, type DiscountSettings as v, type CreateDiscountRuleRequest as w, type CreateDiscountRuleResponse as x, type GetDiscountRuleResponse as y, type UpdateDiscountRuleRequest as z };
|
|
1202
|
+
export {};
|