@wix/auto_sdk_loyalty_rewards 1.0.2 → 1.0.4

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.
Files changed (134) hide show
  1. package/build/index.d.mts +126 -0
  2. package/build/index.d.ts +126 -0
  3. package/build/index.js +834 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +797 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/internal/index.d.mts +126 -0
  8. package/build/internal/index.d.ts +126 -0
  9. package/build/internal/index.js +834 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +797 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/build/{es/src/loyalty-v1-reward-rewards.types.d.ts → internal/loyalty-v1-reward-rewards.universal-DJFLdOGr.d.mts} +186 -177
  14. package/build/{cjs/src/loyalty-v1-reward-rewards.types.d.ts → internal/loyalty-v1-reward-rewards.universal-DJFLdOGr.d.ts} +186 -177
  15. package/build/internal/meta.d.mts +472 -0
  16. package/build/internal/meta.d.ts +472 -0
  17. package/build/internal/meta.js +597 -0
  18. package/build/internal/meta.js.map +1 -0
  19. package/build/internal/meta.mjs +563 -0
  20. package/build/internal/meta.mjs.map +1 -0
  21. package/build/{internal/cjs/src/loyalty-v1-reward-rewards.types.d.ts → loyalty-v1-reward-rewards.universal-DJFLdOGr.d.mts} +186 -177
  22. package/build/{internal/es/src/loyalty-v1-reward-rewards.types.d.ts → loyalty-v1-reward-rewards.universal-DJFLdOGr.d.ts} +186 -177
  23. package/build/meta.d.mts +472 -0
  24. package/build/meta.d.ts +472 -0
  25. package/build/meta.js +597 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +563 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +14 -13
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/loyalty-v1-reward-rewards.context.d.ts +0 -28
  40. package/build/cjs/src/loyalty-v1-reward-rewards.context.js +0 -34
  41. package/build/cjs/src/loyalty-v1-reward-rewards.context.js.map +0 -1
  42. package/build/cjs/src/loyalty-v1-reward-rewards.http.d.ts +0 -56
  43. package/build/cjs/src/loyalty-v1-reward-rewards.http.js +0 -464
  44. package/build/cjs/src/loyalty-v1-reward-rewards.http.js.map +0 -1
  45. package/build/cjs/src/loyalty-v1-reward-rewards.meta.d.ts +0 -26
  46. package/build/cjs/src/loyalty-v1-reward-rewards.meta.js +0 -180
  47. package/build/cjs/src/loyalty-v1-reward-rewards.meta.js.map +0 -1
  48. package/build/cjs/src/loyalty-v1-reward-rewards.public.d.ts +0 -107
  49. package/build/cjs/src/loyalty-v1-reward-rewards.public.js +0 -119
  50. package/build/cjs/src/loyalty-v1-reward-rewards.public.js.map +0 -1
  51. package/build/cjs/src/loyalty-v1-reward-rewards.types.js +0 -29
  52. package/build/cjs/src/loyalty-v1-reward-rewards.types.js.map +0 -1
  53. package/build/cjs/src/loyalty-v1-reward-rewards.universal.d.ts +0 -1007
  54. package/build/cjs/src/loyalty-v1-reward-rewards.universal.js +0 -373
  55. package/build/cjs/src/loyalty-v1-reward-rewards.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/loyalty-v1-reward-rewards.context.d.ts +0 -28
  67. package/build/es/src/loyalty-v1-reward-rewards.context.js +0 -28
  68. package/build/es/src/loyalty-v1-reward-rewards.context.js.map +0 -1
  69. package/build/es/src/loyalty-v1-reward-rewards.http.d.ts +0 -56
  70. package/build/es/src/loyalty-v1-reward-rewards.http.js +0 -453
  71. package/build/es/src/loyalty-v1-reward-rewards.http.js.map +0 -1
  72. package/build/es/src/loyalty-v1-reward-rewards.meta.d.ts +0 -26
  73. package/build/es/src/loyalty-v1-reward-rewards.meta.js +0 -146
  74. package/build/es/src/loyalty-v1-reward-rewards.meta.js.map +0 -1
  75. package/build/es/src/loyalty-v1-reward-rewards.public.d.ts +0 -107
  76. package/build/es/src/loyalty-v1-reward-rewards.public.js +0 -105
  77. package/build/es/src/loyalty-v1-reward-rewards.public.js.map +0 -1
  78. package/build/es/src/loyalty-v1-reward-rewards.types.js +0 -26
  79. package/build/es/src/loyalty-v1-reward-rewards.types.js.map +0 -1
  80. package/build/es/src/loyalty-v1-reward-rewards.universal.d.ts +0 -1007
  81. package/build/es/src/loyalty-v1-reward-rewards.universal.js +0 -339
  82. package/build/es/src/loyalty-v1-reward-rewards.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/loyalty-v1-reward-rewards.context.d.ts +0 -28
  93. package/build/internal/cjs/src/loyalty-v1-reward-rewards.context.js +0 -34
  94. package/build/internal/cjs/src/loyalty-v1-reward-rewards.context.js.map +0 -1
  95. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.d.ts +0 -56
  96. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.js +0 -464
  97. package/build/internal/cjs/src/loyalty-v1-reward-rewards.http.js.map +0 -1
  98. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.d.ts +0 -26
  99. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.js +0 -180
  100. package/build/internal/cjs/src/loyalty-v1-reward-rewards.meta.js.map +0 -1
  101. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.d.ts +0 -107
  102. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.js +0 -119
  103. package/build/internal/cjs/src/loyalty-v1-reward-rewards.public.js.map +0 -1
  104. package/build/internal/cjs/src/loyalty-v1-reward-rewards.types.js +0 -29
  105. package/build/internal/cjs/src/loyalty-v1-reward-rewards.types.js.map +0 -1
  106. package/build/internal/cjs/src/loyalty-v1-reward-rewards.universal.d.ts +0 -1007
  107. package/build/internal/cjs/src/loyalty-v1-reward-rewards.universal.js +0 -373
  108. package/build/internal/cjs/src/loyalty-v1-reward-rewards.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/loyalty-v1-reward-rewards.context.d.ts +0 -28
  119. package/build/internal/es/src/loyalty-v1-reward-rewards.context.js +0 -28
  120. package/build/internal/es/src/loyalty-v1-reward-rewards.context.js.map +0 -1
  121. package/build/internal/es/src/loyalty-v1-reward-rewards.http.d.ts +0 -56
  122. package/build/internal/es/src/loyalty-v1-reward-rewards.http.js +0 -453
  123. package/build/internal/es/src/loyalty-v1-reward-rewards.http.js.map +0 -1
  124. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.d.ts +0 -26
  125. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.js +0 -146
  126. package/build/internal/es/src/loyalty-v1-reward-rewards.meta.js.map +0 -1
  127. package/build/internal/es/src/loyalty-v1-reward-rewards.public.d.ts +0 -107
  128. package/build/internal/es/src/loyalty-v1-reward-rewards.public.js +0 -105
  129. package/build/internal/es/src/loyalty-v1-reward-rewards.public.js.map +0 -1
  130. package/build/internal/es/src/loyalty-v1-reward-rewards.types.js +0 -26
  131. package/build/internal/es/src/loyalty-v1-reward-rewards.types.js.map +0 -1
  132. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.d.ts +0 -1007
  133. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.js +0 -339
  134. package/build/internal/es/src/loyalty-v1-reward-rewards.universal.js.map +0 -1
@@ -1,1007 +0,0 @@
1
- /**
2
- * A loyalty reward is an object a customer can redeem with loyalty points.
3
- * Redeeming a reward then creates a loyalty coupon that the customer can use.
4
- */
5
- export interface Reward extends RewardTypeDetailsOneOf {
6
- /** Discount details. */
7
- discountAmount?: DiscountAmount;
8
- /** Coupon details. */
9
- couponReward?: CouponReward;
10
- /**
11
- * Reward ID.
12
- * @format GUID
13
- * @readonly
14
- */
15
- _id?: string | null;
16
- /**
17
- * Reward name.
18
- * @minLength 1
19
- * @maxLength 50
20
- */
21
- name?: string;
22
- /** Whether the reward is active. Default: `FALSE` */
23
- active?: boolean;
24
- /** Reward type. */
25
- type?: RewardType;
26
- /**
27
- * Revision number, which increments by 1 each time the loyalty reward is updated.
28
- *
29
- * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.
30
- * @readonly
31
- */
32
- revision?: string | null;
33
- /**
34
- * Date and time the reward was created.
35
- * @readonly
36
- */
37
- _createdDate?: Date | null;
38
- /**
39
- * Date and time the reward was last updated.
40
- * @readonly
41
- */
42
- _updatedDate?: Date | null;
43
- }
44
- /** @oneof */
45
- export interface RewardTypeDetailsOneOf {
46
- /** Discount details. */
47
- discountAmount?: DiscountAmount;
48
- /** Coupon details. */
49
- couponReward?: CouponReward;
50
- }
51
- /** Available reward types. */
52
- export declare enum RewardType {
53
- /** Undefined reward type. */
54
- UNDEFINED = "UNDEFINED",
55
- /** Discount reward. Special flexible reward type used in checkout. */
56
- DISCOUNT_AMOUNT = "DISCOUNT_AMOUNT",
57
- /** Coupon reward. [Learn more about coupons.](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards) */
58
- COUPON_REWARD = "COUPON_REWARD",
59
- /** For internal use. */
60
- SPI_DISCOUNT_AMOUNT = "SPI_DISCOUNT_AMOUNT"
61
- }
62
- export interface DiscountAmount {
63
- /**
64
- * Discount details for each tier.
65
- * @maxSize 21
66
- */
67
- configsByTier?: DiscountAmountConfig[];
68
- }
69
- export interface DiscountAmountConfig {
70
- /**
71
- * Discount amount. Must be a positive value.
72
- * @format DECIMAL_VALUE
73
- * @decimalValue options { gt:0, maxScale:2 }
74
- */
75
- amount?: string;
76
- /**
77
- * Tier ID, or empty if config applies to the base tier.
78
- * @format GUID
79
- */
80
- tierId?: string | null;
81
- /**
82
- * Amount of points required to redeem the reward.
83
- * @min 1
84
- * @max 9999999
85
- */
86
- costInPoints?: number;
87
- }
88
- export interface CouponReward extends CouponRewardDiscountTypeOneOf, CouponRewardScopeOrMinSubtotalOneOf {
89
- /** Discount as a fixed amount. */
90
- fixedAmount?: FixedAmountDiscount;
91
- /** Discount as a percentage. */
92
- percentage?: PercentageDiscount;
93
- /** Free shipping. */
94
- freeShipping?: FreeShippingDiscount;
95
- /** Limit the coupon to carts with a subtotal greater than this number. */
96
- minimumSubtotal?: number;
97
- /**
98
- * Specifies the type of line items this coupon will apply to.
99
- *
100
- * For more information, see the Coupons API.
101
- */
102
- scope?: CouponScope;
103
- /** Whether the coupon is limited to one item. */
104
- limitedToOneItem?: boolean | null;
105
- /**
106
- * Whether the coupon applies to subscription products.
107
- *
108
- * If set to `true`, the discount will apply to all billing cycles.
109
- */
110
- appliesToSubscriptions?: boolean | null;
111
- /**
112
- * Reserved for internal use.
113
- * @min 1
114
- * @max 999
115
- */
116
- discountedCycleCount?: number | null;
117
- }
118
- /** @oneof */
119
- export interface CouponRewardDiscountTypeOneOf {
120
- /** Discount as a fixed amount. */
121
- fixedAmount?: FixedAmountDiscount;
122
- /** Discount as a percentage. */
123
- percentage?: PercentageDiscount;
124
- /** Free shipping. */
125
- freeShipping?: FreeShippingDiscount;
126
- }
127
- /** @oneof */
128
- export interface CouponRewardScopeOrMinSubtotalOneOf {
129
- /** Limit the coupon to carts with a subtotal greater than this number. */
130
- minimumSubtotal?: number;
131
- /**
132
- * Specifies the type of line items this coupon will apply to.
133
- *
134
- * For more information, see the Coupons API.
135
- */
136
- scope?: CouponScope;
137
- }
138
- export interface FixedAmountDiscount {
139
- /**
140
- * Discount details for each tier.
141
- * @minSize 1
142
- * @maxSize 21
143
- */
144
- configsByTier?: FixedAmountDiscountConfig[];
145
- }
146
- export interface FixedAmountDiscountConfig {
147
- /**
148
- * Tier ID, or empty if config applies to the base tier.
149
- * @format GUID
150
- */
151
- tierId?: string | null;
152
- /**
153
- * Amount of points required to redeem the reward.
154
- * @min 1
155
- * @max 9999999
156
- */
157
- costInPoints?: number;
158
- /** Discount amount. */
159
- amount?: number;
160
- }
161
- export interface PercentageDiscount {
162
- /**
163
- * Discount details for each tier.
164
- * @minSize 1
165
- * @maxSize 21
166
- */
167
- configsByTier?: PercentageDiscountConfig[];
168
- }
169
- export interface PercentageDiscountConfig {
170
- /**
171
- * Tier ID, or empty if config applies to the base tier.
172
- * @format GUID
173
- */
174
- tierId?: string | null;
175
- /**
176
- * Amount of points required to redeem the reward.
177
- * @min 1
178
- * @max 9999999
179
- */
180
- costInPoints?: number;
181
- /** Percentage discount. */
182
- percentage?: number;
183
- }
184
- export interface FreeShippingDiscount {
185
- /**
186
- * Discount details for each tier.
187
- * @minSize 1
188
- * @maxSize 21
189
- */
190
- configsByTier?: FreeShippingDiscountConfig[];
191
- }
192
- export interface FreeShippingDiscountConfig {
193
- /**
194
- * Tier ID, or empty if config applies to the base tier.
195
- * @format GUID
196
- */
197
- tierId?: string | null;
198
- /**
199
- * Amount of points required to redeem the reward.
200
- * @min 1
201
- * @max 9999999
202
- */
203
- costInPoints?: number;
204
- }
205
- export interface CouponScope {
206
- /**
207
- * Scope namespace.
208
- *
209
- * See the Coupons API for valid namespaces.
210
- */
211
- namespace?: string;
212
- /**
213
- * Coupon scope's applied group.
214
- *
215
- * See the Coupons API for valid groups.
216
- */
217
- group?: Group;
218
- }
219
- export interface Group {
220
- /**
221
- * Name of coupon scope's group.
222
- *
223
- * See the Coupons API for valid groups.
224
- */
225
- name?: string;
226
- /** Entity ID, if the coupon scope is limited to just one item. */
227
- entityId?: string | null;
228
- }
229
- export interface SpiDiscountAmount {
230
- /**
231
- * Discount details for each tier.
232
- * @maxSize 21
233
- */
234
- configsByTier?: DiscountAmountConfig[];
235
- /**
236
- * Description of the SPI discount amount reward. Taken from user input in the SPI config.
237
- * @maxLength 200
238
- */
239
- description?: string;
240
- }
241
- export interface RewardDisabled {
242
- }
243
- export interface CreateRewardRequest {
244
- /** Reward to create. */
245
- reward: Reward;
246
- }
247
- export interface CreateRewardResponse {
248
- /** Created reward. */
249
- reward?: Reward;
250
- }
251
- export interface BulkCreateRewardsRequest {
252
- /**
253
- * Rewards to create.
254
- * @minSize 1
255
- * @maxSize 10
256
- */
257
- rewards: Reward[];
258
- }
259
- export interface BulkCreateRewardsResponse {
260
- /** Created rewards. */
261
- results?: BulkRewardResult[];
262
- /** Total successes and failures of the bulk create rewards action. */
263
- bulkActionMetadata?: BulkActionMetadata;
264
- }
265
- export interface BulkRewardResult {
266
- /** Item metadata. */
267
- itemMetadata?: ItemMetadata;
268
- /** Created reward. */
269
- item?: Reward;
270
- }
271
- export interface ItemMetadata {
272
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
273
- _id?: string | null;
274
- /** Index of the item within the request array. Allows for correlation between request and response items. */
275
- originalIndex?: number;
276
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
277
- success?: boolean;
278
- /** Details about the error in case of failure. */
279
- error?: ApplicationError;
280
- }
281
- export interface ApplicationError {
282
- /** Error code. */
283
- code?: string;
284
- /** Description of the error. */
285
- description?: string;
286
- /** Data related to the error. */
287
- data?: Record<string, any> | null;
288
- }
289
- export interface BulkActionMetadata {
290
- /** Number of items that were successfully processed. */
291
- totalSuccesses?: number;
292
- /** Number of items that couldn't be processed. */
293
- totalFailures?: number;
294
- /** Number of failures without details because detailed failure threshold was exceeded. */
295
- undetailedFailures?: number;
296
- }
297
- export interface GetRewardRequest {
298
- /**
299
- * ID of the reward to retrieve.
300
- * @format GUID
301
- */
302
- _id: string;
303
- }
304
- export interface GetRewardResponse {
305
- /** Retrieved reward. */
306
- reward?: Reward;
307
- }
308
- export interface BulkGetRewardsRequest {
309
- }
310
- export interface BulkGetRewardsResponse {
311
- /** Found rewards per site. */
312
- rewardsInSite?: RewardsInSite[];
313
- }
314
- export interface RewardsInSite {
315
- /**
316
- * Metasite id.
317
- * @format GUID
318
- */
319
- metaSiteId?: string;
320
- /** Rewards. */
321
- rewards?: Reward[];
322
- }
323
- export interface QueryRewardsRequest {
324
- /** Query parameters. */
325
- query: CursorQuery;
326
- }
327
- export interface CursorQuery extends CursorQueryPagingMethodOneOf {
328
- /**
329
- * Cursor paging options.
330
- *
331
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
332
- */
333
- cursorPaging?: CursorPaging;
334
- /**
335
- * Filter object.
336
- *
337
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
338
- */
339
- filter?: Record<string, any> | null;
340
- /**
341
- * Sort object.
342
- *
343
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
344
- * @maxSize 5
345
- */
346
- sort?: Sorting[];
347
- }
348
- /** @oneof */
349
- export interface CursorQueryPagingMethodOneOf {
350
- /**
351
- * Cursor paging options.
352
- *
353
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
354
- */
355
- cursorPaging?: CursorPaging;
356
- }
357
- export interface Sorting {
358
- /**
359
- * Name of the field to sort by.
360
- * @maxLength 512
361
- */
362
- fieldName?: string;
363
- /** Sort order. */
364
- order?: SortOrder;
365
- }
366
- export declare enum SortOrder {
367
- ASC = "ASC",
368
- DESC = "DESC"
369
- }
370
- export interface CursorPaging {
371
- /**
372
- * Maximum number of items to return in the results.
373
- * @max 100
374
- */
375
- limit?: number | null;
376
- /**
377
- * Pointer to the next or previous page in the list of results.
378
- *
379
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
380
- * Not relevant for the first request.
381
- * @maxLength 16000
382
- */
383
- cursor?: string | null;
384
- }
385
- export interface QueryRewardsResponse {
386
- /** Retrieved loyalty rewards. */
387
- rewards?: Reward[];
388
- /** Details on the paged set of results returned. */
389
- pagingMetadata?: CursorPagingMetadata;
390
- }
391
- export interface CursorPagingMetadata {
392
- /** Number of items returned in current page. */
393
- count?: number | null;
394
- /** Cursor strings that point to the next page, previous page, or both. */
395
- cursors?: Cursors;
396
- /**
397
- * Whether there are more pages to retrieve following the current page.
398
- *
399
- * + `true`: Another page of results can be retrieved.
400
- * + `false`: This is the last page.
401
- */
402
- hasNext?: boolean | null;
403
- }
404
- export interface Cursors {
405
- /**
406
- * Cursor string pointing to the next page in the list of results.
407
- * @maxLength 16000
408
- */
409
- next?: string | null;
410
- /**
411
- * Cursor pointing to the previous page in the list of results.
412
- * @maxLength 16000
413
- */
414
- prev?: string | null;
415
- }
416
- export interface UpdateRewardRequest {
417
- /** Reward information to update. */
418
- reward: Reward;
419
- }
420
- export interface UpdateRewardResponse {
421
- /** Updated reward. */
422
- reward?: Reward;
423
- }
424
- export interface DeleteRewardRequest {
425
- /**
426
- * ID of the reward to delete.
427
- * @format GUID
428
- */
429
- _id: string;
430
- /**
431
- * Revision number, which increments by 1 each time the reward is updated.
432
- *
433
- * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
434
- */
435
- revision?: string;
436
- }
437
- export interface DeleteRewardResponse {
438
- }
439
- export interface ListRewardsRequest {
440
- /** Pagination options. */
441
- cursorPaging?: CursorPaging;
442
- }
443
- export interface ListRewardsResponse {
444
- /** Retrieved loyalty rewards. */
445
- rewards?: Reward[];
446
- /** Details on the paged set of results returned. */
447
- pagingMetadata?: PagingMetadataV2;
448
- }
449
- export interface PagingMetadataV2 {
450
- /** Number of items returned in the response. */
451
- count?: number | null;
452
- /** Offset that was requested. */
453
- offset?: number | null;
454
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
455
- total?: number | null;
456
- /** Flag that indicates the server failed to calculate the `total` field. */
457
- tooManyToCount?: boolean | null;
458
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
459
- cursors?: Cursors;
460
- }
461
- export interface ListRewardsInTierRequest {
462
- /**
463
- * Tier id.
464
- * @format GUID
465
- * @readonly
466
- */
467
- tierId?: string | null;
468
- /** Pagination options. */
469
- cursorPaging?: CursorPaging;
470
- }
471
- export interface ListRewardsInTierResponse {
472
- /** Retrieved loyalty rewards. */
473
- rewards?: Reward[];
474
- /** Details on the paged set of results returned. */
475
- pagingMetadata?: PagingMetadataV2;
476
- }
477
- export interface DomainEvent extends DomainEventBodyOneOf {
478
- createdEvent?: EntityCreatedEvent;
479
- updatedEvent?: EntityUpdatedEvent;
480
- deletedEvent?: EntityDeletedEvent;
481
- actionEvent?: ActionEvent;
482
- /**
483
- * Unique event ID.
484
- * Allows clients to ignore duplicate webhooks.
485
- */
486
- _id?: string;
487
- /**
488
- * Assumes actions are also always typed to an entity_type
489
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
490
- */
491
- entityFqdn?: string;
492
- /**
493
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
494
- * This is although the created/updated/deleted notion is duplication of the oneof types
495
- * Example: created/updated/deleted/started/completed/email_opened
496
- */
497
- slug?: string;
498
- /** ID of the entity associated with the event. */
499
- entityId?: string;
500
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
501
- eventTime?: Date | null;
502
- /**
503
- * Whether the event was triggered as a result of a privacy regulation application
504
- * (for example, GDPR).
505
- */
506
- triggeredByAnonymizeRequest?: boolean | null;
507
- /** If present, indicates the action that triggered the event. */
508
- originatedFrom?: string | null;
509
- /**
510
- * A sequence number defining the order of updates to the underlying entity.
511
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
512
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
513
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
514
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
515
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
516
- */
517
- entityEventSequence?: string | null;
518
- }
519
- /** @oneof */
520
- export interface DomainEventBodyOneOf {
521
- createdEvent?: EntityCreatedEvent;
522
- updatedEvent?: EntityUpdatedEvent;
523
- deletedEvent?: EntityDeletedEvent;
524
- actionEvent?: ActionEvent;
525
- }
526
- export interface EntityCreatedEvent {
527
- entity?: string;
528
- }
529
- export interface RestoreInfo {
530
- deletedDate?: Date | null;
531
- }
532
- export interface EntityUpdatedEvent {
533
- /**
534
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
535
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
536
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
537
- */
538
- currentEntity?: string;
539
- }
540
- export interface EntityDeletedEvent {
541
- /** Entity that was deleted */
542
- deletedEntity?: string | null;
543
- }
544
- export interface ActionEvent {
545
- body?: string;
546
- }
547
- export interface Empty {
548
- }
549
- export interface MessageEnvelope {
550
- /**
551
- * App instance ID.
552
- * @format GUID
553
- */
554
- instanceId?: string | null;
555
- /**
556
- * Event type.
557
- * @maxLength 150
558
- */
559
- eventType?: string;
560
- /** The identification type and identity data. */
561
- identity?: IdentificationData;
562
- /** Stringify payload. */
563
- data?: string;
564
- }
565
- export interface IdentificationData extends IdentificationDataIdOneOf {
566
- /**
567
- * ID of a site visitor that has not logged in to the site.
568
- * @format GUID
569
- */
570
- anonymousVisitorId?: string;
571
- /**
572
- * ID of a site visitor that has logged in to the site.
573
- * @format GUID
574
- */
575
- memberId?: string;
576
- /**
577
- * ID of a Wix user (site owner, contributor, etc.).
578
- * @format GUID
579
- */
580
- wixUserId?: string;
581
- /**
582
- * ID of an app.
583
- * @format GUID
584
- */
585
- appId?: string;
586
- /** @readonly */
587
- identityType?: WebhookIdentityType;
588
- }
589
- /** @oneof */
590
- export interface IdentificationDataIdOneOf {
591
- /**
592
- * ID of a site visitor that has not logged in to the site.
593
- * @format GUID
594
- */
595
- anonymousVisitorId?: string;
596
- /**
597
- * ID of a site visitor that has logged in to the site.
598
- * @format GUID
599
- */
600
- memberId?: string;
601
- /**
602
- * ID of a Wix user (site owner, contributor, etc.).
603
- * @format GUID
604
- */
605
- wixUserId?: string;
606
- /**
607
- * ID of an app.
608
- * @format GUID
609
- */
610
- appId?: string;
611
- }
612
- export declare enum WebhookIdentityType {
613
- UNKNOWN = "UNKNOWN",
614
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
615
- MEMBER = "MEMBER",
616
- WIX_USER = "WIX_USER",
617
- APP = "APP"
618
- }
619
- interface DiscountAmountConfigNonNullableFields {
620
- amount: string;
621
- costInPoints: number;
622
- }
623
- interface DiscountAmountNonNullableFields {
624
- amount: string;
625
- configsByTier: DiscountAmountConfigNonNullableFields[];
626
- }
627
- interface FixedAmountDiscountConfigNonNullableFields {
628
- costInPoints: number;
629
- amount: number;
630
- }
631
- interface FixedAmountDiscountNonNullableFields {
632
- configsByTier: FixedAmountDiscountConfigNonNullableFields[];
633
- }
634
- interface PercentageDiscountConfigNonNullableFields {
635
- costInPoints: number;
636
- percentage: number;
637
- }
638
- interface PercentageDiscountNonNullableFields {
639
- configsByTier: PercentageDiscountConfigNonNullableFields[];
640
- }
641
- interface FreeShippingDiscountConfigNonNullableFields {
642
- costInPoints: number;
643
- }
644
- interface FreeShippingDiscountNonNullableFields {
645
- configsByTier: FreeShippingDiscountConfigNonNullableFields[];
646
- }
647
- interface GroupNonNullableFields {
648
- name: string;
649
- }
650
- interface CouponScopeNonNullableFields {
651
- namespace: string;
652
- group?: GroupNonNullableFields;
653
- }
654
- interface CouponRewardNonNullableFields {
655
- fixedAmount?: FixedAmountDiscountNonNullableFields;
656
- percentage?: PercentageDiscountNonNullableFields;
657
- freeShipping?: FreeShippingDiscountNonNullableFields;
658
- minimumSubtotal: number;
659
- scope?: CouponScopeNonNullableFields;
660
- }
661
- interface SpiDiscountAmountNonNullableFields {
662
- configsByTier: DiscountAmountConfigNonNullableFields[];
663
- description: string;
664
- }
665
- export interface RewardNonNullableFields {
666
- discountAmount?: DiscountAmountNonNullableFields;
667
- couponReward?: CouponRewardNonNullableFields;
668
- spiDiscountAmount?: SpiDiscountAmountNonNullableFields;
669
- name: string;
670
- requiredPoints: number;
671
- active: boolean;
672
- type: RewardType;
673
- }
674
- export interface CreateRewardResponseNonNullableFields {
675
- reward?: RewardNonNullableFields;
676
- }
677
- interface ApplicationErrorNonNullableFields {
678
- code: string;
679
- description: string;
680
- }
681
- interface ItemMetadataNonNullableFields {
682
- originalIndex: number;
683
- success: boolean;
684
- error?: ApplicationErrorNonNullableFields;
685
- }
686
- interface BulkRewardResultNonNullableFields {
687
- itemMetadata?: ItemMetadataNonNullableFields;
688
- item?: RewardNonNullableFields;
689
- }
690
- interface BulkActionMetadataNonNullableFields {
691
- totalSuccesses: number;
692
- totalFailures: number;
693
- undetailedFailures: number;
694
- }
695
- export interface BulkCreateRewardsResponseNonNullableFields {
696
- results: BulkRewardResultNonNullableFields[];
697
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
698
- }
699
- export interface GetRewardResponseNonNullableFields {
700
- reward?: RewardNonNullableFields;
701
- }
702
- interface RewardsInSiteNonNullableFields {
703
- metaSiteId: string;
704
- rewards: RewardNonNullableFields[];
705
- }
706
- export interface BulkGetRewardsResponseNonNullableFields {
707
- rewardsInSite: RewardsInSiteNonNullableFields[];
708
- }
709
- export interface QueryRewardsResponseNonNullableFields {
710
- rewards: RewardNonNullableFields[];
711
- }
712
- export interface UpdateRewardResponseNonNullableFields {
713
- reward?: RewardNonNullableFields;
714
- }
715
- export interface ListRewardsResponseNonNullableFields {
716
- rewards: RewardNonNullableFields[];
717
- }
718
- export interface BaseEventMetadata {
719
- /**
720
- * App instance ID.
721
- * @format GUID
722
- */
723
- instanceId?: string | null;
724
- /**
725
- * Event type.
726
- * @maxLength 150
727
- */
728
- eventType?: string;
729
- /** The identification type and identity data. */
730
- identity?: IdentificationData;
731
- }
732
- export interface EventMetadata extends BaseEventMetadata {
733
- /**
734
- * Unique event ID.
735
- * Allows clients to ignore duplicate webhooks.
736
- */
737
- _id?: string;
738
- /**
739
- * Assumes actions are also always typed to an entity_type
740
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
741
- */
742
- entityFqdn?: string;
743
- /**
744
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
745
- * This is although the created/updated/deleted notion is duplication of the oneof types
746
- * Example: created/updated/deleted/started/completed/email_opened
747
- */
748
- slug?: string;
749
- /** ID of the entity associated with the event. */
750
- entityId?: string;
751
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
752
- eventTime?: Date | null;
753
- /**
754
- * Whether the event was triggered as a result of a privacy regulation application
755
- * (for example, GDPR).
756
- */
757
- triggeredByAnonymizeRequest?: boolean | null;
758
- /** If present, indicates the action that triggered the event. */
759
- originatedFrom?: string | null;
760
- /**
761
- * A sequence number defining the order of updates to the underlying entity.
762
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
763
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
764
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
765
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
766
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
767
- */
768
- entityEventSequence?: string | null;
769
- }
770
- export interface RewardCreatedEnvelope {
771
- entity: Reward;
772
- metadata: EventMetadata;
773
- }
774
- /**
775
- * Triggered when a reward is created.
776
- * @permissionScope Read Loyalty
777
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
778
- * @permissionScope Manage Loyalty
779
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
780
- * @permissionId LOYALTY.READ_REWARDS
781
- * @webhook
782
- * @eventType wix.loyalty.v1.reward_created
783
- * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
784
- * @slug created
785
- */
786
- export declare function onRewardCreated(handler: (event: RewardCreatedEnvelope) => void | Promise<void>): void;
787
- export interface RewardDeletedEnvelope {
788
- metadata: EventMetadata;
789
- }
790
- /**
791
- * Triggered when a reward is deleted.
792
- * @permissionScope Read Loyalty
793
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
794
- * @permissionScope Manage Loyalty
795
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
796
- * @permissionId LOYALTY.READ_REWARDS
797
- * @webhook
798
- * @eventType wix.loyalty.v1.reward_deleted
799
- * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
800
- * @slug deleted
801
- */
802
- export declare function onRewardDeleted(handler: (event: RewardDeletedEnvelope) => void | Promise<void>): void;
803
- export interface RewardUpdatedEnvelope {
804
- entity: Reward;
805
- metadata: EventMetadata;
806
- }
807
- /**
808
- * Triggered when a reward is updated.
809
- * @permissionScope Read Loyalty
810
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
811
- * @permissionScope Manage Loyalty
812
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
813
- * @permissionId LOYALTY.READ_REWARDS
814
- * @webhook
815
- * @eventType wix.loyalty.v1.reward_updated
816
- * @serviceIdentifier com.wixpress.loyalty.reward.LoyaltyRewards
817
- * @slug updated
818
- */
819
- export declare function onRewardUpdated(handler: (event: RewardUpdatedEnvelope) => void | Promise<void>): void;
820
- /**
821
- * Creates a reward that can be redeemed with loyalty points.
822
- *
823
- * When a customer redeems a reward, a loyalty coupon is created
824
- * based on the specifications detailed in either the `discountAmount` or `couponReward` fields. This coupon can
825
- * then be used by the customer to receive the discount. Note that while the Rewards API uses coupon scopes and specifications,
826
- * no coupon is actually created until a reward is redeemed with points.
827
- * See the Coupons API for more information about coupons.
828
- *
829
- * A reward's `active` status defaults to `false`. To make the reward available to customers,
830
- * either set the `active` field to `true` during creation or call [`updateReward()`](#updatereward)
831
- * to change the status.
832
- *
833
- * To customize a reward for each loyalty tier, use the `configsByTier` parameter.
834
- * This allows you to specify the amount of the earned discount, the cost in loyalty points
835
- * to redeem the reward, and the tier to which this configuration applies. Each tier requires its own
836
- * `configsByTier` configuration. To create a reward that is available to loyalty accounts in the base tier,
837
- * leave the `tierId` field empty. See the Loyalty Tiers API for more information on tiers.
838
- * @param reward - Reward to create.
839
- * @public
840
- * @requiredField reward
841
- * @requiredField reward.name
842
- * @requiredField reward.typeDetails
843
- * @permissionId LOYALTY.MANAGE_REWARDS
844
- * @permissionScope Manage Loyalty
845
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
846
- * @applicableIdentity APP
847
- * @returns Created reward.
848
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.CreateReward
849
- */
850
- export declare function createReward(reward: Reward): Promise<Reward & RewardNonNullableFields>;
851
- /**
852
- * Creates multiple rewards.
853
- * @param rewards - Rewards to create.
854
- * @public
855
- * @requiredField rewards
856
- * @requiredField rewards.name
857
- * @requiredField rewards.typeDetails
858
- * @permissionId LOYALTY.MANAGE_REWARDS
859
- * @permissionScope Manage Loyalty
860
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
861
- * @applicableIdentity APP
862
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.BulkCreateRewards
863
- */
864
- export declare function bulkCreateRewards(rewards: Reward[]): Promise<BulkCreateRewardsResponse & BulkCreateRewardsResponseNonNullableFields>;
865
- /**
866
- * Retrieves a reward.
867
- * @param _id - ID of the reward to retrieve.
868
- * @public
869
- * @requiredField _id
870
- * @permissionId LOYALTY.READ_REWARDS
871
- * @permissionScope Read Loyalty
872
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
873
- * @permissionScope Manage Loyalty
874
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
875
- * @applicableIdentity APP
876
- * @applicableIdentity VISITOR
877
- * @returns Retrieved reward.
878
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.GetReward
879
- */
880
- export declare function getReward(_id: string): Promise<Reward & RewardNonNullableFields>;
881
- /**
882
- * Retrieves rewards from all metasites that the caller is the member of.
883
- *
884
- * Must be called with user identity.
885
- * @public
886
- * @documentationMaturity preview
887
- * @permissionId LOYALTY.REWARD_BULK_READ
888
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.BulkGetRewards
889
- */
890
- export declare function bulkGetRewards(): Promise<BulkGetRewardsResponse & BulkGetRewardsResponseNonNullableFields>;
891
- /**
892
- * Retrieves a list of rewards, given the provided paging, filtering, and sorting.
893
- *
894
- * Query Rewards runs with these defaults, which you can override: `cursorPaging.limit` is `50`.
895
- *
896
- * To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),[Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
897
- * @param query - Query parameters.
898
- * @public
899
- * @requiredField query
900
- * @permissionId LOYALTY.READ_REWARDS
901
- * @permissionScope Read Loyalty
902
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
903
- * @permissionScope Manage Loyalty
904
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
905
- * @applicableIdentity APP
906
- * @applicableIdentity VISITOR
907
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.QueryRewards
908
- */
909
- export declare function queryRewards(query: CursorQuery): Promise<QueryRewardsResponse & QueryRewardsResponseNonNullableFields>;
910
- /**
911
- * Updates a loyalty reward.
912
- *
913
- * Use this endpoint to update details of a reward, such as the name, whether or not a reward is active,
914
- * or the amount of points it costs to redeem. Also use this endpoint to add new tiers that are eligible to redeem a reward.
915
- *
916
- * You may not change the `type` of a reward. That is set upon creation and cannot be updated.
917
- * @param _id - Reward ID.
918
- * @public
919
- * @requiredField _id
920
- * @requiredField reward
921
- * @requiredField reward.name
922
- * @requiredField reward.revision
923
- * @requiredField reward.typeDetails
924
- * @param reward - Reward info to update.
925
- * @permissionId LOYALTY.MANAGE_REWARDS
926
- * @permissionScope Manage Loyalty
927
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
928
- * @applicableIdentity APP
929
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.UpdateReward
930
- */
931
- export declare function updateReward(_id: string | null, reward: UpdateReward): Promise<UpdateRewardResponse & UpdateRewardResponseNonNullableFields>;
932
- export interface UpdateReward {
933
- /** Discount details. */
934
- discountAmount?: DiscountAmount;
935
- /** Coupon details. */
936
- couponReward?: CouponReward;
937
- /**
938
- * Reward ID.
939
- * @format GUID
940
- * @readonly
941
- */
942
- _id?: string | null;
943
- /**
944
- * Reward name.
945
- * @minLength 1
946
- * @maxLength 50
947
- */
948
- name?: string;
949
- /** Whether the reward is active. Default: `FALSE` */
950
- active?: boolean;
951
- /** Reward type. */
952
- type?: RewardType;
953
- /**
954
- * Revision number, which increments by 1 each time the loyalty reward is updated.
955
- *
956
- * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward.
957
- * @readonly
958
- */
959
- revision?: string | null;
960
- /**
961
- * Date and time the reward was created.
962
- * @readonly
963
- */
964
- _createdDate?: Date | null;
965
- /**
966
- * Date and time the reward was last updated.
967
- * @readonly
968
- */
969
- _updatedDate?: Date | null;
970
- }
971
- /**
972
- * Deletes a reward.
973
- * @param _id - ID of the reward to delete.
974
- * @param revision - Revision number, which increments by 1 each time the reward is updated.
975
- *
976
- * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
977
- * @public
978
- * @requiredField _id
979
- * @requiredField revision
980
- * @permissionId LOYALTY.MANAGE_REWARDS
981
- * @permissionScope Manage Loyalty
982
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
983
- * @applicableIdentity APP
984
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.DeleteReward
985
- */
986
- export declare function deleteReward(_id: string, revision: string): Promise<void>;
987
- /**
988
- * Retrieves a list of rewards.
989
- *
990
- * The list includes rewards that are currently nonredeemable due to insufficient points held by any customers.
991
- * @public
992
- * @param options - List options.
993
- * @permissionId LOYALTY.READ_REWARDS
994
- * @permissionScope Read Loyalty
995
- * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
996
- * @permissionScope Manage Loyalty
997
- * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
998
- * @applicableIdentity APP
999
- * @applicableIdentity VISITOR
1000
- * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.ListRewards
1001
- */
1002
- export declare function listRewards(options?: ListRewardsOptions): Promise<ListRewardsResponse & ListRewardsResponseNonNullableFields>;
1003
- export interface ListRewardsOptions {
1004
- /** Pagination options. */
1005
- cursorPaging?: CursorPaging;
1006
- }
1007
- export {};