@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
@@ -0,0 +1,337 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
+ import * as ambassadorWixLoyaltyV1Coupon from './loyalty-v1-coupon-coupons.http.js';
5
+ export var Type;
6
+ (function (Type) {
7
+ Type["UNKNOWN"] = "UNKNOWN";
8
+ Type["MONEY_OFF_AMOUNT"] = "MONEY_OFF_AMOUNT";
9
+ Type["PERCENT_OFF_RATE"] = "PERCENT_OFF_RATE";
10
+ Type["FREE_SHIPPING"] = "FREE_SHIPPING";
11
+ Type["FIXED_PRICE_AMOUNT"] = "FIXED_PRICE_AMOUNT";
12
+ Type["BUY_X_GET_Y"] = "BUY_X_GET_Y";
13
+ })(Type || (Type = {}));
14
+ export var Status;
15
+ (function (Status) {
16
+ /** Unknown status. */
17
+ Status["UNKNOWN"] = "UNKNOWN";
18
+ /** The reference coupon was created but the loyalty points have not been redeemed yet. */
19
+ Status["PENDING"] = "PENDING";
20
+ /** The reference coupon is active and available to the customer. */
21
+ Status["ACTIVE"] = "ACTIVE";
22
+ /** The reference coupon was applied and is no longer available for use. */
23
+ Status["APPLIED"] = "APPLIED";
24
+ /** The reference coupon was created but something went wrong when redeeming points from the loyalty account. */
25
+ Status["FAILED"] = "FAILED";
26
+ /** The reference coupon was deleted. */
27
+ Status["ARCHIVED"] = "ARCHIVED";
28
+ })(Status || (Status = {}));
29
+ export var SortOrder;
30
+ (function (SortOrder) {
31
+ SortOrder["ASC"] = "ASC";
32
+ SortOrder["DESC"] = "DESC";
33
+ })(SortOrder || (SortOrder = {}));
34
+ export var WebhookIdentityType;
35
+ (function (WebhookIdentityType) {
36
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
37
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
38
+ WebhookIdentityType["MEMBER"] = "MEMBER";
39
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
40
+ WebhookIdentityType["APP"] = "APP";
41
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
42
+ /**
43
+ * Redeems a customer's loyalty points for a loyalty reward and creates a loyalty coupon.
44
+ *
45
+ * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
46
+ * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
47
+ * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
48
+ *
49
+ * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
50
+ * @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
51
+ * @public
52
+ * @requiredField options
53
+ * @requiredField options.loyaltyAccountId
54
+ * @requiredField rewardId
55
+ * @permissionId LOYALTY.REDEEM_COUPON
56
+ * @permissionScope Manage Restaurants - all permissions
57
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
58
+ * @applicableIdentity APP
59
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemPointsForCoupon
60
+ */
61
+ export async function redeemPointsForCoupon(rewardId, options) {
62
+ // @ts-ignore
63
+ const { httpClient, sideEffects } = arguments[2];
64
+ const payload = renameKeysFromSDKRequestToRESTRequest({
65
+ rewardId: rewardId,
66
+ loyaltyAccountId: options?.loyaltyAccountId,
67
+ });
68
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.redeemPointsForCoupon(payload);
69
+ sideEffects?.onSiteCall?.();
70
+ try {
71
+ const result = await httpClient.request(reqOpts);
72
+ sideEffects?.onSuccess?.(result);
73
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
74
+ }
75
+ catch (err) {
76
+ const transformedError = sdkTransformError(err, {
77
+ spreadPathsToArguments: {},
78
+ explicitPathsToArguments: {
79
+ rewardId: '$[0]',
80
+ loyaltyAccountId: '$[1].loyaltyAccountId',
81
+ },
82
+ singleArgumentUnchanged: false,
83
+ }, ['rewardId', 'options']);
84
+ sideEffects?.onError?.(err);
85
+ throw transformedError;
86
+ }
87
+ }
88
+ /**
89
+ * Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.
90
+ *
91
+ * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
92
+ * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
93
+ * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
94
+ *
95
+ * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
96
+ *
97
+ * >**Note:**
98
+ * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
99
+ * @param rewardId - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
100
+ * @public
101
+ * @requiredField rewardId
102
+ * @permissionId LOYALTY.REDEEM_OWN_COUPON
103
+ * @permissionScope Manage Loyalty
104
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
105
+ * @permissionScope Manage Restaurants - all permissions
106
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
107
+ * @applicableIdentity APP
108
+ * @applicableIdentity MEMBER
109
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemCurrentMemberPointsForCoupon
110
+ */
111
+ export async function redeemCurrentMemberPointsForCoupon(rewardId) {
112
+ // @ts-ignore
113
+ const { httpClient, sideEffects } = arguments[1];
114
+ const payload = renameKeysFromSDKRequestToRESTRequest({ rewardId: rewardId });
115
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.redeemCurrentMemberPointsForCoupon(payload);
116
+ sideEffects?.onSiteCall?.();
117
+ try {
118
+ const result = await httpClient.request(reqOpts);
119
+ sideEffects?.onSuccess?.(result);
120
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
121
+ }
122
+ catch (err) {
123
+ const transformedError = sdkTransformError(err, {
124
+ spreadPathsToArguments: {},
125
+ explicitPathsToArguments: { rewardId: '$[0]' },
126
+ singleArgumentUnchanged: false,
127
+ }, ['rewardId']);
128
+ sideEffects?.onError?.(err);
129
+ throw transformedError;
130
+ }
131
+ }
132
+ /**
133
+ * Retrieves a loyalty coupon.
134
+ * @param loyaltyCouponId - ID of the loyalty coupon to retrieve.
135
+ * @public
136
+ * @requiredField loyaltyCouponId
137
+ * @permissionId LOYALTY.READ_COUPONS
138
+ * @permissionScope Read Loyalty
139
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
140
+ * @permissionScope Manage Loyalty
141
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
142
+ * @permissionScope Manage Restaurants - all permissions
143
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
144
+ * @applicableIdentity APP
145
+ * @returns Retrieved loyalty coupon.
146
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetLoyaltyCoupon
147
+ */
148
+ export async function getLoyaltyCoupon(loyaltyCouponId) {
149
+ // @ts-ignore
150
+ const { httpClient, sideEffects } = arguments[1];
151
+ const payload = renameKeysFromSDKRequestToRESTRequest({
152
+ loyaltyCouponId: loyaltyCouponId,
153
+ });
154
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.getLoyaltyCoupon(payload);
155
+ sideEffects?.onSiteCall?.();
156
+ try {
157
+ const result = await httpClient.request(reqOpts);
158
+ sideEffects?.onSuccess?.(result);
159
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.loyaltyCoupon;
160
+ }
161
+ catch (err) {
162
+ const transformedError = sdkTransformError(err, {
163
+ spreadPathsToArguments: {},
164
+ explicitPathsToArguments: { loyaltyCouponId: '$[0]' },
165
+ singleArgumentUnchanged: false,
166
+ }, ['loyaltyCouponId']);
167
+ sideEffects?.onError?.(err);
168
+ throw transformedError;
169
+ }
170
+ }
171
+ /**
172
+ * Retrieves a sequence of loyalty coupons
173
+ * @public
174
+ * @documentationMaturity preview
175
+ * @permissionId LOYALTY.REWARD_BULK_READ
176
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.BulkGetLoyaltyCoupon
177
+ */
178
+ export async function bulkGetLoyaltyCoupon(options) {
179
+ // @ts-ignore
180
+ const { httpClient, sideEffects } = arguments[1];
181
+ const payload = renameKeysFromSDKRequestToRESTRequest({
182
+ query: options?.query,
183
+ });
184
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.bulkGetLoyaltyCoupon(payload);
185
+ sideEffects?.onSiteCall?.();
186
+ try {
187
+ const result = await httpClient.request(reqOpts);
188
+ sideEffects?.onSuccess?.(result);
189
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
190
+ }
191
+ catch (err) {
192
+ const transformedError = sdkTransformError(err, {
193
+ spreadPathsToArguments: {},
194
+ explicitPathsToArguments: { query: '$[0].query' },
195
+ singleArgumentUnchanged: false,
196
+ }, ['options']);
197
+ sideEffects?.onError?.(err);
198
+ throw transformedError;
199
+ }
200
+ }
201
+ /**
202
+ * Retrieves the loyalty coupons for the currently logged-in member.
203
+ *
204
+ * >**Note:**
205
+ * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
206
+ * @public
207
+ * @permissionId LOYALTY.READ_OWN_COUPONS
208
+ * @permissionScope Read Loyalty
209
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
210
+ * @permissionScope Manage Loyalty
211
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
212
+ * @permissionScope Manage Restaurants - all permissions
213
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
214
+ * @applicableIdentity APP
215
+ * @applicableIdentity MEMBER
216
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.GetCurrentMemberCoupons
217
+ */
218
+ export async function getCurrentMemberCoupons() {
219
+ // @ts-ignore
220
+ const { httpClient, sideEffects } = arguments[0];
221
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
222
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.getCurrentMemberCoupons(payload);
223
+ sideEffects?.onSiteCall?.();
224
+ try {
225
+ const result = await httpClient.request(reqOpts);
226
+ sideEffects?.onSuccess?.(result);
227
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
228
+ }
229
+ catch (err) {
230
+ const transformedError = sdkTransformError(err, {
231
+ spreadPathsToArguments: {},
232
+ explicitPathsToArguments: {},
233
+ singleArgumentUnchanged: false,
234
+ }, []);
235
+ sideEffects?.onError?.(err);
236
+ throw transformedError;
237
+ }
238
+ }
239
+ /**
240
+ * Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
241
+ * @public
242
+ * @permissionScope Read Loyalty
243
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
244
+ * @permissionScope Manage Loyalty
245
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
246
+ * @permissionScope Manage Restaurants - all permissions
247
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
248
+ * @permissionId LOYALTY.READ_COUPONS
249
+ * @applicableIdentity APP
250
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.QueryLoyaltyCoupon
251
+ */
252
+ export function queryLoyaltyCoupons() {
253
+ // @ts-ignore
254
+ const { httpClient, sideEffects } = arguments[0];
255
+ return queryBuilder({
256
+ func: async (payload) => {
257
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.queryLoyaltyCoupon(payload);
258
+ sideEffects?.onSiteCall?.();
259
+ try {
260
+ const result = await httpClient.request(reqOpts);
261
+ sideEffects?.onSuccess?.(result);
262
+ return result;
263
+ }
264
+ catch (err) {
265
+ sideEffects?.onError?.(err);
266
+ throw err;
267
+ }
268
+ },
269
+ requestTransformer: (query) => {
270
+ const args = [query, {}];
271
+ return renameKeysFromSDKRequestToRESTRequest({
272
+ ...args?.[1],
273
+ query: args?.[0],
274
+ });
275
+ },
276
+ responseTransformer: ({ data, }) => {
277
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(data);
278
+ return {
279
+ items: transformedData?.loyaltyCoupons,
280
+ pagingMetadata: transformedData?.metadata,
281
+ };
282
+ },
283
+ errorTransformer: (err) => {
284
+ const transformedError = sdkTransformError(err, {
285
+ spreadPathsToArguments: {},
286
+ explicitPathsToArguments: { query: '$[0]' },
287
+ singleArgumentUnchanged: false,
288
+ });
289
+ throw transformedError;
290
+ },
291
+ pagingMethod: 'CURSOR',
292
+ transformationPaths: {},
293
+ });
294
+ }
295
+ /**
296
+ * Deletes a loyalty coupon.
297
+ *
298
+ * The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
299
+ * @param _id - ID of the loyalty coupon to delete.
300
+ * @param revision - Revision number, which increments by 1 each time the loyalty coupon is updated.
301
+ *
302
+ * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
303
+ * @public
304
+ * @requiredField _id
305
+ * @requiredField revision
306
+ * @permissionId LOYALTY.MANAGE_COUPONS
307
+ * @permissionScope Manage Loyalty
308
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
309
+ * @permissionScope Manage Restaurants - all permissions
310
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
311
+ * @applicableIdentity APP
312
+ * @fqn com.wixpress.loyalty.coupon.LoyaltyCoupons.DeleteLoyaltyCoupon
313
+ */
314
+ export async function deleteLoyaltyCoupon(_id, revision) {
315
+ // @ts-ignore
316
+ const { httpClient, sideEffects } = arguments[2];
317
+ const payload = renameKeysFromSDKRequestToRESTRequest({
318
+ id: _id,
319
+ revision: revision,
320
+ });
321
+ const reqOpts = ambassadorWixLoyaltyV1Coupon.deleteLoyaltyCoupon(payload);
322
+ sideEffects?.onSiteCall?.();
323
+ try {
324
+ const result = await httpClient.request(reqOpts);
325
+ sideEffects?.onSuccess?.(result);
326
+ }
327
+ catch (err) {
328
+ const transformedError = sdkTransformError(err, {
329
+ spreadPathsToArguments: {},
330
+ explicitPathsToArguments: { id: '$[0]', revision: '$[1]' },
331
+ singleArgumentUnchanged: false,
332
+ }, ['_id', 'revision']);
333
+ sideEffects?.onError?.(err);
334
+ throw transformedError;
335
+ }
336
+ }
337
+ //# sourceMappingURL=loyalty-v1-coupon-coupons.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty-v1-coupon-coupons.universal.js","sourceRoot":"","sources":["../../../../src/loyalty-v1-coupon-coupons.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,4BAA4B,MAAM,qCAAqC,CAAC;AA+LpF,MAAM,CAAN,IAAY,IAOX;AAPD,WAAY,IAAI;IACd,2BAAmB,C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WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE;YAC1D,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,KAAK,EAAE,UAAU,CAAC,CACpB,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_loyalty_coupons",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
7
7
  },
8
8
  "keywords": [],
9
9
  "sideEffects": false,
10
- "main": "/build/index.js",
11
- "types": "./build/index.d.mts",
10
+ "main": "./build/cjs/index.js",
11
+ "types": "./build/es/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./build/index.mjs",
15
- "require": "./build/index.js",
16
- "types": "./build/index.d.mts"
14
+ "import": "./build/es/index.js",
15
+ "require": "./build/cjs/index.js",
16
+ "types": "./build/es/index.d.ts"
17
17
  },
18
18
  "./package.json": "./package.json",
19
19
  "./meta": {
20
- "import": "./build/meta.mjs",
21
- "require": "./build/meta.js",
22
- "types": "./build/meta.d.mts"
20
+ "import": "./build/es/meta.js",
21
+ "require": "./build/cjs/meta.js",
22
+ "types": "./build/es/meta.d.ts"
23
23
  }
24
24
  },
25
25
  "files": [
@@ -28,15 +28,14 @@
28
28
  "service-plugins"
29
29
  ],
30
30
  "dependencies": {
31
- "@wix/sdk-runtime": "^0.3.42",
32
- "@wix/sdk-types": "^1.13.16"
31
+ "@wix/sdk-runtime": "^0.3.49",
32
+ "@wix/sdk-types": "^1.13.23"
33
33
  },
34
34
  "devDependencies": {
35
- "tsup": "^8.4.0",
36
35
  "typescript": "^5.3.2"
37
36
  },
38
37
  "scripts": {
39
- "build": "tsup",
38
+ "build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
40
39
  "test": ":"
41
40
  },
42
41
  "wix": {
@@ -49,5 +48,5 @@
49
48
  "fqdn": "wix.loyalty.v1.coupon"
50
49
  }
51
50
  },
52
- "falconPackageHash": "0f81720700ff650011192d48613270fb2d628354cff9ee253dd6dcd1"
51
+ "falconPackageHash": "eaf1fbd1c7571bd3e19ec68c7840801ce45f32ba5b0f37316ab8f688"
53
52
  }
package/build/index.d.mts DELETED
@@ -1,100 +0,0 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { R as RedeemPointsForCouponOptions, a as RedeemPointsForCouponResponse, b as RedeemCurrentMemberPointsForCouponResponse, L as LoyaltyCoupon, B as BulkGetLoyaltyCouponOptions, c as BulkGetLoyaltyCouponResponse, G as GetCurrentMemberCouponsResponse, d as LoyaltyCouponsQueryBuilder } from './loyalty-v1-coupon-coupons.universal-BpPn8h94.mjs';
3
- export { O as ActionEvent, Z as BaseEventMetadata, q as BulkGetLoyaltyCouponRequest, i as BuyXGetY, $ as CouponCreatedEnvelope, a0 as CouponDeletedEnvelope, C as CouponReference, v as CouponsInSite, u as CursorPaging, r as CursorQuery, s as CursorQueryPagingMethodOneOf, D as Cursors, E as DeleteLoyaltyCouponRequest, F as DeleteLoyaltyCouponResponse, H as DomainEvent, I as DomainEventBodyOneOf, U as Empty, J as EntityCreatedEvent, N as EntityDeletedEvent, M as EntityUpdatedEvent, _ as EventMetadata, w as GetCurrentMemberCouponsRequest, o as GetLoyaltyCouponRequest, p as GetLoyaltyCouponResponse, X as IdentificationData, Y as IdentificationDataIdOneOf, a1 as LoyaltyCouponsQueryResult, V as MessageEnvelope, P as Paging, A as PagingMetadataV2, Q as QueryLoyaltyCouponRequest, z as QueryLoyaltyCouponResponse, x as QueryV2, y as QueryV2PagingMethodOneOf, l as RedeemCurrentMemberPointsForCouponRequest, m as RedeemMemberPointsForDiscountAmountCouponRequest, n as RedeemMemberPointsForDiscountAmountCouponResponse, k as RedeemPointsForCouponRequest, K as RestoreInfo, j as Scope, e as SortOrder, t as Sorting, f as Specification, h as SpecificationScopeOrMinSubtotalOneOf, g as SpecificationTypeDetailsOneOf, S as Status, T as Type, W as WebhookIdentityType } from './loyalty-v1-coupon-coupons.universal-BpPn8h94.mjs';
4
- import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
5
-
6
- declare function redeemPointsForCoupon$1(httpClient: HttpClient): RedeemPointsForCouponSignature;
7
- interface RedeemPointsForCouponSignature {
8
- /**
9
- * Redeems a customer's loyalty points for a loyalty reward and creates a loyalty coupon.
10
- *
11
- * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
12
- * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
13
- * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
14
- *
15
- * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
16
- * @param - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
17
- */
18
- (rewardId: string, options: RedeemPointsForCouponOptions): Promise<RedeemPointsForCouponResponse>;
19
- }
20
- declare function redeemCurrentMemberPointsForCoupon$1(httpClient: HttpClient): RedeemCurrentMemberPointsForCouponSignature;
21
- interface RedeemCurrentMemberPointsForCouponSignature {
22
- /**
23
- * Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.
24
- *
25
- * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
26
- * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
27
- * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
28
- *
29
- * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
30
- *
31
- * >**Note:**
32
- * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
33
- * @param - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
34
- */
35
- (rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse>;
36
- }
37
- declare function getLoyaltyCoupon$1(httpClient: HttpClient): GetLoyaltyCouponSignature;
38
- interface GetLoyaltyCouponSignature {
39
- /**
40
- * Retrieves a loyalty coupon.
41
- * @param - ID of the loyalty coupon to retrieve.
42
- * @returns Retrieved loyalty coupon.
43
- */
44
- (loyaltyCouponId: string): Promise<LoyaltyCoupon>;
45
- }
46
- declare function bulkGetLoyaltyCoupon$1(httpClient: HttpClient): BulkGetLoyaltyCouponSignature;
47
- interface BulkGetLoyaltyCouponSignature {
48
- /**
49
- * Retrieves a sequence of loyalty coupons
50
- */
51
- (options?: BulkGetLoyaltyCouponOptions | undefined): Promise<BulkGetLoyaltyCouponResponse>;
52
- }
53
- declare function getCurrentMemberCoupons$1(httpClient: HttpClient): GetCurrentMemberCouponsSignature;
54
- interface GetCurrentMemberCouponsSignature {
55
- /**
56
- * Retrieves the loyalty coupons for the currently logged-in member.
57
- *
58
- * >**Note:**
59
- * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
60
- */
61
- (): Promise<GetCurrentMemberCouponsResponse>;
62
- }
63
- declare function queryLoyaltyCoupons$1(httpClient: HttpClient): QueryLoyaltyCouponsSignature;
64
- interface QueryLoyaltyCouponsSignature {
65
- /**
66
- * Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
67
- */
68
- (): LoyaltyCouponsQueryBuilder;
69
- }
70
- declare function deleteLoyaltyCoupon$1(httpClient: HttpClient): DeleteLoyaltyCouponSignature;
71
- interface DeleteLoyaltyCouponSignature {
72
- /**
73
- * Deletes a loyalty coupon.
74
- *
75
- * The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
76
- * @param - ID of the loyalty coupon to delete.
77
- * @param - Revision number, which increments by 1 each time the loyalty coupon is updated.
78
- *
79
- * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
80
- */
81
- (_id: string, revision: string): Promise<void>;
82
- }
83
-
84
- declare const redeemPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemPointsForCoupon$1> & typeof redeemPointsForCoupon$1>;
85
- declare const redeemCurrentMemberPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemCurrentMemberPointsForCoupon$1> & typeof redeemCurrentMemberPointsForCoupon$1>;
86
- declare const getLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof getLoyaltyCoupon$1> & typeof getLoyaltyCoupon$1>;
87
- declare const bulkGetLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof bulkGetLoyaltyCoupon$1> & typeof bulkGetLoyaltyCoupon$1>;
88
- declare const getCurrentMemberCoupons: MaybeContext<BuildRESTFunction<typeof getCurrentMemberCoupons$1> & typeof getCurrentMemberCoupons$1>;
89
- declare const queryLoyaltyCoupons: MaybeContext<BuildRESTFunction<typeof queryLoyaltyCoupons$1> & typeof queryLoyaltyCoupons$1>;
90
- declare const deleteLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof deleteLoyaltyCoupon$1> & typeof deleteLoyaltyCoupon$1>;
91
- /**
92
- * Triggered when a loyalty coupon is created.
93
- */
94
- declare const onCouponCreated: ReturnType<typeof createEventModule<typeof publicOnCouponCreated>>;
95
- /**
96
- * Triggered when a loyalty coupon is deleted.
97
- */
98
- declare const onCouponDeleted: ReturnType<typeof createEventModule<typeof publicOnCouponDeleted>>;
99
-
100
- export { BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, GetCurrentMemberCouponsResponse, LoyaltyCoupon, LoyaltyCouponsQueryBuilder, RedeemCurrentMemberPointsForCouponResponse, RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, bulkGetLoyaltyCoupon, deleteLoyaltyCoupon, getCurrentMemberCoupons, getLoyaltyCoupon, onCouponCreated, onCouponDeleted, queryLoyaltyCoupons, redeemCurrentMemberPointsForCoupon, redeemPointsForCoupon };
package/build/index.d.ts DELETED
@@ -1,100 +0,0 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { R as RedeemPointsForCouponOptions, a as RedeemPointsForCouponResponse, b as RedeemCurrentMemberPointsForCouponResponse, L as LoyaltyCoupon, B as BulkGetLoyaltyCouponOptions, c as BulkGetLoyaltyCouponResponse, G as GetCurrentMemberCouponsResponse, d as LoyaltyCouponsQueryBuilder } from './loyalty-v1-coupon-coupons.universal-BpPn8h94.js';
3
- export { O as ActionEvent, Z as BaseEventMetadata, q as BulkGetLoyaltyCouponRequest, i as BuyXGetY, $ as CouponCreatedEnvelope, a0 as CouponDeletedEnvelope, C as CouponReference, v as CouponsInSite, u as CursorPaging, r as CursorQuery, s as CursorQueryPagingMethodOneOf, D as Cursors, E as DeleteLoyaltyCouponRequest, F as DeleteLoyaltyCouponResponse, H as DomainEvent, I as DomainEventBodyOneOf, U as Empty, J as EntityCreatedEvent, N as EntityDeletedEvent, M as EntityUpdatedEvent, _ as EventMetadata, w as GetCurrentMemberCouponsRequest, o as GetLoyaltyCouponRequest, p as GetLoyaltyCouponResponse, X as IdentificationData, Y as IdentificationDataIdOneOf, a1 as LoyaltyCouponsQueryResult, V as MessageEnvelope, P as Paging, A as PagingMetadataV2, Q as QueryLoyaltyCouponRequest, z as QueryLoyaltyCouponResponse, x as QueryV2, y as QueryV2PagingMethodOneOf, l as RedeemCurrentMemberPointsForCouponRequest, m as RedeemMemberPointsForDiscountAmountCouponRequest, n as RedeemMemberPointsForDiscountAmountCouponResponse, k as RedeemPointsForCouponRequest, K as RestoreInfo, j as Scope, e as SortOrder, t as Sorting, f as Specification, h as SpecificationScopeOrMinSubtotalOneOf, g as SpecificationTypeDetailsOneOf, S as Status, T as Type, W as WebhookIdentityType } from './loyalty-v1-coupon-coupons.universal-BpPn8h94.js';
4
- import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
5
-
6
- declare function redeemPointsForCoupon$1(httpClient: HttpClient): RedeemPointsForCouponSignature;
7
- interface RedeemPointsForCouponSignature {
8
- /**
9
- * Redeems a customer's loyalty points for a loyalty reward and creates a loyalty coupon.
10
- *
11
- * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
12
- * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
13
- * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
14
- *
15
- * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
16
- * @param - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
17
- */
18
- (rewardId: string, options: RedeemPointsForCouponOptions): Promise<RedeemPointsForCouponResponse>;
19
- }
20
- declare function redeemCurrentMemberPointsForCoupon$1(httpClient: HttpClient): RedeemCurrentMemberPointsForCouponSignature;
21
- interface RedeemCurrentMemberPointsForCouponSignature {
22
- /**
23
- * Redeems a current customer's loyalty points for a loyalty reward and creates a loyalty coupon.
24
- *
25
- * Creating a loyalty coupon also creates a corresponding "reference" coupon with the [Coupons API](https://dev.wix.com/api/rest/coupons/about-wix-coupons).
26
- * The customer receives the reference coupon, which they can apply to their order. The loyalty coupon and its corresponding reference coupon
27
- * are linked and the loyalty coupon's `status` reflects the current state of the reference coupon.
28
- *
29
- * Check which loyalty rewards a site has available with [List Rewards](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/list-rewards).
30
- *
31
- * >**Note:**
32
- * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
33
- * @param - ID of the [loyalty reward](https://dev.wix.com/docs/rest/crm/loyalty-program/rewards/reward-object) to redeem.
34
- */
35
- (rewardId: string): Promise<RedeemCurrentMemberPointsForCouponResponse>;
36
- }
37
- declare function getLoyaltyCoupon$1(httpClient: HttpClient): GetLoyaltyCouponSignature;
38
- interface GetLoyaltyCouponSignature {
39
- /**
40
- * Retrieves a loyalty coupon.
41
- * @param - ID of the loyalty coupon to retrieve.
42
- * @returns Retrieved loyalty coupon.
43
- */
44
- (loyaltyCouponId: string): Promise<LoyaltyCoupon>;
45
- }
46
- declare function bulkGetLoyaltyCoupon$1(httpClient: HttpClient): BulkGetLoyaltyCouponSignature;
47
- interface BulkGetLoyaltyCouponSignature {
48
- /**
49
- * Retrieves a sequence of loyalty coupons
50
- */
51
- (options?: BulkGetLoyaltyCouponOptions | undefined): Promise<BulkGetLoyaltyCouponResponse>;
52
- }
53
- declare function getCurrentMemberCoupons$1(httpClient: HttpClient): GetCurrentMemberCouponsSignature;
54
- interface GetCurrentMemberCouponsSignature {
55
- /**
56
- * Retrieves the loyalty coupons for the currently logged-in member.
57
- *
58
- * >**Note:**
59
- * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
60
- */
61
- (): Promise<GetCurrentMemberCouponsResponse>;
62
- }
63
- declare function queryLoyaltyCoupons$1(httpClient: HttpClient): QueryLoyaltyCouponsSignature;
64
- interface QueryLoyaltyCouponsSignature {
65
- /**
66
- * Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.
67
- */
68
- (): LoyaltyCouponsQueryBuilder;
69
- }
70
- declare function deleteLoyaltyCoupon$1(httpClient: HttpClient): DeleteLoyaltyCouponSignature;
71
- interface DeleteLoyaltyCouponSignature {
72
- /**
73
- * Deletes a loyalty coupon.
74
- *
75
- * The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
76
- * @param - ID of the loyalty coupon to delete.
77
- * @param - Revision number, which increments by 1 each time the loyalty coupon is updated.
78
- *
79
- * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon.
80
- */
81
- (_id: string, revision: string): Promise<void>;
82
- }
83
-
84
- declare const redeemPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemPointsForCoupon$1> & typeof redeemPointsForCoupon$1>;
85
- declare const redeemCurrentMemberPointsForCoupon: MaybeContext<BuildRESTFunction<typeof redeemCurrentMemberPointsForCoupon$1> & typeof redeemCurrentMemberPointsForCoupon$1>;
86
- declare const getLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof getLoyaltyCoupon$1> & typeof getLoyaltyCoupon$1>;
87
- declare const bulkGetLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof bulkGetLoyaltyCoupon$1> & typeof bulkGetLoyaltyCoupon$1>;
88
- declare const getCurrentMemberCoupons: MaybeContext<BuildRESTFunction<typeof getCurrentMemberCoupons$1> & typeof getCurrentMemberCoupons$1>;
89
- declare const queryLoyaltyCoupons: MaybeContext<BuildRESTFunction<typeof queryLoyaltyCoupons$1> & typeof queryLoyaltyCoupons$1>;
90
- declare const deleteLoyaltyCoupon: MaybeContext<BuildRESTFunction<typeof deleteLoyaltyCoupon$1> & typeof deleteLoyaltyCoupon$1>;
91
- /**
92
- * Triggered when a loyalty coupon is created.
93
- */
94
- declare const onCouponCreated: ReturnType<typeof createEventModule<typeof publicOnCouponCreated>>;
95
- /**
96
- * Triggered when a loyalty coupon is deleted.
97
- */
98
- declare const onCouponDeleted: ReturnType<typeof createEventModule<typeof publicOnCouponDeleted>>;
99
-
100
- export { BulkGetLoyaltyCouponOptions, BulkGetLoyaltyCouponResponse, GetCurrentMemberCouponsResponse, LoyaltyCoupon, LoyaltyCouponsQueryBuilder, RedeemCurrentMemberPointsForCouponResponse, RedeemPointsForCouponOptions, RedeemPointsForCouponResponse, bulkGetLoyaltyCoupon, deleteLoyaltyCoupon, getCurrentMemberCoupons, getLoyaltyCoupon, onCouponCreated, onCouponDeleted, queryLoyaltyCoupons, redeemCurrentMemberPointsForCoupon, redeemPointsForCoupon };