@wix/auto_sdk_stores_subscription-options 1.0.28 → 1.0.30
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 +276 -276
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +157 -157
- package/build/cjs/index.typings.js +230 -230
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +108 -108
- package/build/cjs/meta.js +204 -204
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +45 -45
- package/build/es/index.mjs +276 -276
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +157 -157
- package/build/es/index.typings.mjs +230 -230
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +108 -108
- package/build/es/meta.mjs +204 -204
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +45 -45
- package/build/internal/cjs/index.js +276 -276
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +157 -157
- package/build/internal/cjs/index.typings.js +230 -230
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +108 -108
- package/build/internal/cjs/meta.js +204 -204
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +45 -45
- package/build/internal/es/index.mjs +276 -276
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +157 -157
- package/build/internal/es/index.typings.mjs +230 -230
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +108 -108
- package/build/internal/es/meta.mjs +204 -204
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -47,76 +47,76 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
47
47
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
48
48
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
49
49
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
50
|
-
function
|
|
50
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
51
51
|
const domainToMappings = {
|
|
52
52
|
"api._api_base_domain_": [
|
|
53
53
|
{
|
|
54
|
-
srcPath: "/wix-ecommerce-plans",
|
|
54
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
55
55
|
destPath: ""
|
|
56
56
|
}
|
|
57
57
|
],
|
|
58
|
-
"www.
|
|
58
|
+
"www._base_domain_": [
|
|
59
59
|
{
|
|
60
|
-
srcPath: "/
|
|
61
|
-
destPath: "
|
|
60
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
61
|
+
destPath: ""
|
|
62
62
|
}
|
|
63
63
|
],
|
|
64
|
-
|
|
64
|
+
_: [
|
|
65
65
|
{
|
|
66
|
-
srcPath: "/_api/subscription-options-server",
|
|
66
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
67
67
|
destPath: ""
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
|
-
"
|
|
70
|
+
"manage._base_domain_": [
|
|
71
71
|
{
|
|
72
|
-
srcPath: "/_api/subscription-options-server",
|
|
72
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
73
73
|
destPath: ""
|
|
74
74
|
}
|
|
75
|
-
]
|
|
76
|
-
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
78
|
+
}
|
|
79
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
80
|
+
const domainToMappings = {
|
|
81
|
+
"api._api_base_domain_": [
|
|
77
82
|
{
|
|
78
|
-
srcPath: "/
|
|
83
|
+
srcPath: "/wix-ecommerce-plans",
|
|
79
84
|
destPath: ""
|
|
80
85
|
}
|
|
81
86
|
],
|
|
82
|
-
"
|
|
87
|
+
"www.wixapis.com": [
|
|
83
88
|
{
|
|
84
|
-
srcPath: "/
|
|
85
|
-
destPath: ""
|
|
89
|
+
srcPath: "/stores/v1/subscription-options",
|
|
90
|
+
destPath: "/v1/subscription-options"
|
|
86
91
|
}
|
|
87
92
|
],
|
|
88
|
-
"
|
|
93
|
+
"www._base_domain_": [
|
|
89
94
|
{
|
|
90
95
|
srcPath: "/_api/subscription-options-server",
|
|
91
96
|
destPath: ""
|
|
92
97
|
}
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
96
|
-
}
|
|
97
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
98
|
-
const domainToMappings = {
|
|
99
|
-
"api._api_base_domain_": [
|
|
98
|
+
],
|
|
99
|
+
"editor._base_domain_": [
|
|
100
100
|
{
|
|
101
|
-
srcPath: "/
|
|
101
|
+
srcPath: "/_api/subscription-options-server",
|
|
102
102
|
destPath: ""
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
|
-
"
|
|
105
|
+
"blocks._base_domain_": [
|
|
106
106
|
{
|
|
107
|
-
srcPath: "/_api/
|
|
107
|
+
srcPath: "/_api/subscription-options-server",
|
|
108
108
|
destPath: ""
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
|
|
111
|
+
"create.editorx": [
|
|
112
112
|
{
|
|
113
|
-
srcPath: "/_api/subscription-options-
|
|
113
|
+
srcPath: "/_api/subscription-options-server",
|
|
114
114
|
destPath: ""
|
|
115
115
|
}
|
|
116
116
|
],
|
|
117
117
|
"manage._base_domain_": [
|
|
118
118
|
{
|
|
119
|
-
srcPath: "/_api/subscription-options-
|
|
119
|
+
srcPath: "/_api/subscription-options-server",
|
|
120
120
|
destPath: ""
|
|
121
121
|
}
|
|
122
122
|
]
|
|
@@ -124,106 +124,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
|
|
|
124
124
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
125
|
}
|
|
126
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
|
-
}
|
|
227
127
|
function createSubscriptionOption(payload) {
|
|
228
128
|
function __createSubscriptionOption({ host }) {
|
|
229
129
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -450,134 +350,122 @@ function allowOneTimePurchases(payload) {
|
|
|
450
350
|
}
|
|
451
351
|
return __allowOneTimePurchases;
|
|
452
352
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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
|
|
353
|
+
function getSubscriptionOption(payload) {
|
|
354
|
+
function __getSubscriptionOption({ host }) {
|
|
355
|
+
const metadata = {
|
|
356
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
357
|
+
method: "GET",
|
|
358
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
359
|
+
packageName: PACKAGE_NAME,
|
|
360
|
+
migrationOptions: {
|
|
361
|
+
optInTransformResponse: true
|
|
485
362
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
363
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
364
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
365
|
+
),
|
|
366
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
367
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
368
|
+
{
|
|
369
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
370
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
371
|
+
}
|
|
372
|
+
])
|
|
373
|
+
};
|
|
374
|
+
return metadata;
|
|
490
375
|
}
|
|
376
|
+
return __getSubscriptionOption;
|
|
491
377
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
|
378
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
379
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
380
|
+
const metadata = {
|
|
381
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
382
|
+
method: "GET",
|
|
383
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
384
|
+
packageName: PACKAGE_NAME,
|
|
385
|
+
migrationOptions: {
|
|
386
|
+
optInTransformResponse: true
|
|
516
387
|
},
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
546
|
-
paging: "$[1].paging"
|
|
547
|
-
},
|
|
548
|
-
singleArgumentUnchanged: false
|
|
388
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
389
|
+
{
|
|
390
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
391
|
+
data: payload,
|
|
392
|
+
host
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
396
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
397
|
+
{
|
|
398
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
399
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
400
|
+
}
|
|
401
|
+
])
|
|
402
|
+
};
|
|
403
|
+
return metadata;
|
|
404
|
+
}
|
|
405
|
+
return __getSubscriptionOptionsForProduct;
|
|
406
|
+
}
|
|
407
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
408
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
409
|
+
const metadata = {
|
|
410
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
411
|
+
method: "GET",
|
|
412
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
413
|
+
packageName: PACKAGE_NAME,
|
|
414
|
+
migrationOptions: {
|
|
415
|
+
optInTransformResponse: true
|
|
549
416
|
},
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
417
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
418
|
+
{
|
|
419
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
420
|
+
data: payload,
|
|
421
|
+
host
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
425
|
+
};
|
|
426
|
+
return metadata;
|
|
554
427
|
}
|
|
428
|
+
return __getProductIdsForSubscriptionOption;
|
|
555
429
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
|
430
|
+
function getOneTimePurchasesStatus(payload) {
|
|
431
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
432
|
+
const metadata = {
|
|
433
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
434
|
+
method: "GET",
|
|
435
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
436
|
+
packageName: PACKAGE_NAME,
|
|
437
|
+
migrationOptions: {
|
|
438
|
+
optInTransformResponse: true
|
|
574
439
|
},
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
440
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
441
|
+
{
|
|
442
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
443
|
+
data: payload,
|
|
444
|
+
host
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
448
|
+
};
|
|
449
|
+
return metadata;
|
|
579
450
|
}
|
|
451
|
+
return __getOneTimePurchasesStatus;
|
|
580
452
|
}
|
|
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 || {});
|
|
581
469
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
582
470
|
const { httpClient, sideEffects } = arguments[1];
|
|
583
471
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -783,38 +671,120 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
783
671
|
throw transformedError;
|
|
784
672
|
}
|
|
785
673
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
674
|
+
async function getSubscriptionOption2(_id) {
|
|
675
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
676
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
677
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
678
|
+
sideEffects?.onSiteCall?.();
|
|
679
|
+
try {
|
|
680
|
+
const result = await httpClient.request(reqOpts);
|
|
681
|
+
sideEffects?.onSuccess?.(result);
|
|
682
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
683
|
+
} catch (err) {
|
|
684
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
685
|
+
err,
|
|
686
|
+
{
|
|
687
|
+
spreadPathsToArguments: {},
|
|
688
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
689
|
+
singleArgumentUnchanged: false
|
|
690
|
+
},
|
|
691
|
+
["_id"]
|
|
692
|
+
);
|
|
693
|
+
sideEffects?.onError?.(err);
|
|
694
|
+
throw transformedError;
|
|
695
|
+
}
|
|
794
696
|
}
|
|
795
|
-
function
|
|
796
|
-
|
|
697
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
698
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
699
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
797
700
|
productId,
|
|
798
|
-
options
|
|
799
|
-
|
|
800
|
-
|
|
701
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
702
|
+
});
|
|
703
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
704
|
+
payload
|
|
801
705
|
);
|
|
706
|
+
sideEffects?.onSiteCall?.();
|
|
707
|
+
try {
|
|
708
|
+
const result = await httpClient.request(reqOpts);
|
|
709
|
+
sideEffects?.onSuccess?.(result);
|
|
710
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
711
|
+
} catch (err) {
|
|
712
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
713
|
+
err,
|
|
714
|
+
{
|
|
715
|
+
spreadPathsToArguments: {},
|
|
716
|
+
explicitPathsToArguments: {
|
|
717
|
+
productId: "$[0]",
|
|
718
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
719
|
+
},
|
|
720
|
+
singleArgumentUnchanged: false
|
|
721
|
+
},
|
|
722
|
+
["productId", "options"]
|
|
723
|
+
);
|
|
724
|
+
sideEffects?.onError?.(err);
|
|
725
|
+
throw transformedError;
|
|
726
|
+
}
|
|
802
727
|
}
|
|
803
|
-
function
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
728
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
729
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
730
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
731
|
+
id: _id,
|
|
732
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
733
|
+
paging: options?.paging
|
|
734
|
+
});
|
|
735
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
736
|
+
payload
|
|
809
737
|
);
|
|
738
|
+
sideEffects?.onSiteCall?.();
|
|
739
|
+
try {
|
|
740
|
+
const result = await httpClient.request(reqOpts);
|
|
741
|
+
sideEffects?.onSuccess?.(result);
|
|
742
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
743
|
+
} catch (err) {
|
|
744
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
745
|
+
err,
|
|
746
|
+
{
|
|
747
|
+
spreadPathsToArguments: {},
|
|
748
|
+
explicitPathsToArguments: {
|
|
749
|
+
id: "$[0]",
|
|
750
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
751
|
+
paging: "$[1].paging"
|
|
752
|
+
},
|
|
753
|
+
singleArgumentUnchanged: false
|
|
754
|
+
},
|
|
755
|
+
["_id", "options"]
|
|
756
|
+
);
|
|
757
|
+
sideEffects?.onError?.(err);
|
|
758
|
+
throw transformedError;
|
|
759
|
+
}
|
|
810
760
|
}
|
|
811
|
-
function
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
);
|
|
761
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
762
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
763
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
764
|
+
productId
|
|
765
|
+
});
|
|
766
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
767
|
+
sideEffects?.onSiteCall?.();
|
|
768
|
+
try {
|
|
769
|
+
const result = await httpClient.request(reqOpts);
|
|
770
|
+
sideEffects?.onSuccess?.(result);
|
|
771
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
772
|
+
} catch (err) {
|
|
773
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
774
|
+
err,
|
|
775
|
+
{
|
|
776
|
+
spreadPathsToArguments: {},
|
|
777
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
778
|
+
singleArgumentUnchanged: false
|
|
779
|
+
},
|
|
780
|
+
["productId"]
|
|
781
|
+
);
|
|
782
|
+
sideEffects?.onError?.(err);
|
|
783
|
+
throw transformedError;
|
|
784
|
+
}
|
|
817
785
|
}
|
|
786
|
+
|
|
787
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
818
788
|
function createSubscriptionOption3(httpClient) {
|
|
819
789
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
820
790
|
subscriptionOption,
|
|
@@ -874,13 +844,39 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
874
844
|
{ httpClient }
|
|
875
845
|
);
|
|
876
846
|
}
|
|
847
|
+
function getSubscriptionOption3(httpClient) {
|
|
848
|
+
return (_id) => getSubscriptionOption2(
|
|
849
|
+
_id,
|
|
850
|
+
// @ts-ignore
|
|
851
|
+
{ httpClient }
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
855
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
856
|
+
productId,
|
|
857
|
+
options,
|
|
858
|
+
// @ts-ignore
|
|
859
|
+
{ httpClient }
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
863
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
864
|
+
_id,
|
|
865
|
+
options,
|
|
866
|
+
// @ts-ignore
|
|
867
|
+
{ httpClient }
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
871
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
872
|
+
productId,
|
|
873
|
+
// @ts-ignore
|
|
874
|
+
{ httpClient }
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
877
|
|
|
878
878
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
879
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);
|
|
884
880
|
var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
|
|
885
881
|
var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
|
|
886
882
|
var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
|
|
@@ -889,6 +885,10 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
889
885
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteSubscriptionOptions3);
|
|
890
886
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
|
|
891
887
|
var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(allowOneTimePurchases3);
|
|
888
|
+
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
889
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
890
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
891
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
892
892
|
// Annotate the CommonJS export names for ESM import in node:
|
|
893
893
|
0 && (module.exports = {
|
|
894
894
|
DiscountType,
|