@wix/auto_sdk_stores_subscription-options 1.0.29 → 1.0.31
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 +58 -47
- package/build/cjs/index.js +333 -274
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +183 -158
- package/build/cjs/index.typings.js +273 -223
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +123 -109
- package/build/cjs/meta.js +246 -203
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +58 -47
- package/build/es/index.mjs +332 -274
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +183 -158
- package/build/es/index.typings.mjs +272 -223
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +123 -109
- package/build/es/meta.mjs +245 -203
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +58 -47
- package/build/internal/cjs/index.js +333 -274
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +183 -158
- package/build/internal/cjs/index.typings.js +273 -223
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +123 -109
- package/build/internal/cjs/meta.js +246 -203
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +58 -47
- package/build/internal/es/index.mjs +332 -274
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +183 -158
- package/build/internal/es/index.typings.mjs +272 -223
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +123 -109
- package/build/internal/es/meta.mjs +245 -203
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
bulkUpdateSubscriptionOptions: () => bulkUpdateSubscriptionOptions4,
|
|
30
30
|
createSubscriptionOption: () => createSubscriptionOption4,
|
|
31
31
|
deleteSubscriptionOption: () => deleteSubscriptionOption4,
|
|
32
|
+
enableCustomerCancellation: () => enableCustomerCancellation4,
|
|
32
33
|
getOneTimePurchasesStatus: () => getOneTimePurchasesStatus4,
|
|
33
34
|
getProductIdsForSubscriptionOption: () => getProductIdsForSubscriptionOption4,
|
|
34
35
|
getSubscriptionOption: () => getSubscriptionOption4,
|
|
@@ -47,76 +48,76 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
47
48
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
48
49
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
49
50
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
50
|
-
function
|
|
51
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
51
52
|
const domainToMappings = {
|
|
52
53
|
"api._api_base_domain_": [
|
|
53
54
|
{
|
|
54
|
-
srcPath: "/wix-ecommerce-plans",
|
|
55
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
55
56
|
destPath: ""
|
|
56
57
|
}
|
|
57
58
|
],
|
|
58
|
-
"www.
|
|
59
|
+
"www._base_domain_": [
|
|
59
60
|
{
|
|
60
|
-
srcPath: "/
|
|
61
|
-
destPath: "
|
|
61
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
62
|
+
destPath: ""
|
|
62
63
|
}
|
|
63
64
|
],
|
|
64
|
-
|
|
65
|
+
_: [
|
|
65
66
|
{
|
|
66
|
-
srcPath: "/_api/subscription-options-server",
|
|
67
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
67
68
|
destPath: ""
|
|
68
69
|
}
|
|
69
70
|
],
|
|
70
|
-
"
|
|
71
|
+
"manage._base_domain_": [
|
|
71
72
|
{
|
|
72
|
-
srcPath: "/_api/subscription-options-server",
|
|
73
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
73
74
|
destPath: ""
|
|
74
75
|
}
|
|
75
|
-
]
|
|
76
|
-
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
79
|
+
}
|
|
80
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
81
|
+
const domainToMappings = {
|
|
82
|
+
"api._api_base_domain_": [
|
|
77
83
|
{
|
|
78
|
-
srcPath: "/
|
|
84
|
+
srcPath: "/wix-ecommerce-plans",
|
|
79
85
|
destPath: ""
|
|
80
86
|
}
|
|
81
87
|
],
|
|
82
|
-
"
|
|
88
|
+
"www.wixapis.com": [
|
|
83
89
|
{
|
|
84
|
-
srcPath: "/
|
|
85
|
-
destPath: ""
|
|
90
|
+
srcPath: "/stores/v1/subscription-options",
|
|
91
|
+
destPath: "/v1/subscription-options"
|
|
86
92
|
}
|
|
87
93
|
],
|
|
88
|
-
"
|
|
94
|
+
"www._base_domain_": [
|
|
89
95
|
{
|
|
90
96
|
srcPath: "/_api/subscription-options-server",
|
|
91
97
|
destPath: ""
|
|
92
98
|
}
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
96
|
-
}
|
|
97
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
98
|
-
const domainToMappings = {
|
|
99
|
-
"api._api_base_domain_": [
|
|
99
|
+
],
|
|
100
|
+
"editor._base_domain_": [
|
|
100
101
|
{
|
|
101
|
-
srcPath: "/
|
|
102
|
+
srcPath: "/_api/subscription-options-server",
|
|
102
103
|
destPath: ""
|
|
103
104
|
}
|
|
104
105
|
],
|
|
105
|
-
"
|
|
106
|
+
"blocks._base_domain_": [
|
|
106
107
|
{
|
|
107
|
-
srcPath: "/_api/
|
|
108
|
+
srcPath: "/_api/subscription-options-server",
|
|
108
109
|
destPath: ""
|
|
109
110
|
}
|
|
110
111
|
],
|
|
111
|
-
|
|
112
|
+
"create.editorx": [
|
|
112
113
|
{
|
|
113
|
-
srcPath: "/_api/subscription-options-
|
|
114
|
+
srcPath: "/_api/subscription-options-server",
|
|
114
115
|
destPath: ""
|
|
115
116
|
}
|
|
116
117
|
],
|
|
117
118
|
"manage._base_domain_": [
|
|
118
119
|
{
|
|
119
|
-
srcPath: "/_api/subscription-options-
|
|
120
|
+
srcPath: "/_api/subscription-options-server",
|
|
120
121
|
destPath: ""
|
|
121
122
|
}
|
|
122
123
|
]
|
|
@@ -124,106 +125,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
|
|
|
124
125
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
126
|
}
|
|
126
127
|
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
127
|
-
function getSubscriptionOption(payload) {
|
|
128
|
-
function __getSubscriptionOption({ host }) {
|
|
129
|
-
const metadata = {
|
|
130
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
131
|
-
method: "GET",
|
|
132
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
133
|
-
packageName: PACKAGE_NAME,
|
|
134
|
-
migrationOptions: {
|
|
135
|
-
optInTransformResponse: true
|
|
136
|
-
},
|
|
137
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
138
|
-
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
139
|
-
),
|
|
140
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
141
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
142
|
-
{
|
|
143
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
144
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
145
|
-
}
|
|
146
|
-
])
|
|
147
|
-
};
|
|
148
|
-
return metadata;
|
|
149
|
-
}
|
|
150
|
-
return __getSubscriptionOption;
|
|
151
|
-
}
|
|
152
|
-
function getSubscriptionOptionsForProduct(payload) {
|
|
153
|
-
function __getSubscriptionOptionsForProduct({ host }) {
|
|
154
|
-
const metadata = {
|
|
155
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
156
|
-
method: "GET",
|
|
157
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
158
|
-
packageName: PACKAGE_NAME,
|
|
159
|
-
migrationOptions: {
|
|
160
|
-
optInTransformResponse: true
|
|
161
|
-
},
|
|
162
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
163
|
-
{
|
|
164
|
-
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
165
|
-
data: payload,
|
|
166
|
-
host
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
170
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
171
|
-
{
|
|
172
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
173
|
-
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
174
|
-
}
|
|
175
|
-
])
|
|
176
|
-
};
|
|
177
|
-
return metadata;
|
|
178
|
-
}
|
|
179
|
-
return __getSubscriptionOptionsForProduct;
|
|
180
|
-
}
|
|
181
|
-
function getProductIdsForSubscriptionOption(payload) {
|
|
182
|
-
function __getProductIdsForSubscriptionOption({ host }) {
|
|
183
|
-
const metadata = {
|
|
184
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
185
|
-
method: "GET",
|
|
186
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
187
|
-
packageName: PACKAGE_NAME,
|
|
188
|
-
migrationOptions: {
|
|
189
|
-
optInTransformResponse: true
|
|
190
|
-
},
|
|
191
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
192
|
-
{
|
|
193
|
-
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
194
|
-
data: payload,
|
|
195
|
-
host
|
|
196
|
-
}
|
|
197
|
-
),
|
|
198
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
199
|
-
};
|
|
200
|
-
return metadata;
|
|
201
|
-
}
|
|
202
|
-
return __getProductIdsForSubscriptionOption;
|
|
203
|
-
}
|
|
204
|
-
function getOneTimePurchasesStatus(payload) {
|
|
205
|
-
function __getOneTimePurchasesStatus({ host }) {
|
|
206
|
-
const metadata = {
|
|
207
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
208
|
-
method: "GET",
|
|
209
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
210
|
-
packageName: PACKAGE_NAME,
|
|
211
|
-
migrationOptions: {
|
|
212
|
-
optInTransformResponse: true
|
|
213
|
-
},
|
|
214
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
215
|
-
{
|
|
216
|
-
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
217
|
-
data: payload,
|
|
218
|
-
host
|
|
219
|
-
}
|
|
220
|
-
),
|
|
221
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
222
|
-
};
|
|
223
|
-
return metadata;
|
|
224
|
-
}
|
|
225
|
-
return __getOneTimePurchasesStatus;
|
|
226
|
-
}
|
|
227
128
|
function createSubscriptionOption(payload) {
|
|
228
129
|
function __createSubscriptionOption({ host }) {
|
|
229
130
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -450,134 +351,145 @@ function allowOneTimePurchases(payload) {
|
|
|
450
351
|
}
|
|
451
352
|
return __allowOneTimePurchases;
|
|
452
353
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
})(SubscriptionFrequency || {});
|
|
463
|
-
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
464
|
-
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
465
|
-
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
466
|
-
DiscountType2["PERCENT"] = "PERCENT";
|
|
467
|
-
return DiscountType2;
|
|
468
|
-
})(DiscountType || {});
|
|
469
|
-
async function getSubscriptionOption2(_id) {
|
|
470
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
471
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
472
|
-
const reqOpts = getSubscriptionOption(payload);
|
|
473
|
-
sideEffects?.onSiteCall?.();
|
|
474
|
-
try {
|
|
475
|
-
const result = await httpClient.request(reqOpts);
|
|
476
|
-
sideEffects?.onSuccess?.(result);
|
|
477
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
478
|
-
} catch (err) {
|
|
479
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
480
|
-
err,
|
|
481
|
-
{
|
|
482
|
-
spreadPathsToArguments: {},
|
|
483
|
-
explicitPathsToArguments: { id: "$[0]" },
|
|
484
|
-
singleArgumentUnchanged: false
|
|
354
|
+
function enableCustomerCancellation(payload) {
|
|
355
|
+
function __enableCustomerCancellation({ host }) {
|
|
356
|
+
const metadata = {
|
|
357
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
358
|
+
method: "PATCH",
|
|
359
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.EnableCustomerCancellation",
|
|
360
|
+
packageName: PACKAGE_NAME,
|
|
361
|
+
migrationOptions: {
|
|
362
|
+
optInTransformResponse: true
|
|
485
363
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
364
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
365
|
+
{
|
|
366
|
+
protoPath: "/v1/subscription-options/product/{productId}/enableCustomerCancellation",
|
|
367
|
+
data: payload,
|
|
368
|
+
host
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
data: payload
|
|
372
|
+
};
|
|
373
|
+
return metadata;
|
|
490
374
|
}
|
|
375
|
+
return __enableCustomerCancellation;
|
|
491
376
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
sideEffects?.onSiteCall?.();
|
|
502
|
-
try {
|
|
503
|
-
const result = await httpClient.request(reqOpts);
|
|
504
|
-
sideEffects?.onSuccess?.(result);
|
|
505
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
506
|
-
} catch (err) {
|
|
507
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
508
|
-
err,
|
|
509
|
-
{
|
|
510
|
-
spreadPathsToArguments: {},
|
|
511
|
-
explicitPathsToArguments: {
|
|
512
|
-
productId: "$[0]",
|
|
513
|
-
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
514
|
-
},
|
|
515
|
-
singleArgumentUnchanged: false
|
|
377
|
+
function getSubscriptionOption(payload) {
|
|
378
|
+
function __getSubscriptionOption({ host }) {
|
|
379
|
+
const metadata = {
|
|
380
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
381
|
+
method: "GET",
|
|
382
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
383
|
+
packageName: PACKAGE_NAME,
|
|
384
|
+
migrationOptions: {
|
|
385
|
+
optInTransformResponse: true
|
|
516
386
|
},
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
387
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
388
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
389
|
+
),
|
|
390
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
391
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
392
|
+
{
|
|
393
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
394
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
395
|
+
}
|
|
396
|
+
])
|
|
397
|
+
};
|
|
398
|
+
return metadata;
|
|
521
399
|
}
|
|
400
|
+
return __getSubscriptionOption;
|
|
522
401
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
);
|
|
533
|
-
sideEffects?.onSiteCall?.();
|
|
534
|
-
try {
|
|
535
|
-
const result = await httpClient.request(reqOpts);
|
|
536
|
-
sideEffects?.onSuccess?.(result);
|
|
537
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
538
|
-
} catch (err) {
|
|
539
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
540
|
-
err,
|
|
541
|
-
{
|
|
542
|
-
spreadPathsToArguments: {},
|
|
543
|
-
explicitPathsToArguments: {
|
|
544
|
-
id: "$[0]",
|
|
545
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
546
|
-
paging: "$[1].paging"
|
|
547
|
-
},
|
|
548
|
-
singleArgumentUnchanged: false
|
|
402
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
403
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
404
|
+
const metadata = {
|
|
405
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
406
|
+
method: "GET",
|
|
407
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
408
|
+
packageName: PACKAGE_NAME,
|
|
409
|
+
migrationOptions: {
|
|
410
|
+
optInTransformResponse: true
|
|
549
411
|
},
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
412
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
413
|
+
{
|
|
414
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
415
|
+
data: payload,
|
|
416
|
+
host
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
420
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
421
|
+
{
|
|
422
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
423
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
424
|
+
}
|
|
425
|
+
])
|
|
426
|
+
};
|
|
427
|
+
return metadata;
|
|
554
428
|
}
|
|
429
|
+
return __getSubscriptionOptionsForProduct;
|
|
555
430
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
sideEffects?.onSuccess?.(result);
|
|
566
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
567
|
-
} catch (err) {
|
|
568
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
569
|
-
err,
|
|
570
|
-
{
|
|
571
|
-
spreadPathsToArguments: {},
|
|
572
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
573
|
-
singleArgumentUnchanged: false
|
|
431
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
432
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
433
|
+
const metadata = {
|
|
434
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
435
|
+
method: "GET",
|
|
436
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
437
|
+
packageName: PACKAGE_NAME,
|
|
438
|
+
migrationOptions: {
|
|
439
|
+
optInTransformResponse: true
|
|
574
440
|
},
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
441
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
442
|
+
{
|
|
443
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
444
|
+
data: payload,
|
|
445
|
+
host
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
449
|
+
};
|
|
450
|
+
return metadata;
|
|
451
|
+
}
|
|
452
|
+
return __getProductIdsForSubscriptionOption;
|
|
453
|
+
}
|
|
454
|
+
function getOneTimePurchasesStatus(payload) {
|
|
455
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
456
|
+
const metadata = {
|
|
457
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
458
|
+
method: "GET",
|
|
459
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
460
|
+
packageName: PACKAGE_NAME,
|
|
461
|
+
migrationOptions: {
|
|
462
|
+
optInTransformResponse: true
|
|
463
|
+
},
|
|
464
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
465
|
+
{
|
|
466
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
467
|
+
data: payload,
|
|
468
|
+
host
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
472
|
+
};
|
|
473
|
+
return metadata;
|
|
579
474
|
}
|
|
475
|
+
return __getOneTimePurchasesStatus;
|
|
580
476
|
}
|
|
477
|
+
|
|
478
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
479
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
480
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
481
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
482
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
483
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
484
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
485
|
+
return SubscriptionFrequency2;
|
|
486
|
+
})(SubscriptionFrequency || {});
|
|
487
|
+
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
488
|
+
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
489
|
+
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
490
|
+
DiscountType2["PERCENT"] = "PERCENT";
|
|
491
|
+
return DiscountType2;
|
|
492
|
+
})(DiscountType || {});
|
|
581
493
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
582
494
|
const { httpClient, sideEffects } = arguments[1];
|
|
583
495
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -783,38 +695,145 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
783
695
|
throw transformedError;
|
|
784
696
|
}
|
|
785
697
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
);
|
|
698
|
+
async function enableCustomerCancellation2(productId, allowed) {
|
|
699
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
700
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
701
|
+
productId,
|
|
702
|
+
allowed
|
|
703
|
+
});
|
|
704
|
+
const reqOpts = enableCustomerCancellation(payload);
|
|
705
|
+
sideEffects?.onSiteCall?.();
|
|
706
|
+
try {
|
|
707
|
+
const result = await httpClient.request(reqOpts);
|
|
708
|
+
sideEffects?.onSuccess?.(result);
|
|
709
|
+
} catch (err) {
|
|
710
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
711
|
+
err,
|
|
712
|
+
{
|
|
713
|
+
spreadPathsToArguments: {},
|
|
714
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
715
|
+
singleArgumentUnchanged: false
|
|
716
|
+
},
|
|
717
|
+
["productId", "allowed"]
|
|
718
|
+
);
|
|
719
|
+
sideEffects?.onError?.(err);
|
|
720
|
+
throw transformedError;
|
|
721
|
+
}
|
|
794
722
|
}
|
|
795
|
-
function
|
|
796
|
-
|
|
723
|
+
async function getSubscriptionOption2(_id) {
|
|
724
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
725
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
726
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
727
|
+
sideEffects?.onSiteCall?.();
|
|
728
|
+
try {
|
|
729
|
+
const result = await httpClient.request(reqOpts);
|
|
730
|
+
sideEffects?.onSuccess?.(result);
|
|
731
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
732
|
+
} catch (err) {
|
|
733
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
734
|
+
err,
|
|
735
|
+
{
|
|
736
|
+
spreadPathsToArguments: {},
|
|
737
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
738
|
+
singleArgumentUnchanged: false
|
|
739
|
+
},
|
|
740
|
+
["_id"]
|
|
741
|
+
);
|
|
742
|
+
sideEffects?.onError?.(err);
|
|
743
|
+
throw transformedError;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
747
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
748
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
797
749
|
productId,
|
|
798
|
-
options
|
|
799
|
-
|
|
800
|
-
|
|
750
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
751
|
+
});
|
|
752
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
753
|
+
payload
|
|
801
754
|
);
|
|
755
|
+
sideEffects?.onSiteCall?.();
|
|
756
|
+
try {
|
|
757
|
+
const result = await httpClient.request(reqOpts);
|
|
758
|
+
sideEffects?.onSuccess?.(result);
|
|
759
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
760
|
+
} catch (err) {
|
|
761
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
762
|
+
err,
|
|
763
|
+
{
|
|
764
|
+
spreadPathsToArguments: {},
|
|
765
|
+
explicitPathsToArguments: {
|
|
766
|
+
productId: "$[0]",
|
|
767
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
768
|
+
},
|
|
769
|
+
singleArgumentUnchanged: false
|
|
770
|
+
},
|
|
771
|
+
["productId", "options"]
|
|
772
|
+
);
|
|
773
|
+
sideEffects?.onError?.(err);
|
|
774
|
+
throw transformedError;
|
|
775
|
+
}
|
|
802
776
|
}
|
|
803
|
-
function
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
777
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
778
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
779
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
780
|
+
id: _id,
|
|
781
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
782
|
+
paging: options?.paging
|
|
783
|
+
});
|
|
784
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
785
|
+
payload
|
|
809
786
|
);
|
|
787
|
+
sideEffects?.onSiteCall?.();
|
|
788
|
+
try {
|
|
789
|
+
const result = await httpClient.request(reqOpts);
|
|
790
|
+
sideEffects?.onSuccess?.(result);
|
|
791
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
792
|
+
} catch (err) {
|
|
793
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
794
|
+
err,
|
|
795
|
+
{
|
|
796
|
+
spreadPathsToArguments: {},
|
|
797
|
+
explicitPathsToArguments: {
|
|
798
|
+
id: "$[0]",
|
|
799
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
800
|
+
paging: "$[1].paging"
|
|
801
|
+
},
|
|
802
|
+
singleArgumentUnchanged: false
|
|
803
|
+
},
|
|
804
|
+
["_id", "options"]
|
|
805
|
+
);
|
|
806
|
+
sideEffects?.onError?.(err);
|
|
807
|
+
throw transformedError;
|
|
808
|
+
}
|
|
810
809
|
}
|
|
811
|
-
function
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
);
|
|
810
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
811
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
812
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
813
|
+
productId
|
|
814
|
+
});
|
|
815
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
816
|
+
sideEffects?.onSiteCall?.();
|
|
817
|
+
try {
|
|
818
|
+
const result = await httpClient.request(reqOpts);
|
|
819
|
+
sideEffects?.onSuccess?.(result);
|
|
820
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
821
|
+
} catch (err) {
|
|
822
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
823
|
+
err,
|
|
824
|
+
{
|
|
825
|
+
spreadPathsToArguments: {},
|
|
826
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
827
|
+
singleArgumentUnchanged: false
|
|
828
|
+
},
|
|
829
|
+
["productId"]
|
|
830
|
+
);
|
|
831
|
+
sideEffects?.onError?.(err);
|
|
832
|
+
throw transformedError;
|
|
833
|
+
}
|
|
817
834
|
}
|
|
835
|
+
|
|
836
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
818
837
|
function createSubscriptionOption3(httpClient) {
|
|
819
838
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
820
839
|
subscriptionOption,
|
|
@@ -874,13 +893,47 @@ function allowOneTimePurchases3(httpClient) {
|
|
|
874
893
|
{ httpClient }
|
|
875
894
|
);
|
|
876
895
|
}
|
|
896
|
+
function enableCustomerCancellation3(httpClient) {
|
|
897
|
+
return (productId, allowed) => enableCustomerCancellation2(
|
|
898
|
+
productId,
|
|
899
|
+
allowed,
|
|
900
|
+
// @ts-ignore
|
|
901
|
+
{ httpClient }
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
function getSubscriptionOption3(httpClient) {
|
|
905
|
+
return (_id) => getSubscriptionOption2(
|
|
906
|
+
_id,
|
|
907
|
+
// @ts-ignore
|
|
908
|
+
{ httpClient }
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
912
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
913
|
+
productId,
|
|
914
|
+
options,
|
|
915
|
+
// @ts-ignore
|
|
916
|
+
{ httpClient }
|
|
917
|
+
);
|
|
918
|
+
}
|
|
919
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
920
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
921
|
+
_id,
|
|
922
|
+
options,
|
|
923
|
+
// @ts-ignore
|
|
924
|
+
{ httpClient }
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
928
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
929
|
+
productId,
|
|
930
|
+
// @ts-ignore
|
|
931
|
+
{ httpClient }
|
|
932
|
+
);
|
|
933
|
+
}
|
|
877
934
|
|
|
878
935
|
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
879
936
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
880
|
-
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
881
|
-
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
882
|
-
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
883
|
-
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
884
937
|
var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
|
|
885
938
|
var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
|
|
886
939
|
var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
|
|
@@ -889,6 +942,11 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
889
942
|
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteSubscriptionOptions3);
|
|
890
943
|
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
|
|
891
944
|
var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(allowOneTimePurchases3);
|
|
945
|
+
var enableCustomerCancellation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(enableCustomerCancellation3);
|
|
946
|
+
var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
|
|
947
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
|
|
948
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
|
|
949
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
|
|
892
950
|
// Annotate the CommonJS export names for ESM import in node:
|
|
893
951
|
0 && (module.exports = {
|
|
894
952
|
DiscountType,
|
|
@@ -900,6 +958,7 @@ var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createREST
|
|
|
900
958
|
bulkUpdateSubscriptionOptions,
|
|
901
959
|
createSubscriptionOption,
|
|
902
960
|
deleteSubscriptionOption,
|
|
961
|
+
enableCustomerCancellation,
|
|
903
962
|
getOneTimePurchasesStatus,
|
|
904
963
|
getProductIdsForSubscriptionOption,
|
|
905
964
|
getSubscriptionOption,
|