@wix/auto_sdk_stores_subscription-options 1.0.29 → 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 +2 -2
package/build/es/index.mjs
CHANGED
|
@@ -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, [
|
|
@@ -414,134 +314,122 @@ function allowOneTimePurchases(payload) {
|
|
|
414
314
|
}
|
|
415
315
|
return __allowOneTimePurchases;
|
|
416
316
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
|
317
|
+
function getSubscriptionOption(payload) {
|
|
318
|
+
function __getSubscriptionOption({ host }) {
|
|
319
|
+
const metadata = {
|
|
320
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
321
|
+
method: "GET",
|
|
322
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
323
|
+
packageName: PACKAGE_NAME,
|
|
324
|
+
migrationOptions: {
|
|
325
|
+
optInTransformResponse: true
|
|
449
326
|
},
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
327
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
328
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
329
|
+
),
|
|
330
|
+
params: toURLSearchParams(payload),
|
|
331
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
332
|
+
{
|
|
333
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
334
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
335
|
+
}
|
|
336
|
+
])
|
|
337
|
+
};
|
|
338
|
+
return metadata;
|
|
454
339
|
}
|
|
340
|
+
return __getSubscriptionOption;
|
|
455
341
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
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
|
|
342
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
343
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
344
|
+
const metadata = {
|
|
345
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
346
|
+
method: "GET",
|
|
347
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
348
|
+
packageName: PACKAGE_NAME,
|
|
349
|
+
migrationOptions: {
|
|
350
|
+
optInTransformResponse: true
|
|
480
351
|
},
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
510
|
-
paging: "$[1].paging"
|
|
511
|
-
},
|
|
512
|
-
singleArgumentUnchanged: false
|
|
352
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
353
|
+
{
|
|
354
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
355
|
+
data: payload,
|
|
356
|
+
host
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
params: toURLSearchParams(payload),
|
|
360
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
361
|
+
{
|
|
362
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
363
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
364
|
+
}
|
|
365
|
+
])
|
|
366
|
+
};
|
|
367
|
+
return metadata;
|
|
368
|
+
}
|
|
369
|
+
return __getSubscriptionOptionsForProduct;
|
|
370
|
+
}
|
|
371
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
372
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
373
|
+
const metadata = {
|
|
374
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
375
|
+
method: "GET",
|
|
376
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
377
|
+
packageName: PACKAGE_NAME,
|
|
378
|
+
migrationOptions: {
|
|
379
|
+
optInTransformResponse: true
|
|
513
380
|
},
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
381
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
382
|
+
{
|
|
383
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
384
|
+
data: payload,
|
|
385
|
+
host
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
params: toURLSearchParams(payload)
|
|
389
|
+
};
|
|
390
|
+
return metadata;
|
|
518
391
|
}
|
|
392
|
+
return __getProductIdsForSubscriptionOption;
|
|
519
393
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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
|
|
394
|
+
function getOneTimePurchasesStatus(payload) {
|
|
395
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
396
|
+
const metadata = {
|
|
397
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
398
|
+
method: "GET",
|
|
399
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
400
|
+
packageName: PACKAGE_NAME,
|
|
401
|
+
migrationOptions: {
|
|
402
|
+
optInTransformResponse: true
|
|
538
403
|
},
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
404
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
405
|
+
{
|
|
406
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
407
|
+
data: payload,
|
|
408
|
+
host
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
params: toURLSearchParams(payload)
|
|
412
|
+
};
|
|
413
|
+
return metadata;
|
|
543
414
|
}
|
|
415
|
+
return __getOneTimePurchasesStatus;
|
|
544
416
|
}
|
|
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 || {});
|
|
545
433
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
546
434
|
const { httpClient, sideEffects } = arguments[1];
|
|
547
435
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -747,38 +635,120 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
747
635
|
throw transformedError;
|
|
748
636
|
}
|
|
749
637
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
638
|
+
async function getSubscriptionOption2(_id) {
|
|
639
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
640
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
641
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
642
|
+
sideEffects?.onSiteCall?.();
|
|
643
|
+
try {
|
|
644
|
+
const result = await httpClient.request(reqOpts);
|
|
645
|
+
sideEffects?.onSuccess?.(result);
|
|
646
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
647
|
+
} catch (err) {
|
|
648
|
+
const transformedError = sdkTransformError(
|
|
649
|
+
err,
|
|
650
|
+
{
|
|
651
|
+
spreadPathsToArguments: {},
|
|
652
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
653
|
+
singleArgumentUnchanged: false
|
|
654
|
+
},
|
|
655
|
+
["_id"]
|
|
656
|
+
);
|
|
657
|
+
sideEffects?.onError?.(err);
|
|
658
|
+
throw transformedError;
|
|
659
|
+
}
|
|
758
660
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
661
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
662
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
663
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
761
664
|
productId,
|
|
762
|
-
options
|
|
763
|
-
|
|
764
|
-
|
|
665
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
666
|
+
});
|
|
667
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
668
|
+
payload
|
|
765
669
|
);
|
|
670
|
+
sideEffects?.onSiteCall?.();
|
|
671
|
+
try {
|
|
672
|
+
const result = await httpClient.request(reqOpts);
|
|
673
|
+
sideEffects?.onSuccess?.(result);
|
|
674
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
675
|
+
} catch (err) {
|
|
676
|
+
const transformedError = sdkTransformError(
|
|
677
|
+
err,
|
|
678
|
+
{
|
|
679
|
+
spreadPathsToArguments: {},
|
|
680
|
+
explicitPathsToArguments: {
|
|
681
|
+
productId: "$[0]",
|
|
682
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
683
|
+
},
|
|
684
|
+
singleArgumentUnchanged: false
|
|
685
|
+
},
|
|
686
|
+
["productId", "options"]
|
|
687
|
+
);
|
|
688
|
+
sideEffects?.onError?.(err);
|
|
689
|
+
throw transformedError;
|
|
690
|
+
}
|
|
766
691
|
}
|
|
767
|
-
function
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
692
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
693
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
694
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
695
|
+
id: _id,
|
|
696
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
697
|
+
paging: options?.paging
|
|
698
|
+
});
|
|
699
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
700
|
+
payload
|
|
773
701
|
);
|
|
702
|
+
sideEffects?.onSiteCall?.();
|
|
703
|
+
try {
|
|
704
|
+
const result = await httpClient.request(reqOpts);
|
|
705
|
+
sideEffects?.onSuccess?.(result);
|
|
706
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
707
|
+
} catch (err) {
|
|
708
|
+
const transformedError = sdkTransformError(
|
|
709
|
+
err,
|
|
710
|
+
{
|
|
711
|
+
spreadPathsToArguments: {},
|
|
712
|
+
explicitPathsToArguments: {
|
|
713
|
+
id: "$[0]",
|
|
714
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
715
|
+
paging: "$[1].paging"
|
|
716
|
+
},
|
|
717
|
+
singleArgumentUnchanged: false
|
|
718
|
+
},
|
|
719
|
+
["_id", "options"]
|
|
720
|
+
);
|
|
721
|
+
sideEffects?.onError?.(err);
|
|
722
|
+
throw transformedError;
|
|
723
|
+
}
|
|
774
724
|
}
|
|
775
|
-
function
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
);
|
|
725
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
726
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
727
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
728
|
+
productId
|
|
729
|
+
});
|
|
730
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
731
|
+
sideEffects?.onSiteCall?.();
|
|
732
|
+
try {
|
|
733
|
+
const result = await httpClient.request(reqOpts);
|
|
734
|
+
sideEffects?.onSuccess?.(result);
|
|
735
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
736
|
+
} catch (err) {
|
|
737
|
+
const transformedError = sdkTransformError(
|
|
738
|
+
err,
|
|
739
|
+
{
|
|
740
|
+
spreadPathsToArguments: {},
|
|
741
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
742
|
+
singleArgumentUnchanged: false
|
|
743
|
+
},
|
|
744
|
+
["productId"]
|
|
745
|
+
);
|
|
746
|
+
sideEffects?.onError?.(err);
|
|
747
|
+
throw transformedError;
|
|
748
|
+
}
|
|
781
749
|
}
|
|
750
|
+
|
|
751
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
782
752
|
function createSubscriptionOption3(httpClient) {
|
|
783
753
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
784
754
|
subscriptionOption,
|
|
@@ -838,13 +808,39 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
838
808
|
{ httpClient }
|
|
839
809
|
);
|
|
840
810
|
}
|
|
811
|
+
function getSubscriptionOption3(httpClient) {
|
|
812
|
+
return (_id) => getSubscriptionOption2(
|
|
813
|
+
_id,
|
|
814
|
+
// @ts-ignore
|
|
815
|
+
{ httpClient }
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
819
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
820
|
+
productId,
|
|
821
|
+
options,
|
|
822
|
+
// @ts-ignore
|
|
823
|
+
{ httpClient }
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
827
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
828
|
+
_id,
|
|
829
|
+
options,
|
|
830
|
+
// @ts-ignore
|
|
831
|
+
{ httpClient }
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
835
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
836
|
+
productId,
|
|
837
|
+
// @ts-ignore
|
|
838
|
+
{ httpClient }
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
841
|
|
|
842
842
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
843
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);
|
|
848
844
|
var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
|
|
849
845
|
var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
|
|
850
846
|
var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
|
|
@@ -853,6 +849,10 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkUpdate
|
|
|
853
849
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDeleteSubscriptionOptions3);
|
|
854
850
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
|
|
855
851
|
var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
|
|
852
|
+
var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
|
|
853
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
|
|
854
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
|
|
855
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
|
|
856
856
|
export {
|
|
857
857
|
DiscountType,
|
|
858
858
|
SubscriptionFrequency,
|