@wix/auto_sdk_stores_subscription-options 1.0.38 → 1.0.39
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 +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 +276 -276
- 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 +276 -276
- 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 +276 -276
- 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
|
@@ -11,76 +11,76 @@ 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
|
|
14
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
15
15
|
const domainToMappings = {
|
|
16
16
|
"api._api_base_domain_": [
|
|
17
17
|
{
|
|
18
|
-
srcPath: "/wix-ecommerce-plans",
|
|
18
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
19
19
|
destPath: ""
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
|
-
"www.
|
|
22
|
+
"www._base_domain_": [
|
|
23
23
|
{
|
|
24
|
-
srcPath: "/
|
|
25
|
-
destPath: "
|
|
24
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
25
|
+
destPath: ""
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
|
-
|
|
28
|
+
_: [
|
|
29
29
|
{
|
|
30
|
-
srcPath: "/_api/subscription-options-server",
|
|
30
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
31
31
|
destPath: ""
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
|
-
"
|
|
34
|
+
"manage._base_domain_": [
|
|
35
35
|
{
|
|
36
|
-
srcPath: "/_api/subscription-options-server",
|
|
36
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
37
37
|
destPath: ""
|
|
38
38
|
}
|
|
39
|
-
]
|
|
40
|
-
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
42
|
+
}
|
|
43
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
44
|
+
const domainToMappings = {
|
|
45
|
+
"api._api_base_domain_": [
|
|
41
46
|
{
|
|
42
|
-
srcPath: "/
|
|
47
|
+
srcPath: "/wix-ecommerce-plans",
|
|
43
48
|
destPath: ""
|
|
44
49
|
}
|
|
45
50
|
],
|
|
46
|
-
"
|
|
51
|
+
"www.wixapis.com": [
|
|
47
52
|
{
|
|
48
|
-
srcPath: "/
|
|
49
|
-
destPath: ""
|
|
53
|
+
srcPath: "/stores/v1/subscription-options",
|
|
54
|
+
destPath: "/v1/subscription-options"
|
|
50
55
|
}
|
|
51
56
|
],
|
|
52
|
-
"
|
|
57
|
+
"www._base_domain_": [
|
|
53
58
|
{
|
|
54
59
|
srcPath: "/_api/subscription-options-server",
|
|
55
60
|
destPath: ""
|
|
56
61
|
}
|
|
57
|
-
]
|
|
58
|
-
|
|
59
|
-
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
60
|
-
}
|
|
61
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
62
|
-
const domainToMappings = {
|
|
63
|
-
"api._api_base_domain_": [
|
|
62
|
+
],
|
|
63
|
+
"editor._base_domain_": [
|
|
64
64
|
{
|
|
65
|
-
srcPath: "/
|
|
65
|
+
srcPath: "/_api/subscription-options-server",
|
|
66
66
|
destPath: ""
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"
|
|
69
|
+
"blocks._base_domain_": [
|
|
70
70
|
{
|
|
71
|
-
srcPath: "/_api/
|
|
71
|
+
srcPath: "/_api/subscription-options-server",
|
|
72
72
|
destPath: ""
|
|
73
73
|
}
|
|
74
74
|
],
|
|
75
|
-
|
|
75
|
+
"create.editorx": [
|
|
76
76
|
{
|
|
77
|
-
srcPath: "/_api/subscription-options-
|
|
77
|
+
srcPath: "/_api/subscription-options-server",
|
|
78
78
|
destPath: ""
|
|
79
79
|
}
|
|
80
80
|
],
|
|
81
81
|
"manage._base_domain_": [
|
|
82
82
|
{
|
|
83
|
-
srcPath: "/_api/subscription-options-
|
|
83
|
+
srcPath: "/_api/subscription-options-server",
|
|
84
84
|
destPath: ""
|
|
85
85
|
}
|
|
86
86
|
]
|
|
@@ -88,106 +88,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
|
|
|
88
88
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
89
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
|
-
}
|
|
191
91
|
function createSubscriptionOption(payload) {
|
|
192
92
|
function __createSubscriptionOption({ host }) {
|
|
193
93
|
const serializedData = transformPaths(payload, [
|
|
@@ -437,134 +337,122 @@ function enableCustomerCancellation(payload) {
|
|
|
437
337
|
}
|
|
438
338
|
return __enableCustomerCancellation;
|
|
439
339
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
async function getSubscriptionOption2(_id) {
|
|
457
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
458
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
459
|
-
const reqOpts = getSubscriptionOption(payload);
|
|
460
|
-
sideEffects?.onSiteCall?.();
|
|
461
|
-
try {
|
|
462
|
-
const result = await httpClient.request(reqOpts);
|
|
463
|
-
sideEffects?.onSuccess?.(result);
|
|
464
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
465
|
-
} catch (err) {
|
|
466
|
-
const transformedError = sdkTransformError(
|
|
467
|
-
err,
|
|
468
|
-
{
|
|
469
|
-
spreadPathsToArguments: {},
|
|
470
|
-
explicitPathsToArguments: { id: "$[0]" },
|
|
471
|
-
singleArgumentUnchanged: false
|
|
340
|
+
function getSubscriptionOption(payload) {
|
|
341
|
+
function __getSubscriptionOption({ host }) {
|
|
342
|
+
const metadata = {
|
|
343
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
344
|
+
method: "GET",
|
|
345
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
346
|
+
packageName: PACKAGE_NAME,
|
|
347
|
+
migrationOptions: {
|
|
348
|
+
optInTransformResponse: true
|
|
472
349
|
},
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
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;
|
|
477
362
|
}
|
|
363
|
+
return __getSubscriptionOption;
|
|
478
364
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
sideEffects?.onSiteCall?.();
|
|
489
|
-
try {
|
|
490
|
-
const result = await httpClient.request(reqOpts);
|
|
491
|
-
sideEffects?.onSuccess?.(result);
|
|
492
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
493
|
-
} catch (err) {
|
|
494
|
-
const transformedError = sdkTransformError(
|
|
495
|
-
err,
|
|
496
|
-
{
|
|
497
|
-
spreadPathsToArguments: {},
|
|
498
|
-
explicitPathsToArguments: {
|
|
499
|
-
productId: "$[0]",
|
|
500
|
-
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
501
|
-
},
|
|
502
|
-
singleArgumentUnchanged: false
|
|
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
|
|
503
374
|
},
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
533
|
-
paging: "$[1].paging"
|
|
534
|
-
},
|
|
535
|
-
singleArgumentUnchanged: false
|
|
375
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
376
|
+
{
|
|
377
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
378
|
+
data: payload,
|
|
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;
|
|
391
|
+
}
|
|
392
|
+
return __getSubscriptionOptionsForProduct;
|
|
393
|
+
}
|
|
394
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
395
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
396
|
+
const metadata = {
|
|
397
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
398
|
+
method: "GET",
|
|
399
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
400
|
+
packageName: PACKAGE_NAME,
|
|
401
|
+
migrationOptions: {
|
|
402
|
+
optInTransformResponse: true
|
|
536
403
|
},
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
404
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
405
|
+
{
|
|
406
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
407
|
+
data: payload,
|
|
408
|
+
host
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
params: toURLSearchParams(payload)
|
|
412
|
+
};
|
|
413
|
+
return metadata;
|
|
541
414
|
}
|
|
415
|
+
return __getProductIdsForSubscriptionOption;
|
|
542
416
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
sideEffects?.onSuccess?.(result);
|
|
553
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
554
|
-
} catch (err) {
|
|
555
|
-
const transformedError = sdkTransformError(
|
|
556
|
-
err,
|
|
557
|
-
{
|
|
558
|
-
spreadPathsToArguments: {},
|
|
559
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
560
|
-
singleArgumentUnchanged: false
|
|
417
|
+
function getOneTimePurchasesStatus(payload) {
|
|
418
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
419
|
+
const metadata = {
|
|
420
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
421
|
+
method: "GET",
|
|
422
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
423
|
+
packageName: PACKAGE_NAME,
|
|
424
|
+
migrationOptions: {
|
|
425
|
+
optInTransformResponse: true
|
|
561
426
|
},
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
427
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
428
|
+
{
|
|
429
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
430
|
+
data: payload,
|
|
431
|
+
host
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
params: toURLSearchParams(payload)
|
|
435
|
+
};
|
|
436
|
+
return metadata;
|
|
566
437
|
}
|
|
438
|
+
return __getOneTimePurchasesStatus;
|
|
567
439
|
}
|
|
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 || {});
|
|
568
456
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
569
457
|
const { httpClient, sideEffects } = arguments[1];
|
|
570
458
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -795,38 +683,120 @@ async function enableCustomerCancellation2(productId, allowed) {
|
|
|
795
683
|
throw transformedError;
|
|
796
684
|
}
|
|
797
685
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
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
|
+
}
|
|
806
708
|
}
|
|
807
|
-
function
|
|
808
|
-
|
|
709
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
710
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
711
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
809
712
|
productId,
|
|
810
|
-
options
|
|
811
|
-
|
|
812
|
-
|
|
713
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
714
|
+
});
|
|
715
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
716
|
+
payload
|
|
813
717
|
);
|
|
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
|
+
}
|
|
814
739
|
}
|
|
815
|
-
function
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
740
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
741
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
742
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
743
|
+
id: _id,
|
|
744
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
745
|
+
paging: options?.paging
|
|
746
|
+
});
|
|
747
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
748
|
+
payload
|
|
821
749
|
);
|
|
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
|
+
}
|
|
822
772
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
);
|
|
773
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
774
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
775
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
776
|
+
productId
|
|
777
|
+
});
|
|
778
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
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
|
+
}
|
|
829
797
|
}
|
|
798
|
+
|
|
799
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
830
800
|
function createSubscriptionOption3(httpClient) {
|
|
831
801
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
832
802
|
subscriptionOption,
|
|
@@ -894,13 +864,39 @@ function enableCustomerCancellation3(httpClient) {
|
|
|
894
864
|
{ httpClient }
|
|
895
865
|
);
|
|
896
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
897
|
|
|
898
898
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
899
899
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
900
|
-
var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
|
|
901
|
-
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
|
|
902
|
-
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
|
|
903
|
-
var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
|
|
904
900
|
var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
|
|
905
901
|
var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
|
|
906
902
|
var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
|
|
@@ -910,6 +906,10 @@ var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDelete
|
|
|
910
906
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
|
|
911
907
|
var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
|
|
912
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
913
|
export {
|
|
914
914
|
DiscountType,
|
|
915
915
|
SubscriptionFrequency,
|