@wix/auto_sdk_stores_subscription-options 1.0.52 → 1.0.53
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 +157 -157
- package/build/cjs/index.typings.js +230 -230
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +108 -108
- package/build/cjs/meta.js +204 -204
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +45 -45
- package/build/es/index.mjs +274 -274
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +157 -157
- package/build/es/index.typings.mjs +230 -230
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +108 -108
- package/build/es/meta.mjs +204 -204
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +45 -45
- package/build/internal/cjs/index.js +274 -274
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +157 -157
- package/build/internal/cjs/index.typings.js +230 -230
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +108 -108
- package/build/internal/cjs/meta.js +204 -204
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +45 -45
- package/build/internal/es/index.mjs +274 -274
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +157 -157
- package/build/internal/es/index.typings.mjs +230 -230
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +108 -108
- package/build/internal/es/meta.mjs +204 -204
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -47,35 +47,6 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
|
47
47
|
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
48
48
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
49
49
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
50
|
-
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
51
|
-
const domainToMappings = {
|
|
52
|
-
"api._api_base_domain_": [
|
|
53
|
-
{
|
|
54
|
-
srcPath: "/wix-ecommerce-plans-reader",
|
|
55
|
-
destPath: ""
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"www._base_domain_": [
|
|
59
|
-
{
|
|
60
|
-
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
61
|
-
destPath: ""
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
_: [
|
|
65
|
-
{
|
|
66
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
67
|
-
destPath: ""
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"manage._base_domain_": [
|
|
71
|
-
{
|
|
72
|
-
srcPath: "/_api/subscription-options-reader-server",
|
|
73
|
-
destPath: ""
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
77
|
-
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
78
|
-
}
|
|
79
50
|
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
80
51
|
const domainToMappings = {
|
|
81
52
|
"api._api_base_domain_": [
|
|
@@ -123,7 +94,136 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUr
|
|
|
123
94
|
};
|
|
124
95
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
96
|
}
|
|
97
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
98
|
+
const domainToMappings = {
|
|
99
|
+
"api._api_base_domain_": [
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"www._base_domain_": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
108
|
+
destPath: ""
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
_: [
|
|
112
|
+
{
|
|
113
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
114
|
+
destPath: ""
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"manage._base_domain_": [
|
|
118
|
+
{
|
|
119
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
120
|
+
destPath: ""
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
|
+
}
|
|
126
126
|
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
|
+
}
|
|
127
227
|
function createSubscriptionOption(payload) {
|
|
128
228
|
function __createSubscriptionOption({ host }) {
|
|
129
229
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -350,106 +450,6 @@ function allowOneTimePurchases(payload) {
|
|
|
350
450
|
}
|
|
351
451
|
return __allowOneTimePurchases;
|
|
352
452
|
}
|
|
353
|
-
function getSubscriptionOption(payload) {
|
|
354
|
-
function __getSubscriptionOption({ host }) {
|
|
355
|
-
const metadata = {
|
|
356
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
357
|
-
method: "GET",
|
|
358
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
359
|
-
packageName: PACKAGE_NAME,
|
|
360
|
-
migrationOptions: {
|
|
361
|
-
optInTransformResponse: true
|
|
362
|
-
},
|
|
363
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
364
|
-
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
365
|
-
),
|
|
366
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
367
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
368
|
-
{
|
|
369
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
370
|
-
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
371
|
-
}
|
|
372
|
-
])
|
|
373
|
-
};
|
|
374
|
-
return metadata;
|
|
375
|
-
}
|
|
376
|
-
return __getSubscriptionOption;
|
|
377
|
-
}
|
|
378
|
-
function getSubscriptionOptionsForProduct(payload) {
|
|
379
|
-
function __getSubscriptionOptionsForProduct({ host }) {
|
|
380
|
-
const metadata = {
|
|
381
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
382
|
-
method: "GET",
|
|
383
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
384
|
-
packageName: PACKAGE_NAME,
|
|
385
|
-
migrationOptions: {
|
|
386
|
-
optInTransformResponse: true
|
|
387
|
-
},
|
|
388
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
389
|
-
{
|
|
390
|
-
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
391
|
-
data: payload,
|
|
392
|
-
host
|
|
393
|
-
}
|
|
394
|
-
),
|
|
395
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
396
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
397
|
-
{
|
|
398
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
399
|
-
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
400
|
-
}
|
|
401
|
-
])
|
|
402
|
-
};
|
|
403
|
-
return metadata;
|
|
404
|
-
}
|
|
405
|
-
return __getSubscriptionOptionsForProduct;
|
|
406
|
-
}
|
|
407
|
-
function getProductIdsForSubscriptionOption(payload) {
|
|
408
|
-
function __getProductIdsForSubscriptionOption({ host }) {
|
|
409
|
-
const metadata = {
|
|
410
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
411
|
-
method: "GET",
|
|
412
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
413
|
-
packageName: PACKAGE_NAME,
|
|
414
|
-
migrationOptions: {
|
|
415
|
-
optInTransformResponse: true
|
|
416
|
-
},
|
|
417
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
418
|
-
{
|
|
419
|
-
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
420
|
-
data: payload,
|
|
421
|
-
host
|
|
422
|
-
}
|
|
423
|
-
),
|
|
424
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
425
|
-
};
|
|
426
|
-
return metadata;
|
|
427
|
-
}
|
|
428
|
-
return __getProductIdsForSubscriptionOption;
|
|
429
|
-
}
|
|
430
|
-
function getOneTimePurchasesStatus(payload) {
|
|
431
|
-
function __getOneTimePurchasesStatus({ host }) {
|
|
432
|
-
const metadata = {
|
|
433
|
-
entityFqdn: "wix.stores.v1.subscription_option",
|
|
434
|
-
method: "GET",
|
|
435
|
-
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
436
|
-
packageName: PACKAGE_NAME,
|
|
437
|
-
migrationOptions: {
|
|
438
|
-
optInTransformResponse: true
|
|
439
|
-
},
|
|
440
|
-
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
441
|
-
{
|
|
442
|
-
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
443
|
-
data: payload,
|
|
444
|
-
host
|
|
445
|
-
}
|
|
446
|
-
),
|
|
447
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
448
|
-
};
|
|
449
|
-
return metadata;
|
|
450
|
-
}
|
|
451
|
-
return __getOneTimePurchasesStatus;
|
|
452
|
-
}
|
|
453
453
|
|
|
454
454
|
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
455
455
|
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
@@ -466,12 +466,10 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
|
466
466
|
DiscountType2["PERCENT"] = "PERCENT";
|
|
467
467
|
return DiscountType2;
|
|
468
468
|
})(DiscountType || {});
|
|
469
|
-
async function
|
|
469
|
+
async function getSubscriptionOption2(_id) {
|
|
470
470
|
const { httpClient, sideEffects } = arguments[1];
|
|
471
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
472
|
-
|
|
473
|
-
});
|
|
474
|
-
const reqOpts = createSubscriptionOption(payload);
|
|
471
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
472
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
475
473
|
sideEffects?.onSiteCall?.();
|
|
476
474
|
try {
|
|
477
475
|
const result = await httpClient.request(reqOpts);
|
|
@@ -482,70 +480,85 @@ async function createSubscriptionOption2(subscriptionOption) {
|
|
|
482
480
|
err,
|
|
483
481
|
{
|
|
484
482
|
spreadPathsToArguments: {},
|
|
485
|
-
explicitPathsToArguments: {
|
|
483
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
486
484
|
singleArgumentUnchanged: false
|
|
487
485
|
},
|
|
488
|
-
["
|
|
486
|
+
["_id"]
|
|
489
487
|
);
|
|
490
488
|
sideEffects?.onError?.(err);
|
|
491
489
|
throw transformedError;
|
|
492
490
|
}
|
|
493
491
|
}
|
|
494
|
-
async function
|
|
492
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
495
493
|
const { httpClient, sideEffects } = arguments[2];
|
|
496
494
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
497
|
-
|
|
495
|
+
productId,
|
|
496
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
498
497
|
});
|
|
499
|
-
const reqOpts =
|
|
498
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
499
|
+
payload
|
|
500
|
+
);
|
|
500
501
|
sideEffects?.onSiteCall?.();
|
|
501
502
|
try {
|
|
502
503
|
const result = await httpClient.request(reqOpts);
|
|
503
504
|
sideEffects?.onSuccess?.(result);
|
|
504
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)
|
|
505
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
505
506
|
} catch (err) {
|
|
506
507
|
const transformedError = (0, import_transform_error.transformError)(
|
|
507
508
|
err,
|
|
508
509
|
{
|
|
509
|
-
spreadPathsToArguments: {
|
|
510
|
-
explicitPathsToArguments: {
|
|
510
|
+
spreadPathsToArguments: {},
|
|
511
|
+
explicitPathsToArguments: {
|
|
512
|
+
productId: "$[0]",
|
|
513
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
514
|
+
},
|
|
511
515
|
singleArgumentUnchanged: false
|
|
512
516
|
},
|
|
513
|
-
["
|
|
517
|
+
["productId", "options"]
|
|
514
518
|
);
|
|
515
519
|
sideEffects?.onError?.(err);
|
|
516
520
|
throw transformedError;
|
|
517
521
|
}
|
|
518
522
|
}
|
|
519
|
-
async function
|
|
520
|
-
const { httpClient, sideEffects } = arguments[
|
|
521
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
522
|
-
|
|
523
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
524
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
525
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
526
|
+
id: _id,
|
|
527
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
528
|
+
paging: options?.paging
|
|
529
|
+
});
|
|
530
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
531
|
+
payload
|
|
532
|
+
);
|
|
523
533
|
sideEffects?.onSiteCall?.();
|
|
524
534
|
try {
|
|
525
535
|
const result = await httpClient.request(reqOpts);
|
|
526
536
|
sideEffects?.onSuccess?.(result);
|
|
537
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
527
538
|
} catch (err) {
|
|
528
539
|
const transformedError = (0, import_transform_error.transformError)(
|
|
529
540
|
err,
|
|
530
541
|
{
|
|
531
542
|
spreadPathsToArguments: {},
|
|
532
|
-
explicitPathsToArguments: {
|
|
543
|
+
explicitPathsToArguments: {
|
|
544
|
+
id: "$[0]",
|
|
545
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
546
|
+
paging: "$[1].paging"
|
|
547
|
+
},
|
|
533
548
|
singleArgumentUnchanged: false
|
|
534
549
|
},
|
|
535
|
-
["_id"]
|
|
550
|
+
["_id", "options"]
|
|
536
551
|
);
|
|
537
552
|
sideEffects?.onError?.(err);
|
|
538
553
|
throw transformedError;
|
|
539
554
|
}
|
|
540
555
|
}
|
|
541
|
-
async function
|
|
556
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
542
557
|
const { httpClient, sideEffects } = arguments[1];
|
|
543
558
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
544
|
-
|
|
559
|
+
productId
|
|
545
560
|
});
|
|
546
|
-
const reqOpts =
|
|
547
|
-
payload
|
|
548
|
-
);
|
|
561
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
549
562
|
sideEffects?.onSiteCall?.();
|
|
550
563
|
try {
|
|
551
564
|
const result = await httpClient.request(reqOpts);
|
|
@@ -556,75 +569,69 @@ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
|
556
569
|
err,
|
|
557
570
|
{
|
|
558
571
|
spreadPathsToArguments: {},
|
|
559
|
-
explicitPathsToArguments: {
|
|
572
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
560
573
|
singleArgumentUnchanged: false
|
|
561
574
|
},
|
|
562
|
-
["
|
|
575
|
+
["productId"]
|
|
563
576
|
);
|
|
564
577
|
sideEffects?.onError?.(err);
|
|
565
578
|
throw transformedError;
|
|
566
579
|
}
|
|
567
580
|
}
|
|
568
|
-
async function
|
|
581
|
+
async function createSubscriptionOption2(subscriptionOption) {
|
|
569
582
|
const { httpClient, sideEffects } = arguments[1];
|
|
570
583
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
571
|
-
|
|
584
|
+
subscriptionOption
|
|
572
585
|
});
|
|
573
|
-
const reqOpts =
|
|
574
|
-
payload
|
|
575
|
-
);
|
|
586
|
+
const reqOpts = createSubscriptionOption(payload);
|
|
576
587
|
sideEffects?.onSiteCall?.();
|
|
577
588
|
try {
|
|
578
589
|
const result = await httpClient.request(reqOpts);
|
|
579
590
|
sideEffects?.onSuccess?.(result);
|
|
580
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
591
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
581
592
|
} catch (err) {
|
|
582
593
|
const transformedError = (0, import_transform_error.transformError)(
|
|
583
594
|
err,
|
|
584
595
|
{
|
|
585
596
|
spreadPathsToArguments: {},
|
|
586
|
-
explicitPathsToArguments: {
|
|
597
|
+
explicitPathsToArguments: { subscriptionOption: "$[0]" },
|
|
587
598
|
singleArgumentUnchanged: false
|
|
588
599
|
},
|
|
589
|
-
["
|
|
600
|
+
["subscriptionOption"]
|
|
590
601
|
);
|
|
591
602
|
sideEffects?.onError?.(err);
|
|
592
603
|
throw transformedError;
|
|
593
604
|
}
|
|
594
605
|
}
|
|
595
|
-
async function
|
|
596
|
-
const { httpClient, sideEffects } = arguments[
|
|
597
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
);
|
|
606
|
+
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
607
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
608
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
609
|
+
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
610
|
+
});
|
|
611
|
+
const reqOpts = updateSubscriptionOption(payload);
|
|
601
612
|
sideEffects?.onSiteCall?.();
|
|
602
613
|
try {
|
|
603
614
|
const result = await httpClient.request(reqOpts);
|
|
604
615
|
sideEffects?.onSuccess?.(result);
|
|
616
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
|
|
605
617
|
} catch (err) {
|
|
606
618
|
const transformedError = (0, import_transform_error.transformError)(
|
|
607
619
|
err,
|
|
608
620
|
{
|
|
609
|
-
spreadPathsToArguments: {},
|
|
610
|
-
explicitPathsToArguments: {
|
|
621
|
+
spreadPathsToArguments: { subscriptionOption: "$[1]" },
|
|
622
|
+
explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
|
|
611
623
|
singleArgumentUnchanged: false
|
|
612
624
|
},
|
|
613
|
-
["
|
|
625
|
+
["_id", "subscriptionOption"]
|
|
614
626
|
);
|
|
615
627
|
sideEffects?.onError?.(err);
|
|
616
628
|
throw transformedError;
|
|
617
629
|
}
|
|
618
630
|
}
|
|
619
|
-
async function
|
|
620
|
-
const { httpClient, sideEffects } = arguments[
|
|
621
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
622
|
-
|
|
623
|
-
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
624
|
-
});
|
|
625
|
-
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
626
|
-
payload
|
|
627
|
-
);
|
|
631
|
+
async function deleteSubscriptionOption2(_id) {
|
|
632
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
633
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
634
|
+
const reqOpts = deleteSubscriptionOption(payload);
|
|
628
635
|
sideEffects?.onSiteCall?.();
|
|
629
636
|
try {
|
|
630
637
|
const result = await httpClient.request(reqOpts);
|
|
@@ -634,150 +641,143 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
|
634
641
|
err,
|
|
635
642
|
{
|
|
636
643
|
spreadPathsToArguments: {},
|
|
637
|
-
explicitPathsToArguments: {
|
|
638
|
-
productId: "$[0]",
|
|
639
|
-
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
640
|
-
},
|
|
644
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
641
645
|
singleArgumentUnchanged: false
|
|
642
646
|
},
|
|
643
|
-
["
|
|
647
|
+
["_id"]
|
|
644
648
|
);
|
|
645
649
|
sideEffects?.onError?.(err);
|
|
646
650
|
throw transformedError;
|
|
647
651
|
}
|
|
648
652
|
}
|
|
649
|
-
async function
|
|
650
|
-
const { httpClient, sideEffects } = arguments[
|
|
653
|
+
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
654
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
651
655
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
652
|
-
|
|
653
|
-
allowed
|
|
656
|
+
subscriptionOptions
|
|
654
657
|
});
|
|
655
|
-
const reqOpts =
|
|
658
|
+
const reqOpts = bulkCreateSubscriptionOptions(
|
|
659
|
+
payload
|
|
660
|
+
);
|
|
656
661
|
sideEffects?.onSiteCall?.();
|
|
657
662
|
try {
|
|
658
663
|
const result = await httpClient.request(reqOpts);
|
|
659
664
|
sideEffects?.onSuccess?.(result);
|
|
665
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
660
666
|
} catch (err) {
|
|
661
667
|
const transformedError = (0, import_transform_error.transformError)(
|
|
662
668
|
err,
|
|
663
669
|
{
|
|
664
670
|
spreadPathsToArguments: {},
|
|
665
|
-
explicitPathsToArguments: {
|
|
671
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
666
672
|
singleArgumentUnchanged: false
|
|
667
673
|
},
|
|
668
|
-
["
|
|
674
|
+
["subscriptionOptions"]
|
|
669
675
|
);
|
|
670
676
|
sideEffects?.onError?.(err);
|
|
671
677
|
throw transformedError;
|
|
672
678
|
}
|
|
673
679
|
}
|
|
674
|
-
async function
|
|
680
|
+
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
675
681
|
const { httpClient, sideEffects } = arguments[1];
|
|
676
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
677
|
-
|
|
682
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
683
|
+
subscriptionOptions
|
|
684
|
+
});
|
|
685
|
+
const reqOpts = bulkUpdateSubscriptionOptions(
|
|
686
|
+
payload
|
|
687
|
+
);
|
|
678
688
|
sideEffects?.onSiteCall?.();
|
|
679
689
|
try {
|
|
680
690
|
const result = await httpClient.request(reqOpts);
|
|
681
691
|
sideEffects?.onSuccess?.(result);
|
|
682
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)
|
|
692
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
683
693
|
} catch (err) {
|
|
684
694
|
const transformedError = (0, import_transform_error.transformError)(
|
|
685
695
|
err,
|
|
686
696
|
{
|
|
687
697
|
spreadPathsToArguments: {},
|
|
688
|
-
explicitPathsToArguments: {
|
|
698
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
689
699
|
singleArgumentUnchanged: false
|
|
690
700
|
},
|
|
691
|
-
["
|
|
701
|
+
["subscriptionOptions"]
|
|
692
702
|
);
|
|
693
703
|
sideEffects?.onError?.(err);
|
|
694
704
|
throw transformedError;
|
|
695
705
|
}
|
|
696
706
|
}
|
|
697
|
-
async function
|
|
698
|
-
const { httpClient, sideEffects } = arguments[
|
|
699
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
700
|
-
|
|
701
|
-
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
702
|
-
});
|
|
703
|
-
const reqOpts = getSubscriptionOptionsForProduct(
|
|
707
|
+
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
708
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
709
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
|
|
710
|
+
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
704
711
|
payload
|
|
705
712
|
);
|
|
706
713
|
sideEffects?.onSiteCall?.();
|
|
707
714
|
try {
|
|
708
715
|
const result = await httpClient.request(reqOpts);
|
|
709
716
|
sideEffects?.onSuccess?.(result);
|
|
710
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
711
717
|
} catch (err) {
|
|
712
718
|
const transformedError = (0, import_transform_error.transformError)(
|
|
713
719
|
err,
|
|
714
720
|
{
|
|
715
721
|
spreadPathsToArguments: {},
|
|
716
|
-
explicitPathsToArguments: {
|
|
717
|
-
productId: "$[0]",
|
|
718
|
-
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
719
|
-
},
|
|
722
|
+
explicitPathsToArguments: { ids: "$[0]" },
|
|
720
723
|
singleArgumentUnchanged: false
|
|
721
724
|
},
|
|
722
|
-
["
|
|
725
|
+
["ids"]
|
|
723
726
|
);
|
|
724
727
|
sideEffects?.onError?.(err);
|
|
725
728
|
throw transformedError;
|
|
726
729
|
}
|
|
727
730
|
}
|
|
728
|
-
async function
|
|
731
|
+
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
729
732
|
const { httpClient, sideEffects } = arguments[2];
|
|
730
733
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
paging: options?.paging
|
|
734
|
+
productId,
|
|
735
|
+
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
734
736
|
});
|
|
735
|
-
const reqOpts =
|
|
737
|
+
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
736
738
|
payload
|
|
737
739
|
);
|
|
738
740
|
sideEffects?.onSiteCall?.();
|
|
739
741
|
try {
|
|
740
742
|
const result = await httpClient.request(reqOpts);
|
|
741
743
|
sideEffects?.onSuccess?.(result);
|
|
742
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
743
744
|
} catch (err) {
|
|
744
745
|
const transformedError = (0, import_transform_error.transformError)(
|
|
745
746
|
err,
|
|
746
747
|
{
|
|
747
748
|
spreadPathsToArguments: {},
|
|
748
749
|
explicitPathsToArguments: {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
paging: "$[1].paging"
|
|
750
|
+
productId: "$[0]",
|
|
751
|
+
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
752
752
|
},
|
|
753
753
|
singleArgumentUnchanged: false
|
|
754
754
|
},
|
|
755
|
-
["
|
|
755
|
+
["productId", "options"]
|
|
756
756
|
);
|
|
757
757
|
sideEffects?.onError?.(err);
|
|
758
758
|
throw transformedError;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
async function
|
|
762
|
-
const { httpClient, sideEffects } = arguments[
|
|
761
|
+
async function allowOneTimePurchases2(productId, allowed) {
|
|
762
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
763
763
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
764
|
-
productId
|
|
764
|
+
productId,
|
|
765
|
+
allowed
|
|
765
766
|
});
|
|
766
|
-
const reqOpts =
|
|
767
|
+
const reqOpts = allowOneTimePurchases(payload);
|
|
767
768
|
sideEffects?.onSiteCall?.();
|
|
768
769
|
try {
|
|
769
770
|
const result = await httpClient.request(reqOpts);
|
|
770
771
|
sideEffects?.onSuccess?.(result);
|
|
771
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
772
772
|
} catch (err) {
|
|
773
773
|
const transformedError = (0, import_transform_error.transformError)(
|
|
774
774
|
err,
|
|
775
775
|
{
|
|
776
776
|
spreadPathsToArguments: {},
|
|
777
|
-
explicitPathsToArguments: { productId: "$[0]" },
|
|
777
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
778
778
|
singleArgumentUnchanged: false
|
|
779
779
|
},
|
|
780
|
-
["productId"]
|
|
780
|
+
["productId", "allowed"]
|
|
781
781
|
);
|
|
782
782
|
sideEffects?.onError?.(err);
|
|
783
783
|
throw transformedError;
|