@wix/auto_sdk_loyalty_rewards 1.0.15 → 1.0.16

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.
@@ -56,13 +56,11 @@ declare enum RewardType {
56
56
  UNDEFINED = "UNDEFINED",
57
57
  /** Discount reward. Special flexible reward type used in checkout. */
58
58
  DISCOUNT_AMOUNT = "DISCOUNT_AMOUNT",
59
- /** Coupon reward. [Learn more about coupons.](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards) */
60
- COUPON_REWARD = "COUPON_REWARD",
61
- /** For internal use. */
62
- SPI_DISCOUNT_AMOUNT = "SPI_DISCOUNT_AMOUNT"
59
+ /** Coupon reward. [Learn more about coupons](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards). */
60
+ COUPON_REWARD = "COUPON_REWARD"
63
61
  }
64
62
  /** @enumType */
65
- type RewardTypeWithLiterals = RewardType | 'UNDEFINED' | 'DISCOUNT_AMOUNT' | 'COUPON_REWARD' | 'SPI_DISCOUNT_AMOUNT';
63
+ type RewardTypeWithLiterals = RewardType | 'UNDEFINED' | 'DISCOUNT_AMOUNT' | 'COUPON_REWARD';
66
64
  interface DiscountAmount {
67
65
  /**
68
66
  * Discount details for each tier.
@@ -99,11 +97,12 @@ interface CouponReward extends CouponRewardDiscountTypeOneOf, CouponRewardScopeO
99
97
  /** Limit the coupon to carts with a subtotal greater than this number. */
100
98
  minimumSubtotal?: number;
101
99
  /**
102
- * Specifies the type of line items this coupon will apply to.
103
- * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values).
100
+ * Specifies the type of line items this coupon applies to.
101
+ *
102
+ * For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values).
104
103
  */
105
104
  scope?: CouponScope;
106
- /** Whether the coupon is limited to one item. */
105
+ /** Whether the coupon is limited to 1 item. */
107
106
  limitedToOneItem?: boolean | null;
108
107
  /** Whether the coupon also applies to subscriptions. */
109
108
  appliesToSubscriptions?: boolean | null;
@@ -131,8 +130,9 @@ interface CouponRewardScopeOrMinSubtotalOneOf {
131
130
  /** Limit the coupon to carts with a subtotal greater than this number. */
132
131
  minimumSubtotal?: number;
133
132
  /**
134
- * Specifies the type of line items this coupon will apply to.
135
- * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values).
133
+ * Specifies the type of line items this coupon applies to.
134
+ *
135
+ * For more information, see [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values).
136
136
  */
137
137
  scope?: CouponScope;
138
138
  }
@@ -207,13 +207,13 @@ interface CouponScope {
207
207
  /**
208
208
  * Scope namespace.
209
209
  *
210
- * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid namespaces.
210
+ * See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values) for valid namespaces.
211
211
  */
212
212
  namespace?: string;
213
213
  /**
214
214
  * Coupon scope's applied group.
215
215
  *
216
- * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups.
216
+ * See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values) for valid groups.
217
217
  */
218
218
  group?: Group;
219
219
  }
@@ -221,10 +221,10 @@ interface Group {
221
221
  /**
222
222
  * Name of coupon scope's group.
223
223
  *
224
- * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups.
224
+ * See [valid scope values](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/valid-scope-values) for valid groups.
225
225
  */
226
226
  name?: string;
227
- /** Entity ID, if the coupon scope is limited to just one item. */
227
+ /** Entity ID, if the coupon scope is limited to just 1 item. */
228
228
  entityId?: string | null;
229
229
  }
230
230
  interface SpiDiscountAmount {
@@ -314,7 +314,7 @@ interface BulkGetRewardsResponse {
314
314
  }
315
315
  interface RewardsInSite {
316
316
  /**
317
- * Metasite id.
317
+ * Metasite ID.
318
318
  * @format GUID
319
319
  */
320
320
  metaSiteId?: string;
@@ -335,13 +335,13 @@ interface CursorQuery extends CursorQueryPagingMethodOneOf {
335
335
  /**
336
336
  * Filter object.
337
337
  *
338
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
338
+ * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
339
339
  */
340
340
  filter?: Record<string, any> | null;
341
341
  /**
342
342
  * Sort object.
343
343
  *
344
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
344
+ * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
345
345
  * @maxSize 5
346
346
  */
347
347
  sort?: Sorting[];
@@ -433,7 +433,7 @@ interface DeleteRewardRequest {
433
433
  /**
434
434
  * Revision number, which increments by 1 each time the reward is updated.
435
435
  *
436
- * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
436
+ * To prevent conflicting changes, pass the current `revision` when deleting the reward.
437
437
  */
438
438
  revision?: string;
439
439
  }
@@ -463,7 +463,7 @@ interface PagingMetadataV2 {
463
463
  }
464
464
  interface ListRewardsInTierRequest {
465
465
  /**
466
- * Tier id.
466
+ * Tier ID.
467
467
  * @format GUID
468
468
  * @readonly
469
469
  */
@@ -482,25 +482,21 @@ interface DomainEvent extends DomainEventBodyOneOf {
482
482
  updatedEvent?: EntityUpdatedEvent;
483
483
  deletedEvent?: EntityDeletedEvent;
484
484
  actionEvent?: ActionEvent;
485
- /**
486
- * Unique event ID.
487
- * Allows clients to ignore duplicate webhooks.
488
- */
485
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
489
486
  _id?: string;
490
487
  /**
491
- * Assumes actions are also always typed to an entity_type
492
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
488
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
489
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
493
490
  */
494
491
  entityFqdn?: string;
495
492
  /**
496
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
497
- * This is although the created/updated/deleted notion is duplication of the oneof types
498
- * Example: created/updated/deleted/started/completed/email_opened
493
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
494
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
499
495
  */
500
496
  slug?: string;
501
497
  /** ID of the entity associated with the event. */
502
498
  entityId?: string;
503
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
499
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
504
500
  eventTime?: Date | null;
505
501
  /**
506
502
  * Whether the event was triggered as a result of a privacy regulation application
@@ -510,12 +506,8 @@ interface DomainEvent extends DomainEventBodyOneOf {
510
506
  /** If present, indicates the action that triggered the event. */
511
507
  originatedFrom?: string | null;
512
508
  /**
513
- * A sequence number defining the order of updates to the underlying entity.
514
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
515
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
516
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
517
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
518
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
509
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
510
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
519
511
  */
520
512
  entityEventSequence?: string | null;
521
513
  }
@@ -541,7 +533,7 @@ interface EntityUpdatedEvent {
541
533
  currentEntity?: string;
542
534
  }
543
535
  interface EntityDeletedEvent {
544
- /** Entity that was deleted */
536
+ /** Entity that was deleted. */
545
537
  deletedEntity?: string | null;
546
538
  }
547
539
  interface ActionEvent {
@@ -636,25 +628,21 @@ interface BaseEventMetadata {
636
628
  identity?: IdentificationData;
637
629
  }
638
630
  interface EventMetadata extends BaseEventMetadata {
639
- /**
640
- * Unique event ID.
641
- * Allows clients to ignore duplicate webhooks.
642
- */
631
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
643
632
  _id?: string;
644
633
  /**
645
- * Assumes actions are also always typed to an entity_type
646
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
634
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
635
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
647
636
  */
648
637
  entityFqdn?: string;
649
638
  /**
650
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
651
- * This is although the created/updated/deleted notion is duplication of the oneof types
652
- * Example: created/updated/deleted/started/completed/email_opened
639
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
640
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
653
641
  */
654
642
  slug?: string;
655
643
  /** ID of the entity associated with the event. */
656
644
  entityId?: string;
657
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
645
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
658
646
  eventTime?: Date | null;
659
647
  /**
660
648
  * Whether the event was triggered as a result of a privacy regulation application
@@ -664,12 +652,8 @@ interface EventMetadata extends BaseEventMetadata {
664
652
  /** If present, indicates the action that triggered the event. */
665
653
  originatedFrom?: string | null;
666
654
  /**
667
- * A sequence number defining the order of updates to the underlying entity.
668
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
669
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
670
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
671
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
672
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
655
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
656
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
673
657
  */
674
658
  entityEventSequence?: string | null;
675
659
  }
@@ -683,6 +667,8 @@ interface RewardCreatedEnvelope {
683
667
  * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
684
668
  * @permissionScope Manage Loyalty
685
669
  * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
670
+ * @permissionScope Manage Restaurants - all permissions
671
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
686
672
  * @permissionId LOYALTY.READ_REWARDS
687
673
  * @webhook
688
674
  * @eventType wix.loyalty.v1.reward_created
@@ -699,6 +685,8 @@ interface RewardDeletedEnvelope {
699
685
  * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
700
686
  * @permissionScope Manage Loyalty
701
687
  * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
688
+ * @permissionScope Manage Restaurants - all permissions
689
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
702
690
  * @permissionId LOYALTY.READ_REWARDS
703
691
  * @webhook
704
692
  * @eventType wix.loyalty.v1.reward_deleted
@@ -716,6 +704,8 @@ interface RewardUpdatedEnvelope {
716
704
  * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
717
705
  * @permissionScope Manage Loyalty
718
706
  * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
707
+ * @permissionScope Manage Restaurants - all permissions
708
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
719
709
  * @permissionId LOYALTY.READ_REWARDS
720
710
  * @webhook
721
711
  * @eventType wix.loyalty.v1.reward_updated
@@ -725,24 +715,23 @@ interface RewardUpdatedEnvelope {
725
715
  declare function onRewardUpdated(handler: (event: RewardUpdatedEnvelope) => void | Promise<void>): void;
726
716
  type RewardNonNullablePaths = `discountAmount.configsByTier` | `discountAmount.configsByTier.${number}.amount` | `discountAmount.configsByTier.${number}.costInPoints` | `couponReward.fixedAmount.configsByTier` | `couponReward.fixedAmount.configsByTier.${number}.costInPoints` | `couponReward.fixedAmount.configsByTier.${number}.amount` | `couponReward.percentage.configsByTier` | `couponReward.percentage.configsByTier.${number}.costInPoints` | `couponReward.percentage.configsByTier.${number}.percentage` | `couponReward.freeShipping.configsByTier` | `couponReward.freeShipping.configsByTier.${number}.costInPoints` | `couponReward.minimumSubtotal` | `couponReward.scope.namespace` | `couponReward.scope.group.name` | `name` | `active` | `type`;
727
717
  /**
728
- * Creates a reward that can be redeemed with loyalty points.
718
+ * Creates a reward that customers can redeem with loyalty points.
729
719
  *
730
- * When a customer [redeems a reward](/coupons/redeem-points-for-coupon), a loyalty coupon is created
731
- * based on the specifications detailed in either the `discountAmount` or `couponReward` fields. This coupon can
732
- * then be used by the customer to receive the discount. Note that while the Rewards API uses coupon scopes and specifications,
733
- * no coupon is actually created until a [reward is redeemed](/coupons/redeem-points-for-coupon) with points.
734
- * See the [Coupons API](https://dev.wix.com/api/rest/coupons) for more information about coupons. The `type` of reward
735
- * cannot be updated.
720
+ * When a customer redeems a reward, a loyalty coupon is created
721
+ * based on the specifications detailed in the `discountAmount` or `couponReward` fields. The customer can
722
+ * then use this coupon to receive the discount. Note that while the Rewards API uses coupon scopes and specifications,
723
+ * no coupon is actually created until a customer redeems a reward with points.
724
+ * See the Coupons API for more information about coupons. You can't update the `type` of reward after it's created.
736
725
  *
737
726
  * A reward's `active` status defaults to `false`. To make the reward available to customers,
738
- * either set the `active` field to `true` during creation or call [Update Reward](/update-reward)
727
+ * either set the `active` field to `true` during creation or call Update Reward
739
728
  * to change the status.
740
729
  *
741
- * To customize a reward for each [loyalty tier](/tiers), use the `configsByTier` parameter.
730
+ * To customize a reward for each loyalty tier, use `configsByTier`.
742
731
  * This allows you to specify the amount of the earned discount, the cost in loyalty points
743
732
  * to redeem the reward, and the tier to which this configuration applies. Each tier requires its own
744
- * `configsByTier` configuration. To create a reward that is available to loyalty accounts in the base tier,
745
- * leave the `tierId` field empty. See the [Tiers API](/tiers) for more information on tiers.
733
+ * `configsByTier` configuration. To create a reward that's available to loyalty accounts in the base tier,
734
+ * leave the `tierId` field empty. See the Tiers API for more information on tiers.
746
735
  * @param reward - Reward to create.
747
736
  * @public
748
737
  * @requiredField reward
@@ -779,11 +768,10 @@ declare function bulkCreateRewards(rewards: NonNullablePaths<Reward, `name`>[]):
779
768
  */
780
769
  declare function getReward(_id: string): Promise<NonNullablePaths<Reward, RewardNonNullablePaths>>;
781
770
  /**
782
- * Retrieves rewards from all metasites that the caller is the member of.
771
+ * Retrieves rewards from all metasites that the caller is a member of.
783
772
  *
784
773
  * Must be called with user identity.
785
774
  * @public
786
- * @documentationMaturity preview
787
775
  * @permissionId LOYALTY.REWARD_BULK_READ
788
776
  * @fqn com.wixpress.loyalty.reward.LoyaltyRewards.BulkGetRewards
789
777
  */
@@ -791,11 +779,11 @@ declare function bulkGetRewards(): Promise<NonNullablePaths<BulkGetRewardsRespon
791
779
  [P in RewardNonNullablePaths]: `rewardsInSite.${number}.rewards.${number}.${P}`;
792
780
  }[RewardNonNullablePaths]>>;
793
781
  /**
794
- * Retrieves a list of rewards, given the provided paging, filtering, and sorting.
782
+ * Retrieves a list of rewards with the specified paging, filtering, and sorting.
795
783
  *
796
784
  * Query Rewards runs with these defaults, which you can override: `cursorPaging.limit` is `50`.
797
785
  *
798
- * 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).
786
+ * To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language),[Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging),and [Field Projection](https://dev.wix.com/docs/rest/articles/get-started/field-projection).
799
787
  * @param query - Query parameters.
800
788
  * @public
801
789
  * @requiredField query
@@ -810,10 +798,10 @@ declare function queryRewards(query: CursorQuery): Promise<NonNullablePaths<Quer
810
798
  /**
811
799
  * Updates a loyalty reward.
812
800
  *
813
- * Use this endpoint to update details of a reward, such as the name, whether or not a reward is active,
814
- * or the amount of points it costs to redeem. Also use this endpoint to add new tiers that are eligible to redeem a reward.
801
+ * Call this method to update details of a reward, such as the name, whether a reward is active,
802
+ * or the amount of points it costs to redeem. Also call this method to add new tiers that are eligible to redeem a reward.
815
803
  *
816
- * You may not change the `type` of a reward. That is set upon creation and cannot be updated.
804
+ * You may not change the `type` of a reward. That's set upon creation and can't be updated.
817
805
  * @param _id - Reward ID.
818
806
  * @public
819
807
  * @requiredField _id
@@ -872,7 +860,7 @@ interface UpdateReward {
872
860
  * @param _id - ID of the reward to delete.
873
861
  * @param revision - Revision number, which increments by 1 each time the reward is updated.
874
862
  *
875
- * To prevent conflicting changes, the current `revision` must be passed when deleting the reward.
863
+ * To prevent conflicting changes, pass the current `revision` when deleting the reward.
876
864
  * @public
877
865
  * @requiredField _id
878
866
  * @requiredField revision
@@ -417,7 +417,6 @@ var RewardType = /* @__PURE__ */ ((RewardType2) => {
417
417
  RewardType2["UNDEFINED"] = "UNDEFINED";
418
418
  RewardType2["DISCOUNT_AMOUNT"] = "DISCOUNT_AMOUNT";
419
419
  RewardType2["COUPON_REWARD"] = "COUPON_REWARD";
420
- RewardType2["SPI_DISCOUNT_AMOUNT"] = "SPI_DISCOUNT_AMOUNT";
421
420
  return RewardType2;
422
421
  })(RewardType || {});
423
422
  var SortOrder = /* @__PURE__ */ ((SortOrder2) => {