@wix/auto_sdk_stores_subscription-options 1.0.36 → 1.0.37

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