@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
|
@@ -11,35 +11,6 @@ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/f
|
|
|
11
11
|
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
12
12
|
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
13
13
|
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
14
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
15
|
-
const domainToMappings = {
|
|
16
|
-
"api._api_base_domain_": [
|
|
17
|
-
{
|
|
18
|
-
srcPath: "/wix-ecommerce-plans-reader",
|
|
19
|
-
destPath: ""
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"www._base_domain_": [
|
|
23
|
-
{
|
|
24
|
-
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
25
|
-
destPath: ""
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
_: [
|
|
29
|
-
{
|
|
30
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
31
|
-
destPath: ""
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"manage._base_domain_": [
|
|
35
|
-
{
|
|
36
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
37
|
-
destPath: ""
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
};
|
|
41
|
-
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
42
|
-
}
|
|
43
14
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
44
15
|
const domainToMappings = {
|
|
45
16
|
"api._api_base_domain_": [
|
|
@@ -87,7 +58,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
87
58
|
};
|
|
88
59
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
89
60
|
}
|
|
61
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
62
|
+
const domainToMappings = {
|
|
63
|
+
"api._api_base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"www._base_domain_": [
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
72
|
+
destPath: ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
_: [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"manage._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
89
|
+
}
|
|
90
90
|
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
91
|
+
function getSubscriptionOption(payload) {
|
|
92
|
+
function __getSubscriptionOption({ host }) {
|
|
93
|
+
const metadata = {
|
|
94
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
95
|
+
method: "GET",
|
|
96
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
97
|
+
packageName: PACKAGE_NAME,
|
|
98
|
+
migrationOptions: {
|
|
99
|
+
optInTransformResponse: true
|
|
100
|
+
},
|
|
101
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
102
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
103
|
+
),
|
|
104
|
+
params: toURLSearchParams(payload),
|
|
105
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
106
|
+
{
|
|
107
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
108
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
109
|
+
}
|
|
110
|
+
])
|
|
111
|
+
};
|
|
112
|
+
return metadata;
|
|
113
|
+
}
|
|
114
|
+
return __getSubscriptionOption;
|
|
115
|
+
}
|
|
116
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
117
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
118
|
+
const metadata = {
|
|
119
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
120
|
+
method: "GET",
|
|
121
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
122
|
+
packageName: PACKAGE_NAME,
|
|
123
|
+
migrationOptions: {
|
|
124
|
+
optInTransformResponse: true
|
|
125
|
+
},
|
|
126
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
127
|
+
{
|
|
128
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
129
|
+
data: payload,
|
|
130
|
+
host
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
params: toURLSearchParams(payload),
|
|
134
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
135
|
+
{
|
|
136
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
137
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
138
|
+
}
|
|
139
|
+
])
|
|
140
|
+
};
|
|
141
|
+
return metadata;
|
|
142
|
+
}
|
|
143
|
+
return __getSubscriptionOptionsForProduct;
|
|
144
|
+
}
|
|
145
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
146
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
147
|
+
const metadata = {
|
|
148
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
149
|
+
method: "GET",
|
|
150
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
151
|
+
packageName: PACKAGE_NAME,
|
|
152
|
+
migrationOptions: {
|
|
153
|
+
optInTransformResponse: true
|
|
154
|
+
},
|
|
155
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
156
|
+
{
|
|
157
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
158
|
+
data: payload,
|
|
159
|
+
host
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
params: toURLSearchParams(payload)
|
|
163
|
+
};
|
|
164
|
+
return metadata;
|
|
165
|
+
}
|
|
166
|
+
return __getProductIdsForSubscriptionOption;
|
|
167
|
+
}
|
|
168
|
+
function getOneTimePurchasesStatus(payload) {
|
|
169
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
170
|
+
const metadata = {
|
|
171
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
172
|
+
method: "GET",
|
|
173
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
174
|
+
packageName: PACKAGE_NAME,
|
|
175
|
+
migrationOptions: {
|
|
176
|
+
optInTransformResponse: true
|
|
177
|
+
},
|
|
178
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
179
|
+
{
|
|
180
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
181
|
+
data: payload,
|
|
182
|
+
host
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
params: toURLSearchParams(payload)
|
|
186
|
+
};
|
|
187
|
+
return metadata;
|
|
188
|
+
}
|
|
189
|
+
return __getOneTimePurchasesStatus;
|
|
190
|
+
}
|
|
91
191
|
function createSubscriptionOption(payload) {
|
|
92
192
|
function __createSubscriptionOption({ host }) {
|
|
93
193
|
const serializedData = transformPaths(payload, [
|
|
@@ -314,145 +414,134 @@ function allowOneTimePurchases(payload) {
|
|
|
314
414
|
}
|
|
315
415
|
return __allowOneTimePurchases;
|
|
316
416
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
},
|
|
350
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
351
|
-
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
352
|
-
),
|
|
353
|
-
params: toURLSearchParams(payload),
|
|
354
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
355
|
-
{
|
|
356
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
357
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
358
|
-
}
|
|
359
|
-
])
|
|
360
|
-
};
|
|
361
|
-
return metadata;
|
|
362
|
-
}
|
|
363
|
-
return __getSubscriptionOption;
|
|
364
|
-
}
|
|
365
|
-
function getSubscriptionOptionsForProduct(payload) {
|
|
366
|
-
function __getSubscriptionOptionsForProduct({ host }) {
|
|
367
|
-
const metadata = {
|
|
368
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
369
|
-
method: "GET",
|
|
370
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
371
|
-
packageName: PACKAGE_NAME,
|
|
372
|
-
migrationOptions: {
|
|
373
|
-
optInTransformResponse: true
|
|
417
|
+
|
|
418
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
419
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
420
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
421
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
422
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
423
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
424
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
425
|
+
return SubscriptionFrequency2;
|
|
426
|
+
})(SubscriptionFrequency || {});
|
|
427
|
+
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
428
|
+
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
429
|
+
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
430
|
+
DiscountType2["PERCENT"] = "PERCENT";
|
|
431
|
+
return DiscountType2;
|
|
432
|
+
})(DiscountType || {});
|
|
433
|
+
async function getSubscriptionOption2(_id) {
|
|
434
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
435
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
436
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
437
|
+
sideEffects?.onSiteCall?.();
|
|
438
|
+
try {
|
|
439
|
+
const result = await httpClient.request(reqOpts);
|
|
440
|
+
sideEffects?.onSuccess?.(result);
|
|
441
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
442
|
+
} catch (err) {
|
|
443
|
+
const transformedError = sdkTransformError(
|
|
444
|
+
err,
|
|
445
|
+
{
|
|
446
|
+
spreadPathsToArguments: {},
|
|
447
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
448
|
+
singleArgumentUnchanged: false
|
|
374
449
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
host
|
|
380
|
-
}
|
|
381
|
-
),
|
|
382
|
-
params: toURLSearchParams(payload),
|
|
383
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
384
|
-
{
|
|
385
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
386
|
-
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
387
|
-
}
|
|
388
|
-
])
|
|
389
|
-
};
|
|
390
|
-
return metadata;
|
|
450
|
+
["_id"]
|
|
451
|
+
);
|
|
452
|
+
sideEffects?.onError?.(err);
|
|
453
|
+
throw transformedError;
|
|
391
454
|
}
|
|
392
|
-
return __getSubscriptionOptionsForProduct;
|
|
393
455
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
456
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
457
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
458
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
459
|
+
productId,
|
|
460
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
461
|
+
});
|
|
462
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
463
|
+
payload
|
|
464
|
+
);
|
|
465
|
+
sideEffects?.onSiteCall?.();
|
|
466
|
+
try {
|
|
467
|
+
const result = await httpClient.request(reqOpts);
|
|
468
|
+
sideEffects?.onSuccess?.(result);
|
|
469
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
470
|
+
} catch (err) {
|
|
471
|
+
const transformedError = sdkTransformError(
|
|
472
|
+
err,
|
|
473
|
+
{
|
|
474
|
+
spreadPathsToArguments: {},
|
|
475
|
+
explicitPathsToArguments: {
|
|
476
|
+
productId: "$[0]",
|
|
477
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
478
|
+
},
|
|
479
|
+
singleArgumentUnchanged: false
|
|
403
480
|
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
host
|
|
409
|
-
}
|
|
410
|
-
),
|
|
411
|
-
params: toURLSearchParams(payload)
|
|
412
|
-
};
|
|
413
|
-
return metadata;
|
|
481
|
+
["productId", "options"]
|
|
482
|
+
);
|
|
483
|
+
sideEffects?.onError?.(err);
|
|
484
|
+
throw transformedError;
|
|
414
485
|
}
|
|
415
|
-
return __getProductIdsForSubscriptionOption;
|
|
416
486
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
487
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
488
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
489
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
490
|
+
id: _id,
|
|
491
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
492
|
+
paging: options?.paging
|
|
493
|
+
});
|
|
494
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
495
|
+
payload
|
|
496
|
+
);
|
|
497
|
+
sideEffects?.onSiteCall?.();
|
|
498
|
+
try {
|
|
499
|
+
const result = await httpClient.request(reqOpts);
|
|
500
|
+
sideEffects?.onSuccess?.(result);
|
|
501
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
502
|
+
} catch (err) {
|
|
503
|
+
const transformedError = sdkTransformError(
|
|
504
|
+
err,
|
|
505
|
+
{
|
|
506
|
+
spreadPathsToArguments: {},
|
|
507
|
+
explicitPathsToArguments: {
|
|
508
|
+
id: "$[0]",
|
|
509
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
510
|
+
paging: "$[1].paging"
|
|
511
|
+
},
|
|
512
|
+
singleArgumentUnchanged: false
|
|
426
513
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
514
|
+
["_id", "options"]
|
|
515
|
+
);
|
|
516
|
+
sideEffects?.onError?.(err);
|
|
517
|
+
throw transformedError;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
521
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
522
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
523
|
+
productId
|
|
524
|
+
});
|
|
525
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
526
|
+
sideEffects?.onSiteCall?.();
|
|
527
|
+
try {
|
|
528
|
+
const result = await httpClient.request(reqOpts);
|
|
529
|
+
sideEffects?.onSuccess?.(result);
|
|
530
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
531
|
+
} catch (err) {
|
|
532
|
+
const transformedError = sdkTransformError(
|
|
533
|
+
err,
|
|
534
|
+
{
|
|
535
|
+
spreadPathsToArguments: {},
|
|
536
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
537
|
+
singleArgumentUnchanged: false
|
|
538
|
+
},
|
|
539
|
+
["productId"]
|
|
540
|
+
);
|
|
541
|
+
sideEffects?.onError?.(err);
|
|
542
|
+
throw transformedError;
|
|
437
543
|
}
|
|
438
|
-
return __getOneTimePurchasesStatus;
|
|
439
544
|
}
|
|
440
|
-
|
|
441
|
-
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
442
|
-
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
443
|
-
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
444
|
-
SubscriptionFrequency2["DAY"] = "DAY";
|
|
445
|
-
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
446
|
-
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
447
|
-
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
448
|
-
return SubscriptionFrequency2;
|
|
449
|
-
})(SubscriptionFrequency || {});
|
|
450
|
-
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
451
|
-
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
452
|
-
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
453
|
-
DiscountType2["PERCENT"] = "PERCENT";
|
|
454
|
-
return DiscountType2;
|
|
455
|
-
})(DiscountType || {});
|
|
456
545
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
457
546
|
const { httpClient, sideEffects } = arguments[1];
|
|
458
547
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -658,145 +747,38 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
658
747
|
throw transformedError;
|
|
659
748
|
}
|
|
660
749
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
try {
|
|
670
|
-
const result = await httpClient.request(reqOpts);
|
|
671
|
-
sideEffects?.onSuccess?.(result);
|
|
672
|
-
} catch (err) {
|
|
673
|
-
const transformedError = sdkTransformError(
|
|
674
|
-
err,
|
|
675
|
-
{
|
|
676
|
-
spreadPathsToArguments: {},
|
|
677
|
-
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
678
|
-
singleArgumentUnchanged: false
|
|
679
|
-
},
|
|
680
|
-
["productId", "allowed"]
|
|
681
|
-
);
|
|
682
|
-
sideEffects?.onError?.(err);
|
|
683
|
-
throw transformedError;
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
async function getSubscriptionOption2(_id) {
|
|
687
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
688
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
689
|
-
const reqOpts = getSubscriptionOption(payload);
|
|
690
|
-
sideEffects?.onSiteCall?.();
|
|
691
|
-
try {
|
|
692
|
-
const result = await httpClient.request(reqOpts);
|
|
693
|
-
sideEffects?.onSuccess?.(result);
|
|
694
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
695
|
-
} catch (err) {
|
|
696
|
-
const transformedError = sdkTransformError(
|
|
697
|
-
err,
|
|
698
|
-
{
|
|
699
|
-
spreadPathsToArguments: {},
|
|
700
|
-
explicitPathsToArguments: { id: "$[0]" },
|
|
701
|
-
singleArgumentUnchanged: false
|
|
702
|
-
},
|
|
703
|
-
["_id"]
|
|
704
|
-
);
|
|
705
|
-
sideEffects?.onError?.(err);
|
|
706
|
-
throw transformedError;
|
|
707
|
-
}
|
|
750
|
+
|
|
751
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
752
|
+
function getSubscriptionOption3(httpClient) {
|
|
753
|
+
return (_id) => getSubscriptionOption2(
|
|
754
|
+
_id,
|
|
755
|
+
// @ts-ignore
|
|
756
|
+
{ httpClient }
|
|
757
|
+
);
|
|
708
758
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
759
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
760
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
712
761
|
productId,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
payload
|
|
762
|
+
options,
|
|
763
|
+
// @ts-ignore
|
|
764
|
+
{ httpClient }
|
|
717
765
|
);
|
|
718
|
-
sideEffects?.onSiteCall?.();
|
|
719
|
-
try {
|
|
720
|
-
const result = await httpClient.request(reqOpts);
|
|
721
|
-
sideEffects?.onSuccess?.(result);
|
|
722
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
723
|
-
} catch (err) {
|
|
724
|
-
const transformedError = sdkTransformError(
|
|
725
|
-
err,
|
|
726
|
-
{
|
|
727
|
-
spreadPathsToArguments: {},
|
|
728
|
-
explicitPathsToArguments: {
|
|
729
|
-
productId: "$[0]",
|
|
730
|
-
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
731
|
-
},
|
|
732
|
-
singleArgumentUnchanged: false
|
|
733
|
-
},
|
|
734
|
-
["productId", "options"]
|
|
735
|
-
);
|
|
736
|
-
sideEffects?.onError?.(err);
|
|
737
|
-
throw transformedError;
|
|
738
|
-
}
|
|
739
766
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
});
|
|
747
|
-
const reqOpts = getProductIdsForSubscriptionOption(
|
|
748
|
-
payload
|
|
767
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
768
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
769
|
+
_id,
|
|
770
|
+
options,
|
|
771
|
+
// @ts-ignore
|
|
772
|
+
{ httpClient }
|
|
749
773
|
);
|
|
750
|
-
sideEffects?.onSiteCall?.();
|
|
751
|
-
try {
|
|
752
|
-
const result = await httpClient.request(reqOpts);
|
|
753
|
-
sideEffects?.onSuccess?.(result);
|
|
754
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
755
|
-
} catch (err) {
|
|
756
|
-
const transformedError = sdkTransformError(
|
|
757
|
-
err,
|
|
758
|
-
{
|
|
759
|
-
spreadPathsToArguments: {},
|
|
760
|
-
explicitPathsToArguments: {
|
|
761
|
-
id: "$[0]",
|
|
762
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
763
|
-
paging: "$[1].paging"
|
|
764
|
-
},
|
|
765
|
-
singleArgumentUnchanged: false
|
|
766
|
-
},
|
|
767
|
-
["_id", "options"]
|
|
768
|
-
);
|
|
769
|
-
sideEffects?.onError?.(err);
|
|
770
|
-
throw transformedError;
|
|
771
|
-
}
|
|
772
774
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
sideEffects?.onSiteCall?.();
|
|
780
|
-
try {
|
|
781
|
-
const result = await httpClient.request(reqOpts);
|
|
782
|
-
sideEffects?.onSuccess?.(result);
|
|
783
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
784
|
-
} catch (err) {
|
|
785
|
-
const transformedError = sdkTransformError(
|
|
786
|
-
err,
|
|
787
|
-
{
|
|
788
|
-
spreadPathsToArguments: {},
|
|
789
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
790
|
-
singleArgumentUnchanged: false
|
|
791
|
-
},
|
|
792
|
-
["productId"]
|
|
793
|
-
);
|
|
794
|
-
sideEffects?.onError?.(err);
|
|
795
|
-
throw transformedError;
|
|
796
|
-
}
|
|
775
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
776
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
777
|
+
productId,
|
|
778
|
+
// @ts-ignore
|
|
779
|
+
{ httpClient }
|
|
780
|
+
);
|
|
797
781
|
}
|
|
798
|
-
|
|
799
|
-
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
800
782
|
function createSubscriptionOption3(httpClient) {
|
|
801
783
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
802
784
|
subscriptionOption,
|
|
@@ -856,47 +838,13 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
856
838
|
{ httpClient }
|
|
857
839
|
);
|
|
858
840
|
}
|
|
859
|
-
function enableCustomerCancellation3(httpClient) {
|
|
860
|
-
return (productId, allowed) => enableCustomerCancellation2(
|
|
861
|
-
productId,
|
|
862
|
-
allowed,
|
|
863
|
-
// @ts-ignore
|
|
864
|
-
{ httpClient }
|
|
865
|
-
);
|
|
866
|
-
}
|
|
867
|
-
function getSubscriptionOption3(httpClient) {
|
|
868
|
-
return (_id) => getSubscriptionOption2(
|
|
869
|
-
_id,
|
|
870
|
-
// @ts-ignore
|
|
871
|
-
{ httpClient }
|
|
872
|
-
);
|
|
873
|
-
}
|
|
874
|
-
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
875
|
-
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
876
|
-
productId,
|
|
877
|
-
options,
|
|
878
|
-
// @ts-ignore
|
|
879
|
-
{ httpClient }
|
|
880
|
-
);
|
|
881
|
-
}
|
|
882
|
-
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
883
|
-
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
884
|
-
_id,
|
|
885
|
-
options,
|
|
886
|
-
// @ts-ignore
|
|
887
|
-
{ httpClient }
|
|
888
|
-
);
|
|
889
|
-
}
|
|
890
|
-
function getOneTimePurchasesStatus3(httpClient) {
|
|
891
|
-
return (productId) => getOneTimePurchasesStatus2(
|
|
892
|
-
productId,
|
|
893
|
-
// @ts-ignore
|
|
894
|
-
{ httpClient }
|
|
895
|
-
);
|
|
896
|
-
}
|
|
897
841
|
|
|
898
842
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
899
843
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
844
|
+
var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
|
|
845
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
|
|
846
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
|
|
847
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
|
|
900
848
|
var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
|
|
901
849
|
var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
|
|
902
850
|
var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
|
|
@@ -905,11 +853,6 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkUpdate
|
|
|
905
853
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDeleteSubscriptionOptions3);
|
|
906
854
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
|
|
907
855
|
var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
|
|
908
|
-
var enableCustomerCancellation4 = /* @__PURE__ */ createRESTModule(enableCustomerCancellation3);
|
|
909
|
-
var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
|
|
910
|
-
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
|
|
911
|
-
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
|
|
912
|
-
var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
|
|
913
856
|
export {
|
|
914
857
|
DiscountType,
|
|
915
858
|
SubscriptionFrequency,
|
|
@@ -920,7 +863,6 @@ export {
|
|
|
920
863
|
bulkUpdateSubscriptionOptions4 as bulkUpdateSubscriptionOptions,
|
|
921
864
|
createSubscriptionOption4 as createSubscriptionOption,
|
|
922
865
|
deleteSubscriptionOption4 as deleteSubscriptionOption,
|
|
923
|
-
enableCustomerCancellation4 as enableCustomerCancellation,
|
|
924
866
|
getOneTimePurchasesStatus4 as getOneTimePurchasesStatus,
|
|
925
867
|
getProductIdsForSubscriptionOption4 as getProductIdsForSubscriptionOption,
|
|
926
868
|
getSubscriptionOption4 as getSubscriptionOption,
|