@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,599 @@
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
+ * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values).
81
+ */
82
+ scope?: CouponScope;
83
+ /** Whether the coupon is limited to one item. */
84
+ limitedToOneItem?: boolean | null;
85
+ /** Whether the coupon also applies to subscriptions. */
86
+ appliesToSubscriptions?: boolean | null;
87
+ /**
88
+ * Specifies the amount of discounted cycles for a subscription item.
89
+ *
90
+ * Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`.
91
+ * If `discountedCycleCount` is empty, the coupon applies to all available cycles.
92
+ */
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
+ * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values).
111
+ */
112
+ scope?: CouponScope;
113
+ }
114
+ export interface FixedAmountDiscount {
115
+ /** Discount details for each tier. */
116
+ configsByTier?: FixedAmountDiscountConfig[];
117
+ }
118
+ export interface FixedAmountDiscountConfig {
119
+ /** Tier ID, or empty if config applies to the base tier. */
120
+ tierId?: string | null;
121
+ /** Amount of points required to redeem the reward. */
122
+ costInPoints?: number;
123
+ /** Discount amount. */
124
+ amount?: number;
125
+ }
126
+ export interface PercentageDiscount {
127
+ /** Discount details for each tier. */
128
+ configsByTier?: PercentageDiscountConfig[];
129
+ }
130
+ export interface PercentageDiscountConfig {
131
+ /** Tier ID, or empty if config applies to the base tier. */
132
+ tierId?: string | null;
133
+ /** Amount of points required to redeem the reward. */
134
+ costInPoints?: number;
135
+ /** Percentage discount. */
136
+ percentage?: number;
137
+ }
138
+ export interface FreeShippingDiscount {
139
+ /** Discount details for each tier. */
140
+ configsByTier?: FreeShippingDiscountConfig[];
141
+ }
142
+ export interface FreeShippingDiscountConfig {
143
+ /** Tier ID, or empty if config applies to the base tier. */
144
+ tierId?: string | null;
145
+ /** Amount of points required to redeem the reward. */
146
+ costInPoints?: number;
147
+ }
148
+ export interface CouponScope {
149
+ /**
150
+ * Scope namespace.
151
+ *
152
+ * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid namespaces.
153
+ */
154
+ namespace?: string;
155
+ /**
156
+ * Coupon scope's applied group.
157
+ *
158
+ * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups.
159
+ */
160
+ group?: Group;
161
+ }
162
+ export interface Group {
163
+ /**
164
+ * Name of coupon scope's group.
165
+ *
166
+ * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups.
167
+ */
168
+ name?: string;
169
+ /** Entity ID, if the coupon scope is limited to just one item. */
170
+ entityId?: string | null;
171
+ }
172
+ export interface SpiDiscountAmount {
173
+ /** Discount details for each tier. */
174
+ configsByTier?: DiscountAmountConfig[];
175
+ /** Description of the SPI discount amount reward. Taken from user input in the SPI config. */
176
+ description?: string;
177
+ }
178
+ export interface RewardDisabled {
179
+ }
180
+ export interface CreateRewardRequest {
181
+ /** Reward to create. */
182
+ reward: Reward;
183
+ }
184
+ export interface CreateRewardResponse {
185
+ /** Created reward. */
186
+ reward?: Reward;
187
+ }
188
+ export interface BulkCreateRewardsRequest {
189
+ /** Rewards to create. */
190
+ rewards: Reward[];
191
+ }
192
+ export interface BulkCreateRewardsResponse {
193
+ /** Created rewards. */
194
+ results?: BulkRewardResult[];
195
+ /** Total successes and failures of the bulk create rewards action. */
196
+ bulkActionMetadata?: BulkActionMetadata;
197
+ }
198
+ export interface BulkRewardResult {
199
+ /** Item metadata. */
200
+ itemMetadata?: ItemMetadata;
201
+ /** Created reward. */
202
+ item?: Reward;
203
+ }
204
+ export interface ItemMetadata {
205
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
206
+ id?: string | null;
207
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
208
+ originalIndex?: number;
209
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
210
+ success?: boolean;
211
+ /** Details about the error in case of failure. */
212
+ error?: ApplicationError;
213
+ }
214
+ export interface ApplicationError {
215
+ /** Error code. */
216
+ code?: string;
217
+ /** Description of the error. */
218
+ description?: string;
219
+ /** Data related to the error. */
220
+ data?: Record<string, any> | null;
221
+ }
222
+ export interface BulkActionMetadata {
223
+ /** Number of items that were successfully processed. */
224
+ totalSuccesses?: number;
225
+ /** Number of items that couldn't be processed. */
226
+ totalFailures?: number;
227
+ /** Number of failures without details because detailed failure threshold was exceeded. */
228
+ undetailedFailures?: number;
229
+ }
230
+ export interface GetRewardRequest {
231
+ /** ID of the reward to retrieve. */
232
+ id: string;
233
+ }
234
+ export interface GetRewardResponse {
235
+ /** Retrieved reward. */
236
+ reward?: Reward;
237
+ }
238
+ export interface BulkGetRewardsRequest {
239
+ }
240
+ export interface BulkGetRewardsResponse {
241
+ /** Found rewards per site. */
242
+ rewardsInSite?: RewardsInSite[];
243
+ }
244
+ export interface RewardsInSite {
245
+ /** Metasite id. */
246
+ metaSiteId?: string;
247
+ /** Rewards. */
248
+ rewards?: Reward[];
249
+ }
250
+ export interface QueryRewardsRequest {
251
+ /** Query parameters. */
252
+ query: CursorQuery;
253
+ }
254
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
255
+ /**
256
+ * Cursor paging options.
257
+ *
258
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
259
+ */
260
+ cursorPaging?: CursorPaging;
261
+ /**
262
+ * Filter object.
263
+ *
264
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
265
+ */
266
+ filter?: Record<string, any> | null;
267
+ /**
268
+ * Sort object.
269
+ *
270
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
271
+ */
272
+ sort?: Sorting[];
273
+ }
274
+ /** @oneof */
275
+ export interface CursorQueryPagingMethodOneOf {
276
+ /**
277
+ * Cursor paging options.
278
+ *
279
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
280
+ */
281
+ cursorPaging?: CursorPaging;
282
+ }
283
+ export interface Sorting {
284
+ /** Name of the field to sort by. */
285
+ fieldName?: string;
286
+ /** Sort order. */
287
+ order?: SortOrder;
288
+ }
289
+ export declare enum SortOrder {
290
+ ASC = "ASC",
291
+ DESC = "DESC"
292
+ }
293
+ export interface CursorPaging {
294
+ /** Maximum number of items to return in the results. */
295
+ limit?: number | null;
296
+ /**
297
+ * Pointer to the next or previous page in the list of results.
298
+ *
299
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
300
+ * Not relevant for the first request.
301
+ */
302
+ cursor?: string | null;
303
+ }
304
+ export interface QueryRewardsResponse {
305
+ /** Retrieved loyalty rewards. */
306
+ rewards?: Reward[];
307
+ /** Details on the paged set of results returned. */
308
+ pagingMetadata?: CursorPagingMetadata;
309
+ }
310
+ export interface CursorPagingMetadata {
311
+ /** Number of items returned in current page. */
312
+ count?: number | null;
313
+ /** Cursor strings that point to the next page, previous page, or both. */
314
+ cursors?: Cursors;
315
+ /**
316
+ * Whether there are more pages to retrieve following the current page.
317
+ *
318
+ * + `true`: Another page of results can be retrieved.
319
+ * + `false`: This is the last page.
320
+ */
321
+ hasNext?: boolean | null;
322
+ }
323
+ export interface Cursors {
324
+ /** Cursor string pointing to the next page in the list of results. */
325
+ next?: string | null;
326
+ /** Cursor pointing to the previous page in the list of results. */
327
+ prev?: string | null;
328
+ }
329
+ export interface UpdateRewardRequest {
330
+ /** Reward information to update. */
331
+ reward: Reward;
332
+ }
333
+ export interface UpdateRewardResponse {
334
+ /** Updated reward. */
335
+ reward?: Reward;
336
+ }
337
+ export interface DeleteRewardRequest {
338
+ /** ID of the reward to delete. */
339
+ id: string;
340
+ /**
341
+ * Revision number, which increments by 1 each time the reward is updated.
342
+ *
343
+ * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
344
+ */
345
+ revision?: string;
346
+ }
347
+ export interface DeleteRewardResponse {
348
+ }
349
+ export interface ListRewardsRequest {
350
+ /** Pagination options. */
351
+ cursorPaging?: CursorPaging;
352
+ }
353
+ export interface ListRewardsResponse {
354
+ /** Retrieved loyalty rewards. */
355
+ rewards?: Reward[];
356
+ /** Details on the paged set of results returned. */
357
+ pagingMetadata?: PagingMetadataV2;
358
+ }
359
+ export interface PagingMetadataV2 {
360
+ /** Number of items returned in the response. */
361
+ count?: number | null;
362
+ /** Offset that was requested. */
363
+ offset?: number | null;
364
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
365
+ total?: number | null;
366
+ /** Flag that indicates the server failed to calculate the `total` field. */
367
+ tooManyToCount?: boolean | null;
368
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
369
+ cursors?: Cursors;
370
+ }
371
+ export interface ListRewardsInTierRequest {
372
+ /**
373
+ * Tier id.
374
+ * @readonly
375
+ */
376
+ tierId?: string | null;
377
+ /** Pagination options. */
378
+ cursorPaging?: CursorPaging;
379
+ }
380
+ export interface ListRewardsInTierResponse {
381
+ /** Retrieved loyalty rewards. */
382
+ rewards?: Reward[];
383
+ /** Details on the paged set of results returned. */
384
+ pagingMetadata?: PagingMetadataV2;
385
+ }
386
+ export interface DomainEvent extends DomainEventBodyOneOf {
387
+ createdEvent?: EntityCreatedEvent;
388
+ updatedEvent?: EntityUpdatedEvent;
389
+ deletedEvent?: EntityDeletedEvent;
390
+ actionEvent?: ActionEvent;
391
+ /**
392
+ * Unique event ID.
393
+ * Allows clients to ignore duplicate webhooks.
394
+ */
395
+ id?: string;
396
+ /**
397
+ * Assumes actions are also always typed to an entity_type
398
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
399
+ */
400
+ entityFqdn?: string;
401
+ /**
402
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
403
+ * This is although the created/updated/deleted notion is duplication of the oneof types
404
+ * Example: created/updated/deleted/started/completed/email_opened
405
+ */
406
+ slug?: string;
407
+ /** ID of the entity associated with the event. */
408
+ entityId?: string;
409
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
410
+ eventTime?: Date | null;
411
+ /**
412
+ * Whether the event was triggered as a result of a privacy regulation application
413
+ * (for example, GDPR).
414
+ */
415
+ triggeredByAnonymizeRequest?: boolean | null;
416
+ /** If present, indicates the action that triggered the event. */
417
+ originatedFrom?: string | null;
418
+ /**
419
+ * A sequence number defining the order of updates to the underlying entity.
420
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
421
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
422
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
423
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
424
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
425
+ */
426
+ entityEventSequence?: string | null;
427
+ }
428
+ /** @oneof */
429
+ export interface DomainEventBodyOneOf {
430
+ createdEvent?: EntityCreatedEvent;
431
+ updatedEvent?: EntityUpdatedEvent;
432
+ deletedEvent?: EntityDeletedEvent;
433
+ actionEvent?: ActionEvent;
434
+ }
435
+ export interface EntityCreatedEvent {
436
+ entityAsJson?: string;
437
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
438
+ restoreInfo?: RestoreInfo;
439
+ }
440
+ export interface RestoreInfo {
441
+ deletedDate?: Date | null;
442
+ }
443
+ export interface EntityUpdatedEvent {
444
+ /**
445
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
446
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
447
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
448
+ */
449
+ currentEntityAsJson?: string;
450
+ }
451
+ export interface EntityDeletedEvent {
452
+ /** Entity that was deleted */
453
+ deletedEntityAsJson?: string | null;
454
+ }
455
+ export interface ActionEvent {
456
+ bodyAsJson?: string;
457
+ }
458
+ export interface Empty {
459
+ }
460
+ export interface MessageEnvelope {
461
+ /** App instance ID. */
462
+ instanceId?: string | null;
463
+ /** Event type. */
464
+ eventType?: string;
465
+ /** The identification type and identity data. */
466
+ identity?: IdentificationData;
467
+ /** Stringify payload. */
468
+ data?: string;
469
+ }
470
+ export interface IdentificationData extends IdentificationDataIdOneOf {
471
+ /** ID of a site visitor that has not logged in to the site. */
472
+ anonymousVisitorId?: string;
473
+ /** ID of a site visitor that has logged in to the site. */
474
+ memberId?: string;
475
+ /** ID of a Wix user (site owner, contributor, etc.). */
476
+ wixUserId?: string;
477
+ /** ID of an app. */
478
+ appId?: string;
479
+ /** @readonly */
480
+ identityType?: WebhookIdentityType;
481
+ }
482
+ /** @oneof */
483
+ export interface IdentificationDataIdOneOf {
484
+ /** ID of a site visitor that has not logged in to the site. */
485
+ anonymousVisitorId?: string;
486
+ /** ID of a site visitor that has logged in to the site. */
487
+ memberId?: string;
488
+ /** ID of a Wix user (site owner, contributor, etc.). */
489
+ wixUserId?: string;
490
+ /** ID of an app. */
491
+ appId?: string;
492
+ }
493
+ export declare enum WebhookIdentityType {
494
+ UNKNOWN = "UNKNOWN",
495
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
496
+ MEMBER = "MEMBER",
497
+ WIX_USER = "WIX_USER",
498
+ APP = "APP"
499
+ }
500
+ interface DiscountAmountConfigNonNullableFields {
501
+ amount: string;
502
+ costInPoints: number;
503
+ }
504
+ interface DiscountAmountNonNullableFields {
505
+ amount: string;
506
+ configsByTier: DiscountAmountConfigNonNullableFields[];
507
+ }
508
+ interface FixedAmountDiscountConfigNonNullableFields {
509
+ costInPoints: number;
510
+ amount: number;
511
+ }
512
+ interface FixedAmountDiscountNonNullableFields {
513
+ configsByTier: FixedAmountDiscountConfigNonNullableFields[];
514
+ }
515
+ interface PercentageDiscountConfigNonNullableFields {
516
+ costInPoints: number;
517
+ percentage: number;
518
+ }
519
+ interface PercentageDiscountNonNullableFields {
520
+ configsByTier: PercentageDiscountConfigNonNullableFields[];
521
+ }
522
+ interface FreeShippingDiscountConfigNonNullableFields {
523
+ costInPoints: number;
524
+ }
525
+ interface FreeShippingDiscountNonNullableFields {
526
+ configsByTier: FreeShippingDiscountConfigNonNullableFields[];
527
+ }
528
+ interface GroupNonNullableFields {
529
+ name: string;
530
+ }
531
+ interface CouponScopeNonNullableFields {
532
+ namespace: string;
533
+ group?: GroupNonNullableFields;
534
+ }
535
+ interface CouponRewardNonNullableFields {
536
+ fixedAmount?: FixedAmountDiscountNonNullableFields;
537
+ percentage?: PercentageDiscountNonNullableFields;
538
+ freeShipping?: FreeShippingDiscountNonNullableFields;
539
+ minimumSubtotal: number;
540
+ scope?: CouponScopeNonNullableFields;
541
+ }
542
+ interface SpiDiscountAmountNonNullableFields {
543
+ configsByTier: DiscountAmountConfigNonNullableFields[];
544
+ description: string;
545
+ }
546
+ interface RewardNonNullableFields {
547
+ discountAmount?: DiscountAmountNonNullableFields;
548
+ couponReward?: CouponRewardNonNullableFields;
549
+ spiDiscountAmount?: SpiDiscountAmountNonNullableFields;
550
+ name: string;
551
+ requiredPoints: number;
552
+ active: boolean;
553
+ type: RewardType;
554
+ }
555
+ export interface CreateRewardResponseNonNullableFields {
556
+ reward?: RewardNonNullableFields;
557
+ }
558
+ interface ApplicationErrorNonNullableFields {
559
+ code: string;
560
+ description: string;
561
+ }
562
+ interface ItemMetadataNonNullableFields {
563
+ originalIndex: number;
564
+ success: boolean;
565
+ error?: ApplicationErrorNonNullableFields;
566
+ }
567
+ interface BulkRewardResultNonNullableFields {
568
+ itemMetadata?: ItemMetadataNonNullableFields;
569
+ item?: RewardNonNullableFields;
570
+ }
571
+ interface BulkActionMetadataNonNullableFields {
572
+ totalSuccesses: number;
573
+ totalFailures: number;
574
+ undetailedFailures: number;
575
+ }
576
+ export interface BulkCreateRewardsResponseNonNullableFields {
577
+ results: BulkRewardResultNonNullableFields[];
578
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
579
+ }
580
+ export interface GetRewardResponseNonNullableFields {
581
+ reward?: RewardNonNullableFields;
582
+ }
583
+ interface RewardsInSiteNonNullableFields {
584
+ metaSiteId: string;
585
+ rewards: RewardNonNullableFields[];
586
+ }
587
+ export interface BulkGetRewardsResponseNonNullableFields {
588
+ rewardsInSite: RewardsInSiteNonNullableFields[];
589
+ }
590
+ export interface QueryRewardsResponseNonNullableFields {
591
+ rewards: RewardNonNullableFields[];
592
+ }
593
+ export interface UpdateRewardResponseNonNullableFields {
594
+ reward?: RewardNonNullableFields;
595
+ }
596
+ export interface ListRewardsResponseNonNullableFields {
597
+ rewards: RewardNonNullableFields[];
598
+ }
599
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookIdentityType = exports.SortOrder = exports.RewardType = void 0;
4
+ /** Available reward types. */
5
+ var RewardType;
6
+ (function (RewardType) {
7
+ /** Undefined reward type. */
8
+ RewardType["UNDEFINED"] = "UNDEFINED";
9
+ /** Discount reward. Special flexible reward type used in checkout. */
10
+ RewardType["DISCOUNT_AMOUNT"] = "DISCOUNT_AMOUNT";
11
+ /** Coupon reward. [Learn more about coupons.](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards) */
12
+ RewardType["COUPON_REWARD"] = "COUPON_REWARD";
13
+ /** For internal use. */
14
+ RewardType["SPI_DISCOUNT_AMOUNT"] = "SPI_DISCOUNT_AMOUNT";
15
+ })(RewardType || (exports.RewardType = RewardType = {}));
16
+ var SortOrder;
17
+ (function (SortOrder) {
18
+ SortOrder["ASC"] = "ASC";
19
+ SortOrder["DESC"] = "DESC";
20
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
21
+ var WebhookIdentityType;
22
+ (function (WebhookIdentityType) {
23
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
24
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
25
+ WebhookIdentityType["MEMBER"] = "MEMBER";
26
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
27
+ WebhookIdentityType["APP"] = "APP";
28
+ })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
29
+ //# sourceMappingURL=loyalty-v1-reward-rewards.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty-v1-reward-rewards.types.js","sourceRoot":"","sources":["../../../../src/loyalty-v1-reward-rewards.types.ts"],"names":[],"mappings":";;;AA+CA,8BAA8B;AAC9B,IAAY,UASX;AATD,WAAY,UAAU;IACpB,6BAA6B;IAC7B,qCAAuB,CAAA;IACvB,sEAAsE;IACtE,iDAAmC,CAAA;IACnC,sHAAsH;IACtH,6CAA+B,CAAA;IAC/B,wBAAwB;IACxB,yDAA2C,CAAA;AAC7C,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB;AA0QD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAgOD,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B"}