@wix/auto_sdk_stores_subscription-options 1.0.35 → 1.0.36
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 +45 -45
- package/build/cjs/index.js +274 -274
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +168 -168
- package/build/cjs/index.typings.js +233 -233
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +119 -119
- package/build/cjs/meta.js +205 -205
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +45 -45
- package/build/es/index.mjs +274 -274
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +168 -168
- package/build/es/index.typings.mjs +233 -233
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +119 -119
- package/build/es/meta.mjs +205 -205
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +45 -45
- package/build/internal/cjs/index.js +274 -274
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +168 -168
- package/build/internal/cjs/index.typings.js +233 -233
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +119 -119
- package/build/internal/cjs/meta.js +205 -205
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +45 -45
- package/build/internal/es/index.mjs +274 -274
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +168 -168
- package/build/internal/es/index.typings.mjs +233 -233
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +119 -119
- package/build/internal/es/meta.mjs +205 -205
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -48,35 +48,6 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
48
48
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
49
49
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
50
50
|
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
51
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
81
52
|
const domainToMappings = {
|
|
82
53
|
"api._api_base_domain_": [
|
|
@@ -124,7 +95,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
124
95
|
};
|
|
125
96
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
126
97
|
}
|
|
98
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
99
|
+
const domainToMappings = {
|
|
100
|
+
"api._api_base_domain_": [
|
|
101
|
+
{
|
|
102
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
103
|
+
destPath: ""
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"www._base_domain_": [
|
|
107
|
+
{
|
|
108
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
109
|
+
destPath: ""
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
_: [
|
|
113
|
+
{
|
|
114
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
115
|
+
destPath: ""
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"manage._base_domain_": [
|
|
119
|
+
{
|
|
120
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
121
|
+
destPath: ""
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
126
|
+
}
|
|
127
127
|
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
128
|
+
function getSubscriptionOption(payload) {
|
|
129
|
+
function __getSubscriptionOption({ host }) {
|
|
130
|
+
const metadata = {
|
|
131
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
132
|
+
method: "GET",
|
|
133
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
134
|
+
packageName: PACKAGE_NAME,
|
|
135
|
+
migrationOptions: {
|
|
136
|
+
optInTransformResponse: true
|
|
137
|
+
},
|
|
138
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
139
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
140
|
+
),
|
|
141
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
142
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
143
|
+
{
|
|
144
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
145
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
146
|
+
}
|
|
147
|
+
])
|
|
148
|
+
};
|
|
149
|
+
return metadata;
|
|
150
|
+
}
|
|
151
|
+
return __getSubscriptionOption;
|
|
152
|
+
}
|
|
153
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
154
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
155
|
+
const metadata = {
|
|
156
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
157
|
+
method: "GET",
|
|
158
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
159
|
+
packageName: PACKAGE_NAME,
|
|
160
|
+
migrationOptions: {
|
|
161
|
+
optInTransformResponse: true
|
|
162
|
+
},
|
|
163
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
164
|
+
{
|
|
165
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
166
|
+
data: payload,
|
|
167
|
+
host
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
171
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
172
|
+
{
|
|
173
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
174
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
175
|
+
}
|
|
176
|
+
])
|
|
177
|
+
};
|
|
178
|
+
return metadata;
|
|
179
|
+
}
|
|
180
|
+
return __getSubscriptionOptionsForProduct;
|
|
181
|
+
}
|
|
182
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
183
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
184
|
+
const metadata = {
|
|
185
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
186
|
+
method: "GET",
|
|
187
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
188
|
+
packageName: PACKAGE_NAME,
|
|
189
|
+
migrationOptions: {
|
|
190
|
+
optInTransformResponse: true
|
|
191
|
+
},
|
|
192
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
193
|
+
{
|
|
194
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
195
|
+
data: payload,
|
|
196
|
+
host
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
200
|
+
};
|
|
201
|
+
return metadata;
|
|
202
|
+
}
|
|
203
|
+
return __getProductIdsForSubscriptionOption;
|
|
204
|
+
}
|
|
205
|
+
function getOneTimePurchasesStatus(payload) {
|
|
206
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
207
|
+
const metadata = {
|
|
208
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
209
|
+
method: "GET",
|
|
210
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
211
|
+
packageName: PACKAGE_NAME,
|
|
212
|
+
migrationOptions: {
|
|
213
|
+
optInTransformResponse: true
|
|
214
|
+
},
|
|
215
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
216
|
+
{
|
|
217
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
218
|
+
data: payload,
|
|
219
|
+
host
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
223
|
+
};
|
|
224
|
+
return metadata;
|
|
225
|
+
}
|
|
226
|
+
return __getOneTimePurchasesStatus;
|
|
227
|
+
}
|
|
128
228
|
function createSubscriptionOption(payload) {
|
|
129
229
|
function __createSubscriptionOption({ host }) {
|
|
130
230
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -374,122 +474,134 @@ function enableCustomerCancellation(payload) {
|
|
|
374
474
|
}
|
|
375
475
|
return __enableCustomerCancellation;
|
|
376
476
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
+
async function getSubscriptionOption2(_id) {
|
|
494
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
495
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
496
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
497
|
+
sideEffects?.onSiteCall?.();
|
|
498
|
+
try {
|
|
499
|
+
const result = await httpClient.request(reqOpts);
|
|
500
|
+
sideEffects?.onSuccess?.(result);
|
|
501
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
502
|
+
} catch (err) {
|
|
503
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
504
|
+
err,
|
|
505
|
+
{
|
|
506
|
+
spreadPathsToArguments: {},
|
|
507
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
508
|
+
singleArgumentUnchanged: false
|
|
386
509
|
},
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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;
|
|
510
|
+
["_id"]
|
|
511
|
+
);
|
|
512
|
+
sideEffects?.onError?.(err);
|
|
513
|
+
throw transformedError;
|
|
399
514
|
}
|
|
400
|
-
return __getSubscriptionOption;
|
|
401
515
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
516
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
517
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
518
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
519
|
+
productId,
|
|
520
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
521
|
+
});
|
|
522
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
523
|
+
payload
|
|
524
|
+
);
|
|
525
|
+
sideEffects?.onSiteCall?.();
|
|
526
|
+
try {
|
|
527
|
+
const result = await httpClient.request(reqOpts);
|
|
528
|
+
sideEffects?.onSuccess?.(result);
|
|
529
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
530
|
+
} catch (err) {
|
|
531
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
532
|
+
err,
|
|
533
|
+
{
|
|
534
|
+
spreadPathsToArguments: {},
|
|
535
|
+
explicitPathsToArguments: {
|
|
536
|
+
productId: "$[0]",
|
|
537
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
538
|
+
},
|
|
539
|
+
singleArgumentUnchanged: false
|
|
411
540
|
},
|
|
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;
|
|
541
|
+
["productId", "options"]
|
|
542
|
+
);
|
|
543
|
+
sideEffects?.onError?.(err);
|
|
544
|
+
throw transformedError;
|
|
428
545
|
}
|
|
429
|
-
return __getSubscriptionOptionsForProduct;
|
|
430
546
|
}
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
547
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
548
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
549
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
550
|
+
id: _id,
|
|
551
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
552
|
+
paging: options?.paging
|
|
553
|
+
});
|
|
554
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
555
|
+
payload
|
|
556
|
+
);
|
|
557
|
+
sideEffects?.onSiteCall?.();
|
|
558
|
+
try {
|
|
559
|
+
const result = await httpClient.request(reqOpts);
|
|
560
|
+
sideEffects?.onSuccess?.(result);
|
|
561
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
562
|
+
} catch (err) {
|
|
563
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
564
|
+
err,
|
|
565
|
+
{
|
|
566
|
+
spreadPathsToArguments: {},
|
|
567
|
+
explicitPathsToArguments: {
|
|
568
|
+
id: "$[0]",
|
|
569
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
570
|
+
paging: "$[1].paging"
|
|
571
|
+
},
|
|
572
|
+
singleArgumentUnchanged: false
|
|
440
573
|
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
host
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
449
|
-
};
|
|
450
|
-
return metadata;
|
|
574
|
+
["_id", "options"]
|
|
575
|
+
);
|
|
576
|
+
sideEffects?.onError?.(err);
|
|
577
|
+
throw transformedError;
|
|
451
578
|
}
|
|
452
|
-
return __getProductIdsForSubscriptionOption;
|
|
453
579
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
580
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
581
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
582
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
583
|
+
productId
|
|
584
|
+
});
|
|
585
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
586
|
+
sideEffects?.onSiteCall?.();
|
|
587
|
+
try {
|
|
588
|
+
const result = await httpClient.request(reqOpts);
|
|
589
|
+
sideEffects?.onSuccess?.(result);
|
|
590
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
591
|
+
} catch (err) {
|
|
592
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
593
|
+
err,
|
|
594
|
+
{
|
|
595
|
+
spreadPathsToArguments: {},
|
|
596
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
597
|
+
singleArgumentUnchanged: false
|
|
463
598
|
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
host
|
|
469
|
-
}
|
|
470
|
-
),
|
|
471
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
472
|
-
};
|
|
473
|
-
return metadata;
|
|
599
|
+
["productId"]
|
|
600
|
+
);
|
|
601
|
+
sideEffects?.onError?.(err);
|
|
602
|
+
throw transformedError;
|
|
474
603
|
}
|
|
475
|
-
return __getOneTimePurchasesStatus;
|
|
476
604
|
}
|
|
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
605
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
494
606
|
const { httpClient, sideEffects } = arguments[1];
|
|
495
607
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -720,120 +832,38 @@ async function enableCustomerCancellation2(productId, allowed) {
|
|
|
720
832
|
throw transformedError;
|
|
721
833
|
}
|
|
722
834
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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
|
-
}
|
|
835
|
+
|
|
836
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
837
|
+
function getSubscriptionOption3(httpClient) {
|
|
838
|
+
return (_id) => getSubscriptionOption2(
|
|
839
|
+
_id,
|
|
840
|
+
// @ts-ignore
|
|
841
|
+
{ httpClient }
|
|
842
|
+
);
|
|
745
843
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
844
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
845
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
749
846
|
productId,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
payload
|
|
847
|
+
options,
|
|
848
|
+
// @ts-ignore
|
|
849
|
+
{ httpClient }
|
|
754
850
|
);
|
|
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
851
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
});
|
|
784
|
-
const reqOpts = getProductIdsForSubscriptionOption(
|
|
785
|
-
payload
|
|
852
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
853
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
854
|
+
_id,
|
|
855
|
+
options,
|
|
856
|
+
// @ts-ignore
|
|
857
|
+
{ httpClient }
|
|
786
858
|
);
|
|
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
859
|
}
|
|
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
|
-
}
|
|
860
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
861
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
862
|
+
productId,
|
|
863
|
+
// @ts-ignore
|
|
864
|
+
{ httpClient }
|
|
865
|
+
);
|
|
834
866
|
}
|
|
835
|
-
|
|
836
|
-
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
837
867
|
function createSubscriptionOption3(httpClient) {
|
|
838
868
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
839
869
|
subscriptionOption,
|
|
@@ -901,39 +931,13 @@ function enableCustomerCancellation3(httpClient) {
|
|
|
901
931
|
{ httpClient }
|
|
902
932
|
);
|
|
903
933
|
}
|
|
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
934
|
|
|
935
935
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
936
936
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
937
|
+
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
938
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
939
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
940
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
937
941
|
var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
|
|
938
942
|
var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
|
|
939
943
|
var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
|
|
@@ -943,10 +947,6 @@ var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
943
947
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
|
|
944
948
|
var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(allowOneTimePurchases3);
|
|
945
949
|
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
950
|
// Annotate the CommonJS export names for ESM import in node:
|
|
951
951
|
0 && (module.exports = {
|
|
952
952
|
DiscountType,
|