@wix/auto_sdk_loyalty_rewards 1.0.7 → 1.0.8

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