@wix/auto_sdk_loyalty_coupons 1.0.8 → 1.0.10

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 (130) 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-coupon-coupons.context.d.ts +22 -0
  11. package/build/cjs/src/loyalty-v1-coupon-coupons.context.js +29 -0
  12. package/build/cjs/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
  13. package/build/cjs/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
  14. package/build/cjs/src/loyalty-v1-coupon-coupons.http.js +389 -0
  15. package/build/cjs/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
  16. package/build/cjs/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
  17. package/build/cjs/src/loyalty-v1-coupon-coupons.meta.js +161 -0
  18. package/build/cjs/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
  19. package/build/cjs/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
  20. package/build/cjs/src/loyalty-v1-coupon-coupons.public.js +98 -0
  21. package/build/cjs/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
  22. package/build/{meta.d.mts → cjs/src/loyalty-v1-coupon-coupons.types.d.ts} +201 -61
  23. package/build/cjs/src/loyalty-v1-coupon-coupons.types.js +41 -0
  24. package/build/cjs/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
  25. package/build/{internal/loyalty-v1-coupon-coupons.universal-BpPn8h94.d.mts → cjs/src/loyalty-v1-coupon-coupons.universal.d.ts} +218 -58
  26. package/build/cjs/src/loyalty-v1-coupon-coupons.universal.js +370 -0
  27. package/build/cjs/src/loyalty-v1-coupon-coupons.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-coupon-coupons.context.d.ts +22 -0
  39. package/build/es/src/loyalty-v1-coupon-coupons.context.js +22 -0
  40. package/build/es/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
  41. package/build/es/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
  42. package/build/es/src/loyalty-v1-coupon-coupons.http.js +379 -0
  43. package/build/es/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
  44. package/build/es/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
  45. package/build/es/src/loyalty-v1-coupon-coupons.meta.js +128 -0
  46. package/build/es/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
  47. package/build/es/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
  48. package/build/es/src/loyalty-v1-coupon-coupons.public.js +84 -0
  49. package/build/es/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
  50. package/build/{internal/meta.d.mts → es/src/loyalty-v1-coupon-coupons.types.d.ts} +201 -61
  51. package/build/es/src/loyalty-v1-coupon-coupons.types.js +38 -0
  52. package/build/es/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
  53. package/build/{loyalty-v1-coupon-coupons.universal-BpPn8h94.d.ts → es/src/loyalty-v1-coupon-coupons.universal.d.ts} +218 -58
  54. package/build/es/src/loyalty-v1-coupon-coupons.universal.js +337 -0
  55. package/build/es/src/loyalty-v1-coupon-coupons.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-coupon-coupons.context.d.ts +22 -0
  66. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.context.js +29 -0
  67. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
  68. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
  69. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.js +389 -0
  70. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
  71. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
  72. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.js +161 -0
  73. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
  74. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
  75. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.js +98 -0
  76. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
  77. package/build/internal/{meta.d.ts → cjs/src/loyalty-v1-coupon-coupons.types.d.ts} +201 -61
  78. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.types.js +41 -0
  79. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
  80. package/build/{loyalty-v1-coupon-coupons.universal-BpPn8h94.d.mts → internal/cjs/src/loyalty-v1-coupon-coupons.universal.d.ts} +218 -58
  81. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.universal.js +370 -0
  82. package/build/internal/cjs/src/loyalty-v1-coupon-coupons.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-coupon-coupons.context.d.ts +22 -0
  93. package/build/internal/es/src/loyalty-v1-coupon-coupons.context.js +22 -0
  94. package/build/internal/es/src/loyalty-v1-coupon-coupons.context.js.map +1 -0
  95. package/build/internal/es/src/loyalty-v1-coupon-coupons.http.d.ts +43 -0
  96. package/build/internal/es/src/loyalty-v1-coupon-coupons.http.js +379 -0
  97. package/build/internal/es/src/loyalty-v1-coupon-coupons.http.js.map +1 -0
  98. package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.d.ts +23 -0
  99. package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.js +128 -0
  100. package/build/internal/es/src/loyalty-v1-coupon-coupons.meta.js.map +1 -0
  101. package/build/internal/es/src/loyalty-v1-coupon-coupons.public.d.ts +85 -0
  102. package/build/internal/es/src/loyalty-v1-coupon-coupons.public.js +84 -0
  103. package/build/internal/es/src/loyalty-v1-coupon-coupons.public.js.map +1 -0
  104. package/build/{meta.d.ts → internal/es/src/loyalty-v1-coupon-coupons.types.d.ts} +201 -61
  105. package/build/internal/es/src/loyalty-v1-coupon-coupons.types.js +38 -0
  106. package/build/internal/es/src/loyalty-v1-coupon-coupons.types.js.map +1 -0
  107. package/build/internal/{loyalty-v1-coupon-coupons.universal-BpPn8h94.d.ts → es/src/loyalty-v1-coupon-coupons.universal.d.ts} +218 -58
  108. package/build/internal/es/src/loyalty-v1-coupon-coupons.universal.js +337 -0
  109. package/build/internal/es/src/loyalty-v1-coupon-coupons.universal.js.map +1 -0
  110. package/package.json +13 -14
  111. package/build/index.d.mts +0 -100
  112. package/build/index.d.ts +0 -100
  113. package/build/index.js +0 -753
  114. package/build/index.js.map +0 -1
  115. package/build/index.mjs +0 -717
  116. package/build/index.mjs.map +0 -1
  117. package/build/internal/index.d.mts +0 -100
  118. package/build/internal/index.d.ts +0 -100
  119. package/build/internal/index.js +0 -753
  120. package/build/internal/index.js.map +0 -1
  121. package/build/internal/index.mjs +0 -717
  122. package/build/internal/index.mjs.map +0 -1
  123. package/build/internal/meta.js +0 -515
  124. package/build/internal/meta.js.map +0 -1
  125. package/build/internal/meta.mjs +0 -482
  126. package/build/internal/meta.mjs.map +0 -1
  127. package/build/meta.js +0 -515
  128. package/build/meta.js.map +0 -1
  129. package/build/meta.mjs +0 -482
  130. package/build/meta.mjs.map +0 -1
@@ -1,8 +1,9 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
1
2
  /**
2
3
  * A loyalty coupon is created when a customer redeems their loyalty points for a reward. Creating a loyalty coupon
3
4
  * also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
4
5
  */
5
- interface LoyaltyCoupon {
6
+ export interface LoyaltyCoupon {
6
7
  /**
7
8
  * Loyalty coupon ID.
8
9
  * @format GUID
@@ -75,7 +76,7 @@ interface LoyaltyCoupon {
75
76
  */
76
77
  _updatedDate?: Date | null;
77
78
  }
78
- interface CouponReference {
79
+ export interface CouponReference {
79
80
  /**
80
81
  * Coupon ID.
81
82
  * @format GUID
@@ -107,7 +108,7 @@ interface CouponReference {
107
108
  */
108
109
  deleted?: boolean | null;
109
110
  }
110
- interface Specification extends SpecificationTypeDetailsOneOf, SpecificationScopeOrMinSubtotalOneOf {
111
+ export interface Specification extends SpecificationTypeDetailsOneOf, SpecificationScopeOrMinSubtotalOneOf {
111
112
  /** Fixed price discount. */
112
113
  moneyOffAmount?: number;
113
114
  /** Discount as a percentage. */
@@ -153,7 +154,7 @@ interface Specification extends SpecificationTypeDetailsOneOf, SpecificationScop
153
154
  discountedCycleCount?: number | null;
154
155
  }
155
156
  /** @oneof */
156
- interface SpecificationTypeDetailsOneOf {
157
+ export interface SpecificationTypeDetailsOneOf {
157
158
  /** Fixed price discount. */
158
159
  moneyOffAmount?: number;
159
160
  /** Discount as a percentage. */
@@ -170,7 +171,7 @@ interface SpecificationTypeDetailsOneOf {
170
171
  buyXGetY?: BuyXGetY;
171
172
  }
172
173
  /** @oneof */
173
- interface SpecificationScopeOrMinSubtotalOneOf {
174
+ export interface SpecificationScopeOrMinSubtotalOneOf {
174
175
  /**
175
176
  * Scope of the coupon. When no scope is defined, the coupon applies to all
176
177
  * items in all `namespaces` in the site.
@@ -179,7 +180,7 @@ interface SpecificationScopeOrMinSubtotalOneOf {
179
180
  /** The coupon is only applicable when the order subtotal is over this amount. */
180
181
  minimumSubtotal?: number | null;
181
182
  }
182
- declare enum Type {
183
+ export declare enum Type {
183
184
  UNKNOWN = "UNKNOWN",
184
185
  MONEY_OFF_AMOUNT = "MONEY_OFF_AMOUNT",
185
186
  PERCENT_OFF_RATE = "PERCENT_OFF_RATE",
@@ -187,13 +188,13 @@ declare enum Type {
187
188
  FIXED_PRICE_AMOUNT = "FIXED_PRICE_AMOUNT",
188
189
  BUY_X_GET_Y = "BUY_X_GET_Y"
189
190
  }
190
- interface BuyXGetY {
191
+ export interface BuyXGetY {
191
192
  /** Number of purchased items required to receive free items. */
192
193
  x?: number;
193
194
  /** Number of items received for free if required number of items were purchased. */
194
195
  y?: number;
195
196
  }
196
- interface Scope {
197
+ export interface Scope {
197
198
  /**
198
199
  * Group within a `namespace` for which the coupon is applicable.
199
200
  *
@@ -221,7 +222,7 @@ interface Scope {
221
222
  */
222
223
  namespace?: string;
223
224
  }
224
- declare enum Status {
225
+ export declare enum Status {
225
226
  /** Unknown status. */
226
227
  UNKNOWN = "UNKNOWN",
227
228
  /** The reference coupon was created but the loyalty points have not been redeemed yet. */
@@ -235,7 +236,7 @@ declare enum Status {
235
236
  /** The reference coupon was deleted. */
236
237
  ARCHIVED = "ARCHIVED"
237
238
  }
238
- interface RedeemPointsForCouponRequest {
239
+ export interface RedeemPointsForCouponRequest {
239
240
  /**
240
241
  * ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
241
242
  * @format GUID
@@ -247,22 +248,22 @@ interface RedeemPointsForCouponRequest {
247
248
  */
248
249
  loyaltyAccountId: string;
249
250
  }
250
- interface RedeemPointsForCouponResponse {
251
+ export interface RedeemPointsForCouponResponse {
251
252
  /** Created loyalty coupon. */
252
253
  coupon?: LoyaltyCoupon;
253
254
  }
254
- interface RedeemCurrentMemberPointsForCouponRequest {
255
+ export interface RedeemCurrentMemberPointsForCouponRequest {
255
256
  /**
256
257
  * ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
257
258
  * @format GUID
258
259
  */
259
260
  rewardId: string;
260
261
  }
261
- interface RedeemCurrentMemberPointsForCouponResponse {
262
+ export interface RedeemCurrentMemberPointsForCouponResponse {
262
263
  /** Created loyalty coupon. */
263
264
  coupon?: LoyaltyCoupon;
264
265
  }
265
- interface RedeemMemberPointsForDiscountAmountCouponRequest {
266
+ export interface RedeemMemberPointsForDiscountAmountCouponRequest {
266
267
  /**
267
268
  * ID of the [loyalty reward](https://dev.wix.com/api/rest/wix-loyalty-program/rewards) to redeem.
268
269
  * @format GUID
@@ -278,28 +279,28 @@ interface RedeemMemberPointsForDiscountAmountCouponRequest {
278
279
  /** Coupon specification. */
279
280
  specification?: Specification;
280
281
  }
281
- interface RedeemMemberPointsForDiscountAmountCouponResponse {
282
+ export interface RedeemMemberPointsForDiscountAmountCouponResponse {
282
283
  /** Created loyalty coupon. */
283
284
  coupon?: LoyaltyCoupon;
284
285
  /** Transaction id of the coupon redemption */
285
286
  transactionId?: string;
286
287
  }
287
- interface GetLoyaltyCouponRequest {
288
+ export interface GetLoyaltyCouponRequest {
288
289
  /**
289
290
  * ID of the loyalty coupon to retrieve.
290
291
  * @format GUID
291
292
  */
292
293
  loyaltyCouponId: string;
293
294
  }
294
- interface GetLoyaltyCouponResponse {
295
+ export interface GetLoyaltyCouponResponse {
295
296
  /** Retrieved loyalty coupon. */
296
297
  loyaltyCoupon?: LoyaltyCoupon;
297
298
  }
298
- interface BulkGetLoyaltyCouponRequest {
299
+ export interface BulkGetLoyaltyCouponRequest {
299
300
  /** Query to filter loyalty coupons. */
300
301
  query?: CursorQuery;
301
302
  }
302
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
303
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
303
304
  /**
304
305
  * Cursor paging options.
305
306
  *
@@ -321,7 +322,7 @@ interface CursorQuery extends CursorQueryPagingMethodOneOf {
321
322
  sort?: Sorting[];
322
323
  }
323
324
  /** @oneof */
324
- interface CursorQueryPagingMethodOneOf {
325
+ export interface CursorQueryPagingMethodOneOf {
325
326
  /**
326
327
  * Cursor paging options.
327
328
  *
@@ -329,7 +330,7 @@ interface CursorQueryPagingMethodOneOf {
329
330
  */
330
331
  cursorPaging?: CursorPaging;
331
332
  }
332
- interface Sorting {
333
+ export interface Sorting {
333
334
  /**
334
335
  * Name of the field to sort by.
335
336
  * @maxLength 512
@@ -338,11 +339,11 @@ interface Sorting {
338
339
  /** Sort order. */
339
340
  order?: SortOrder;
340
341
  }
341
- declare enum SortOrder {
342
+ export declare enum SortOrder {
342
343
  ASC = "ASC",
343
344
  DESC = "DESC"
344
345
  }
345
- interface CursorPaging {
346
+ export interface CursorPaging {
346
347
  /**
347
348
  * Maximum number of items to return in the results.
348
349
  * @max 100
@@ -357,14 +358,14 @@ interface CursorPaging {
357
358
  */
358
359
  cursor?: string | null;
359
360
  }
360
- interface BulkGetLoyaltyCouponResponse {
361
+ export interface BulkGetLoyaltyCouponResponse {
361
362
  /**
362
363
  * Retrieved loyalty coupons.
363
364
  * @maxSize 100
364
365
  */
365
366
  couponsInSite?: CouponsInSite[];
366
367
  }
367
- interface CouponsInSite {
368
+ export interface CouponsInSite {
368
369
  /**
369
370
  * Metasite id
370
371
  * @format GUID
@@ -376,17 +377,17 @@ interface CouponsInSite {
376
377
  */
377
378
  loyaltyCoupons?: LoyaltyCoupon[];
378
379
  }
379
- interface GetCurrentMemberCouponsRequest {
380
+ export interface GetCurrentMemberCouponsRequest {
380
381
  }
381
- interface GetCurrentMemberCouponsResponse {
382
+ export interface GetCurrentMemberCouponsResponse {
382
383
  /** Retrieved loyalty coupons. */
383
384
  loyaltyCoupons?: LoyaltyCoupon[];
384
385
  }
385
- interface QueryLoyaltyCouponRequest {
386
+ export interface QueryLoyaltyCouponRequest {
386
387
  /** Query options. */
387
388
  query: QueryV2;
388
389
  }
389
- interface QueryV2 extends QueryV2PagingMethodOneOf {
390
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
390
391
  /** Paging options to limit and skip the number of items. */
391
392
  paging?: Paging;
392
393
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
@@ -409,25 +410,25 @@ interface QueryV2 extends QueryV2PagingMethodOneOf {
409
410
  fieldsets?: string[];
410
411
  }
411
412
  /** @oneof */
412
- interface QueryV2PagingMethodOneOf {
413
+ export interface QueryV2PagingMethodOneOf {
413
414
  /** Paging options to limit and skip the number of items. */
414
415
  paging?: Paging;
415
416
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
416
417
  cursorPaging?: CursorPaging;
417
418
  }
418
- interface Paging {
419
+ export interface Paging {
419
420
  /** Number of items to load. */
420
421
  limit?: number | null;
421
422
  /** Number of items to skip in the current sort order. */
422
423
  offset?: number | null;
423
424
  }
424
- interface QueryLoyaltyCouponResponse {
425
+ export interface QueryLoyaltyCouponResponse {
425
426
  /** Retrieved loyalty coupons. */
426
427
  loyaltyCoupons?: LoyaltyCoupon[];
427
428
  /** Metadata. */
428
429
  metadata?: PagingMetadataV2;
429
430
  }
430
- interface PagingMetadataV2 {
431
+ export interface PagingMetadataV2 {
431
432
  /** Number of items returned in the response. */
432
433
  count?: number | null;
433
434
  /** Offset that was requested. */
@@ -439,7 +440,7 @@ interface PagingMetadataV2 {
439
440
  /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
440
441
  cursors?: Cursors;
441
442
  }
442
- interface Cursors {
443
+ export interface Cursors {
443
444
  /**
444
445
  * Cursor string pointing to the next page in the list of results.
445
446
  * @maxLength 16000
@@ -451,7 +452,7 @@ interface Cursors {
451
452
  */
452
453
  prev?: string | null;
453
454
  }
454
- interface DeleteLoyaltyCouponRequest {
455
+ export interface DeleteLoyaltyCouponRequest {
455
456
  /**
456
457
  * ID of the loyalty coupon to delete.
457
458
  * @format GUID
@@ -464,9 +465,9 @@ interface DeleteLoyaltyCouponRequest {
464
465
  */
465
466
  revision?: string;
466
467
  }
467
- interface DeleteLoyaltyCouponResponse {
468
+ export interface DeleteLoyaltyCouponResponse {
468
469
  }
469
- interface DomainEvent extends DomainEventBodyOneOf {
470
+ export interface DomainEvent extends DomainEventBodyOneOf {
470
471
  createdEvent?: EntityCreatedEvent;
471
472
  updatedEvent?: EntityUpdatedEvent;
472
473
  deletedEvent?: EntityDeletedEvent;
@@ -509,19 +510,19 @@ interface DomainEvent extends DomainEventBodyOneOf {
509
510
  entityEventSequence?: string | null;
510
511
  }
511
512
  /** @oneof */
512
- interface DomainEventBodyOneOf {
513
+ export interface DomainEventBodyOneOf {
513
514
  createdEvent?: EntityCreatedEvent;
514
515
  updatedEvent?: EntityUpdatedEvent;
515
516
  deletedEvent?: EntityDeletedEvent;
516
517
  actionEvent?: ActionEvent;
517
518
  }
518
- interface EntityCreatedEvent {
519
+ export interface EntityCreatedEvent {
519
520
  entity?: string;
520
521
  }
521
- interface RestoreInfo {
522
+ export interface RestoreInfo {
522
523
  deletedDate?: Date | null;
523
524
  }
524
- interface EntityUpdatedEvent {
525
+ export interface EntityUpdatedEvent {
525
526
  /**
526
527
  * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
527
528
  * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
@@ -529,16 +530,16 @@ interface EntityUpdatedEvent {
529
530
  */
530
531
  currentEntity?: string;
531
532
  }
532
- interface EntityDeletedEvent {
533
+ export interface EntityDeletedEvent {
533
534
  /** Entity that was deleted */
534
535
  deletedEntity?: string | null;
535
536
  }
536
- interface ActionEvent {
537
+ export interface ActionEvent {
537
538
  body?: string;
538
539
  }
539
- interface Empty {
540
+ export interface Empty {
540
541
  }
541
- interface MessageEnvelope {
542
+ export interface MessageEnvelope {
542
543
  /**
543
544
  * App instance ID.
544
545
  * @format GUID
@@ -554,7 +555,7 @@ interface MessageEnvelope {
554
555
  /** Stringify payload. */
555
556
  data?: string;
556
557
  }
557
- interface IdentificationData extends IdentificationDataIdOneOf {
558
+ export interface IdentificationData extends IdentificationDataIdOneOf {
558
559
  /**
559
560
  * ID of a site visitor that has not logged in to the site.
560
561
  * @format GUID
@@ -579,7 +580,7 @@ interface IdentificationData extends IdentificationDataIdOneOf {
579
580
  identityType?: WebhookIdentityType;
580
581
  }
581
582
  /** @oneof */
582
- interface IdentificationDataIdOneOf {
583
+ export interface IdentificationDataIdOneOf {
583
584
  /**
584
585
  * ID of a site visitor that has not logged in to the site.
585
586
  * @format GUID
@@ -601,14 +602,14 @@ interface IdentificationDataIdOneOf {
601
602
  */
602
603
  appId?: string;
603
604
  }
604
- declare enum WebhookIdentityType {
605
+ export declare enum WebhookIdentityType {
605
606
  UNKNOWN = "UNKNOWN",
606
607
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
607
608
  MEMBER = "MEMBER",
608
609
  WIX_USER = "WIX_USER",
609
610
  APP = "APP"
610
611
  }
611
- interface BaseEventMetadata {
612
+ export interface BaseEventMetadata {
612
613
  /**
613
614
  * App instance ID.
614
615
  * @format GUID
@@ -622,7 +623,7 @@ interface BaseEventMetadata {
622
623
  /** The identification type and identity data. */
623
624
  identity?: IdentificationData;
624
625
  }
625
- interface EventMetadata extends BaseEventMetadata {
626
+ export interface EventMetadata extends BaseEventMetadata {
626
627
  /**
627
628
  * Unique event ID.
628
629
  * Allows clients to ignore duplicate webhooks.
@@ -660,24 +661,164 @@ interface EventMetadata extends BaseEventMetadata {
660
661
  */
661
662
  entityEventSequence?: string | null;
662
663
  }
663
- interface CouponCreatedEnvelope {
664
+ export interface CouponCreatedEnvelope {
664
665
  entity: LoyaltyCoupon;
665
666
  metadata: EventMetadata;
666
667
  }
667
- interface CouponDeletedEnvelope {
668
+ /**
669
+ * Triggered when a loyalty coupon is created.
670
+ * @permissionScope Read Loyalty
671
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
672
+ * @permissionScope Manage Loyalty
673
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
674
+ * @permissionScope Manage Restaurants - all permissions
675
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
676
+ * @permissionId LOYALTY.READ_COUPONS
677
+ * @webhook
678
+ * @eventType wix.loyalty.v1.coupon_created
679
+ * @serviceIdentifier com.wixpress.loyalty.coupon.LoyaltyCoupons
680
+ * @slug created
681
+ */
682
+ export declare function onCouponCreated(handler: (event: CouponCreatedEnvelope) => void | Promise<void>): void;
683
+ export interface CouponDeletedEnvelope {
668
684
  metadata: EventMetadata;
669
685
  }
670
- interface RedeemPointsForCouponOptions {
686
+ /**
687
+ * Triggered when a loyalty coupon is deleted.
688
+ * @permissionScope Read Loyalty
689
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
690
+ * @permissionScope Manage Loyalty
691
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
692
+ * @permissionScope Manage Restaurants - all permissions
693
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
694
+ * @permissionId LOYALTY.READ_COUPONS
695
+ * @webhook
696
+ * @eventType wix.loyalty.v1.coupon_deleted
697
+ * @serviceIdentifier com.wixpress.loyalty.coupon.LoyaltyCoupons
698
+ * @slug deleted
699
+ */
700
+ export declare function onCouponDeleted(handler: (event: CouponDeletedEnvelope) => void | Promise<void>): void;
701
+ type CouponNonNullablePaths = `_id` | `accountId` | `memberIdDeprecated` | `couponReference.couponId` | `couponReference.code` | `couponReference.specification.moneyOffAmount` | `couponReference.specification.percentOffRate` | `couponReference.specification.freeShipping` | `couponReference.specification.fixedPriceAmount` | `couponReference.specification.buyXGetY.x` | `couponReference.specification.buyXGetY.y` | `couponReference.specification.scope.namespace` | `couponReference.specification.type` | `status` | `rewardName`;
702
+ /**
703
+ * Redeems a customer's loyalty points for a loyalty reward and creates a loyalty coupon.
704
+ *
705
+ * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
706
+ * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
707
+ * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
708
+ *
709
+ * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
710
+ * @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
711
+ * @public
712
+ * @requiredField options
713
+ * @requiredField options.loyaltyAccountId
714
+ * @requiredField rewardId
715
+ * @permissionId LOYALTY.REDEEM_COUPON
716
+ * @permissionScope Manage Restaurants - all permissions
717
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
718
+ * @applicableIdentity APP
719
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemPointsForCoupon
720
+ */
721
+ export declare function redeemPointsForCoupon(rewardId: string, options: NonNullablePaths<RedeemPointsForCouponOptions, `loyaltyAccountId`>): Promise<NonNullablePaths<RedeemPointsForCouponResponse, {
722
+ [P in CouponNonNullablePaths]: `coupon.${P}`;
723
+ }[CouponNonNullablePaths]>>;
724
+ export interface RedeemPointsForCouponOptions {
671
725
  /**
672
726
  * ID of the [loyalty account](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer redeeming points.
673
727
  * @format GUID
674
728
  */
675
729
  loyaltyAccountId: string;
676
730
  }
677
- interface BulkGetLoyaltyCouponOptions {
731
+ /**
732
+ * Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.
733
+ *
734
+ * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
735
+ * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
736
+ * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
737
+ *
738
+ * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
739
+ *
740
+ * >**Note:**
741
+ * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
742
+ * @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
743
+ * @public
744
+ * @requiredField rewardId
745
+ * @permissionId LOYALTY.REDEEM_OWN_COUPON
746
+ * @permissionScope Manage Loyalty
747
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
748
+ * @permissionScope Manage Restaurants - all permissions
749
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
750
+ * @applicableIdentity APP
751
+ * @applicableIdentity MEMBER
752
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemCurrentMemberPointsForCoupon
753
+ */
754
+ export declare function redeemCurrentMemberPointsForCoupon(rewardId: string): Promise<NonNullablePaths<RedeemCurrentMemberPointsForCouponResponse, {
755
+ [P in CouponNonNullablePaths]: `coupon.${P}`;
756
+ }[CouponNonNullablePaths]>>;
757
+ /**
758
+ * Retrieves a loyalty coupon.
759
+ * @param loyaltyCouponId - ID of the loyalty coupon to retrieve.
760
+ * @public
761
+ * @requiredField loyaltyCouponId
762
+ * @permissionId LOYALTY.READ_COUPONS
763
+ * @permissionScope Read Loyalty
764
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
765
+ * @permissionScope Manage Loyalty
766
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
767
+ * @permissionScope Manage Restaurants - all permissions
768
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
769
+ * @applicableIdentity APP
770
+ * @returns Retrieved loyalty coupon.
771
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetLoyaltyCoupon
772
+ */
773
+ export declare function getLoyaltyCoupon(loyaltyCouponId: string): Promise<NonNullablePaths<LoyaltyCoupon, CouponNonNullablePaths>>;
774
+ /**
775
+ * Retrieves a sequence of loyalty coupons
776
+ * @public
777
+ * @documentationMaturity preview
778
+ * @permissionId LOYALTY.REWARD_BULK_READ
779
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.BulkGetLoyaltyCoupon
780
+ */
781
+ export declare function bulkGetLoyaltyCoupon(options?: BulkGetLoyaltyCouponOptions): Promise<NonNullablePaths<BulkGetLoyaltyCouponResponse, `couponsInSite` | `couponsInSite.${number}.metaSiteId` | {
782
+ [P in CouponNonNullablePaths]: `couponsInSite.${number}.loyaltyCoupons.${number}.${P}`;
783
+ }[CouponNonNullablePaths]>>;
784
+ export interface BulkGetLoyaltyCouponOptions {
678
785
  /** Query to filter loyalty coupons. */
679
786
  query?: CursorQuery;
680
787
  }
788
+ /**
789
+ * Retrieves the loyalty coupons for the currently logged-in member.
790
+ *
791
+ * >**Note:**
792
+ * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
793
+ * @public
794
+ * @permissionId LOYALTY.READ_OWN_COUPONS
795
+ * @permissionScope Read Loyalty
796
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
797
+ * @permissionScope Manage Loyalty
798
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
799
+ * @permissionScope Manage Restaurants - all permissions
800
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
801
+ * @applicableIdentity APP
802
+ * @applicableIdentity MEMBER
803
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetCurrentMemberCoupons
804
+ */
805
+ export declare function getCurrentMemberCoupons(): Promise<NonNullablePaths<GetCurrentMemberCouponsResponse, {
806
+ [P in CouponNonNullablePaths]: `loyaltyCoupons.${number}.${P}`;
807
+ }[CouponNonNullablePaths]>>;
808
+ /**
809
+ * Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
810
+ * @public
811
+ * @permissionScope Read Loyalty
812
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
813
+ * @permissionScope Manage Loyalty
814
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
815
+ * @permissionScope Manage Restaurants - all permissions
816
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
817
+ * @permissionId LOYALTY.READ_COUPONS
818
+ * @applicableIdentity APP
819
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.QueryLoyaltyCoupon
820
+ */
821
+ export declare function queryLoyaltyCoupons(): LoyaltyCouponsQueryBuilder;
681
822
  interface QueryCursorResult {
682
823
  cursors: Cursors;
683
824
  hasNext: () => boolean;
@@ -685,13 +826,13 @@ interface QueryCursorResult {
685
826
  length: number;
686
827
  pageSize: number;
687
828
  }
688
- interface LoyaltyCouponsQueryResult extends QueryCursorResult {
829
+ export interface LoyaltyCouponsQueryResult extends QueryCursorResult {
689
830
  items: LoyaltyCoupon[];
690
831
  query: LoyaltyCouponsQueryBuilder;
691
832
  next: () => Promise<LoyaltyCouponsQueryResult>;
692
833
  prev: () => Promise<LoyaltyCouponsQueryResult>;
693
834
  }
694
- interface LoyaltyCouponsQueryBuilder {
835
+ export interface LoyaltyCouponsQueryBuilder {
695
836
  /** @param propertyName - Property whose value is compared with `value`.
696
837
  * @param value - Value to compare against.
697
838
  */
@@ -736,5 +877,24 @@ interface LoyaltyCouponsQueryBuilder {
736
877
  skipTo: (cursor: string) => LoyaltyCouponsQueryBuilder;
737
878
  find: () => Promise<LoyaltyCouponsQueryResult>;
738
879
  }
739
-
740
- export { type CouponCreatedEnvelope as $, type PagingMetadataV2 as A, type BulkGetLoyaltyCouponOptions as B, type CouponReference as C, type Cursors as D, type DeleteLoyaltyCouponRequest as E, type DeleteLoyaltyCouponResponse as F, type GetCurrentMemberCouponsResponse as G, type DomainEvent as H, type DomainEventBodyOneOf as I, type EntityCreatedEvent as J, type RestoreInfo as K, type LoyaltyCoupon as L, type EntityUpdatedEvent as M, type EntityDeletedEvent as N, type ActionEvent as O, type Paging as P, type QueryLoyaltyCouponRequest as Q, type RedeemPointsForCouponOptions as R, Status as S, Type as T, type Empty as U, type MessageEnvelope as V, WebhookIdentityType as W, type IdentificationData as X, type IdentificationDataIdOneOf as Y, type BaseEventMetadata as Z, type EventMetadata as _, type RedeemPointsForCouponResponse as a, type CouponDeletedEnvelope as a0, type LoyaltyCouponsQueryResult as a1, type RedeemCurrentMemberPointsForCouponResponse as b, type BulkGetLoyaltyCouponResponse as c, type LoyaltyCouponsQueryBuilder as d, SortOrder as e, type Specification as f, type SpecificationTypeDetailsOneOf as g, type SpecificationScopeOrMinSubtotalOneOf as h, type BuyXGetY as i, type Scope as j, type RedeemPointsForCouponRequest as k, type RedeemCurrentMemberPointsForCouponRequest as l, type RedeemMemberPointsForDiscountAmountCouponRequest as m, type RedeemMemberPointsForDiscountAmountCouponResponse as n, type GetLoyaltyCouponRequest as o, type GetLoyaltyCouponResponse as p, type BulkGetLoyaltyCouponRequest as q, type CursorQuery as r, type CursorQueryPagingMethodOneOf as s, type Sorting as t, type CursorPaging as u, type CouponsInSite as v, type GetCurrentMemberCouponsRequest as w, type QueryV2 as x, type QueryV2PagingMethodOneOf as y, type QueryLoyaltyCouponResponse as z };
880
+ /**
881
+ * Deletes a loyalty coupon.
882
+ *
883
+ * The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
884
+ * @param _id - ID of the loyalty coupon to delete.
885
+ * @param revision - Revision number, which increments by 1 each time the loyalty coupon is updated.
886
+ *
887
+ * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
888
+ * @public
889
+ * @requiredField _id
890
+ * @requiredField revision
891
+ * @permissionId LOYALTY.MANAGE_COUPONS
892
+ * @permissionScope Manage Loyalty
893
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
894
+ * @permissionScope Manage Restaurants - all permissions
895
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
896
+ * @applicableIdentity APP
897
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.DeleteLoyaltyCoupon
898
+ */
899
+ export declare function deleteLoyaltyCoupon(_id: string, revision: string): Promise<void>;
900
+ export {};