@wix/auto_sdk_stores_subscription-options 1.0.39 → 1.0.41
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 +47 -58
- package/build/cjs/index.js +277 -336
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +158 -183
- package/build/cjs/index.typings.js +223 -273
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +109 -123
- package/build/cjs/meta.js +203 -246
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +47 -58
- package/build/es/index.mjs +277 -335
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +158 -183
- package/build/es/index.typings.mjs +223 -272
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +109 -123
- package/build/es/meta.mjs +203 -245
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +47 -58
- package/build/internal/cjs/index.js +277 -336
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +158 -183
- package/build/internal/cjs/index.typings.js +223 -273
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +109 -123
- package/build/internal/cjs/meta.js +203 -246
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +47 -58
- package/build/internal/es/index.mjs +277 -335
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +158 -183
- package/build/internal/es/index.typings.mjs +223 -272
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +109 -123
- package/build/internal/es/meta.mjs +203 -245
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -29,7 +29,6 @@ __export(index_exports, {
|
|
|
29
29
|
bulkUpdateSubscriptionOptions: () => bulkUpdateSubscriptionOptions4,
|
|
30
30
|
createSubscriptionOption: () => createSubscriptionOption4,
|
|
31
31
|
deleteSubscriptionOption: () => deleteSubscriptionOption4,
|
|
32
|
-
enableCustomerCancellation: () => enableCustomerCancellation4,
|
|
33
32
|
getOneTimePurchasesStatus: () => getOneTimePurchasesStatus4,
|
|
34
33
|
getProductIdsForSubscriptionOption: () => getProductIdsForSubscriptionOption4,
|
|
35
34
|
getSubscriptionOption: () => getSubscriptionOption4,
|
|
@@ -48,35 +47,6 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
48
47
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
49
48
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
50
49
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
51
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
52
|
-
const domainToMappings = {
|
|
53
|
-
"api._api_base_domain_": [
|
|
54
|
-
{
|
|
55
|
-
srcPath: "/wix-ecommerce-plans-reader",
|
|
56
|
-
destPath: ""
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"www._base_domain_": [
|
|
60
|
-
{
|
|
61
|
-
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
62
|
-
destPath: ""
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
_: [
|
|
66
|
-
{
|
|
67
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
68
|
-
destPath: ""
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"manage._base_domain_": [
|
|
72
|
-
{
|
|
73
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
74
|
-
destPath: ""
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
};
|
|
78
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
79
|
-
}
|
|
80
50
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
81
51
|
const domainToMappings = {
|
|
82
52
|
"api._api_base_domain_": [
|
|
@@ -124,7 +94,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
124
94
|
};
|
|
125
95
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
126
96
|
}
|
|
97
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
98
|
+
const domainToMappings = {
|
|
99
|
+
"api._api_base_domain_": [
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"www._base_domain_": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
108
|
+
destPath: ""
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
_: [
|
|
112
|
+
{
|
|
113
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
114
|
+
destPath: ""
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"manage._base_domain_": [
|
|
118
|
+
{
|
|
119
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
120
|
+
destPath: ""
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
|
+
}
|
|
127
126
|
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
127
|
+
function getSubscriptionOption(payload) {
|
|
128
|
+
function __getSubscriptionOption({ host }) {
|
|
129
|
+
const metadata = {
|
|
130
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
131
|
+
method: "GET",
|
|
132
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
133
|
+
packageName: PACKAGE_NAME,
|
|
134
|
+
migrationOptions: {
|
|
135
|
+
optInTransformResponse: true
|
|
136
|
+
},
|
|
137
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
138
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
139
|
+
),
|
|
140
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
141
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
142
|
+
{
|
|
143
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
144
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
145
|
+
}
|
|
146
|
+
])
|
|
147
|
+
};
|
|
148
|
+
return metadata;
|
|
149
|
+
}
|
|
150
|
+
return __getSubscriptionOption;
|
|
151
|
+
}
|
|
152
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
153
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
154
|
+
const metadata = {
|
|
155
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
156
|
+
method: "GET",
|
|
157
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
158
|
+
packageName: PACKAGE_NAME,
|
|
159
|
+
migrationOptions: {
|
|
160
|
+
optInTransformResponse: true
|
|
161
|
+
},
|
|
162
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
163
|
+
{
|
|
164
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
165
|
+
data: payload,
|
|
166
|
+
host
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
170
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
171
|
+
{
|
|
172
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
173
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
174
|
+
}
|
|
175
|
+
])
|
|
176
|
+
};
|
|
177
|
+
return metadata;
|
|
178
|
+
}
|
|
179
|
+
return __getSubscriptionOptionsForProduct;
|
|
180
|
+
}
|
|
181
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
182
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
183
|
+
const metadata = {
|
|
184
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
185
|
+
method: "GET",
|
|
186
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
187
|
+
packageName: PACKAGE_NAME,
|
|
188
|
+
migrationOptions: {
|
|
189
|
+
optInTransformResponse: true
|
|
190
|
+
},
|
|
191
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
192
|
+
{
|
|
193
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
194
|
+
data: payload,
|
|
195
|
+
host
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
199
|
+
};
|
|
200
|
+
return metadata;
|
|
201
|
+
}
|
|
202
|
+
return __getProductIdsForSubscriptionOption;
|
|
203
|
+
}
|
|
204
|
+
function getOneTimePurchasesStatus(payload) {
|
|
205
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
206
|
+
const metadata = {
|
|
207
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
208
|
+
method: "GET",
|
|
209
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
210
|
+
packageName: PACKAGE_NAME,
|
|
211
|
+
migrationOptions: {
|
|
212
|
+
optInTransformResponse: true
|
|
213
|
+
},
|
|
214
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
215
|
+
{
|
|
216
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
217
|
+
data: payload,
|
|
218
|
+
host
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
222
|
+
};
|
|
223
|
+
return metadata;
|
|
224
|
+
}
|
|
225
|
+
return __getOneTimePurchasesStatus;
|
|
226
|
+
}
|
|
128
227
|
function createSubscriptionOption(payload) {
|
|
129
228
|
function __createSubscriptionOption({ host }) {
|
|
130
229
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -351,145 +450,134 @@ function allowOneTimePurchases(payload) {
|
|
|
351
450
|
}
|
|
352
451
|
return __allowOneTimePurchases;
|
|
353
452
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
388
|
-
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
389
|
-
),
|
|
390
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
391
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
392
|
-
{
|
|
393
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
394
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
395
|
-
}
|
|
396
|
-
])
|
|
397
|
-
};
|
|
398
|
-
return metadata;
|
|
399
|
-
}
|
|
400
|
-
return __getSubscriptionOption;
|
|
401
|
-
}
|
|
402
|
-
function getSubscriptionOptionsForProduct(payload) {
|
|
403
|
-
function __getSubscriptionOptionsForProduct({ host }) {
|
|
404
|
-
const metadata = {
|
|
405
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
406
|
-
method: "GET",
|
|
407
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
408
|
-
packageName: PACKAGE_NAME,
|
|
409
|
-
migrationOptions: {
|
|
410
|
-
optInTransformResponse: true
|
|
453
|
+
|
|
454
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
455
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
456
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
457
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
458
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
459
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
460
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
461
|
+
return SubscriptionFrequency2;
|
|
462
|
+
})(SubscriptionFrequency || {});
|
|
463
|
+
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
464
|
+
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
465
|
+
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
466
|
+
DiscountType2["PERCENT"] = "PERCENT";
|
|
467
|
+
return DiscountType2;
|
|
468
|
+
})(DiscountType || {});
|
|
469
|
+
async function getSubscriptionOption2(_id) {
|
|
470
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
471
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
472
|
+
const reqOpts = getSubscriptionOption(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)?.subscriptionOption;
|
|
478
|
+
} catch (err) {
|
|
479
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
480
|
+
err,
|
|
481
|
+
{
|
|
482
|
+
spreadPathsToArguments: {},
|
|
483
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
484
|
+
singleArgumentUnchanged: false
|
|
411
485
|
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
host
|
|
417
|
-
}
|
|
418
|
-
),
|
|
419
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
420
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
421
|
-
{
|
|
422
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
423
|
-
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
424
|
-
}
|
|
425
|
-
])
|
|
426
|
-
};
|
|
427
|
-
return metadata;
|
|
486
|
+
["_id"]
|
|
487
|
+
);
|
|
488
|
+
sideEffects?.onError?.(err);
|
|
489
|
+
throw transformedError;
|
|
428
490
|
}
|
|
429
|
-
return __getSubscriptionOptionsForProduct;
|
|
430
491
|
}
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
492
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
493
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
494
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
495
|
+
productId,
|
|
496
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
497
|
+
});
|
|
498
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
499
|
+
payload
|
|
500
|
+
);
|
|
501
|
+
sideEffects?.onSiteCall?.();
|
|
502
|
+
try {
|
|
503
|
+
const result = await httpClient.request(reqOpts);
|
|
504
|
+
sideEffects?.onSuccess?.(result);
|
|
505
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
506
|
+
} catch (err) {
|
|
507
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
508
|
+
err,
|
|
509
|
+
{
|
|
510
|
+
spreadPathsToArguments: {},
|
|
511
|
+
explicitPathsToArguments: {
|
|
512
|
+
productId: "$[0]",
|
|
513
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
514
|
+
},
|
|
515
|
+
singleArgumentUnchanged: false
|
|
440
516
|
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
host
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
449
|
-
};
|
|
450
|
-
return metadata;
|
|
517
|
+
["productId", "options"]
|
|
518
|
+
);
|
|
519
|
+
sideEffects?.onError?.(err);
|
|
520
|
+
throw transformedError;
|
|
451
521
|
}
|
|
452
|
-
return __getProductIdsForSubscriptionOption;
|
|
453
522
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
523
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
524
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
525
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
526
|
+
id: _id,
|
|
527
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
528
|
+
paging: options?.paging
|
|
529
|
+
});
|
|
530
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
531
|
+
payload
|
|
532
|
+
);
|
|
533
|
+
sideEffects?.onSiteCall?.();
|
|
534
|
+
try {
|
|
535
|
+
const result = await httpClient.request(reqOpts);
|
|
536
|
+
sideEffects?.onSuccess?.(result);
|
|
537
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
538
|
+
} catch (err) {
|
|
539
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
540
|
+
err,
|
|
541
|
+
{
|
|
542
|
+
spreadPathsToArguments: {},
|
|
543
|
+
explicitPathsToArguments: {
|
|
544
|
+
id: "$[0]",
|
|
545
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
546
|
+
paging: "$[1].paging"
|
|
547
|
+
},
|
|
548
|
+
singleArgumentUnchanged: false
|
|
463
549
|
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
550
|
+
["_id", "options"]
|
|
551
|
+
);
|
|
552
|
+
sideEffects?.onError?.(err);
|
|
553
|
+
throw transformedError;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
557
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
558
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
559
|
+
productId
|
|
560
|
+
});
|
|
561
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
562
|
+
sideEffects?.onSiteCall?.();
|
|
563
|
+
try {
|
|
564
|
+
const result = await httpClient.request(reqOpts);
|
|
565
|
+
sideEffects?.onSuccess?.(result);
|
|
566
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
567
|
+
} catch (err) {
|
|
568
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
569
|
+
err,
|
|
570
|
+
{
|
|
571
|
+
spreadPathsToArguments: {},
|
|
572
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
573
|
+
singleArgumentUnchanged: false
|
|
574
|
+
},
|
|
575
|
+
["productId"]
|
|
576
|
+
);
|
|
577
|
+
sideEffects?.onError?.(err);
|
|
578
|
+
throw transformedError;
|
|
474
579
|
}
|
|
475
|
-
return __getOneTimePurchasesStatus;
|
|
476
580
|
}
|
|
477
|
-
|
|
478
|
-
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
479
|
-
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
480
|
-
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
481
|
-
SubscriptionFrequency2["DAY"] = "DAY";
|
|
482
|
-
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
483
|
-
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
484
|
-
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
485
|
-
return SubscriptionFrequency2;
|
|
486
|
-
})(SubscriptionFrequency || {});
|
|
487
|
-
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
488
|
-
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
489
|
-
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
490
|
-
DiscountType2["PERCENT"] = "PERCENT";
|
|
491
|
-
return DiscountType2;
|
|
492
|
-
})(DiscountType || {});
|
|
493
581
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
494
582
|
const { httpClient, sideEffects } = arguments[1];
|
|
495
583
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -695,145 +783,38 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
695
783
|
throw transformedError;
|
|
696
784
|
}
|
|
697
785
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
try {
|
|
707
|
-
const result = await httpClient.request(reqOpts);
|
|
708
|
-
sideEffects?.onSuccess?.(result);
|
|
709
|
-
} catch (err) {
|
|
710
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
711
|
-
err,
|
|
712
|
-
{
|
|
713
|
-
spreadPathsToArguments: {},
|
|
714
|
-
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
715
|
-
singleArgumentUnchanged: false
|
|
716
|
-
},
|
|
717
|
-
["productId", "allowed"]
|
|
718
|
-
);
|
|
719
|
-
sideEffects?.onError?.(err);
|
|
720
|
-
throw transformedError;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
async function getSubscriptionOption2(_id) {
|
|
724
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
725
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
726
|
-
const reqOpts = getSubscriptionOption(payload);
|
|
727
|
-
sideEffects?.onSiteCall?.();
|
|
728
|
-
try {
|
|
729
|
-
const result = await httpClient.request(reqOpts);
|
|
730
|
-
sideEffects?.onSuccess?.(result);
|
|
731
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
732
|
-
} catch (err) {
|
|
733
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
734
|
-
err,
|
|
735
|
-
{
|
|
736
|
-
spreadPathsToArguments: {},
|
|
737
|
-
explicitPathsToArguments: { id: "$[0]" },
|
|
738
|
-
singleArgumentUnchanged: false
|
|
739
|
-
},
|
|
740
|
-
["_id"]
|
|
741
|
-
);
|
|
742
|
-
sideEffects?.onError?.(err);
|
|
743
|
-
throw transformedError;
|
|
744
|
-
}
|
|
786
|
+
|
|
787
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
788
|
+
function getSubscriptionOption3(httpClient) {
|
|
789
|
+
return (_id) => getSubscriptionOption2(
|
|
790
|
+
_id,
|
|
791
|
+
// @ts-ignore
|
|
792
|
+
{ httpClient }
|
|
793
|
+
);
|
|
745
794
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
795
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
796
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
749
797
|
productId,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
payload
|
|
798
|
+
options,
|
|
799
|
+
// @ts-ignore
|
|
800
|
+
{ httpClient }
|
|
754
801
|
);
|
|
755
|
-
sideEffects?.onSiteCall?.();
|
|
756
|
-
try {
|
|
757
|
-
const result = await httpClient.request(reqOpts);
|
|
758
|
-
sideEffects?.onSuccess?.(result);
|
|
759
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
760
|
-
} catch (err) {
|
|
761
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
762
|
-
err,
|
|
763
|
-
{
|
|
764
|
-
spreadPathsToArguments: {},
|
|
765
|
-
explicitPathsToArguments: {
|
|
766
|
-
productId: "$[0]",
|
|
767
|
-
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
768
|
-
},
|
|
769
|
-
singleArgumentUnchanged: false
|
|
770
|
-
},
|
|
771
|
-
["productId", "options"]
|
|
772
|
-
);
|
|
773
|
-
sideEffects?.onError?.(err);
|
|
774
|
-
throw transformedError;
|
|
775
|
-
}
|
|
776
802
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
});
|
|
784
|
-
const reqOpts = getProductIdsForSubscriptionOption(
|
|
785
|
-
payload
|
|
803
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
804
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
805
|
+
_id,
|
|
806
|
+
options,
|
|
807
|
+
// @ts-ignore
|
|
808
|
+
{ httpClient }
|
|
786
809
|
);
|
|
787
|
-
sideEffects?.onSiteCall?.();
|
|
788
|
-
try {
|
|
789
|
-
const result = await httpClient.request(reqOpts);
|
|
790
|
-
sideEffects?.onSuccess?.(result);
|
|
791
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
792
|
-
} catch (err) {
|
|
793
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
794
|
-
err,
|
|
795
|
-
{
|
|
796
|
-
spreadPathsToArguments: {},
|
|
797
|
-
explicitPathsToArguments: {
|
|
798
|
-
id: "$[0]",
|
|
799
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
800
|
-
paging: "$[1].paging"
|
|
801
|
-
},
|
|
802
|
-
singleArgumentUnchanged: false
|
|
803
|
-
},
|
|
804
|
-
["_id", "options"]
|
|
805
|
-
);
|
|
806
|
-
sideEffects?.onError?.(err);
|
|
807
|
-
throw transformedError;
|
|
808
|
-
}
|
|
809
810
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
sideEffects?.onSiteCall?.();
|
|
817
|
-
try {
|
|
818
|
-
const result = await httpClient.request(reqOpts);
|
|
819
|
-
sideEffects?.onSuccess?.(result);
|
|
820
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
821
|
-
} catch (err) {
|
|
822
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
823
|
-
err,
|
|
824
|
-
{
|
|
825
|
-
spreadPathsToArguments: {},
|
|
826
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
827
|
-
singleArgumentUnchanged: false
|
|
828
|
-
},
|
|
829
|
-
["productId"]
|
|
830
|
-
);
|
|
831
|
-
sideEffects?.onError?.(err);
|
|
832
|
-
throw transformedError;
|
|
833
|
-
}
|
|
811
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
812
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
813
|
+
productId,
|
|
814
|
+
// @ts-ignore
|
|
815
|
+
{ httpClient }
|
|
816
|
+
);
|
|
834
817
|
}
|
|
835
|
-
|
|
836
|
-
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
837
818
|
function createSubscriptionOption3(httpClient) {
|
|
838
819
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
839
820
|
subscriptionOption,
|
|
@@ -893,47 +874,13 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
893
874
|
{ httpClient }
|
|
894
875
|
);
|
|
895
876
|
}
|
|
896
|
-
function enableCustomerCancellation3(httpClient) {
|
|
897
|
-
return (productId, allowed) => enableCustomerCancellation2(
|
|
898
|
-
productId,
|
|
899
|
-
allowed,
|
|
900
|
-
// @ts-ignore
|
|
901
|
-
{ httpClient }
|
|
902
|
-
);
|
|
903
|
-
}
|
|
904
|
-
function getSubscriptionOption3(httpClient) {
|
|
905
|
-
return (_id) => getSubscriptionOption2(
|
|
906
|
-
_id,
|
|
907
|
-
// @ts-ignore
|
|
908
|
-
{ httpClient }
|
|
909
|
-
);
|
|
910
|
-
}
|
|
911
|
-
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
912
|
-
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
913
|
-
productId,
|
|
914
|
-
options,
|
|
915
|
-
// @ts-ignore
|
|
916
|
-
{ httpClient }
|
|
917
|
-
);
|
|
918
|
-
}
|
|
919
|
-
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
920
|
-
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
921
|
-
_id,
|
|
922
|
-
options,
|
|
923
|
-
// @ts-ignore
|
|
924
|
-
{ httpClient }
|
|
925
|
-
);
|
|
926
|
-
}
|
|
927
|
-
function getOneTimePurchasesStatus3(httpClient) {
|
|
928
|
-
return (productId) => getOneTimePurchasesStatus2(
|
|
929
|
-
productId,
|
|
930
|
-
// @ts-ignore
|
|
931
|
-
{ httpClient }
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
877
|
|
|
935
878
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
936
879
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
880
|
+
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
881
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
882
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
883
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
937
884
|
var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
|
|
938
885
|
var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
|
|
939
886
|
var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
|
|
@@ -942,11 +889,6 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
942
889
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteSubscriptionOptions3);
|
|
943
890
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
|
|
944
891
|
var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(allowOneTimePurchases3);
|
|
945
|
-
var enableCustomerCancellation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(enableCustomerCancellation3);
|
|
946
|
-
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
947
|
-
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
948
|
-
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
949
|
-
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
950
892
|
// Annotate the CommonJS export names for ESM import in node:
|
|
951
893
|
0 && (module.exports = {
|
|
952
894
|
DiscountType,
|
|
@@ -958,7 +900,6 @@ var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.create
|
|
|
958
900
|
bulkUpdateSubscriptionOptions,
|
|
959
901
|
createSubscriptionOption,
|
|
960
902
|
deleteSubscriptionOption,
|
|
961
|
-
enableCustomerCancellation,
|
|
962
903
|
getOneTimePurchasesStatus,
|
|
963
904
|
getProductIdsForSubscriptionOption,
|
|
964
905
|
getSubscriptionOption,
|