@wix/auto_sdk_loyalty_rewards 1.0.0

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