@wix/auto_sdk_loyalty_rewards 1.0.11 → 1.0.12
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/{loyalty-v1-reward-rewards.universal-BFnbQRqi.d.ts → index.typings.d.ts} +174 -1
- package/build/cjs/index.typings.js +673 -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/{loyalty-v1-reward-rewards.universal-BFnbQRqi.d.mts → index.typings.d.mts} +174 -1
- package/build/es/index.typings.mjs +639 -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/{loyalty-v1-reward-rewards.universal-BFnbQRqi.d.ts → index.typings.d.ts} +174 -1
- package/build/internal/cjs/index.typings.js +673 -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/{loyalty-v1-reward-rewards.universal-BFnbQRqi.d.mts → index.typings.d.mts} +174 -1
- package/build/internal/es/index.typings.mjs +639 -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,673 @@
|
|
|
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
|
+
RewardType: () => RewardType,
|
|
24
|
+
SortOrder: () => SortOrder,
|
|
25
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
26
|
+
bulkCreateRewards: () => bulkCreateRewards2,
|
|
27
|
+
bulkGetRewards: () => bulkGetRewards2,
|
|
28
|
+
createReward: () => createReward2,
|
|
29
|
+
deleteReward: () => deleteReward2,
|
|
30
|
+
getReward: () => getReward2,
|
|
31
|
+
listRewards: () => listRewards2,
|
|
32
|
+
queryRewards: () => queryRewards2,
|
|
33
|
+
updateReward: () => updateReward2
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
36
|
+
|
|
37
|
+
// src/loyalty-v1-reward-rewards.universal.ts
|
|
38
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
39
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
40
|
+
|
|
41
|
+
// src/loyalty-v1-reward-rewards.http.ts
|
|
42
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
43
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
44
|
+
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
45
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
46
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
47
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
48
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
49
|
+
function resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl(opts) {
|
|
50
|
+
const domainToMappings = {
|
|
51
|
+
"manage._base_domain_": [
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/_api/loyalty-rewards",
|
|
54
|
+
destPath: ""
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
_: [
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/_api/loyalty-rewards",
|
|
60
|
+
destPath: ""
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"editor.wixapps.net": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/_api/loyalty-rewards",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"editor._base_domain_": [
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/_api/loyalty-rewards",
|
|
72
|
+
destPath: ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"blocks._base_domain_": [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/loyalty-rewards",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"create.editorx": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/loyalty-rewards",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"www._base_domain_": [
|
|
88
|
+
{
|
|
89
|
+
srcPath: "/_api/loyalty-rewards",
|
|
90
|
+
destPath: ""
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"*.dev.wix-code.com": [
|
|
94
|
+
{
|
|
95
|
+
srcPath: "/_api/loyalty-rewards",
|
|
96
|
+
destPath: ""
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"*.pub.wix-code.com": [
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/_api/loyalty-rewards",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"api._api_base_domain_": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/loyalty-rewards",
|
|
108
|
+
destPath: ""
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"www.wixapis.com": [
|
|
112
|
+
{
|
|
113
|
+
srcPath: "/loyalty-rewards",
|
|
114
|
+
destPath: ""
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
};
|
|
118
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
119
|
+
}
|
|
120
|
+
var PACKAGE_NAME = "@wix/auto_sdk_loyalty_rewards";
|
|
121
|
+
function createReward(payload) {
|
|
122
|
+
function __createReward({ host }) {
|
|
123
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
124
|
+
{
|
|
125
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
126
|
+
paths: [{ path: "reward.createdDate" }, { path: "reward.updatedDate" }]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
130
|
+
paths: [
|
|
131
|
+
{ path: "reward.couponReward.minimumSubtotal" },
|
|
132
|
+
{ path: "reward.couponReward.fixedAmount.configsByTier.amount" },
|
|
133
|
+
{ path: "reward.couponReward.percentage.configsByTier.percentage" }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]);
|
|
137
|
+
const metadata = {
|
|
138
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
139
|
+
method: "POST",
|
|
140
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.CreateReward",
|
|
141
|
+
packageName: PACKAGE_NAME,
|
|
142
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
143
|
+
protoPath: "/v1/rewards",
|
|
144
|
+
data: serializedData,
|
|
145
|
+
host
|
|
146
|
+
}),
|
|
147
|
+
data: serializedData,
|
|
148
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
149
|
+
{
|
|
150
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
151
|
+
paths: [
|
|
152
|
+
{ path: "reward.createdDate" },
|
|
153
|
+
{ path: "reward.updatedDate" }
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
158
|
+
paths: [
|
|
159
|
+
{ path: "reward.couponReward.minimumSubtotal" },
|
|
160
|
+
{ path: "reward.couponReward.fixedAmount.configsByTier.amount" },
|
|
161
|
+
{
|
|
162
|
+
path: "reward.couponReward.percentage.configsByTier.percentage"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
])
|
|
167
|
+
};
|
|
168
|
+
return metadata;
|
|
169
|
+
}
|
|
170
|
+
return __createReward;
|
|
171
|
+
}
|
|
172
|
+
function bulkCreateRewards(payload) {
|
|
173
|
+
function __bulkCreateRewards({ host }) {
|
|
174
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
175
|
+
{
|
|
176
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
177
|
+
paths: [
|
|
178
|
+
{ path: "rewards.createdDate" },
|
|
179
|
+
{ path: "rewards.updatedDate" }
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
184
|
+
paths: [
|
|
185
|
+
{ path: "rewards.couponReward.minimumSubtotal" },
|
|
186
|
+
{ path: "rewards.couponReward.fixedAmount.configsByTier.amount" },
|
|
187
|
+
{ path: "rewards.couponReward.percentage.configsByTier.percentage" }
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]);
|
|
191
|
+
const metadata = {
|
|
192
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
193
|
+
method: "POST",
|
|
194
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.BulkCreateRewards",
|
|
195
|
+
packageName: PACKAGE_NAME,
|
|
196
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
197
|
+
protoPath: "/v1/bulk/rewards/create",
|
|
198
|
+
data: serializedData,
|
|
199
|
+
host
|
|
200
|
+
}),
|
|
201
|
+
data: serializedData,
|
|
202
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
203
|
+
{
|
|
204
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
205
|
+
paths: [
|
|
206
|
+
{ path: "results.item.createdDate" },
|
|
207
|
+
{ path: "results.item.updatedDate" }
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
212
|
+
paths: [
|
|
213
|
+
{ path: "results.item.couponReward.minimumSubtotal" },
|
|
214
|
+
{
|
|
215
|
+
path: "results.item.couponReward.fixedAmount.configsByTier.amount"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
path: "results.item.couponReward.percentage.configsByTier.percentage"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
])
|
|
223
|
+
};
|
|
224
|
+
return metadata;
|
|
225
|
+
}
|
|
226
|
+
return __bulkCreateRewards;
|
|
227
|
+
}
|
|
228
|
+
function getReward(payload) {
|
|
229
|
+
function __getReward({ host }) {
|
|
230
|
+
const metadata = {
|
|
231
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
232
|
+
method: "GET",
|
|
233
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.GetReward",
|
|
234
|
+
packageName: PACKAGE_NAME,
|
|
235
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
236
|
+
protoPath: "/v1/rewards/{id}",
|
|
237
|
+
data: payload,
|
|
238
|
+
host
|
|
239
|
+
}),
|
|
240
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
241
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
242
|
+
{
|
|
243
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
244
|
+
paths: [
|
|
245
|
+
{ path: "reward.createdDate" },
|
|
246
|
+
{ path: "reward.updatedDate" }
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
251
|
+
paths: [
|
|
252
|
+
{ path: "reward.couponReward.minimumSubtotal" },
|
|
253
|
+
{ path: "reward.couponReward.fixedAmount.configsByTier.amount" },
|
|
254
|
+
{
|
|
255
|
+
path: "reward.couponReward.percentage.configsByTier.percentage"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
])
|
|
260
|
+
};
|
|
261
|
+
return metadata;
|
|
262
|
+
}
|
|
263
|
+
return __getReward;
|
|
264
|
+
}
|
|
265
|
+
function bulkGetRewards(payload) {
|
|
266
|
+
function __bulkGetRewards({ host }) {
|
|
267
|
+
const metadata = {
|
|
268
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
269
|
+
method: "GET",
|
|
270
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.BulkGetRewards",
|
|
271
|
+
packageName: PACKAGE_NAME,
|
|
272
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
273
|
+
protoPath: "/v1/bulk/rewards",
|
|
274
|
+
data: payload,
|
|
275
|
+
host
|
|
276
|
+
}),
|
|
277
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
278
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
279
|
+
{
|
|
280
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
281
|
+
paths: [
|
|
282
|
+
{ path: "rewardsInSite.rewards.createdDate" },
|
|
283
|
+
{ path: "rewardsInSite.rewards.updatedDate" }
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
288
|
+
paths: [
|
|
289
|
+
{ path: "rewardsInSite.rewards.couponReward.minimumSubtotal" },
|
|
290
|
+
{
|
|
291
|
+
path: "rewardsInSite.rewards.couponReward.fixedAmount.configsByTier.amount"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
path: "rewardsInSite.rewards.couponReward.percentage.configsByTier.percentage"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
])
|
|
299
|
+
};
|
|
300
|
+
return metadata;
|
|
301
|
+
}
|
|
302
|
+
return __bulkGetRewards;
|
|
303
|
+
}
|
|
304
|
+
function queryRewards(payload) {
|
|
305
|
+
function __queryRewards({ host }) {
|
|
306
|
+
const metadata = {
|
|
307
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
308
|
+
method: "POST",
|
|
309
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.QueryRewards",
|
|
310
|
+
packageName: PACKAGE_NAME,
|
|
311
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
312
|
+
protoPath: "/v1/rewards/query",
|
|
313
|
+
data: payload,
|
|
314
|
+
host
|
|
315
|
+
}),
|
|
316
|
+
data: payload,
|
|
317
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
318
|
+
{
|
|
319
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
320
|
+
paths: [
|
|
321
|
+
{ path: "rewards.createdDate" },
|
|
322
|
+
{ path: "rewards.updatedDate" }
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
327
|
+
paths: [
|
|
328
|
+
{ path: "rewards.couponReward.minimumSubtotal" },
|
|
329
|
+
{ path: "rewards.couponReward.fixedAmount.configsByTier.amount" },
|
|
330
|
+
{
|
|
331
|
+
path: "rewards.couponReward.percentage.configsByTier.percentage"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
])
|
|
336
|
+
};
|
|
337
|
+
return metadata;
|
|
338
|
+
}
|
|
339
|
+
return __queryRewards;
|
|
340
|
+
}
|
|
341
|
+
function updateReward(payload) {
|
|
342
|
+
function __updateReward({ host }) {
|
|
343
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
344
|
+
{
|
|
345
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
346
|
+
paths: [{ path: "reward.createdDate" }, { path: "reward.updatedDate" }]
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
350
|
+
paths: [
|
|
351
|
+
{ path: "reward.couponReward.minimumSubtotal" },
|
|
352
|
+
{ path: "reward.couponReward.fixedAmount.configsByTier.amount" },
|
|
353
|
+
{ path: "reward.couponReward.percentage.configsByTier.percentage" }
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
]);
|
|
357
|
+
const metadata = {
|
|
358
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
359
|
+
method: "PUT",
|
|
360
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.UpdateReward",
|
|
361
|
+
packageName: PACKAGE_NAME,
|
|
362
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
363
|
+
protoPath: "/v1/rewards/{reward.id}",
|
|
364
|
+
data: serializedData,
|
|
365
|
+
host
|
|
366
|
+
}),
|
|
367
|
+
data: serializedData,
|
|
368
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
369
|
+
{
|
|
370
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
371
|
+
paths: [
|
|
372
|
+
{ path: "reward.createdDate" },
|
|
373
|
+
{ path: "reward.updatedDate" }
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
378
|
+
paths: [
|
|
379
|
+
{ path: "reward.couponReward.minimumSubtotal" },
|
|
380
|
+
{ path: "reward.couponReward.fixedAmount.configsByTier.amount" },
|
|
381
|
+
{
|
|
382
|
+
path: "reward.couponReward.percentage.configsByTier.percentage"
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
])
|
|
387
|
+
};
|
|
388
|
+
return metadata;
|
|
389
|
+
}
|
|
390
|
+
return __updateReward;
|
|
391
|
+
}
|
|
392
|
+
function deleteReward(payload) {
|
|
393
|
+
function __deleteReward({ host }) {
|
|
394
|
+
const metadata = {
|
|
395
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
396
|
+
method: "DELETE",
|
|
397
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.DeleteReward",
|
|
398
|
+
packageName: PACKAGE_NAME,
|
|
399
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
400
|
+
protoPath: "/v1/rewards/{id}",
|
|
401
|
+
data: payload,
|
|
402
|
+
host
|
|
403
|
+
}),
|
|
404
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
405
|
+
};
|
|
406
|
+
return metadata;
|
|
407
|
+
}
|
|
408
|
+
return __deleteReward;
|
|
409
|
+
}
|
|
410
|
+
function listRewards(payload) {
|
|
411
|
+
function __listRewards({ host }) {
|
|
412
|
+
const metadata = {
|
|
413
|
+
entityFqdn: "wix.loyalty.v1.reward",
|
|
414
|
+
method: "GET",
|
|
415
|
+
methodFqn: "com.wixpress.loyalty.reward.LoyaltyRewards.ListRewards",
|
|
416
|
+
packageName: PACKAGE_NAME,
|
|
417
|
+
url: resolveComWixpressLoyaltyRewardLoyaltyRewardsUrl({
|
|
418
|
+
protoPath: "/v1/rewards",
|
|
419
|
+
data: payload,
|
|
420
|
+
host
|
|
421
|
+
}),
|
|
422
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
423
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
424
|
+
{
|
|
425
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
426
|
+
paths: [
|
|
427
|
+
{ path: "rewards.createdDate" },
|
|
428
|
+
{ path: "rewards.updatedDate" }
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
433
|
+
paths: [
|
|
434
|
+
{ path: "rewards.couponReward.minimumSubtotal" },
|
|
435
|
+
{ path: "rewards.couponReward.fixedAmount.configsByTier.amount" },
|
|
436
|
+
{
|
|
437
|
+
path: "rewards.couponReward.percentage.configsByTier.percentage"
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
])
|
|
442
|
+
};
|
|
443
|
+
return metadata;
|
|
444
|
+
}
|
|
445
|
+
return __listRewards;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// src/loyalty-v1-reward-rewards.universal.ts
|
|
449
|
+
var RewardType = /* @__PURE__ */ ((RewardType2) => {
|
|
450
|
+
RewardType2["UNDEFINED"] = "UNDEFINED";
|
|
451
|
+
RewardType2["DISCOUNT_AMOUNT"] = "DISCOUNT_AMOUNT";
|
|
452
|
+
RewardType2["COUPON_REWARD"] = "COUPON_REWARD";
|
|
453
|
+
RewardType2["SPI_DISCOUNT_AMOUNT"] = "SPI_DISCOUNT_AMOUNT";
|
|
454
|
+
return RewardType2;
|
|
455
|
+
})(RewardType || {});
|
|
456
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
457
|
+
SortOrder2["ASC"] = "ASC";
|
|
458
|
+
SortOrder2["DESC"] = "DESC";
|
|
459
|
+
return SortOrder2;
|
|
460
|
+
})(SortOrder || {});
|
|
461
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
462
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
463
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
464
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
465
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
466
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
467
|
+
return WebhookIdentityType2;
|
|
468
|
+
})(WebhookIdentityType || {});
|
|
469
|
+
async function createReward2(reward) {
|
|
470
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
471
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ reward });
|
|
472
|
+
const reqOpts = createReward(payload);
|
|
473
|
+
sideEffects?.onSiteCall?.();
|
|
474
|
+
try {
|
|
475
|
+
const result = await httpClient.request(reqOpts);
|
|
476
|
+
sideEffects?.onSuccess?.(result);
|
|
477
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.reward;
|
|
478
|
+
} catch (err) {
|
|
479
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
480
|
+
err,
|
|
481
|
+
{
|
|
482
|
+
spreadPathsToArguments: {},
|
|
483
|
+
explicitPathsToArguments: { reward: "$[0]" },
|
|
484
|
+
singleArgumentUnchanged: false
|
|
485
|
+
},
|
|
486
|
+
["reward"]
|
|
487
|
+
);
|
|
488
|
+
sideEffects?.onError?.(err);
|
|
489
|
+
throw transformedError;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
async function bulkCreateRewards2(rewards) {
|
|
493
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
494
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ rewards });
|
|
495
|
+
const reqOpts = bulkCreateRewards(payload);
|
|
496
|
+
sideEffects?.onSiteCall?.();
|
|
497
|
+
try {
|
|
498
|
+
const result = await httpClient.request(reqOpts);
|
|
499
|
+
sideEffects?.onSuccess?.(result);
|
|
500
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
501
|
+
} catch (err) {
|
|
502
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
503
|
+
err,
|
|
504
|
+
{
|
|
505
|
+
spreadPathsToArguments: {},
|
|
506
|
+
explicitPathsToArguments: { rewards: "$[0]" },
|
|
507
|
+
singleArgumentUnchanged: false
|
|
508
|
+
},
|
|
509
|
+
["rewards"]
|
|
510
|
+
);
|
|
511
|
+
sideEffects?.onError?.(err);
|
|
512
|
+
throw transformedError;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
async function getReward2(_id) {
|
|
516
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
517
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
518
|
+
const reqOpts = getReward(payload);
|
|
519
|
+
sideEffects?.onSiteCall?.();
|
|
520
|
+
try {
|
|
521
|
+
const result = await httpClient.request(reqOpts);
|
|
522
|
+
sideEffects?.onSuccess?.(result);
|
|
523
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.reward;
|
|
524
|
+
} catch (err) {
|
|
525
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
526
|
+
err,
|
|
527
|
+
{
|
|
528
|
+
spreadPathsToArguments: {},
|
|
529
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
530
|
+
singleArgumentUnchanged: false
|
|
531
|
+
},
|
|
532
|
+
["_id"]
|
|
533
|
+
);
|
|
534
|
+
sideEffects?.onError?.(err);
|
|
535
|
+
throw transformedError;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
async function bulkGetRewards2() {
|
|
539
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
540
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
541
|
+
const reqOpts = bulkGetRewards(payload);
|
|
542
|
+
sideEffects?.onSiteCall?.();
|
|
543
|
+
try {
|
|
544
|
+
const result = await httpClient.request(reqOpts);
|
|
545
|
+
sideEffects?.onSuccess?.(result);
|
|
546
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
547
|
+
} catch (err) {
|
|
548
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
549
|
+
err,
|
|
550
|
+
{
|
|
551
|
+
spreadPathsToArguments: {},
|
|
552
|
+
explicitPathsToArguments: {},
|
|
553
|
+
singleArgumentUnchanged: false
|
|
554
|
+
},
|
|
555
|
+
[]
|
|
556
|
+
);
|
|
557
|
+
sideEffects?.onError?.(err);
|
|
558
|
+
throw transformedError;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
async function queryRewards2(query) {
|
|
562
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
563
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
564
|
+
const reqOpts = queryRewards(payload);
|
|
565
|
+
sideEffects?.onSiteCall?.();
|
|
566
|
+
try {
|
|
567
|
+
const result = await httpClient.request(reqOpts);
|
|
568
|
+
sideEffects?.onSuccess?.(result);
|
|
569
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
570
|
+
} catch (err) {
|
|
571
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
572
|
+
err,
|
|
573
|
+
{
|
|
574
|
+
spreadPathsToArguments: {},
|
|
575
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
576
|
+
singleArgumentUnchanged: false
|
|
577
|
+
},
|
|
578
|
+
["query"]
|
|
579
|
+
);
|
|
580
|
+
sideEffects?.onError?.(err);
|
|
581
|
+
throw transformedError;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
async function updateReward2(_id, reward) {
|
|
585
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
586
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
587
|
+
reward: { ...reward, id: _id }
|
|
588
|
+
});
|
|
589
|
+
const reqOpts = updateReward(payload);
|
|
590
|
+
sideEffects?.onSiteCall?.();
|
|
591
|
+
try {
|
|
592
|
+
const result = await httpClient.request(reqOpts);
|
|
593
|
+
sideEffects?.onSuccess?.(result);
|
|
594
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
595
|
+
} catch (err) {
|
|
596
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
597
|
+
err,
|
|
598
|
+
{
|
|
599
|
+
spreadPathsToArguments: { reward: "$[1]" },
|
|
600
|
+
explicitPathsToArguments: { "reward.id": "$[0]" },
|
|
601
|
+
singleArgumentUnchanged: false
|
|
602
|
+
},
|
|
603
|
+
["_id", "reward"]
|
|
604
|
+
);
|
|
605
|
+
sideEffects?.onError?.(err);
|
|
606
|
+
throw transformedError;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
async function deleteReward2(_id, revision) {
|
|
610
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
611
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
612
|
+
id: _id,
|
|
613
|
+
revision
|
|
614
|
+
});
|
|
615
|
+
const reqOpts = deleteReward(payload);
|
|
616
|
+
sideEffects?.onSiteCall?.();
|
|
617
|
+
try {
|
|
618
|
+
const result = await httpClient.request(reqOpts);
|
|
619
|
+
sideEffects?.onSuccess?.(result);
|
|
620
|
+
} catch (err) {
|
|
621
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
622
|
+
err,
|
|
623
|
+
{
|
|
624
|
+
spreadPathsToArguments: {},
|
|
625
|
+
explicitPathsToArguments: { id: "$[0]", revision: "$[1]" },
|
|
626
|
+
singleArgumentUnchanged: false
|
|
627
|
+
},
|
|
628
|
+
["_id", "revision"]
|
|
629
|
+
);
|
|
630
|
+
sideEffects?.onError?.(err);
|
|
631
|
+
throw transformedError;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
async function listRewards2(options) {
|
|
635
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
636
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
637
|
+
cursorPaging: options?.cursorPaging
|
|
638
|
+
});
|
|
639
|
+
const reqOpts = listRewards(payload);
|
|
640
|
+
sideEffects?.onSiteCall?.();
|
|
641
|
+
try {
|
|
642
|
+
const result = await httpClient.request(reqOpts);
|
|
643
|
+
sideEffects?.onSuccess?.(result);
|
|
644
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
645
|
+
} catch (err) {
|
|
646
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
647
|
+
err,
|
|
648
|
+
{
|
|
649
|
+
spreadPathsToArguments: {},
|
|
650
|
+
explicitPathsToArguments: { cursorPaging: "$[0].cursorPaging" },
|
|
651
|
+
singleArgumentUnchanged: false
|
|
652
|
+
},
|
|
653
|
+
["options"]
|
|
654
|
+
);
|
|
655
|
+
sideEffects?.onError?.(err);
|
|
656
|
+
throw transformedError;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
660
|
+
0 && (module.exports = {
|
|
661
|
+
RewardType,
|
|
662
|
+
SortOrder,
|
|
663
|
+
WebhookIdentityType,
|
|
664
|
+
bulkCreateRewards,
|
|
665
|
+
bulkGetRewards,
|
|
666
|
+
createReward,
|
|
667
|
+
deleteReward,
|
|
668
|
+
getReward,
|
|
669
|
+
listRewards,
|
|
670
|
+
queryRewards,
|
|
671
|
+
updateReward
|
|
672
|
+
});
|
|
673
|
+
//# sourceMappingURL=index.typings.js.map
|