@wix/auto_sdk_stores_subscription-options 1.0.55 → 1.0.56
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 +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/cjs/schemas.d.ts +84 -84
- package/build/cjs/schemas.js +104 -104
- package/build/cjs/schemas.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 +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/es/schemas.d.mts +84 -84
- package/build/es/schemas.mjs +104 -104
- package/build/es/schemas.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 +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/cjs/schemas.d.ts +84 -84
- package/build/internal/cjs/schemas.js +104 -104
- package/build/internal/cjs/schemas.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 +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/build/internal/es/schemas.d.mts +84 -84
- package/build/internal/es/schemas.mjs +104 -104
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -47,35 +47,6 @@ 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 resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
51
|
-
const domainToMappings = {
|
|
52
|
-
"api._api_base_domain_": [
|
|
53
|
-
{
|
|
54
|
-
srcPath: "/wix-ecommerce-plans-reader",
|
|
55
|
-
destPath: ""
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"www._base_domain_": [
|
|
59
|
-
{
|
|
60
|
-
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
61
|
-
destPath: ""
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
_: [
|
|
65
|
-
{
|
|
66
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
67
|
-
destPath: ""
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"manage._base_domain_": [
|
|
71
|
-
{
|
|
72
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
73
|
-
destPath: ""
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
77
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
78
|
-
}
|
|
79
50
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
80
51
|
const domainToMappings = {
|
|
81
52
|
"api._api_base_domain_": [
|
|
@@ -123,7 +94,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
123
94
|
};
|
|
124
95
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
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
|
+
}
|
|
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
|
+
}
|
|
127
227
|
function createSubscriptionOption(payload) {
|
|
128
228
|
function __createSubscriptionOption({ host }) {
|
|
129
229
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -350,122 +450,134 @@ function allowOneTimePurchases(payload) {
|
|
|
350
450
|
}
|
|
351
451
|
return __allowOneTimePurchases;
|
|
352
452
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
|
362
485
|
},
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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;
|
|
486
|
+
["_id"]
|
|
487
|
+
);
|
|
488
|
+
sideEffects?.onError?.(err);
|
|
489
|
+
throw transformedError;
|
|
375
490
|
}
|
|
376
|
-
return __getSubscriptionOption;
|
|
377
491
|
}
|
|
378
|
-
function
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
|
387
516
|
},
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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;
|
|
517
|
+
["productId", "options"]
|
|
518
|
+
);
|
|
519
|
+
sideEffects?.onError?.(err);
|
|
520
|
+
throw transformedError;
|
|
404
521
|
}
|
|
405
|
-
return __getSubscriptionOptionsForProduct;
|
|
406
522
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
|
416
549
|
},
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
host
|
|
422
|
-
}
|
|
423
|
-
),
|
|
424
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
425
|
-
};
|
|
426
|
-
return metadata;
|
|
550
|
+
["_id", "options"]
|
|
551
|
+
);
|
|
552
|
+
sideEffects?.onError?.(err);
|
|
553
|
+
throw transformedError;
|
|
427
554
|
}
|
|
428
|
-
return __getProductIdsForSubscriptionOption;
|
|
429
555
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
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
|
|
439
574
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
host
|
|
445
|
-
}
|
|
446
|
-
),
|
|
447
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
448
|
-
};
|
|
449
|
-
return metadata;
|
|
575
|
+
["productId"]
|
|
576
|
+
);
|
|
577
|
+
sideEffects?.onError?.(err);
|
|
578
|
+
throw transformedError;
|
|
450
579
|
}
|
|
451
|
-
return __getOneTimePurchasesStatus;
|
|
452
580
|
}
|
|
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
581
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
470
582
|
const { httpClient, sideEffects } = arguments[1];
|
|
471
583
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -671,120 +783,38 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
671
783
|
throw transformedError;
|
|
672
784
|
}
|
|
673
785
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
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
|
-
}
|
|
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
|
+
);
|
|
696
794
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
795
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
796
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
700
797
|
productId,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
payload
|
|
798
|
+
options,
|
|
799
|
+
// @ts-ignore
|
|
800
|
+
{ httpClient }
|
|
705
801
|
);
|
|
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
|
-
}
|
|
727
802
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
});
|
|
735
|
-
const reqOpts = getProductIdsForSubscriptionOption(
|
|
736
|
-
payload
|
|
803
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
804
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
805
|
+
_id,
|
|
806
|
+
options,
|
|
807
|
+
// @ts-ignore
|
|
808
|
+
{ httpClient }
|
|
737
809
|
);
|
|
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
|
-
}
|
|
760
810
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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
|
-
}
|
|
811
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
812
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
813
|
+
productId,
|
|
814
|
+
// @ts-ignore
|
|
815
|
+
{ httpClient }
|
|
816
|
+
);
|
|
785
817
|
}
|
|
786
|
-
|
|
787
|
-
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
788
818
|
function createSubscriptionOption3(httpClient) {
|
|
789
819
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
790
820
|
subscriptionOption,
|
|
@@ -844,39 +874,13 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
844
874
|
{ httpClient }
|
|
845
875
|
);
|
|
846
876
|
}
|
|
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);
|
|
880
884
|
var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
|
|
881
885
|
var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
|
|
882
886
|
var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
|
|
@@ -885,10 +889,6 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
885
889
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteSubscriptionOptions3);
|
|
886
890
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
|
|
887
891
|
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,
|