@wix/auto_sdk_loyalty_coupons 1.0.17 → 1.0.18
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.
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{loyalty-v1-coupon-coupons.universal-BooyrntV.d.ts → index.typings.d.ts} +134 -1
- package/build/cjs/index.typings.js +629 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +2 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/{loyalty-v1-coupon-coupons.universal-BooyrntV.d.mts → index.typings.d.mts} +134 -1
- package/build/es/index.typings.mjs +595 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{loyalty-v1-coupon-coupons.universal-BooyrntV.d.ts → index.typings.d.ts} +134 -1
- package/build/internal/cjs/index.typings.js +629 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{loyalty-v1-coupon-coupons.universal-BooyrntV.d.mts → index.typings.d.mts} +134 -1
- package/build/internal/es/index.typings.mjs +595 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
SortOrder: () => SortOrder,
|
|
24
|
+
Status: () => Status,
|
|
25
|
+
Type: () => Type,
|
|
26
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
27
|
+
bulkGetLoyaltyCoupon: () => bulkGetLoyaltyCoupon2,
|
|
28
|
+
deleteLoyaltyCoupon: () => deleteLoyaltyCoupon2,
|
|
29
|
+
getCurrentMemberCoupons: () => getCurrentMemberCoupons2,
|
|
30
|
+
getLoyaltyCoupon: () => getLoyaltyCoupon2,
|
|
31
|
+
queryLoyaltyCoupons: () => queryLoyaltyCoupons,
|
|
32
|
+
redeemCurrentMemberPointsForCoupon: () => redeemCurrentMemberPointsForCoupon2,
|
|
33
|
+
redeemPointsForCoupon: () => redeemPointsForCoupon2
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
36
|
+
|
|
37
|
+
// src/loyalty-v1-coupon-coupons.universal.ts
|
|
38
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
39
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
40
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
41
|
+
|
|
42
|
+
// src/loyalty-v1-coupon-coupons.http.ts
|
|
43
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
44
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
45
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
46
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
47
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
48
|
+
function resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl(opts) {
|
|
49
|
+
const domainToMappings = {
|
|
50
|
+
"manage._base_domain_": [
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/_api/loyalty-coupons",
|
|
53
|
+
destPath: ""
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
_: [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/_api/loyalty-coupons",
|
|
59
|
+
destPath: ""
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"editor.wixapps.net": [
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/_api/loyalty-coupons",
|
|
65
|
+
destPath: ""
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"editor._base_domain_": [
|
|
69
|
+
{
|
|
70
|
+
srcPath: "/_api/loyalty-coupons",
|
|
71
|
+
destPath: ""
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"blocks._base_domain_": [
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/_api/loyalty-coupons",
|
|
77
|
+
destPath: ""
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"create.editorx": [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/_api/loyalty-coupons",
|
|
83
|
+
destPath: ""
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"www._base_domain_": [
|
|
87
|
+
{
|
|
88
|
+
srcPath: "/_api/loyalty-coupons",
|
|
89
|
+
destPath: ""
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"*.dev.wix-code.com": [
|
|
93
|
+
{
|
|
94
|
+
srcPath: "/_api/loyalty-coupons",
|
|
95
|
+
destPath: ""
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"*.pub.wix-code.com": [
|
|
99
|
+
{
|
|
100
|
+
srcPath: "/_api/loyalty-coupons",
|
|
101
|
+
destPath: ""
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"api._api_base_domain_": [
|
|
105
|
+
{
|
|
106
|
+
srcPath: "/loyalty-coupons",
|
|
107
|
+
destPath: ""
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"www.wixapis.com": [
|
|
111
|
+
{
|
|
112
|
+
srcPath: "/loyalty-coupons",
|
|
113
|
+
destPath: ""
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
118
|
+
}
|
|
119
|
+
var PACKAGE_NAME = "@wix/auto_sdk_loyalty_coupons";
|
|
120
|
+
function redeemPointsForCoupon(payload) {
|
|
121
|
+
function __redeemPointsForCoupon({ host }) {
|
|
122
|
+
const metadata = {
|
|
123
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
124
|
+
method: "POST",
|
|
125
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemPointsForCoupon",
|
|
126
|
+
packageName: PACKAGE_NAME,
|
|
127
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
128
|
+
protoPath: "/v1/coupons",
|
|
129
|
+
data: payload,
|
|
130
|
+
host
|
|
131
|
+
}),
|
|
132
|
+
data: payload,
|
|
133
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
134
|
+
{
|
|
135
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
136
|
+
paths: [
|
|
137
|
+
{ path: "coupon.createdDate" },
|
|
138
|
+
{ path: "coupon.updatedDate" }
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
143
|
+
paths: [
|
|
144
|
+
{ path: "coupon.couponReference.specification.moneyOffAmount" },
|
|
145
|
+
{ path: "coupon.couponReference.specification.percentOffRate" },
|
|
146
|
+
{ path: "coupon.couponReference.specification.fixedPriceAmount" },
|
|
147
|
+
{ path: "coupon.couponReference.specification.minimumSubtotal" }
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
])
|
|
151
|
+
};
|
|
152
|
+
return metadata;
|
|
153
|
+
}
|
|
154
|
+
return __redeemPointsForCoupon;
|
|
155
|
+
}
|
|
156
|
+
function redeemCurrentMemberPointsForCoupon(payload) {
|
|
157
|
+
function __redeemCurrentMemberPointsForCoupon({ host }) {
|
|
158
|
+
const metadata = {
|
|
159
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
160
|
+
method: "POST",
|
|
161
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.RedeemCurrentMemberPointsForCoupon",
|
|
162
|
+
packageName: PACKAGE_NAME,
|
|
163
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
164
|
+
protoPath: "/v1/coupons/redeem-my-coupon",
|
|
165
|
+
data: payload,
|
|
166
|
+
host
|
|
167
|
+
}),
|
|
168
|
+
data: payload,
|
|
169
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
170
|
+
{
|
|
171
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
172
|
+
paths: [
|
|
173
|
+
{ path: "coupon.createdDate" },
|
|
174
|
+
{ path: "coupon.updatedDate" }
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
179
|
+
paths: [
|
|
180
|
+
{ path: "coupon.couponReference.specification.moneyOffAmount" },
|
|
181
|
+
{ path: "coupon.couponReference.specification.percentOffRate" },
|
|
182
|
+
{ path: "coupon.couponReference.specification.fixedPriceAmount" },
|
|
183
|
+
{ path: "coupon.couponReference.specification.minimumSubtotal" }
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
])
|
|
187
|
+
};
|
|
188
|
+
return metadata;
|
|
189
|
+
}
|
|
190
|
+
return __redeemCurrentMemberPointsForCoupon;
|
|
191
|
+
}
|
|
192
|
+
function getLoyaltyCoupon(payload) {
|
|
193
|
+
function __getLoyaltyCoupon({ host }) {
|
|
194
|
+
const metadata = {
|
|
195
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
196
|
+
method: "GET",
|
|
197
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.GetLoyaltyCoupon",
|
|
198
|
+
packageName: PACKAGE_NAME,
|
|
199
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
200
|
+
protoPath: "/v1/coupons/{loyaltyCouponId}",
|
|
201
|
+
data: payload,
|
|
202
|
+
host
|
|
203
|
+
}),
|
|
204
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
205
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
206
|
+
{
|
|
207
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
208
|
+
paths: [
|
|
209
|
+
{ path: "loyaltyCoupon.createdDate" },
|
|
210
|
+
{ path: "loyaltyCoupon.updatedDate" }
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
215
|
+
paths: [
|
|
216
|
+
{
|
|
217
|
+
path: "loyaltyCoupon.couponReference.specification.moneyOffAmount"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
path: "loyaltyCoupon.couponReference.specification.percentOffRate"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
path: "loyaltyCoupon.couponReference.specification.fixedPriceAmount"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
path: "loyaltyCoupon.couponReference.specification.minimumSubtotal"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
])
|
|
231
|
+
};
|
|
232
|
+
return metadata;
|
|
233
|
+
}
|
|
234
|
+
return __getLoyaltyCoupon;
|
|
235
|
+
}
|
|
236
|
+
function bulkGetLoyaltyCoupon(payload) {
|
|
237
|
+
function __bulkGetLoyaltyCoupon({ host }) {
|
|
238
|
+
const metadata = {
|
|
239
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
240
|
+
method: "GET",
|
|
241
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.BulkGetLoyaltyCoupon",
|
|
242
|
+
packageName: PACKAGE_NAME,
|
|
243
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
244
|
+
protoPath: "/v1/bulk/coupons",
|
|
245
|
+
data: payload,
|
|
246
|
+
host
|
|
247
|
+
}),
|
|
248
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload, true),
|
|
249
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
250
|
+
{
|
|
251
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
252
|
+
paths: [
|
|
253
|
+
{ path: "couponsInSite.loyaltyCoupons.createdDate" },
|
|
254
|
+
{ path: "couponsInSite.loyaltyCoupons.updatedDate" }
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
259
|
+
paths: [
|
|
260
|
+
{
|
|
261
|
+
path: "couponsInSite.loyaltyCoupons.couponReference.specification.moneyOffAmount"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
path: "couponsInSite.loyaltyCoupons.couponReference.specification.percentOffRate"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
path: "couponsInSite.loyaltyCoupons.couponReference.specification.fixedPriceAmount"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
path: "couponsInSite.loyaltyCoupons.couponReference.specification.minimumSubtotal"
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
])
|
|
275
|
+
};
|
|
276
|
+
return metadata;
|
|
277
|
+
}
|
|
278
|
+
return __bulkGetLoyaltyCoupon;
|
|
279
|
+
}
|
|
280
|
+
function getCurrentMemberCoupons(payload) {
|
|
281
|
+
function __getCurrentMemberCoupons({ host }) {
|
|
282
|
+
const metadata = {
|
|
283
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
284
|
+
method: "GET",
|
|
285
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.GetCurrentMemberCoupons",
|
|
286
|
+
packageName: PACKAGE_NAME,
|
|
287
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
288
|
+
protoPath: "/v1/coupons/my-coupons",
|
|
289
|
+
data: payload,
|
|
290
|
+
host
|
|
291
|
+
}),
|
|
292
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
293
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
294
|
+
{
|
|
295
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
296
|
+
paths: [
|
|
297
|
+
{ path: "loyaltyCoupons.createdDate" },
|
|
298
|
+
{ path: "loyaltyCoupons.updatedDate" }
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
303
|
+
paths: [
|
|
304
|
+
{
|
|
305
|
+
path: "loyaltyCoupons.couponReference.specification.moneyOffAmount"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
path: "loyaltyCoupons.couponReference.specification.percentOffRate"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
path: "loyaltyCoupons.couponReference.specification.fixedPriceAmount"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
path: "loyaltyCoupons.couponReference.specification.minimumSubtotal"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
])
|
|
319
|
+
};
|
|
320
|
+
return metadata;
|
|
321
|
+
}
|
|
322
|
+
return __getCurrentMemberCoupons;
|
|
323
|
+
}
|
|
324
|
+
function queryLoyaltyCoupon(payload) {
|
|
325
|
+
function __queryLoyaltyCoupon({ host }) {
|
|
326
|
+
const metadata = {
|
|
327
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
328
|
+
method: "POST",
|
|
329
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.QueryLoyaltyCoupon",
|
|
330
|
+
packageName: PACKAGE_NAME,
|
|
331
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
332
|
+
protoPath: "/v1/coupons/query",
|
|
333
|
+
data: payload,
|
|
334
|
+
host
|
|
335
|
+
}),
|
|
336
|
+
data: payload,
|
|
337
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
338
|
+
{
|
|
339
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
340
|
+
paths: [
|
|
341
|
+
{ path: "loyaltyCoupons.createdDate" },
|
|
342
|
+
{ path: "loyaltyCoupons.updatedDate" }
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
347
|
+
paths: [
|
|
348
|
+
{
|
|
349
|
+
path: "loyaltyCoupons.couponReference.specification.moneyOffAmount"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
path: "loyaltyCoupons.couponReference.specification.percentOffRate"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
path: "loyaltyCoupons.couponReference.specification.fixedPriceAmount"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
path: "loyaltyCoupons.couponReference.specification.minimumSubtotal"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
])
|
|
363
|
+
};
|
|
364
|
+
return metadata;
|
|
365
|
+
}
|
|
366
|
+
return __queryLoyaltyCoupon;
|
|
367
|
+
}
|
|
368
|
+
function deleteLoyaltyCoupon(payload) {
|
|
369
|
+
function __deleteLoyaltyCoupon({ host }) {
|
|
370
|
+
const metadata = {
|
|
371
|
+
entityFqdn: "wix.loyalty.v1.coupon",
|
|
372
|
+
method: "DELETE",
|
|
373
|
+
methodFqn: "com.wixpress.loyalty.coupon.LoyaltyCoupons.DeleteLoyaltyCoupon",
|
|
374
|
+
packageName: PACKAGE_NAME,
|
|
375
|
+
url: resolveComWixpressLoyaltyCouponLoyaltyCouponsUrl({
|
|
376
|
+
protoPath: "/v1/coupons/{id}",
|
|
377
|
+
data: payload,
|
|
378
|
+
host
|
|
379
|
+
}),
|
|
380
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
381
|
+
};
|
|
382
|
+
return metadata;
|
|
383
|
+
}
|
|
384
|
+
return __deleteLoyaltyCoupon;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// src/loyalty-v1-coupon-coupons.universal.ts
|
|
388
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
389
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
390
|
+
Type2["UNKNOWN"] = "UNKNOWN";
|
|
391
|
+
Type2["MONEY_OFF_AMOUNT"] = "MONEY_OFF_AMOUNT";
|
|
392
|
+
Type2["PERCENT_OFF_RATE"] = "PERCENT_OFF_RATE";
|
|
393
|
+
Type2["FREE_SHIPPING"] = "FREE_SHIPPING";
|
|
394
|
+
Type2["FIXED_PRICE_AMOUNT"] = "FIXED_PRICE_AMOUNT";
|
|
395
|
+
Type2["BUY_X_GET_Y"] = "BUY_X_GET_Y";
|
|
396
|
+
return Type2;
|
|
397
|
+
})(Type || {});
|
|
398
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
399
|
+
Status2["UNKNOWN"] = "UNKNOWN";
|
|
400
|
+
Status2["PENDING"] = "PENDING";
|
|
401
|
+
Status2["ACTIVE"] = "ACTIVE";
|
|
402
|
+
Status2["APPLIED"] = "APPLIED";
|
|
403
|
+
Status2["FAILED"] = "FAILED";
|
|
404
|
+
Status2["ARCHIVED"] = "ARCHIVED";
|
|
405
|
+
return Status2;
|
|
406
|
+
})(Status || {});
|
|
407
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
408
|
+
SortOrder2["ASC"] = "ASC";
|
|
409
|
+
SortOrder2["DESC"] = "DESC";
|
|
410
|
+
return SortOrder2;
|
|
411
|
+
})(SortOrder || {});
|
|
412
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
413
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
414
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
415
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
416
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
417
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
418
|
+
return WebhookIdentityType2;
|
|
419
|
+
})(WebhookIdentityType || {});
|
|
420
|
+
async function redeemPointsForCoupon2(rewardId, options) {
|
|
421
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
422
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
423
|
+
rewardId,
|
|
424
|
+
loyaltyAccountId: options?.loyaltyAccountId
|
|
425
|
+
});
|
|
426
|
+
const reqOpts = redeemPointsForCoupon(payload);
|
|
427
|
+
sideEffects?.onSiteCall?.();
|
|
428
|
+
try {
|
|
429
|
+
const result = await httpClient.request(reqOpts);
|
|
430
|
+
sideEffects?.onSuccess?.(result);
|
|
431
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
432
|
+
} catch (err) {
|
|
433
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
434
|
+
err,
|
|
435
|
+
{
|
|
436
|
+
spreadPathsToArguments: {},
|
|
437
|
+
explicitPathsToArguments: {
|
|
438
|
+
rewardId: "$[0]",
|
|
439
|
+
loyaltyAccountId: "$[1].loyaltyAccountId"
|
|
440
|
+
},
|
|
441
|
+
singleArgumentUnchanged: false
|
|
442
|
+
},
|
|
443
|
+
["rewardId", "options"]
|
|
444
|
+
);
|
|
445
|
+
sideEffects?.onError?.(err);
|
|
446
|
+
throw transformedError;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
async function redeemCurrentMemberPointsForCoupon2(rewardId) {
|
|
450
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
451
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ rewardId });
|
|
452
|
+
const reqOpts = redeemCurrentMemberPointsForCoupon(payload);
|
|
453
|
+
sideEffects?.onSiteCall?.();
|
|
454
|
+
try {
|
|
455
|
+
const result = await httpClient.request(reqOpts);
|
|
456
|
+
sideEffects?.onSuccess?.(result);
|
|
457
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
458
|
+
} catch (err) {
|
|
459
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
460
|
+
err,
|
|
461
|
+
{
|
|
462
|
+
spreadPathsToArguments: {},
|
|
463
|
+
explicitPathsToArguments: { rewardId: "$[0]" },
|
|
464
|
+
singleArgumentUnchanged: false
|
|
465
|
+
},
|
|
466
|
+
["rewardId"]
|
|
467
|
+
);
|
|
468
|
+
sideEffects?.onError?.(err);
|
|
469
|
+
throw transformedError;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
async function getLoyaltyCoupon2(loyaltyCouponId) {
|
|
473
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
474
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
475
|
+
loyaltyCouponId
|
|
476
|
+
});
|
|
477
|
+
const reqOpts = getLoyaltyCoupon(payload);
|
|
478
|
+
sideEffects?.onSiteCall?.();
|
|
479
|
+
try {
|
|
480
|
+
const result = await httpClient.request(reqOpts);
|
|
481
|
+
sideEffects?.onSuccess?.(result);
|
|
482
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.loyaltyCoupon;
|
|
483
|
+
} catch (err) {
|
|
484
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
485
|
+
err,
|
|
486
|
+
{
|
|
487
|
+
spreadPathsToArguments: {},
|
|
488
|
+
explicitPathsToArguments: { loyaltyCouponId: "$[0]" },
|
|
489
|
+
singleArgumentUnchanged: false
|
|
490
|
+
},
|
|
491
|
+
["loyaltyCouponId"]
|
|
492
|
+
);
|
|
493
|
+
sideEffects?.onError?.(err);
|
|
494
|
+
throw transformedError;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
async function bulkGetLoyaltyCoupon2(options) {
|
|
498
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
499
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
500
|
+
query: options?.query
|
|
501
|
+
});
|
|
502
|
+
const reqOpts = bulkGetLoyaltyCoupon(payload);
|
|
503
|
+
sideEffects?.onSiteCall?.();
|
|
504
|
+
try {
|
|
505
|
+
const result = await httpClient.request(reqOpts);
|
|
506
|
+
sideEffects?.onSuccess?.(result);
|
|
507
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
508
|
+
} catch (err) {
|
|
509
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
510
|
+
err,
|
|
511
|
+
{
|
|
512
|
+
spreadPathsToArguments: {},
|
|
513
|
+
explicitPathsToArguments: { query: "$[0].query" },
|
|
514
|
+
singleArgumentUnchanged: false
|
|
515
|
+
},
|
|
516
|
+
["options"]
|
|
517
|
+
);
|
|
518
|
+
sideEffects?.onError?.(err);
|
|
519
|
+
throw transformedError;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function getCurrentMemberCoupons2() {
|
|
523
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
524
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
525
|
+
const reqOpts = getCurrentMemberCoupons(payload);
|
|
526
|
+
sideEffects?.onSiteCall?.();
|
|
527
|
+
try {
|
|
528
|
+
const result = await httpClient.request(reqOpts);
|
|
529
|
+
sideEffects?.onSuccess?.(result);
|
|
530
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
531
|
+
} catch (err) {
|
|
532
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
533
|
+
err,
|
|
534
|
+
{
|
|
535
|
+
spreadPathsToArguments: {},
|
|
536
|
+
explicitPathsToArguments: {},
|
|
537
|
+
singleArgumentUnchanged: false
|
|
538
|
+
},
|
|
539
|
+
[]
|
|
540
|
+
);
|
|
541
|
+
sideEffects?.onError?.(err);
|
|
542
|
+
throw transformedError;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function queryLoyaltyCoupons() {
|
|
546
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
547
|
+
return (0, import_query_builder.queryBuilder)({
|
|
548
|
+
func: async (payload) => {
|
|
549
|
+
const reqOpts = queryLoyaltyCoupon(payload);
|
|
550
|
+
sideEffects?.onSiteCall?.();
|
|
551
|
+
try {
|
|
552
|
+
const result = await httpClient.request(reqOpts);
|
|
553
|
+
sideEffects?.onSuccess?.(result);
|
|
554
|
+
return result;
|
|
555
|
+
} catch (err) {
|
|
556
|
+
sideEffects?.onError?.(err);
|
|
557
|
+
throw err;
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
requestTransformer: (query) => {
|
|
561
|
+
const args = [query, {}];
|
|
562
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
563
|
+
...args?.[1],
|
|
564
|
+
query: args?.[0]
|
|
565
|
+
});
|
|
566
|
+
},
|
|
567
|
+
responseTransformer: ({
|
|
568
|
+
data
|
|
569
|
+
}) => {
|
|
570
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
571
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
572
|
+
);
|
|
573
|
+
return {
|
|
574
|
+
items: transformedData?.loyaltyCoupons,
|
|
575
|
+
pagingMetadata: transformedData?.metadata
|
|
576
|
+
};
|
|
577
|
+
},
|
|
578
|
+
errorTransformer: (err) => {
|
|
579
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
580
|
+
spreadPathsToArguments: {},
|
|
581
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
582
|
+
singleArgumentUnchanged: false
|
|
583
|
+
});
|
|
584
|
+
throw transformedError;
|
|
585
|
+
},
|
|
586
|
+
pagingMethod: "CURSOR",
|
|
587
|
+
transformationPaths: {}
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
async function deleteLoyaltyCoupon2(_id, revision) {
|
|
591
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
592
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
593
|
+
id: _id,
|
|
594
|
+
revision
|
|
595
|
+
});
|
|
596
|
+
const reqOpts = deleteLoyaltyCoupon(payload);
|
|
597
|
+
sideEffects?.onSiteCall?.();
|
|
598
|
+
try {
|
|
599
|
+
const result = await httpClient.request(reqOpts);
|
|
600
|
+
sideEffects?.onSuccess?.(result);
|
|
601
|
+
} catch (err) {
|
|
602
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
603
|
+
err,
|
|
604
|
+
{
|
|
605
|
+
spreadPathsToArguments: {},
|
|
606
|
+
explicitPathsToArguments: { id: "$[0]", revision: "$[1]" },
|
|
607
|
+
singleArgumentUnchanged: false
|
|
608
|
+
},
|
|
609
|
+
["_id", "revision"]
|
|
610
|
+
);
|
|
611
|
+
sideEffects?.onError?.(err);
|
|
612
|
+
throw transformedError;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
616
|
+
0 && (module.exports = {
|
|
617
|
+
SortOrder,
|
|
618
|
+
Status,
|
|
619
|
+
Type,
|
|
620
|
+
WebhookIdentityType,
|
|
621
|
+
bulkGetLoyaltyCoupon,
|
|
622
|
+
deleteLoyaltyCoupon,
|
|
623
|
+
getCurrentMemberCoupons,
|
|
624
|
+
getLoyaltyCoupon,
|
|
625
|
+
queryLoyaltyCoupons,
|
|
626
|
+
redeemCurrentMemberPointsForCoupon,
|
|
627
|
+
redeemPointsForCoupon
|
|
628
|
+
});
|
|
629
|
+
//# sourceMappingURL=index.typings.js.map
|