@wix/auto_sdk_stores_subscription-options 1.0.33 → 1.0.34
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
|
@@ -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,106 +437,6 @@ function enableCustomerCancellation(payload) {
|
|
|
337
437
|
}
|
|
338
438
|
return __enableCustomerCancellation;
|
|
339
439
|
}
|
|
340
|
-
function getSubscriptionOption(payload) {
|
|
341
|
-
function __getSubscriptionOption({ host }) {
|
|
342
|
-
const metadata = {
|
|
343
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
344
|
-
method: "GET",
|
|
345
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
346
|
-
packageName: PACKAGE_NAME,
|
|
347
|
-
migrationOptions: {
|
|
348
|
-
optInTransformResponse: true
|
|
349
|
-
},
|
|
350
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
351
|
-
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
352
|
-
),
|
|
353
|
-
params: toURLSearchParams(payload),
|
|
354
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
355
|
-
{
|
|
356
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
357
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
358
|
-
}
|
|
359
|
-
])
|
|
360
|
-
};
|
|
361
|
-
return metadata;
|
|
362
|
-
}
|
|
363
|
-
return __getSubscriptionOption;
|
|
364
|
-
}
|
|
365
|
-
function getSubscriptionOptionsForProduct(payload) {
|
|
366
|
-
function __getSubscriptionOptionsForProduct({ host }) {
|
|
367
|
-
const metadata = {
|
|
368
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
369
|
-
method: "GET",
|
|
370
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
371
|
-
packageName: PACKAGE_NAME,
|
|
372
|
-
migrationOptions: {
|
|
373
|
-
optInTransformResponse: true
|
|
374
|
-
},
|
|
375
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
376
|
-
{
|
|
377
|
-
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
378
|
-
data: payload,
|
|
379
|
-
host
|
|
380
|
-
}
|
|
381
|
-
),
|
|
382
|
-
params: toURLSearchParams(payload),
|
|
383
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
384
|
-
{
|
|
385
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
386
|
-
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
387
|
-
}
|
|
388
|
-
])
|
|
389
|
-
};
|
|
390
|
-
return metadata;
|
|
391
|
-
}
|
|
392
|
-
return __getSubscriptionOptionsForProduct;
|
|
393
|
-
}
|
|
394
|
-
function getProductIdsForSubscriptionOption(payload) {
|
|
395
|
-
function __getProductIdsForSubscriptionOption({ host }) {
|
|
396
|
-
const metadata = {
|
|
397
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
398
|
-
method: "GET",
|
|
399
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
400
|
-
packageName: PACKAGE_NAME,
|
|
401
|
-
migrationOptions: {
|
|
402
|
-
optInTransformResponse: true
|
|
403
|
-
},
|
|
404
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
405
|
-
{
|
|
406
|
-
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
407
|
-
data: payload,
|
|
408
|
-
host
|
|
409
|
-
}
|
|
410
|
-
),
|
|
411
|
-
params: toURLSearchParams(payload)
|
|
412
|
-
};
|
|
413
|
-
return metadata;
|
|
414
|
-
}
|
|
415
|
-
return __getProductIdsForSubscriptionOption;
|
|
416
|
-
}
|
|
417
|
-
function getOneTimePurchasesStatus(payload) {
|
|
418
|
-
function __getOneTimePurchasesStatus({ host }) {
|
|
419
|
-
const metadata = {
|
|
420
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
421
|
-
method: "GET",
|
|
422
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
423
|
-
packageName: PACKAGE_NAME,
|
|
424
|
-
migrationOptions: {
|
|
425
|
-
optInTransformResponse: true
|
|
426
|
-
},
|
|
427
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
428
|
-
{
|
|
429
|
-
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
430
|
-
data: payload,
|
|
431
|
-
host
|
|
432
|
-
}
|
|
433
|
-
),
|
|
434
|
-
params: toURLSearchParams(payload)
|
|
435
|
-
};
|
|
436
|
-
return metadata;
|
|
437
|
-
}
|
|
438
|
-
return __getOneTimePurchasesStatus;
|
|
439
|
-
}
|
|
440
440
|
|
|
441
441
|
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
442
442
|
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
@@ -453,12 +453,10 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
|
453
453
|
DiscountType2["PERCENT"] = "PERCENT";
|
|
454
454
|
return DiscountType2;
|
|
455
455
|
})(DiscountType || {});
|
|
456
|
-
async function
|
|
456
|
+
async function getSubscriptionOption2(_id) {
|
|
457
457
|
const { httpClient, sideEffects } = arguments[1];
|
|
458
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
459
|
-
|
|
460
|
-
});
|
|
461
|
-
const reqOpts = createSubscriptionOption(payload);
|
|
458
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
459
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
462
460
|
sideEffects?.onSiteCall?.();
|
|
463
461
|
try {
|
|
464
462
|
const result = await httpClient.request(reqOpts);
|
|
@@ -469,70 +467,85 @@ async function createSubscriptionOption2(subscriptionOption) {
|
|
|
469
467
|
err,
|
|
470
468
|
{
|
|
471
469
|
spreadPathsToArguments: {},
|
|
472
|
-
explicitPathsToArguments: {
|
|
470
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
473
471
|
singleArgumentUnchanged: false
|
|
474
472
|
},
|
|
475
|
-
["
|
|
473
|
+
["_id"]
|
|
476
474
|
);
|
|
477
475
|
sideEffects?.onError?.(err);
|
|
478
476
|
throw transformedError;
|
|
479
477
|
}
|
|
480
478
|
}
|
|
481
|
-
async function
|
|
479
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
482
480
|
const { httpClient, sideEffects } = arguments[2];
|
|
483
481
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
484
|
-
|
|
482
|
+
productId,
|
|
483
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
485
484
|
});
|
|
486
|
-
const reqOpts =
|
|
485
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
486
|
+
payload
|
|
487
|
+
);
|
|
487
488
|
sideEffects?.onSiteCall?.();
|
|
488
489
|
try {
|
|
489
490
|
const result = await httpClient.request(reqOpts);
|
|
490
491
|
sideEffects?.onSuccess?.(result);
|
|
491
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data)
|
|
492
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
492
493
|
} catch (err) {
|
|
493
494
|
const transformedError = sdkTransformError(
|
|
494
495
|
err,
|
|
495
496
|
{
|
|
496
|
-
spreadPathsToArguments: {
|
|
497
|
-
explicitPathsToArguments: {
|
|
497
|
+
spreadPathsToArguments: {},
|
|
498
|
+
explicitPathsToArguments: {
|
|
499
|
+
productId: "$[0]",
|
|
500
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
501
|
+
},
|
|
498
502
|
singleArgumentUnchanged: false
|
|
499
503
|
},
|
|
500
|
-
["
|
|
504
|
+
["productId", "options"]
|
|
501
505
|
);
|
|
502
506
|
sideEffects?.onError?.(err);
|
|
503
507
|
throw transformedError;
|
|
504
508
|
}
|
|
505
509
|
}
|
|
506
|
-
async function
|
|
507
|
-
const { httpClient, sideEffects } = arguments[
|
|
508
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
509
|
-
|
|
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
|
+
);
|
|
510
520
|
sideEffects?.onSiteCall?.();
|
|
511
521
|
try {
|
|
512
522
|
const result = await httpClient.request(reqOpts);
|
|
513
523
|
sideEffects?.onSuccess?.(result);
|
|
524
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
514
525
|
} catch (err) {
|
|
515
526
|
const transformedError = sdkTransformError(
|
|
516
527
|
err,
|
|
517
528
|
{
|
|
518
529
|
spreadPathsToArguments: {},
|
|
519
|
-
explicitPathsToArguments: {
|
|
530
|
+
explicitPathsToArguments: {
|
|
531
|
+
id: "$[0]",
|
|
532
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
533
|
+
paging: "$[1].paging"
|
|
534
|
+
},
|
|
520
535
|
singleArgumentUnchanged: false
|
|
521
536
|
},
|
|
522
|
-
["_id"]
|
|
537
|
+
["_id", "options"]
|
|
523
538
|
);
|
|
524
539
|
sideEffects?.onError?.(err);
|
|
525
540
|
throw transformedError;
|
|
526
541
|
}
|
|
527
542
|
}
|
|
528
|
-
async function
|
|
543
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
529
544
|
const { httpClient, sideEffects } = arguments[1];
|
|
530
545
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
531
|
-
|
|
546
|
+
productId
|
|
532
547
|
});
|
|
533
|
-
const reqOpts =
|
|
534
|
-
payload
|
|
535
|
-
);
|
|
548
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
536
549
|
sideEffects?.onSiteCall?.();
|
|
537
550
|
try {
|
|
538
551
|
const result = await httpClient.request(reqOpts);
|
|
@@ -543,75 +556,69 @@ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
|
543
556
|
err,
|
|
544
557
|
{
|
|
545
558
|
spreadPathsToArguments: {},
|
|
546
|
-
explicitPathsToArguments: {
|
|
559
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
547
560
|
singleArgumentUnchanged: false
|
|
548
561
|
},
|
|
549
|
-
["
|
|
562
|
+
["productId"]
|
|
550
563
|
);
|
|
551
564
|
sideEffects?.onError?.(err);
|
|
552
565
|
throw transformedError;
|
|
553
566
|
}
|
|
554
567
|
}
|
|
555
|
-
async function
|
|
568
|
+
async function createSubscriptionOption2(subscriptionOption) {
|
|
556
569
|
const { httpClient, sideEffects } = arguments[1];
|
|
557
570
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
558
|
-
|
|
571
|
+
subscriptionOption
|
|
559
572
|
});
|
|
560
|
-
const reqOpts =
|
|
561
|
-
payload
|
|
562
|
-
);
|
|
573
|
+
const reqOpts = createSubscriptionOption(payload);
|
|
563
574
|
sideEffects?.onSiteCall?.();
|
|
564
575
|
try {
|
|
565
576
|
const result = await httpClient.request(reqOpts);
|
|
566
577
|
sideEffects?.onSuccess?.(result);
|
|
567
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
578
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
568
579
|
} catch (err) {
|
|
569
580
|
const transformedError = sdkTransformError(
|
|
570
581
|
err,
|
|
571
582
|
{
|
|
572
583
|
spreadPathsToArguments: {},
|
|
573
|
-
explicitPathsToArguments: {
|
|
584
|
+
explicitPathsToArguments: { subscriptionOption: "$[0]" },
|
|
574
585
|
singleArgumentUnchanged: false
|
|
575
586
|
},
|
|
576
|
-
["
|
|
587
|
+
["subscriptionOption"]
|
|
577
588
|
);
|
|
578
589
|
sideEffects?.onError?.(err);
|
|
579
590
|
throw transformedError;
|
|
580
591
|
}
|
|
581
592
|
}
|
|
582
|
-
async function
|
|
583
|
-
const { httpClient, sideEffects } = arguments[
|
|
584
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
);
|
|
593
|
+
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
594
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
595
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
596
|
+
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
597
|
+
});
|
|
598
|
+
const reqOpts = updateSubscriptionOption(payload);
|
|
588
599
|
sideEffects?.onSiteCall?.();
|
|
589
600
|
try {
|
|
590
601
|
const result = await httpClient.request(reqOpts);
|
|
591
602
|
sideEffects?.onSuccess?.(result);
|
|
603
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
592
604
|
} catch (err) {
|
|
593
605
|
const transformedError = sdkTransformError(
|
|
594
606
|
err,
|
|
595
607
|
{
|
|
596
|
-
spreadPathsToArguments: {},
|
|
597
|
-
explicitPathsToArguments: {
|
|
608
|
+
spreadPathsToArguments: { subscriptionOption: "$[1]" },
|
|
609
|
+
explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
|
|
598
610
|
singleArgumentUnchanged: false
|
|
599
611
|
},
|
|
600
|
-
["
|
|
612
|
+
["_id", "subscriptionOption"]
|
|
601
613
|
);
|
|
602
614
|
sideEffects?.onError?.(err);
|
|
603
615
|
throw transformedError;
|
|
604
616
|
}
|
|
605
617
|
}
|
|
606
|
-
async function
|
|
607
|
-
const { httpClient, sideEffects } = arguments[
|
|
608
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
609
|
-
|
|
610
|
-
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
611
|
-
});
|
|
612
|
-
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
613
|
-
payload
|
|
614
|
-
);
|
|
618
|
+
async function deleteSubscriptionOption2(_id) {
|
|
619
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
620
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
621
|
+
const reqOpts = deleteSubscriptionOption(payload);
|
|
615
622
|
sideEffects?.onSiteCall?.();
|
|
616
623
|
try {
|
|
617
624
|
const result = await httpClient.request(reqOpts);
|
|
@@ -621,105 +628,106 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
|
621
628
|
err,
|
|
622
629
|
{
|
|
623
630
|
spreadPathsToArguments: {},
|
|
624
|
-
explicitPathsToArguments: {
|
|
625
|
-
productId: "$[0]",
|
|
626
|
-
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
627
|
-
},
|
|
631
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
628
632
|
singleArgumentUnchanged: false
|
|
629
633
|
},
|
|
630
|
-
["
|
|
634
|
+
["_id"]
|
|
631
635
|
);
|
|
632
636
|
sideEffects?.onError?.(err);
|
|
633
637
|
throw transformedError;
|
|
634
638
|
}
|
|
635
639
|
}
|
|
636
|
-
async function
|
|
637
|
-
const { httpClient, sideEffects } = arguments[
|
|
640
|
+
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
641
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
638
642
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
639
|
-
|
|
640
|
-
allowed
|
|
643
|
+
subscriptionOptions
|
|
641
644
|
});
|
|
642
|
-
const reqOpts =
|
|
645
|
+
const reqOpts = bulkCreateSubscriptionOptions(
|
|
646
|
+
payload
|
|
647
|
+
);
|
|
643
648
|
sideEffects?.onSiteCall?.();
|
|
644
649
|
try {
|
|
645
650
|
const result = await httpClient.request(reqOpts);
|
|
646
651
|
sideEffects?.onSuccess?.(result);
|
|
652
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
647
653
|
} catch (err) {
|
|
648
654
|
const transformedError = sdkTransformError(
|
|
649
655
|
err,
|
|
650
656
|
{
|
|
651
657
|
spreadPathsToArguments: {},
|
|
652
|
-
explicitPathsToArguments: {
|
|
658
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
653
659
|
singleArgumentUnchanged: false
|
|
654
660
|
},
|
|
655
|
-
["
|
|
661
|
+
["subscriptionOptions"]
|
|
656
662
|
);
|
|
657
663
|
sideEffects?.onError?.(err);
|
|
658
664
|
throw transformedError;
|
|
659
665
|
}
|
|
660
666
|
}
|
|
661
|
-
async function
|
|
662
|
-
const { httpClient, sideEffects } = arguments[
|
|
667
|
+
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
668
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
663
669
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
664
|
-
|
|
665
|
-
allowed
|
|
670
|
+
subscriptionOptions
|
|
666
671
|
});
|
|
667
|
-
const reqOpts =
|
|
672
|
+
const reqOpts = bulkUpdateSubscriptionOptions(
|
|
673
|
+
payload
|
|
674
|
+
);
|
|
668
675
|
sideEffects?.onSiteCall?.();
|
|
669
676
|
try {
|
|
670
677
|
const result = await httpClient.request(reqOpts);
|
|
671
678
|
sideEffects?.onSuccess?.(result);
|
|
679
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
672
680
|
} catch (err) {
|
|
673
681
|
const transformedError = sdkTransformError(
|
|
674
682
|
err,
|
|
675
683
|
{
|
|
676
684
|
spreadPathsToArguments: {},
|
|
677
|
-
explicitPathsToArguments: {
|
|
685
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
678
686
|
singleArgumentUnchanged: false
|
|
679
687
|
},
|
|
680
|
-
["
|
|
688
|
+
["subscriptionOptions"]
|
|
681
689
|
);
|
|
682
690
|
sideEffects?.onError?.(err);
|
|
683
691
|
throw transformedError;
|
|
684
692
|
}
|
|
685
693
|
}
|
|
686
|
-
async function
|
|
694
|
+
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
687
695
|
const { httpClient, sideEffects } = arguments[1];
|
|
688
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
689
|
-
const reqOpts =
|
|
696
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
|
|
697
|
+
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
698
|
+
payload
|
|
699
|
+
);
|
|
690
700
|
sideEffects?.onSiteCall?.();
|
|
691
701
|
try {
|
|
692
702
|
const result = await httpClient.request(reqOpts);
|
|
693
703
|
sideEffects?.onSuccess?.(result);
|
|
694
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
695
704
|
} catch (err) {
|
|
696
705
|
const transformedError = sdkTransformError(
|
|
697
706
|
err,
|
|
698
707
|
{
|
|
699
708
|
spreadPathsToArguments: {},
|
|
700
|
-
explicitPathsToArguments: {
|
|
709
|
+
explicitPathsToArguments: { ids: "$[0]" },
|
|
701
710
|
singleArgumentUnchanged: false
|
|
702
711
|
},
|
|
703
|
-
["
|
|
712
|
+
["ids"]
|
|
704
713
|
);
|
|
705
714
|
sideEffects?.onError?.(err);
|
|
706
715
|
throw transformedError;
|
|
707
716
|
}
|
|
708
717
|
}
|
|
709
|
-
async function
|
|
718
|
+
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
710
719
|
const { httpClient, sideEffects } = arguments[2];
|
|
711
720
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
712
721
|
productId,
|
|
713
|
-
|
|
722
|
+
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
714
723
|
});
|
|
715
|
-
const reqOpts =
|
|
724
|
+
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
716
725
|
payload
|
|
717
726
|
);
|
|
718
727
|
sideEffects?.onSiteCall?.();
|
|
719
728
|
try {
|
|
720
729
|
const result = await httpClient.request(reqOpts);
|
|
721
730
|
sideEffects?.onSuccess?.(result);
|
|
722
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
723
731
|
} catch (err) {
|
|
724
732
|
const transformedError = sdkTransformError(
|
|
725
733
|
err,
|
|
@@ -727,7 +735,7 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
|
727
735
|
spreadPathsToArguments: {},
|
|
728
736
|
explicitPathsToArguments: {
|
|
729
737
|
productId: "$[0]",
|
|
730
|
-
|
|
738
|
+
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
731
739
|
},
|
|
732
740
|
singleArgumentUnchanged: false
|
|
733
741
|
},
|
|
@@ -737,59 +745,51 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
|
737
745
|
throw transformedError;
|
|
738
746
|
}
|
|
739
747
|
}
|
|
740
|
-
async function
|
|
748
|
+
async function allowOneTimePurchases2(productId, allowed) {
|
|
741
749
|
const { httpClient, sideEffects } = arguments[2];
|
|
742
750
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
paging: options?.paging
|
|
751
|
+
productId,
|
|
752
|
+
allowed
|
|
746
753
|
});
|
|
747
|
-
const reqOpts =
|
|
748
|
-
payload
|
|
749
|
-
);
|
|
754
|
+
const reqOpts = allowOneTimePurchases(payload);
|
|
750
755
|
sideEffects?.onSiteCall?.();
|
|
751
756
|
try {
|
|
752
757
|
const result = await httpClient.request(reqOpts);
|
|
753
758
|
sideEffects?.onSuccess?.(result);
|
|
754
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
755
759
|
} catch (err) {
|
|
756
760
|
const transformedError = sdkTransformError(
|
|
757
761
|
err,
|
|
758
762
|
{
|
|
759
763
|
spreadPathsToArguments: {},
|
|
760
|
-
explicitPathsToArguments: {
|
|
761
|
-
id: "$[0]",
|
|
762
|
-
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
763
|
-
paging: "$[1].paging"
|
|
764
|
-
},
|
|
764
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
765
765
|
singleArgumentUnchanged: false
|
|
766
766
|
},
|
|
767
|
-
["
|
|
767
|
+
["productId", "allowed"]
|
|
768
768
|
);
|
|
769
769
|
sideEffects?.onError?.(err);
|
|
770
770
|
throw transformedError;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
async function
|
|
774
|
-
const { httpClient, sideEffects } = arguments[
|
|
773
|
+
async function enableCustomerCancellation2(productId, allowed) {
|
|
774
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
775
775
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
776
|
-
productId
|
|
776
|
+
productId,
|
|
777
|
+
allowed
|
|
777
778
|
});
|
|
778
|
-
const reqOpts =
|
|
779
|
+
const reqOpts = enableCustomerCancellation(payload);
|
|
779
780
|
sideEffects?.onSiteCall?.();
|
|
780
781
|
try {
|
|
781
782
|
const result = await httpClient.request(reqOpts);
|
|
782
783
|
sideEffects?.onSuccess?.(result);
|
|
783
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
784
784
|
} catch (err) {
|
|
785
785
|
const transformedError = sdkTransformError(
|
|
786
786
|
err,
|
|
787
787
|
{
|
|
788
788
|
spreadPathsToArguments: {},
|
|
789
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
789
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
790
790
|
singleArgumentUnchanged: false
|
|
791
791
|
},
|
|
792
|
-
["productId"]
|
|
792
|
+
["productId", "allowed"]
|
|
793
793
|
);
|
|
794
794
|
sideEffects?.onError?.(err);
|
|
795
795
|
throw transformedError;
|