@wix/auto_sdk_stores_subscription-options 1.0.39 → 1.0.40
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
|
@@ -48,35 +48,6 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
48
48
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
49
49
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
50
50
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
51
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
52
|
-
const domainToMappings = {
|
|
53
|
-
"api._api_base_domain_": [
|
|
54
|
-
{
|
|
55
|
-
srcPath: "/wix-ecommerce-plans-reader",
|
|
56
|
-
destPath: ""
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"www._base_domain_": [
|
|
60
|
-
{
|
|
61
|
-
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
62
|
-
destPath: ""
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
_: [
|
|
66
|
-
{
|
|
67
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
68
|
-
destPath: ""
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"manage._base_domain_": [
|
|
72
|
-
{
|
|
73
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
74
|
-
destPath: ""
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
};
|
|
78
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
79
|
-
}
|
|
80
51
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
81
52
|
const domainToMappings = {
|
|
82
53
|
"api._api_base_domain_": [
|
|
@@ -124,7 +95,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
124
95
|
};
|
|
125
96
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
126
97
|
}
|
|
98
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
99
|
+
const domainToMappings = {
|
|
100
|
+
"api._api_base_domain_": [
|
|
101
|
+
{
|
|
102
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
103
|
+
destPath: ""
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"www._base_domain_": [
|
|
107
|
+
{
|
|
108
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
109
|
+
destPath: ""
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
_: [
|
|
113
|
+
{
|
|
114
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
115
|
+
destPath: ""
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"manage._base_domain_": [
|
|
119
|
+
{
|
|
120
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
121
|
+
destPath: ""
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
126
|
+
}
|
|
127
127
|
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
128
|
+
function getSubscriptionOption(payload) {
|
|
129
|
+
function __getSubscriptionOption({ host }) {
|
|
130
|
+
const metadata = {
|
|
131
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
132
|
+
method: "GET",
|
|
133
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
134
|
+
packageName: PACKAGE_NAME,
|
|
135
|
+
migrationOptions: {
|
|
136
|
+
optInTransformResponse: true
|
|
137
|
+
},
|
|
138
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
139
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
140
|
+
),
|
|
141
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
142
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
143
|
+
{
|
|
144
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
145
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
146
|
+
}
|
|
147
|
+
])
|
|
148
|
+
};
|
|
149
|
+
return metadata;
|
|
150
|
+
}
|
|
151
|
+
return __getSubscriptionOption;
|
|
152
|
+
}
|
|
153
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
154
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
155
|
+
const metadata = {
|
|
156
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
157
|
+
method: "GET",
|
|
158
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
159
|
+
packageName: PACKAGE_NAME,
|
|
160
|
+
migrationOptions: {
|
|
161
|
+
optInTransformResponse: true
|
|
162
|
+
},
|
|
163
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
164
|
+
{
|
|
165
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
166
|
+
data: payload,
|
|
167
|
+
host
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
171
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
172
|
+
{
|
|
173
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
174
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
175
|
+
}
|
|
176
|
+
])
|
|
177
|
+
};
|
|
178
|
+
return metadata;
|
|
179
|
+
}
|
|
180
|
+
return __getSubscriptionOptionsForProduct;
|
|
181
|
+
}
|
|
182
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
183
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
184
|
+
const metadata = {
|
|
185
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
186
|
+
method: "GET",
|
|
187
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
188
|
+
packageName: PACKAGE_NAME,
|
|
189
|
+
migrationOptions: {
|
|
190
|
+
optInTransformResponse: true
|
|
191
|
+
},
|
|
192
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
193
|
+
{
|
|
194
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
195
|
+
data: payload,
|
|
196
|
+
host
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
200
|
+
};
|
|
201
|
+
return metadata;
|
|
202
|
+
}
|
|
203
|
+
return __getProductIdsForSubscriptionOption;
|
|
204
|
+
}
|
|
205
|
+
function getOneTimePurchasesStatus(payload) {
|
|
206
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
207
|
+
const metadata = {
|
|
208
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
209
|
+
method: "GET",
|
|
210
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
211
|
+
packageName: PACKAGE_NAME,
|
|
212
|
+
migrationOptions: {
|
|
213
|
+
optInTransformResponse: true
|
|
214
|
+
},
|
|
215
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
216
|
+
{
|
|
217
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
218
|
+
data: payload,
|
|
219
|
+
host
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
223
|
+
};
|
|
224
|
+
return metadata;
|
|
225
|
+
}
|
|
226
|
+
return __getOneTimePurchasesStatus;
|
|
227
|
+
}
|
|
128
228
|
function createSubscriptionOption(payload) {
|
|
129
229
|
function __createSubscriptionOption({ host }) {
|
|
130
230
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -374,106 +474,6 @@ function enableCustomerCancellation(payload) {
|
|
|
374
474
|
}
|
|
375
475
|
return __enableCustomerCancellation;
|
|
376
476
|
}
|
|
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
|
|
386
|
-
},
|
|
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;
|
|
399
|
-
}
|
|
400
|
-
return __getSubscriptionOption;
|
|
401
|
-
}
|
|
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
|
|
411
|
-
},
|
|
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;
|
|
428
|
-
}
|
|
429
|
-
return __getSubscriptionOptionsForProduct;
|
|
430
|
-
}
|
|
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
|
|
440
|
-
},
|
|
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;
|
|
474
|
-
}
|
|
475
|
-
return __getOneTimePurchasesStatus;
|
|
476
|
-
}
|
|
477
477
|
|
|
478
478
|
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
479
479
|
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
@@ -490,12 +490,10 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
|
490
490
|
DiscountType2["PERCENT"] = "PERCENT";
|
|
491
491
|
return DiscountType2;
|
|
492
492
|
})(DiscountType || {});
|
|
493
|
-
async function
|
|
493
|
+
async function getSubscriptionOption2(_id) {
|
|
494
494
|
const { httpClient, sideEffects } = arguments[1];
|
|
495
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
496
|
-
|
|
497
|
-
});
|
|
498
|
-
const reqOpts = createSubscriptionOption(payload);
|
|
495
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
496
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
499
497
|
sideEffects?.onSiteCall?.();
|
|
500
498
|
try {
|
|
501
499
|
const result = await httpClient.request(reqOpts);
|
|
@@ -506,70 +504,85 @@ async function createSubscriptionOption2(subscriptionOption) {
|
|
|
506
504
|
err,
|
|
507
505
|
{
|
|
508
506
|
spreadPathsToArguments: {},
|
|
509
|
-
explicitPathsToArguments: {
|
|
507
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
510
508
|
singleArgumentUnchanged: false
|
|
511
509
|
},
|
|
512
|
-
["
|
|
510
|
+
["_id"]
|
|
513
511
|
);
|
|
514
512
|
sideEffects?.onError?.(err);
|
|
515
513
|
throw transformedError;
|
|
516
514
|
}
|
|
517
515
|
}
|
|
518
|
-
async function
|
|
516
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
519
517
|
const { httpClient, sideEffects } = arguments[2];
|
|
520
518
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
521
|
-
|
|
519
|
+
productId,
|
|
520
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
522
521
|
});
|
|
523
|
-
const reqOpts =
|
|
522
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
523
|
+
payload
|
|
524
|
+
);
|
|
524
525
|
sideEffects?.onSiteCall?.();
|
|
525
526
|
try {
|
|
526
527
|
const result = await httpClient.request(reqOpts);
|
|
527
528
|
sideEffects?.onSuccess?.(result);
|
|
528
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)
|
|
529
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
529
530
|
} catch (err) {
|
|
530
531
|
const transformedError = (0, import_transform_error.transformError)(
|
|
531
532
|
err,
|
|
532
533
|
{
|
|
533
|
-
spreadPathsToArguments: {
|
|
534
|
-
explicitPathsToArguments: {
|
|
534
|
+
spreadPathsToArguments: {},
|
|
535
|
+
explicitPathsToArguments: {
|
|
536
|
+
productId: "$[0]",
|
|
537
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
538
|
+
},
|
|
535
539
|
singleArgumentUnchanged: false
|
|
536
540
|
},
|
|
537
|
-
["
|
|
541
|
+
["productId", "options"]
|
|
538
542
|
);
|
|
539
543
|
sideEffects?.onError?.(err);
|
|
540
544
|
throw transformedError;
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
|
-
async function
|
|
544
|
-
const { httpClient, sideEffects } = arguments[
|
|
545
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
546
|
-
|
|
547
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
548
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
549
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
550
|
+
id: _id,
|
|
551
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
552
|
+
paging: options?.paging
|
|
553
|
+
});
|
|
554
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
555
|
+
payload
|
|
556
|
+
);
|
|
547
557
|
sideEffects?.onSiteCall?.();
|
|
548
558
|
try {
|
|
549
559
|
const result = await httpClient.request(reqOpts);
|
|
550
560
|
sideEffects?.onSuccess?.(result);
|
|
561
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
551
562
|
} catch (err) {
|
|
552
563
|
const transformedError = (0, import_transform_error.transformError)(
|
|
553
564
|
err,
|
|
554
565
|
{
|
|
555
566
|
spreadPathsToArguments: {},
|
|
556
|
-
explicitPathsToArguments: {
|
|
567
|
+
explicitPathsToArguments: {
|
|
568
|
+
id: "$[0]",
|
|
569
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
570
|
+
paging: "$[1].paging"
|
|
571
|
+
},
|
|
557
572
|
singleArgumentUnchanged: false
|
|
558
573
|
},
|
|
559
|
-
["_id"]
|
|
574
|
+
["_id", "options"]
|
|
560
575
|
);
|
|
561
576
|
sideEffects?.onError?.(err);
|
|
562
577
|
throw transformedError;
|
|
563
578
|
}
|
|
564
579
|
}
|
|
565
|
-
async function
|
|
580
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
566
581
|
const { httpClient, sideEffects } = arguments[1];
|
|
567
582
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
568
|
-
|
|
583
|
+
productId
|
|
569
584
|
});
|
|
570
|
-
const reqOpts =
|
|
571
|
-
payload
|
|
572
|
-
);
|
|
585
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
573
586
|
sideEffects?.onSiteCall?.();
|
|
574
587
|
try {
|
|
575
588
|
const result = await httpClient.request(reqOpts);
|
|
@@ -580,75 +593,69 @@ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
|
580
593
|
err,
|
|
581
594
|
{
|
|
582
595
|
spreadPathsToArguments: {},
|
|
583
|
-
explicitPathsToArguments: {
|
|
596
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
584
597
|
singleArgumentUnchanged: false
|
|
585
598
|
},
|
|
586
|
-
["
|
|
599
|
+
["productId"]
|
|
587
600
|
);
|
|
588
601
|
sideEffects?.onError?.(err);
|
|
589
602
|
throw transformedError;
|
|
590
603
|
}
|
|
591
604
|
}
|
|
592
|
-
async function
|
|
605
|
+
async function createSubscriptionOption2(subscriptionOption) {
|
|
593
606
|
const { httpClient, sideEffects } = arguments[1];
|
|
594
607
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
595
|
-
|
|
608
|
+
subscriptionOption
|
|
596
609
|
});
|
|
597
|
-
const reqOpts =
|
|
598
|
-
payload
|
|
599
|
-
);
|
|
610
|
+
const reqOpts = createSubscriptionOption(payload);
|
|
600
611
|
sideEffects?.onSiteCall?.();
|
|
601
612
|
try {
|
|
602
613
|
const result = await httpClient.request(reqOpts);
|
|
603
614
|
sideEffects?.onSuccess?.(result);
|
|
604
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
615
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
605
616
|
} catch (err) {
|
|
606
617
|
const transformedError = (0, import_transform_error.transformError)(
|
|
607
618
|
err,
|
|
608
619
|
{
|
|
609
620
|
spreadPathsToArguments: {},
|
|
610
|
-
explicitPathsToArguments: {
|
|
621
|
+
explicitPathsToArguments: { subscriptionOption: "$[0]" },
|
|
611
622
|
singleArgumentUnchanged: false
|
|
612
623
|
},
|
|
613
|
-
["
|
|
624
|
+
["subscriptionOption"]
|
|
614
625
|
);
|
|
615
626
|
sideEffects?.onError?.(err);
|
|
616
627
|
throw transformedError;
|
|
617
628
|
}
|
|
618
629
|
}
|
|
619
|
-
async function
|
|
620
|
-
const { httpClient, sideEffects } = arguments[
|
|
621
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
);
|
|
630
|
+
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
631
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
632
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
633
|
+
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
634
|
+
});
|
|
635
|
+
const reqOpts = updateSubscriptionOption(payload);
|
|
625
636
|
sideEffects?.onSiteCall?.();
|
|
626
637
|
try {
|
|
627
638
|
const result = await httpClient.request(reqOpts);
|
|
628
639
|
sideEffects?.onSuccess?.(result);
|
|
640
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
629
641
|
} catch (err) {
|
|
630
642
|
const transformedError = (0, import_transform_error.transformError)(
|
|
631
643
|
err,
|
|
632
644
|
{
|
|
633
|
-
spreadPathsToArguments: {},
|
|
634
|
-
explicitPathsToArguments: {
|
|
645
|
+
spreadPathsToArguments: { subscriptionOption: "$[1]" },
|
|
646
|
+
explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
|
|
635
647
|
singleArgumentUnchanged: false
|
|
636
648
|
},
|
|
637
|
-
["
|
|
649
|
+
["_id", "subscriptionOption"]
|
|
638
650
|
);
|
|
639
651
|
sideEffects?.onError?.(err);
|
|
640
652
|
throw transformedError;
|
|
641
653
|
}
|
|
642
654
|
}
|
|
643
|
-
async function
|
|
644
|
-
const { httpClient, sideEffects } = arguments[
|
|
645
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
646
|
-
|
|
647
|
-
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
648
|
-
});
|
|
649
|
-
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
650
|
-
payload
|
|
651
|
-
);
|
|
655
|
+
async function deleteSubscriptionOption2(_id) {
|
|
656
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
657
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
658
|
+
const reqOpts = deleteSubscriptionOption(payload);
|
|
652
659
|
sideEffects?.onSiteCall?.();
|
|
653
660
|
try {
|
|
654
661
|
const result = await httpClient.request(reqOpts);
|
|
@@ -658,105 +665,106 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
|
658
665
|
err,
|
|
659
666
|
{
|
|
660
667
|
spreadPathsToArguments: {},
|
|
661
|
-
explicitPathsToArguments: {
|
|
662
|
-
productId: "$[0]",
|
|
663
|
-
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
664
|
-
},
|
|
668
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
665
669
|
singleArgumentUnchanged: false
|
|
666
670
|
},
|
|
667
|
-
["
|
|
671
|
+
["_id"]
|
|
668
672
|
);
|
|
669
673
|
sideEffects?.onError?.(err);
|
|
670
674
|
throw transformedError;
|
|
671
675
|
}
|
|
672
676
|
}
|
|
673
|
-
async function
|
|
674
|
-
const { httpClient, sideEffects } = arguments[
|
|
677
|
+
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
678
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
675
679
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
676
|
-
|
|
677
|
-
allowed
|
|
680
|
+
subscriptionOptions
|
|
678
681
|
});
|
|
679
|
-
const reqOpts =
|
|
682
|
+
const reqOpts = bulkCreateSubscriptionOptions(
|
|
683
|
+
payload
|
|
684
|
+
);
|
|
680
685
|
sideEffects?.onSiteCall?.();
|
|
681
686
|
try {
|
|
682
687
|
const result = await httpClient.request(reqOpts);
|
|
683
688
|
sideEffects?.onSuccess?.(result);
|
|
689
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
684
690
|
} catch (err) {
|
|
685
691
|
const transformedError = (0, import_transform_error.transformError)(
|
|
686
692
|
err,
|
|
687
693
|
{
|
|
688
694
|
spreadPathsToArguments: {},
|
|
689
|
-
explicitPathsToArguments: {
|
|
695
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
690
696
|
singleArgumentUnchanged: false
|
|
691
697
|
},
|
|
692
|
-
["
|
|
698
|
+
["subscriptionOptions"]
|
|
693
699
|
);
|
|
694
700
|
sideEffects?.onError?.(err);
|
|
695
701
|
throw transformedError;
|
|
696
702
|
}
|
|
697
703
|
}
|
|
698
|
-
async function
|
|
699
|
-
const { httpClient, sideEffects } = arguments[
|
|
704
|
+
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
705
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
700
706
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
701
|
-
|
|
702
|
-
allowed
|
|
707
|
+
subscriptionOptions
|
|
703
708
|
});
|
|
704
|
-
const reqOpts =
|
|
709
|
+
const reqOpts = bulkUpdateSubscriptionOptions(
|
|
710
|
+
payload
|
|
711
|
+
);
|
|
705
712
|
sideEffects?.onSiteCall?.();
|
|
706
713
|
try {
|
|
707
714
|
const result = await httpClient.request(reqOpts);
|
|
708
715
|
sideEffects?.onSuccess?.(result);
|
|
716
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
709
717
|
} catch (err) {
|
|
710
718
|
const transformedError = (0, import_transform_error.transformError)(
|
|
711
719
|
err,
|
|
712
720
|
{
|
|
713
721
|
spreadPathsToArguments: {},
|
|
714
|
-
explicitPathsToArguments: {
|
|
722
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
715
723
|
singleArgumentUnchanged: false
|
|
716
724
|
},
|
|
717
|
-
["
|
|
725
|
+
["subscriptionOptions"]
|
|
718
726
|
);
|
|
719
727
|
sideEffects?.onError?.(err);
|
|
720
728
|
throw transformedError;
|
|
721
729
|
}
|
|
722
730
|
}
|
|
723
|
-
async function
|
|
731
|
+
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
724
732
|
const { httpClient, sideEffects } = arguments[1];
|
|
725
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
726
|
-
const reqOpts =
|
|
733
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
|
|
734
|
+
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
735
|
+
payload
|
|
736
|
+
);
|
|
727
737
|
sideEffects?.onSiteCall?.();
|
|
728
738
|
try {
|
|
729
739
|
const result = await httpClient.request(reqOpts);
|
|
730
740
|
sideEffects?.onSuccess?.(result);
|
|
731
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
732
741
|
} catch (err) {
|
|
733
742
|
const transformedError = (0, import_transform_error.transformError)(
|
|
734
743
|
err,
|
|
735
744
|
{
|
|
736
745
|
spreadPathsToArguments: {},
|
|
737
|
-
explicitPathsToArguments: {
|
|
746
|
+
explicitPathsToArguments: { ids: "$[0]" },
|
|
738
747
|
singleArgumentUnchanged: false
|
|
739
748
|
},
|
|
740
|
-
["
|
|
749
|
+
["ids"]
|
|
741
750
|
);
|
|
742
751
|
sideEffects?.onError?.(err);
|
|
743
752
|
throw transformedError;
|
|
744
753
|
}
|
|
745
754
|
}
|
|
746
|
-
async function
|
|
755
|
+
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
747
756
|
const { httpClient, sideEffects } = arguments[2];
|
|
748
757
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
749
758
|
productId,
|
|
750
|
-
|
|
759
|
+
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
751
760
|
});
|
|
752
|
-
const reqOpts =
|
|
761
|
+
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
753
762
|
payload
|
|
754
763
|
);
|
|
755
764
|
sideEffects?.onSiteCall?.();
|
|
756
765
|
try {
|
|
757
766
|
const result = await httpClient.request(reqOpts);
|
|
758
767
|
sideEffects?.onSuccess?.(result);
|
|
759
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
760
768
|
} catch (err) {
|
|
761
769
|
const transformedError = (0, import_transform_error.transformError)(
|
|
762
770
|
err,
|
|
@@ -764,7 +772,7 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
|
764
772
|
spreadPathsToArguments: {},
|
|
765
773
|
explicitPathsToArguments: {
|
|
766
774
|
productId: "$[0]",
|
|
767
|
-
|
|
775
|
+
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
768
776
|
},
|
|
769
777
|
singleArgumentUnchanged: false
|
|
770
778
|
},
|
|
@@ -774,59 +782,51 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
|
774
782
|
throw transformedError;
|
|
775
783
|
}
|
|
776
784
|
}
|
|
777
|
-
async function
|
|
785
|
+
async function allowOneTimePurchases2(productId, allowed) {
|
|
778
786
|
const { httpClient, sideEffects } = arguments[2];
|
|
779
787
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
paging: options?.paging
|
|
788
|
+
productId,
|
|
789
|
+
allowed
|
|
783
790
|
});
|
|
784
|
-
const reqOpts =
|
|
785
|
-
payload
|
|
786
|
-
);
|
|
791
|
+
const reqOpts = allowOneTimePurchases(payload);
|
|
787
792
|
sideEffects?.onSiteCall?.();
|
|
788
793
|
try {
|
|
789
794
|
const result = await httpClient.request(reqOpts);
|
|
790
795
|
sideEffects?.onSuccess?.(result);
|
|
791
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
792
796
|
} catch (err) {
|
|
793
797
|
const transformedError = (0, import_transform_error.transformError)(
|
|
794
798
|
err,
|
|
795
799
|
{
|
|
796
800
|
spreadPathsToArguments: {},
|
|
797
|
-
explicitPathsToArguments: {
|
|
798
|
-
id: "$[0]",
|
|
799
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
800
|
-
paging: "$[1].paging"
|
|
801
|
-
},
|
|
801
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
802
802
|
singleArgumentUnchanged: false
|
|
803
803
|
},
|
|
804
|
-
["
|
|
804
|
+
["productId", "allowed"]
|
|
805
805
|
);
|
|
806
806
|
sideEffects?.onError?.(err);
|
|
807
807
|
throw transformedError;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
async function
|
|
811
|
-
const { httpClient, sideEffects } = arguments[
|
|
810
|
+
async function enableCustomerCancellation2(productId, allowed) {
|
|
811
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
812
812
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
813
|
-
productId
|
|
813
|
+
productId,
|
|
814
|
+
allowed
|
|
814
815
|
});
|
|
815
|
-
const reqOpts =
|
|
816
|
+
const reqOpts = enableCustomerCancellation(payload);
|
|
816
817
|
sideEffects?.onSiteCall?.();
|
|
817
818
|
try {
|
|
818
819
|
const result = await httpClient.request(reqOpts);
|
|
819
820
|
sideEffects?.onSuccess?.(result);
|
|
820
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
821
821
|
} catch (err) {
|
|
822
822
|
const transformedError = (0, import_transform_error.transformError)(
|
|
823
823
|
err,
|
|
824
824
|
{
|
|
825
825
|
spreadPathsToArguments: {},
|
|
826
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
826
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
827
827
|
singleArgumentUnchanged: false
|
|
828
828
|
},
|
|
829
|
-
["productId"]
|
|
829
|
+
["productId", "allowed"]
|
|
830
830
|
);
|
|
831
831
|
sideEffects?.onError?.(err);
|
|
832
832
|
throw transformedError;
|