@wix/auto_sdk_stores_subscription-options 1.0.16 → 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 +17 -12
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts → index.typings.d.ts} +176 -1
- package/build/cjs/index.typings.js +767 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +17 -12
- package/build/es/index.mjs.map +1 -1
- package/build/es/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts → index.typings.d.mts} +176 -1
- package/build/es/index.typings.mjs +730 -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 +17 -12
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts → index.typings.d.ts} +176 -1
- package/build/internal/cjs/index.typings.js +767 -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 +17 -12
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts → index.typings.d.mts} +176 -1
- package/build/internal/es/index.typings.mjs +730 -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,730 @@
|
|
|
1
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/stores-v1-subscription-option-subscription-options.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
11
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
12
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
13
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
14
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
15
|
+
const domainToMappings = {
|
|
16
|
+
"api._api_base_domain_": [
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/wix-ecommerce-plans",
|
|
19
|
+
destPath: ""
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"www.wixapis.com": [
|
|
23
|
+
{
|
|
24
|
+
srcPath: "/stores/v1/subscription-options",
|
|
25
|
+
destPath: "/v1/subscription-options"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"www._base_domain_": [
|
|
29
|
+
{
|
|
30
|
+
srcPath: "/_api/subscription-options-server",
|
|
31
|
+
destPath: ""
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"editor._base_domain_": [
|
|
35
|
+
{
|
|
36
|
+
srcPath: "/_api/subscription-options-server",
|
|
37
|
+
destPath: ""
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"blocks._base_domain_": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/_api/subscription-options-server",
|
|
43
|
+
destPath: ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"create.editorx": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/subscription-options-server",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"manage._base_domain_": [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/subscription-options-server",
|
|
55
|
+
destPath: ""
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
60
|
+
}
|
|
61
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
62
|
+
const domainToMappings = {
|
|
63
|
+
"api._api_base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"www._base_domain_": [
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
72
|
+
destPath: ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
_: [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"manage._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
89
|
+
}
|
|
90
|
+
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
91
|
+
function getSubscriptionOption(payload) {
|
|
92
|
+
function __getSubscriptionOption({ host }) {
|
|
93
|
+
const metadata = {
|
|
94
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
95
|
+
method: "GET",
|
|
96
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
97
|
+
packageName: PACKAGE_NAME,
|
|
98
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
99
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
100
|
+
),
|
|
101
|
+
params: toURLSearchParams(payload),
|
|
102
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
103
|
+
{
|
|
104
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
105
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
106
|
+
}
|
|
107
|
+
])
|
|
108
|
+
};
|
|
109
|
+
return metadata;
|
|
110
|
+
}
|
|
111
|
+
return __getSubscriptionOption;
|
|
112
|
+
}
|
|
113
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
114
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
115
|
+
const metadata = {
|
|
116
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
117
|
+
method: "GET",
|
|
118
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
119
|
+
packageName: PACKAGE_NAME,
|
|
120
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
121
|
+
{
|
|
122
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
123
|
+
data: payload,
|
|
124
|
+
host
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
params: toURLSearchParams(payload),
|
|
128
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
129
|
+
{
|
|
130
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
131
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
132
|
+
}
|
|
133
|
+
])
|
|
134
|
+
};
|
|
135
|
+
return metadata;
|
|
136
|
+
}
|
|
137
|
+
return __getSubscriptionOptionsForProduct;
|
|
138
|
+
}
|
|
139
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
140
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
141
|
+
const metadata = {
|
|
142
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
143
|
+
method: "GET",
|
|
144
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
145
|
+
packageName: PACKAGE_NAME,
|
|
146
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
147
|
+
{
|
|
148
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
149
|
+
data: payload,
|
|
150
|
+
host
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
params: toURLSearchParams(payload)
|
|
154
|
+
};
|
|
155
|
+
return metadata;
|
|
156
|
+
}
|
|
157
|
+
return __getProductIdsForSubscriptionOption;
|
|
158
|
+
}
|
|
159
|
+
function getOneTimePurchasesStatus(payload) {
|
|
160
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
161
|
+
const metadata = {
|
|
162
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
163
|
+
method: "GET",
|
|
164
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
165
|
+
packageName: PACKAGE_NAME,
|
|
166
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
167
|
+
{
|
|
168
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
169
|
+
data: payload,
|
|
170
|
+
host
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
params: toURLSearchParams(payload)
|
|
174
|
+
};
|
|
175
|
+
return metadata;
|
|
176
|
+
}
|
|
177
|
+
return __getOneTimePurchasesStatus;
|
|
178
|
+
}
|
|
179
|
+
function createSubscriptionOption(payload) {
|
|
180
|
+
function __createSubscriptionOption({ host }) {
|
|
181
|
+
const serializedData = transformPaths(payload, [
|
|
182
|
+
{
|
|
183
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
184
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
185
|
+
}
|
|
186
|
+
]);
|
|
187
|
+
const metadata = {
|
|
188
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
189
|
+
method: "POST",
|
|
190
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.CreateSubscriptionOption",
|
|
191
|
+
packageName: PACKAGE_NAME,
|
|
192
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
193
|
+
{ protoPath: "/v1/subscription-options", data: serializedData, host }
|
|
194
|
+
),
|
|
195
|
+
data: serializedData,
|
|
196
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
197
|
+
{
|
|
198
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
199
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
200
|
+
}
|
|
201
|
+
])
|
|
202
|
+
};
|
|
203
|
+
return metadata;
|
|
204
|
+
}
|
|
205
|
+
return __createSubscriptionOption;
|
|
206
|
+
}
|
|
207
|
+
function updateSubscriptionOption(payload) {
|
|
208
|
+
function __updateSubscriptionOption({ host }) {
|
|
209
|
+
const serializedData = transformPaths(payload, [
|
|
210
|
+
{
|
|
211
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
212
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
213
|
+
}
|
|
214
|
+
]);
|
|
215
|
+
const metadata = {
|
|
216
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
217
|
+
method: "PATCH",
|
|
218
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.UpdateSubscriptionOption",
|
|
219
|
+
packageName: PACKAGE_NAME,
|
|
220
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
221
|
+
{
|
|
222
|
+
protoPath: "/v1/subscription-options/{subscriptionOption.id}",
|
|
223
|
+
data: serializedData,
|
|
224
|
+
host
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
data: serializedData,
|
|
228
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
229
|
+
{
|
|
230
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
231
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
232
|
+
}
|
|
233
|
+
])
|
|
234
|
+
};
|
|
235
|
+
return metadata;
|
|
236
|
+
}
|
|
237
|
+
return __updateSubscriptionOption;
|
|
238
|
+
}
|
|
239
|
+
function deleteSubscriptionOption(payload) {
|
|
240
|
+
function __deleteSubscriptionOption({ host }) {
|
|
241
|
+
const metadata = {
|
|
242
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
243
|
+
method: "DELETE",
|
|
244
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.DeleteSubscriptionOption",
|
|
245
|
+
packageName: PACKAGE_NAME,
|
|
246
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
247
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
248
|
+
),
|
|
249
|
+
params: toURLSearchParams(payload)
|
|
250
|
+
};
|
|
251
|
+
return metadata;
|
|
252
|
+
}
|
|
253
|
+
return __deleteSubscriptionOption;
|
|
254
|
+
}
|
|
255
|
+
function bulkCreateSubscriptionOptions(payload) {
|
|
256
|
+
function __bulkCreateSubscriptionOptions({ host }) {
|
|
257
|
+
const serializedData = transformPaths(payload, [
|
|
258
|
+
{
|
|
259
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
260
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
261
|
+
}
|
|
262
|
+
]);
|
|
263
|
+
const metadata = {
|
|
264
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
265
|
+
method: "POST",
|
|
266
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkCreateSubscriptionOptions",
|
|
267
|
+
packageName: PACKAGE_NAME,
|
|
268
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
269
|
+
{
|
|
270
|
+
protoPath: "/v1/subscription-options/createBulk",
|
|
271
|
+
data: serializedData,
|
|
272
|
+
host
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
data: serializedData,
|
|
276
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
277
|
+
{
|
|
278
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
279
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
280
|
+
}
|
|
281
|
+
])
|
|
282
|
+
};
|
|
283
|
+
return metadata;
|
|
284
|
+
}
|
|
285
|
+
return __bulkCreateSubscriptionOptions;
|
|
286
|
+
}
|
|
287
|
+
function bulkUpdateSubscriptionOptions(payload) {
|
|
288
|
+
function __bulkUpdateSubscriptionOptions({ host }) {
|
|
289
|
+
const serializedData = transformPaths(payload, [
|
|
290
|
+
{
|
|
291
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
292
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
293
|
+
}
|
|
294
|
+
]);
|
|
295
|
+
const metadata = {
|
|
296
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
297
|
+
method: "PATCH",
|
|
298
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkUpdateSubscriptionOptions",
|
|
299
|
+
packageName: PACKAGE_NAME,
|
|
300
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
301
|
+
{ protoPath: "/v1/subscription-options", data: serializedData, host }
|
|
302
|
+
),
|
|
303
|
+
data: serializedData,
|
|
304
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
305
|
+
{
|
|
306
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
307
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
308
|
+
}
|
|
309
|
+
])
|
|
310
|
+
};
|
|
311
|
+
return metadata;
|
|
312
|
+
}
|
|
313
|
+
return __bulkUpdateSubscriptionOptions;
|
|
314
|
+
}
|
|
315
|
+
function bulkDeleteSubscriptionOptions(payload) {
|
|
316
|
+
function __bulkDeleteSubscriptionOptions({ host }) {
|
|
317
|
+
const metadata = {
|
|
318
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
319
|
+
method: "POST",
|
|
320
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkDeleteSubscriptionOptions",
|
|
321
|
+
packageName: PACKAGE_NAME,
|
|
322
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
323
|
+
{
|
|
324
|
+
protoPath: "/v1/subscription-options/deleteBulk",
|
|
325
|
+
data: payload,
|
|
326
|
+
host
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
data: payload
|
|
330
|
+
};
|
|
331
|
+
return metadata;
|
|
332
|
+
}
|
|
333
|
+
return __bulkDeleteSubscriptionOptions;
|
|
334
|
+
}
|
|
335
|
+
function assignSubscriptionOptionsToProduct(payload) {
|
|
336
|
+
function __assignSubscriptionOptionsToProduct({ host }) {
|
|
337
|
+
const serializedData = transformPaths(payload, [
|
|
338
|
+
{
|
|
339
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
340
|
+
paths: [{ path: "assignedSubscriptionOptions.discount.value" }]
|
|
341
|
+
}
|
|
342
|
+
]);
|
|
343
|
+
const metadata = {
|
|
344
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
345
|
+
method: "POST",
|
|
346
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AssignSubscriptionOptionsToProduct",
|
|
347
|
+
packageName: PACKAGE_NAME,
|
|
348
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
349
|
+
{
|
|
350
|
+
protoPath: "/v1/subscription-options/product/{productId}/assign",
|
|
351
|
+
data: serializedData,
|
|
352
|
+
host
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
data: serializedData
|
|
356
|
+
};
|
|
357
|
+
return metadata;
|
|
358
|
+
}
|
|
359
|
+
return __assignSubscriptionOptionsToProduct;
|
|
360
|
+
}
|
|
361
|
+
function allowOneTimePurchases(payload) {
|
|
362
|
+
function __allowOneTimePurchases({ host }) {
|
|
363
|
+
const metadata = {
|
|
364
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
365
|
+
method: "PATCH",
|
|
366
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AllowOneTimePurchases",
|
|
367
|
+
packageName: PACKAGE_NAME,
|
|
368
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
369
|
+
{
|
|
370
|
+
protoPath: "/v1/subscription-options/product/{productId}/allowOneTimePurchase",
|
|
371
|
+
data: payload,
|
|
372
|
+
host
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
data: payload
|
|
376
|
+
};
|
|
377
|
+
return metadata;
|
|
378
|
+
}
|
|
379
|
+
return __allowOneTimePurchases;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
383
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
384
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
385
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
386
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
387
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
388
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
389
|
+
return SubscriptionFrequency2;
|
|
390
|
+
})(SubscriptionFrequency || {});
|
|
391
|
+
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
392
|
+
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
393
|
+
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
394
|
+
DiscountType2["PERCENT"] = "PERCENT";
|
|
395
|
+
return DiscountType2;
|
|
396
|
+
})(DiscountType || {});
|
|
397
|
+
async function getSubscriptionOption2(_id) {
|
|
398
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
399
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
400
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
401
|
+
sideEffects?.onSiteCall?.();
|
|
402
|
+
try {
|
|
403
|
+
const result = await httpClient.request(reqOpts);
|
|
404
|
+
sideEffects?.onSuccess?.(result);
|
|
405
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
406
|
+
} catch (err) {
|
|
407
|
+
const transformedError = sdkTransformError(
|
|
408
|
+
err,
|
|
409
|
+
{
|
|
410
|
+
spreadPathsToArguments: {},
|
|
411
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
412
|
+
singleArgumentUnchanged: false
|
|
413
|
+
},
|
|
414
|
+
["_id"]
|
|
415
|
+
);
|
|
416
|
+
sideEffects?.onError?.(err);
|
|
417
|
+
throw transformedError;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
421
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
422
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
423
|
+
productId,
|
|
424
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
425
|
+
});
|
|
426
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
427
|
+
payload
|
|
428
|
+
);
|
|
429
|
+
sideEffects?.onSiteCall?.();
|
|
430
|
+
try {
|
|
431
|
+
const result = await httpClient.request(reqOpts);
|
|
432
|
+
sideEffects?.onSuccess?.(result);
|
|
433
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
434
|
+
} catch (err) {
|
|
435
|
+
const transformedError = sdkTransformError(
|
|
436
|
+
err,
|
|
437
|
+
{
|
|
438
|
+
spreadPathsToArguments: {},
|
|
439
|
+
explicitPathsToArguments: {
|
|
440
|
+
productId: "$[0]",
|
|
441
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
442
|
+
},
|
|
443
|
+
singleArgumentUnchanged: false
|
|
444
|
+
},
|
|
445
|
+
["productId", "options"]
|
|
446
|
+
);
|
|
447
|
+
sideEffects?.onError?.(err);
|
|
448
|
+
throw transformedError;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
452
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
453
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
454
|
+
id: _id,
|
|
455
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
456
|
+
paging: options?.paging
|
|
457
|
+
});
|
|
458
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
459
|
+
payload
|
|
460
|
+
);
|
|
461
|
+
sideEffects?.onSiteCall?.();
|
|
462
|
+
try {
|
|
463
|
+
const result = await httpClient.request(reqOpts);
|
|
464
|
+
sideEffects?.onSuccess?.(result);
|
|
465
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
466
|
+
} catch (err) {
|
|
467
|
+
const transformedError = sdkTransformError(
|
|
468
|
+
err,
|
|
469
|
+
{
|
|
470
|
+
spreadPathsToArguments: {},
|
|
471
|
+
explicitPathsToArguments: {
|
|
472
|
+
id: "$[0]",
|
|
473
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
474
|
+
paging: "$[1].paging"
|
|
475
|
+
},
|
|
476
|
+
singleArgumentUnchanged: false
|
|
477
|
+
},
|
|
478
|
+
["_id", "options"]
|
|
479
|
+
);
|
|
480
|
+
sideEffects?.onError?.(err);
|
|
481
|
+
throw transformedError;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
485
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
486
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
487
|
+
productId
|
|
488
|
+
});
|
|
489
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
490
|
+
sideEffects?.onSiteCall?.();
|
|
491
|
+
try {
|
|
492
|
+
const result = await httpClient.request(reqOpts);
|
|
493
|
+
sideEffects?.onSuccess?.(result);
|
|
494
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
495
|
+
} catch (err) {
|
|
496
|
+
const transformedError = sdkTransformError(
|
|
497
|
+
err,
|
|
498
|
+
{
|
|
499
|
+
spreadPathsToArguments: {},
|
|
500
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
501
|
+
singleArgumentUnchanged: false
|
|
502
|
+
},
|
|
503
|
+
["productId"]
|
|
504
|
+
);
|
|
505
|
+
sideEffects?.onError?.(err);
|
|
506
|
+
throw transformedError;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
async function createSubscriptionOption2(subscriptionOption) {
|
|
510
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
511
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
512
|
+
subscriptionOption
|
|
513
|
+
});
|
|
514
|
+
const reqOpts = createSubscriptionOption(payload);
|
|
515
|
+
sideEffects?.onSiteCall?.();
|
|
516
|
+
try {
|
|
517
|
+
const result = await httpClient.request(reqOpts);
|
|
518
|
+
sideEffects?.onSuccess?.(result);
|
|
519
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
520
|
+
} catch (err) {
|
|
521
|
+
const transformedError = sdkTransformError(
|
|
522
|
+
err,
|
|
523
|
+
{
|
|
524
|
+
spreadPathsToArguments: {},
|
|
525
|
+
explicitPathsToArguments: { subscriptionOption: "$[0]" },
|
|
526
|
+
singleArgumentUnchanged: false
|
|
527
|
+
},
|
|
528
|
+
["subscriptionOption"]
|
|
529
|
+
);
|
|
530
|
+
sideEffects?.onError?.(err);
|
|
531
|
+
throw transformedError;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
535
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
536
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
537
|
+
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
538
|
+
});
|
|
539
|
+
const reqOpts = updateSubscriptionOption(payload);
|
|
540
|
+
sideEffects?.onSiteCall?.();
|
|
541
|
+
try {
|
|
542
|
+
const result = await httpClient.request(reqOpts);
|
|
543
|
+
sideEffects?.onSuccess?.(result);
|
|
544
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
545
|
+
} catch (err) {
|
|
546
|
+
const transformedError = sdkTransformError(
|
|
547
|
+
err,
|
|
548
|
+
{
|
|
549
|
+
spreadPathsToArguments: { subscriptionOption: "$[1]" },
|
|
550
|
+
explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
|
|
551
|
+
singleArgumentUnchanged: false
|
|
552
|
+
},
|
|
553
|
+
["_id", "subscriptionOption"]
|
|
554
|
+
);
|
|
555
|
+
sideEffects?.onError?.(err);
|
|
556
|
+
throw transformedError;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
async function deleteSubscriptionOption2(_id) {
|
|
560
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
561
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
562
|
+
const reqOpts = deleteSubscriptionOption(payload);
|
|
563
|
+
sideEffects?.onSiteCall?.();
|
|
564
|
+
try {
|
|
565
|
+
const result = await httpClient.request(reqOpts);
|
|
566
|
+
sideEffects?.onSuccess?.(result);
|
|
567
|
+
} catch (err) {
|
|
568
|
+
const transformedError = sdkTransformError(
|
|
569
|
+
err,
|
|
570
|
+
{
|
|
571
|
+
spreadPathsToArguments: {},
|
|
572
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
573
|
+
singleArgumentUnchanged: false
|
|
574
|
+
},
|
|
575
|
+
["_id"]
|
|
576
|
+
);
|
|
577
|
+
sideEffects?.onError?.(err);
|
|
578
|
+
throw transformedError;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
582
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
583
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
584
|
+
subscriptionOptions
|
|
585
|
+
});
|
|
586
|
+
const reqOpts = bulkCreateSubscriptionOptions(
|
|
587
|
+
payload
|
|
588
|
+
);
|
|
589
|
+
sideEffects?.onSiteCall?.();
|
|
590
|
+
try {
|
|
591
|
+
const result = await httpClient.request(reqOpts);
|
|
592
|
+
sideEffects?.onSuccess?.(result);
|
|
593
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
594
|
+
} catch (err) {
|
|
595
|
+
const transformedError = sdkTransformError(
|
|
596
|
+
err,
|
|
597
|
+
{
|
|
598
|
+
spreadPathsToArguments: {},
|
|
599
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
600
|
+
singleArgumentUnchanged: false
|
|
601
|
+
},
|
|
602
|
+
["subscriptionOptions"]
|
|
603
|
+
);
|
|
604
|
+
sideEffects?.onError?.(err);
|
|
605
|
+
throw transformedError;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
609
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
610
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
611
|
+
subscriptionOptions
|
|
612
|
+
});
|
|
613
|
+
const reqOpts = bulkUpdateSubscriptionOptions(
|
|
614
|
+
payload
|
|
615
|
+
);
|
|
616
|
+
sideEffects?.onSiteCall?.();
|
|
617
|
+
try {
|
|
618
|
+
const result = await httpClient.request(reqOpts);
|
|
619
|
+
sideEffects?.onSuccess?.(result);
|
|
620
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
621
|
+
} catch (err) {
|
|
622
|
+
const transformedError = sdkTransformError(
|
|
623
|
+
err,
|
|
624
|
+
{
|
|
625
|
+
spreadPathsToArguments: {},
|
|
626
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
627
|
+
singleArgumentUnchanged: false
|
|
628
|
+
},
|
|
629
|
+
["subscriptionOptions"]
|
|
630
|
+
);
|
|
631
|
+
sideEffects?.onError?.(err);
|
|
632
|
+
throw transformedError;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
636
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
637
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
|
|
638
|
+
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
639
|
+
payload
|
|
640
|
+
);
|
|
641
|
+
sideEffects?.onSiteCall?.();
|
|
642
|
+
try {
|
|
643
|
+
const result = await httpClient.request(reqOpts);
|
|
644
|
+
sideEffects?.onSuccess?.(result);
|
|
645
|
+
} catch (err) {
|
|
646
|
+
const transformedError = sdkTransformError(
|
|
647
|
+
err,
|
|
648
|
+
{
|
|
649
|
+
spreadPathsToArguments: {},
|
|
650
|
+
explicitPathsToArguments: { ids: "$[0]" },
|
|
651
|
+
singleArgumentUnchanged: false
|
|
652
|
+
},
|
|
653
|
+
["ids"]
|
|
654
|
+
);
|
|
655
|
+
sideEffects?.onError?.(err);
|
|
656
|
+
throw transformedError;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
660
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
661
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
662
|
+
productId,
|
|
663
|
+
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
664
|
+
});
|
|
665
|
+
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
666
|
+
payload
|
|
667
|
+
);
|
|
668
|
+
sideEffects?.onSiteCall?.();
|
|
669
|
+
try {
|
|
670
|
+
const result = await httpClient.request(reqOpts);
|
|
671
|
+
sideEffects?.onSuccess?.(result);
|
|
672
|
+
} catch (err) {
|
|
673
|
+
const transformedError = sdkTransformError(
|
|
674
|
+
err,
|
|
675
|
+
{
|
|
676
|
+
spreadPathsToArguments: {},
|
|
677
|
+
explicitPathsToArguments: {
|
|
678
|
+
productId: "$[0]",
|
|
679
|
+
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
680
|
+
},
|
|
681
|
+
singleArgumentUnchanged: false
|
|
682
|
+
},
|
|
683
|
+
["productId", "options"]
|
|
684
|
+
);
|
|
685
|
+
sideEffects?.onError?.(err);
|
|
686
|
+
throw transformedError;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
async function allowOneTimePurchases2(productId, allowed) {
|
|
690
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
691
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
692
|
+
productId,
|
|
693
|
+
allowed
|
|
694
|
+
});
|
|
695
|
+
const reqOpts = allowOneTimePurchases(payload);
|
|
696
|
+
sideEffects?.onSiteCall?.();
|
|
697
|
+
try {
|
|
698
|
+
const result = await httpClient.request(reqOpts);
|
|
699
|
+
sideEffects?.onSuccess?.(result);
|
|
700
|
+
} catch (err) {
|
|
701
|
+
const transformedError = sdkTransformError(
|
|
702
|
+
err,
|
|
703
|
+
{
|
|
704
|
+
spreadPathsToArguments: {},
|
|
705
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
706
|
+
singleArgumentUnchanged: false
|
|
707
|
+
},
|
|
708
|
+
["productId", "allowed"]
|
|
709
|
+
);
|
|
710
|
+
sideEffects?.onError?.(err);
|
|
711
|
+
throw transformedError;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
export {
|
|
715
|
+
DiscountType,
|
|
716
|
+
SubscriptionFrequency,
|
|
717
|
+
allowOneTimePurchases2 as allowOneTimePurchases,
|
|
718
|
+
assignSubscriptionOptionsToProduct2 as assignSubscriptionOptionsToProduct,
|
|
719
|
+
bulkCreateSubscriptionOptions2 as bulkCreateSubscriptionOptions,
|
|
720
|
+
bulkDeleteSubscriptionOptions2 as bulkDeleteSubscriptionOptions,
|
|
721
|
+
bulkUpdateSubscriptionOptions2 as bulkUpdateSubscriptionOptions,
|
|
722
|
+
createSubscriptionOption2 as createSubscriptionOption,
|
|
723
|
+
deleteSubscriptionOption2 as deleteSubscriptionOption,
|
|
724
|
+
getOneTimePurchasesStatus2 as getOneTimePurchasesStatus,
|
|
725
|
+
getProductIdsForSubscriptionOption2 as getProductIdsForSubscriptionOption,
|
|
726
|
+
getSubscriptionOption2 as getSubscriptionOption,
|
|
727
|
+
getSubscriptionOptionsForProduct2 as getSubscriptionOptionsForProduct,
|
|
728
|
+
updateSubscriptionOption2 as updateSubscriptionOption
|
|
729
|
+
};
|
|
730
|
+
//# sourceMappingURL=index.typings.mjs.map
|