@wix/auto_sdk_stores_subscription-options 1.0.31 → 1.0.32
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 +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 +274 -274
- 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 +274 -274
- 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 +274 -274
- 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
package/build/es/index.mjs
CHANGED
|
@@ -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, [
|
|
@@ -337,122 +437,134 @@ function enableCustomerCancellation(payload) {
|
|
|
337
437
|
}
|
|
338
438
|
return __enableCustomerCancellation;
|
|
339
439
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
+
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
|
|
349
472
|
},
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
355
|
-
{
|
|
356
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
357
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
358
|
-
}
|
|
359
|
-
])
|
|
360
|
-
};
|
|
361
|
-
return metadata;
|
|
473
|
+
["_id"]
|
|
474
|
+
);
|
|
475
|
+
sideEffects?.onError?.(err);
|
|
476
|
+
throw transformedError;
|
|
362
477
|
}
|
|
363
|
-
return __getSubscriptionOption;
|
|
364
478
|
}
|
|
365
|
-
function
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
479
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
480
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
481
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
482
|
+
productId,
|
|
483
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
484
|
+
});
|
|
485
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
486
|
+
payload
|
|
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
|
|
374
503
|
},
|
|
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;
|
|
504
|
+
["productId", "options"]
|
|
505
|
+
);
|
|
506
|
+
sideEffects?.onError?.(err);
|
|
507
|
+
throw transformedError;
|
|
391
508
|
}
|
|
392
|
-
return __getSubscriptionOptionsForProduct;
|
|
393
509
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
510
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
511
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
512
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
513
|
+
id: _id,
|
|
514
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
515
|
+
paging: options?.paging
|
|
516
|
+
});
|
|
517
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
518
|
+
payload
|
|
519
|
+
);
|
|
520
|
+
sideEffects?.onSiteCall?.();
|
|
521
|
+
try {
|
|
522
|
+
const result = await httpClient.request(reqOpts);
|
|
523
|
+
sideEffects?.onSuccess?.(result);
|
|
524
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
525
|
+
} catch (err) {
|
|
526
|
+
const transformedError = sdkTransformError(
|
|
527
|
+
err,
|
|
528
|
+
{
|
|
529
|
+
spreadPathsToArguments: {},
|
|
530
|
+
explicitPathsToArguments: {
|
|
531
|
+
id: "$[0]",
|
|
532
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
533
|
+
paging: "$[1].paging"
|
|
534
|
+
},
|
|
535
|
+
singleArgumentUnchanged: false
|
|
403
536
|
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
host
|
|
409
|
-
}
|
|
410
|
-
),
|
|
411
|
-
params: toURLSearchParams(payload)
|
|
412
|
-
};
|
|
413
|
-
return metadata;
|
|
537
|
+
["_id", "options"]
|
|
538
|
+
);
|
|
539
|
+
sideEffects?.onError?.(err);
|
|
540
|
+
throw transformedError;
|
|
414
541
|
}
|
|
415
|
-
return __getProductIdsForSubscriptionOption;
|
|
416
542
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
543
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
544
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
545
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
546
|
+
productId
|
|
547
|
+
});
|
|
548
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
549
|
+
sideEffects?.onSiteCall?.();
|
|
550
|
+
try {
|
|
551
|
+
const result = await httpClient.request(reqOpts);
|
|
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
|
|
426
561
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
host
|
|
432
|
-
}
|
|
433
|
-
),
|
|
434
|
-
params: toURLSearchParams(payload)
|
|
435
|
-
};
|
|
436
|
-
return metadata;
|
|
562
|
+
["productId"]
|
|
563
|
+
);
|
|
564
|
+
sideEffects?.onError?.(err);
|
|
565
|
+
throw transformedError;
|
|
437
566
|
}
|
|
438
|
-
return __getOneTimePurchasesStatus;
|
|
439
567
|
}
|
|
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
568
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
457
569
|
const { httpClient, sideEffects } = arguments[1];
|
|
458
570
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -683,120 +795,38 @@ async function enableCustomerCancellation2(productId, allowed) {
|
|
|
683
795
|
throw transformedError;
|
|
684
796
|
}
|
|
685
797
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
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
|
-
}
|
|
798
|
+
|
|
799
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
800
|
+
function getSubscriptionOption3(httpClient) {
|
|
801
|
+
return (_id) => getSubscriptionOption2(
|
|
802
|
+
_id,
|
|
803
|
+
// @ts-ignore
|
|
804
|
+
{ httpClient }
|
|
805
|
+
);
|
|
708
806
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
807
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
808
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
712
809
|
productId,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
payload
|
|
810
|
+
options,
|
|
811
|
+
// @ts-ignore
|
|
812
|
+
{ httpClient }
|
|
717
813
|
);
|
|
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
814
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
});
|
|
747
|
-
const reqOpts = getProductIdsForSubscriptionOption(
|
|
748
|
-
payload
|
|
815
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
816
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
817
|
+
_id,
|
|
818
|
+
options,
|
|
819
|
+
// @ts-ignore
|
|
820
|
+
{ httpClient }
|
|
749
821
|
);
|
|
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
822
|
}
|
|
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
|
-
}
|
|
823
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
824
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
825
|
+
productId,
|
|
826
|
+
// @ts-ignore
|
|
827
|
+
{ httpClient }
|
|
828
|
+
);
|
|
797
829
|
}
|
|
798
|
-
|
|
799
|
-
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
800
830
|
function createSubscriptionOption3(httpClient) {
|
|
801
831
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
802
832
|
subscriptionOption,
|
|
@@ -864,39 +894,13 @@ function enableCustomerCancellation3(httpClient) {
|
|
|
864
894
|
{ httpClient }
|
|
865
895
|
);
|
|
866
896
|
}
|
|
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);
|
|
900
904
|
var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
|
|
901
905
|
var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
|
|
902
906
|
var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
|
|
@@ -906,10 +910,6 @@ var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDelete
|
|
|
906
910
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
|
|
907
911
|
var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
|
|
908
912
|
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,
|