@wix/auto_sdk_stores_subscription-options 1.0.41 → 1.0.42

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +45 -45
  2. package/build/cjs/index.js +276 -276
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +157 -157
  5. package/build/cjs/index.typings.js +230 -230
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +108 -108
  8. package/build/cjs/meta.js +204 -204
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +45 -45
  11. package/build/es/index.mjs +276 -276
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +157 -157
  14. package/build/es/index.typings.mjs +230 -230
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +108 -108
  17. package/build/es/meta.mjs +204 -204
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +45 -45
  20. package/build/internal/cjs/index.js +276 -276
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +157 -157
  23. package/build/internal/cjs/index.typings.js +230 -230
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +108 -108
  26. package/build/internal/cjs/meta.js +204 -204
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +45 -45
  29. package/build/internal/es/index.mjs +276 -276
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +157 -157
  32. package/build/internal/es/index.typings.mjs +230 -230
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +108 -108
  35. package/build/internal/es/meta.mjs +204 -204
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -47,76 +47,76 @@ 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 resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
50
+ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
51
51
  const domainToMappings = {
52
52
  "api._api_base_domain_": [
53
53
  {
54
- srcPath: "/wix-ecommerce-plans",
54
+ srcPath: "/wix-ecommerce-plans-reader",
55
55
  destPath: ""
56
56
  }
57
57
  ],
58
- "www.wixapis.com": [
58
+ "www._base_domain_": [
59
59
  {
60
- srcPath: "/stores/v1/subscription-options",
61
- destPath: "/v1/subscription-options"
60
+ srcPath: "/_api/wix-ecommerce-plans-reader",
61
+ destPath: ""
62
62
  }
63
63
  ],
64
- "www._base_domain_": [
64
+ _: [
65
65
  {
66
- srcPath: "/_api/subscription-options-server",
66
+ srcPath: "/_api/subscription-options-reader-server",
67
67
  destPath: ""
68
68
  }
69
69
  ],
70
- "editor._base_domain_": [
70
+ "manage._base_domain_": [
71
71
  {
72
- srcPath: "/_api/subscription-options-server",
72
+ srcPath: "/_api/subscription-options-reader-server",
73
73
  destPath: ""
74
74
  }
75
- ],
76
- "blocks._base_domain_": [
75
+ ]
76
+ };
77
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
78
+ }
79
+ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
80
+ const domainToMappings = {
81
+ "api._api_base_domain_": [
77
82
  {
78
- srcPath: "/_api/subscription-options-server",
83
+ srcPath: "/wix-ecommerce-plans",
79
84
  destPath: ""
80
85
  }
81
86
  ],
82
- "create.editorx": [
87
+ "www.wixapis.com": [
83
88
  {
84
- srcPath: "/_api/subscription-options-server",
85
- destPath: ""
89
+ srcPath: "/stores/v1/subscription-options",
90
+ destPath: "/v1/subscription-options"
86
91
  }
87
92
  ],
88
- "manage._base_domain_": [
93
+ "www._base_domain_": [
89
94
  {
90
95
  srcPath: "/_api/subscription-options-server",
91
96
  destPath: ""
92
97
  }
93
- ]
94
- };
95
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
96
- }
97
- function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
98
- const domainToMappings = {
99
- "api._api_base_domain_": [
98
+ ],
99
+ "editor._base_domain_": [
100
100
  {
101
- srcPath: "/wix-ecommerce-plans-reader",
101
+ srcPath: "/_api/subscription-options-server",
102
102
  destPath: ""
103
103
  }
104
104
  ],
105
- "www._base_domain_": [
105
+ "blocks._base_domain_": [
106
106
  {
107
- srcPath: "/_api/wix-ecommerce-plans-reader",
107
+ srcPath: "/_api/subscription-options-server",
108
108
  destPath: ""
109
109
  }
110
110
  ],
111
- _: [
111
+ "create.editorx": [
112
112
  {
113
- srcPath: "/_api/subscription-options-reader-server",
113
+ srcPath: "/_api/subscription-options-server",
114
114
  destPath: ""
115
115
  }
116
116
  ],
117
117
  "manage._base_domain_": [
118
118
  {
119
- srcPath: "/_api/subscription-options-reader-server",
119
+ srcPath: "/_api/subscription-options-server",
120
120
  destPath: ""
121
121
  }
122
122
  ]
@@ -124,106 +124,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
124
124
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
125
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
- }
227
127
  function createSubscriptionOption(payload) {
228
128
  function __createSubscriptionOption({ host }) {
229
129
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -450,6 +350,106 @@ function allowOneTimePurchases(payload) {
450
350
  }
451
351
  return __allowOneTimePurchases;
452
352
  }
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,10 +466,12 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
466
466
  DiscountType2["PERCENT"] = "PERCENT";
467
467
  return DiscountType2;
468
468
  })(DiscountType || {});
469
- async function getSubscriptionOption2(_id) {
469
+ async function createSubscriptionOption2(subscriptionOption) {
470
470
  const { httpClient, sideEffects } = arguments[1];
471
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
472
- const reqOpts = getSubscriptionOption(payload);
471
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
472
+ subscriptionOption
473
+ });
474
+ const reqOpts = createSubscriptionOption(payload);
473
475
  sideEffects?.onSiteCall?.();
474
476
  try {
475
477
  const result = await httpClient.request(reqOpts);
@@ -480,85 +482,70 @@ async function getSubscriptionOption2(_id) {
480
482
  err,
481
483
  {
482
484
  spreadPathsToArguments: {},
483
- explicitPathsToArguments: { id: "$[0]" },
485
+ explicitPathsToArguments: { subscriptionOption: "$[0]" },
484
486
  singleArgumentUnchanged: false
485
487
  },
486
- ["_id"]
488
+ ["subscriptionOption"]
487
489
  );
488
490
  sideEffects?.onError?.(err);
489
491
  throw transformedError;
490
492
  }
491
493
  }
492
- async function getSubscriptionOptionsForProduct2(productId, options) {
494
+ async function updateSubscriptionOption2(_id, subscriptionOption) {
493
495
  const { httpClient, sideEffects } = arguments[2];
494
496
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
495
- productId,
496
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
497
+ subscriptionOption: { ...subscriptionOption, id: _id }
497
498
  });
498
- const reqOpts = getSubscriptionOptionsForProduct(
499
- payload
500
- );
499
+ const reqOpts = updateSubscriptionOption(payload);
501
500
  sideEffects?.onSiteCall?.();
502
501
  try {
503
502
  const result = await httpClient.request(reqOpts);
504
503
  sideEffects?.onSuccess?.(result);
505
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
504
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
506
505
  } catch (err) {
507
506
  const transformedError = (0, import_transform_error.transformError)(
508
507
  err,
509
508
  {
510
- spreadPathsToArguments: {},
511
- explicitPathsToArguments: {
512
- productId: "$[0]",
513
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
514
- },
509
+ spreadPathsToArguments: { subscriptionOption: "$[1]" },
510
+ explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
515
511
  singleArgumentUnchanged: false
516
512
  },
517
- ["productId", "options"]
513
+ ["_id", "subscriptionOption"]
518
514
  );
519
515
  sideEffects?.onError?.(err);
520
516
  throw transformedError;
521
517
  }
522
518
  }
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
- );
519
+ async function deleteSubscriptionOption2(_id) {
520
+ const { httpClient, sideEffects } = arguments[1];
521
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
522
+ const reqOpts = deleteSubscriptionOption(payload);
533
523
  sideEffects?.onSiteCall?.();
534
524
  try {
535
525
  const result = await httpClient.request(reqOpts);
536
526
  sideEffects?.onSuccess?.(result);
537
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
538
527
  } catch (err) {
539
528
  const transformedError = (0, import_transform_error.transformError)(
540
529
  err,
541
530
  {
542
531
  spreadPathsToArguments: {},
543
- explicitPathsToArguments: {
544
- id: "$[0]",
545
- includeHiddenProducts: "$[1].includeHiddenProducts",
546
- paging: "$[1].paging"
547
- },
532
+ explicitPathsToArguments: { id: "$[0]" },
548
533
  singleArgumentUnchanged: false
549
534
  },
550
- ["_id", "options"]
535
+ ["_id"]
551
536
  );
552
537
  sideEffects?.onError?.(err);
553
538
  throw transformedError;
554
539
  }
555
540
  }
556
- async function getOneTimePurchasesStatus2(productId) {
541
+ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
557
542
  const { httpClient, sideEffects } = arguments[1];
558
543
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
559
- productId
544
+ subscriptionOptions
560
545
  });
561
- const reqOpts = getOneTimePurchasesStatus(payload);
546
+ const reqOpts = bulkCreateSubscriptionOptions(
547
+ payload
548
+ );
562
549
  sideEffects?.onSiteCall?.();
563
550
  try {
564
551
  const result = await httpClient.request(reqOpts);
@@ -569,69 +556,75 @@ async function getOneTimePurchasesStatus2(productId) {
569
556
  err,
570
557
  {
571
558
  spreadPathsToArguments: {},
572
- explicitPathsToArguments: { productId: "$[0]" },
559
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
573
560
  singleArgumentUnchanged: false
574
561
  },
575
- ["productId"]
562
+ ["subscriptionOptions"]
576
563
  );
577
564
  sideEffects?.onError?.(err);
578
565
  throw transformedError;
579
566
  }
580
567
  }
581
- async function createSubscriptionOption2(subscriptionOption) {
568
+ async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
582
569
  const { httpClient, sideEffects } = arguments[1];
583
570
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
584
- subscriptionOption
571
+ subscriptionOptions
585
572
  });
586
- const reqOpts = createSubscriptionOption(payload);
573
+ const reqOpts = bulkUpdateSubscriptionOptions(
574
+ payload
575
+ );
587
576
  sideEffects?.onSiteCall?.();
588
577
  try {
589
578
  const result = await httpClient.request(reqOpts);
590
579
  sideEffects?.onSuccess?.(result);
591
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
580
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
592
581
  } catch (err) {
593
582
  const transformedError = (0, import_transform_error.transformError)(
594
583
  err,
595
584
  {
596
585
  spreadPathsToArguments: {},
597
- explicitPathsToArguments: { subscriptionOption: "$[0]" },
586
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
598
587
  singleArgumentUnchanged: false
599
588
  },
600
- ["subscriptionOption"]
589
+ ["subscriptionOptions"]
601
590
  );
602
591
  sideEffects?.onError?.(err);
603
592
  throw transformedError;
604
593
  }
605
594
  }
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);
595
+ async function bulkDeleteSubscriptionOptions2(ids) {
596
+ const { httpClient, sideEffects } = arguments[1];
597
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
598
+ const reqOpts = bulkDeleteSubscriptionOptions(
599
+ payload
600
+ );
612
601
  sideEffects?.onSiteCall?.();
613
602
  try {
614
603
  const result = await httpClient.request(reqOpts);
615
604
  sideEffects?.onSuccess?.(result);
616
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
617
605
  } catch (err) {
618
606
  const transformedError = (0, import_transform_error.transformError)(
619
607
  err,
620
608
  {
621
- spreadPathsToArguments: { subscriptionOption: "$[1]" },
622
- explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
609
+ spreadPathsToArguments: {},
610
+ explicitPathsToArguments: { ids: "$[0]" },
623
611
  singleArgumentUnchanged: false
624
612
  },
625
- ["_id", "subscriptionOption"]
613
+ ["ids"]
626
614
  );
627
615
  sideEffects?.onError?.(err);
628
616
  throw transformedError;
629
617
  }
630
618
  }
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);
619
+ async function assignSubscriptionOptionsToProduct2(productId, options) {
620
+ const { httpClient, sideEffects } = arguments[2];
621
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
622
+ productId,
623
+ assignedSubscriptionOptions: options?.assignedSubscriptionOptions
624
+ });
625
+ const reqOpts = assignSubscriptionOptionsToProduct(
626
+ payload
627
+ );
635
628
  sideEffects?.onSiteCall?.();
636
629
  try {
637
630
  const result = await httpClient.request(reqOpts);
@@ -641,143 +634,150 @@ async function deleteSubscriptionOption2(_id) {
641
634
  err,
642
635
  {
643
636
  spreadPathsToArguments: {},
644
- explicitPathsToArguments: { id: "$[0]" },
637
+ explicitPathsToArguments: {
638
+ productId: "$[0]",
639
+ assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
640
+ },
645
641
  singleArgumentUnchanged: false
646
642
  },
647
- ["_id"]
643
+ ["productId", "options"]
648
644
  );
649
645
  sideEffects?.onError?.(err);
650
646
  throw transformedError;
651
647
  }
652
648
  }
653
- async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
654
- const { httpClient, sideEffects } = arguments[1];
649
+ async function allowOneTimePurchases2(productId, allowed) {
650
+ const { httpClient, sideEffects } = arguments[2];
655
651
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
656
- subscriptionOptions
652
+ productId,
653
+ allowed
657
654
  });
658
- const reqOpts = bulkCreateSubscriptionOptions(
659
- payload
660
- );
655
+ const reqOpts = allowOneTimePurchases(payload);
661
656
  sideEffects?.onSiteCall?.();
662
657
  try {
663
658
  const result = await httpClient.request(reqOpts);
664
659
  sideEffects?.onSuccess?.(result);
665
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
666
660
  } catch (err) {
667
661
  const transformedError = (0, import_transform_error.transformError)(
668
662
  err,
669
663
  {
670
664
  spreadPathsToArguments: {},
671
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
665
+ explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
672
666
  singleArgumentUnchanged: false
673
667
  },
674
- ["subscriptionOptions"]
668
+ ["productId", "allowed"]
675
669
  );
676
670
  sideEffects?.onError?.(err);
677
671
  throw transformedError;
678
672
  }
679
673
  }
680
- async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
674
+ async function getSubscriptionOption2(_id) {
681
675
  const { httpClient, sideEffects } = arguments[1];
682
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
683
- subscriptionOptions
684
- });
685
- const reqOpts = bulkUpdateSubscriptionOptions(
686
- payload
687
- );
676
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
677
+ const reqOpts = getSubscriptionOption(payload);
688
678
  sideEffects?.onSiteCall?.();
689
679
  try {
690
680
  const result = await httpClient.request(reqOpts);
691
681
  sideEffects?.onSuccess?.(result);
692
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
682
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
693
683
  } catch (err) {
694
684
  const transformedError = (0, import_transform_error.transformError)(
695
685
  err,
696
686
  {
697
687
  spreadPathsToArguments: {},
698
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
688
+ explicitPathsToArguments: { id: "$[0]" },
699
689
  singleArgumentUnchanged: false
700
690
  },
701
- ["subscriptionOptions"]
691
+ ["_id"]
702
692
  );
703
693
  sideEffects?.onError?.(err);
704
694
  throw transformedError;
705
695
  }
706
696
  }
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(
697
+ async function getSubscriptionOptionsForProduct2(productId, options) {
698
+ const { httpClient, sideEffects } = arguments[2];
699
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
700
+ productId,
701
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
702
+ });
703
+ const reqOpts = getSubscriptionOptionsForProduct(
711
704
  payload
712
705
  );
713
706
  sideEffects?.onSiteCall?.();
714
707
  try {
715
708
  const result = await httpClient.request(reqOpts);
716
709
  sideEffects?.onSuccess?.(result);
710
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
717
711
  } catch (err) {
718
712
  const transformedError = (0, import_transform_error.transformError)(
719
713
  err,
720
714
  {
721
715
  spreadPathsToArguments: {},
722
- explicitPathsToArguments: { ids: "$[0]" },
716
+ explicitPathsToArguments: {
717
+ productId: "$[0]",
718
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
719
+ },
723
720
  singleArgumentUnchanged: false
724
721
  },
725
- ["ids"]
722
+ ["productId", "options"]
726
723
  );
727
724
  sideEffects?.onError?.(err);
728
725
  throw transformedError;
729
726
  }
730
727
  }
731
- async function assignSubscriptionOptionsToProduct2(productId, options) {
728
+ async function getProductIdsForSubscriptionOption2(_id, options) {
732
729
  const { httpClient, sideEffects } = arguments[2];
733
730
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
734
- productId,
735
- assignedSubscriptionOptions: options?.assignedSubscriptionOptions
731
+ id: _id,
732
+ includeHiddenProducts: options?.includeHiddenProducts,
733
+ paging: options?.paging
736
734
  });
737
- const reqOpts = assignSubscriptionOptionsToProduct(
735
+ const reqOpts = getProductIdsForSubscriptionOption(
738
736
  payload
739
737
  );
740
738
  sideEffects?.onSiteCall?.();
741
739
  try {
742
740
  const result = await httpClient.request(reqOpts);
743
741
  sideEffects?.onSuccess?.(result);
742
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
744
743
  } catch (err) {
745
744
  const transformedError = (0, import_transform_error.transformError)(
746
745
  err,
747
746
  {
748
747
  spreadPathsToArguments: {},
749
748
  explicitPathsToArguments: {
750
- productId: "$[0]",
751
- assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
749
+ id: "$[0]",
750
+ includeHiddenProducts: "$[1].includeHiddenProducts",
751
+ paging: "$[1].paging"
752
752
  },
753
753
  singleArgumentUnchanged: false
754
754
  },
755
- ["productId", "options"]
755
+ ["_id", "options"]
756
756
  );
757
757
  sideEffects?.onError?.(err);
758
758
  throw transformedError;
759
759
  }
760
760
  }
761
- async function allowOneTimePurchases2(productId, allowed) {
762
- const { httpClient, sideEffects } = arguments[2];
761
+ async function getOneTimePurchasesStatus2(productId) {
762
+ const { httpClient, sideEffects } = arguments[1];
763
763
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
764
- productId,
765
- allowed
764
+ productId
766
765
  });
767
- const reqOpts = allowOneTimePurchases(payload);
766
+ const reqOpts = getOneTimePurchasesStatus(payload);
768
767
  sideEffects?.onSiteCall?.();
769
768
  try {
770
769
  const result = await httpClient.request(reqOpts);
771
770
  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]", allowed: "$[1]" },
777
+ explicitPathsToArguments: { productId: "$[0]" },
778
778
  singleArgumentUnchanged: false
779
779
  },
780
- ["productId", "allowed"]
780
+ ["productId"]
781
781
  );
782
782
  sideEffects?.onError?.(err);
783
783
  throw transformedError;