@wix/auto_sdk_stores_subscription-options 1.0.40 → 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 +42 -53
  2. package/build/cjs/index.js +234 -293
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +150 -175
  5. package/build/cjs/index.typings.js +205 -255
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +108 -122
  8. package/build/cjs/meta.js +176 -219
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +42 -53
  11. package/build/es/index.mjs +234 -292
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +150 -175
  14. package/build/es/index.typings.mjs +205 -254
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +108 -122
  17. package/build/es/meta.mjs +176 -218
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +42 -53
  20. package/build/internal/cjs/index.js +234 -293
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +150 -175
  23. package/build/internal/cjs/index.typings.js +205 -255
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +108 -122
  26. package/build/internal/cjs/meta.js +176 -219
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +42 -53
  29. package/build/internal/es/index.mjs +234 -292
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +150 -175
  32. package/build/internal/es/index.typings.mjs +205 -254
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +108 -122
  35. package/build/internal/es/meta.mjs +176 -218
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -29,7 +29,6 @@ __export(index_typings_exports, {
29
29
  bulkUpdateSubscriptionOptions: () => bulkUpdateSubscriptionOptions2,
30
30
  createSubscriptionOption: () => createSubscriptionOption2,
31
31
  deleteSubscriptionOption: () => deleteSubscriptionOption2,
32
- enableCustomerCancellation: () => enableCustomerCancellation2,
33
32
  getOneTimePurchasesStatus: () => getOneTimePurchasesStatus2,
34
33
  getProductIdsForSubscriptionOption: () => getProductIdsForSubscriptionOption2,
35
34
  getSubscriptionOption: () => getSubscriptionOption2,
@@ -48,76 +47,76 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
48
47
  var import_float2 = require("@wix/sdk-runtime/transformations/float");
49
48
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
50
49
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
51
- function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
50
+ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
52
51
  const domainToMappings = {
53
52
  "api._api_base_domain_": [
54
53
  {
55
- srcPath: "/wix-ecommerce-plans",
54
+ srcPath: "/wix-ecommerce-plans-reader",
56
55
  destPath: ""
57
56
  }
58
57
  ],
59
- "www.wixapis.com": [
58
+ "www._base_domain_": [
60
59
  {
61
- srcPath: "/stores/v1/subscription-options",
62
- destPath: "/v1/subscription-options"
60
+ srcPath: "/_api/wix-ecommerce-plans-reader",
61
+ destPath: ""
63
62
  }
64
63
  ],
65
- "www._base_domain_": [
64
+ _: [
66
65
  {
67
- srcPath: "/_api/subscription-options-server",
66
+ srcPath: "/_api/subscription-options-reader-server",
68
67
  destPath: ""
69
68
  }
70
69
  ],
71
- "editor._base_domain_": [
70
+ "manage._base_domain_": [
72
71
  {
73
- srcPath: "/_api/subscription-options-server",
72
+ srcPath: "/_api/subscription-options-reader-server",
74
73
  destPath: ""
75
74
  }
76
- ],
77
- "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_": [
78
82
  {
79
- srcPath: "/_api/subscription-options-server",
83
+ srcPath: "/wix-ecommerce-plans",
80
84
  destPath: ""
81
85
  }
82
86
  ],
83
- "create.editorx": [
87
+ "www.wixapis.com": [
84
88
  {
85
- srcPath: "/_api/subscription-options-server",
86
- destPath: ""
89
+ srcPath: "/stores/v1/subscription-options",
90
+ destPath: "/v1/subscription-options"
87
91
  }
88
92
  ],
89
- "manage._base_domain_": [
93
+ "www._base_domain_": [
90
94
  {
91
95
  srcPath: "/_api/subscription-options-server",
92
96
  destPath: ""
93
97
  }
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_": [
98
+ ],
99
+ "editor._base_domain_": [
101
100
  {
102
- srcPath: "/wix-ecommerce-plans-reader",
101
+ srcPath: "/_api/subscription-options-server",
103
102
  destPath: ""
104
103
  }
105
104
  ],
106
- "www._base_domain_": [
105
+ "blocks._base_domain_": [
107
106
  {
108
- srcPath: "/_api/wix-ecommerce-plans-reader",
107
+ srcPath: "/_api/subscription-options-server",
109
108
  destPath: ""
110
109
  }
111
110
  ],
112
- _: [
111
+ "create.editorx": [
113
112
  {
114
- srcPath: "/_api/subscription-options-reader-server",
113
+ srcPath: "/_api/subscription-options-server",
115
114
  destPath: ""
116
115
  }
117
116
  ],
118
117
  "manage._base_domain_": [
119
118
  {
120
- srcPath: "/_api/subscription-options-reader-server",
119
+ srcPath: "/_api/subscription-options-server",
121
120
  destPath: ""
122
121
  }
123
122
  ]
@@ -125,106 +124,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
125
124
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
126
125
  }
127
126
  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
127
  function createSubscriptionOption(payload) {
229
128
  function __createSubscriptionOption({ host }) {
230
129
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -451,28 +350,105 @@ function allowOneTimePurchases(payload) {
451
350
  }
452
351
  return __allowOneTimePurchases;
453
352
  }
454
- function enableCustomerCancellation(payload) {
455
- function __enableCustomerCancellation({ host }) {
353
+ function getSubscriptionOption(payload) {
354
+ function __getSubscriptionOption({ host }) {
456
355
  const metadata = {
457
356
  entityFqdn: "wix.stores.v1.subscription_option",
458
- method: "PATCH",
459
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.EnableCustomerCancellation",
357
+ method: "GET",
358
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
460
359
  packageName: PACKAGE_NAME,
461
360
  migrationOptions: {
462
361
  optInTransformResponse: true
463
362
  },
464
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
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, [
465
368
  {
466
- protoPath: "/v1/subscription-options/product/{productId}/enableCustomerCancellation",
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}",
467
391
  data: payload,
468
392
  host
469
393
  }
470
394
  ),
471
- data: payload
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)
472
425
  };
473
426
  return metadata;
474
427
  }
475
- return __enableCustomerCancellation;
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;
476
452
  }
477
453
 
478
454
  // src/stores-v1-subscription-option-subscription-options.universal.ts
@@ -490,10 +466,12 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
490
466
  DiscountType2["PERCENT"] = "PERCENT";
491
467
  return DiscountType2;
492
468
  })(DiscountType || {});
493
- async function getSubscriptionOption2(_id) {
469
+ async function createSubscriptionOption2(subscriptionOption) {
494
470
  const { httpClient, sideEffects } = arguments[1];
495
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
496
- const reqOpts = getSubscriptionOption(payload);
471
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
472
+ subscriptionOption
473
+ });
474
+ const reqOpts = createSubscriptionOption(payload);
497
475
  sideEffects?.onSiteCall?.();
498
476
  try {
499
477
  const result = await httpClient.request(reqOpts);
@@ -504,85 +482,70 @@ async function getSubscriptionOption2(_id) {
504
482
  err,
505
483
  {
506
484
  spreadPathsToArguments: {},
507
- explicitPathsToArguments: { id: "$[0]" },
485
+ explicitPathsToArguments: { subscriptionOption: "$[0]" },
508
486
  singleArgumentUnchanged: false
509
487
  },
510
- ["_id"]
488
+ ["subscriptionOption"]
511
489
  );
512
490
  sideEffects?.onError?.(err);
513
491
  throw transformedError;
514
492
  }
515
493
  }
516
- async function getSubscriptionOptionsForProduct2(productId, options) {
494
+ async function updateSubscriptionOption2(_id, subscriptionOption) {
517
495
  const { httpClient, sideEffects } = arguments[2];
518
496
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
519
- productId,
520
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
497
+ subscriptionOption: { ...subscriptionOption, id: _id }
521
498
  });
522
- const reqOpts = getSubscriptionOptionsForProduct(
523
- payload
524
- );
499
+ const reqOpts = updateSubscriptionOption(payload);
525
500
  sideEffects?.onSiteCall?.();
526
501
  try {
527
502
  const result = await httpClient.request(reqOpts);
528
503
  sideEffects?.onSuccess?.(result);
529
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
504
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
530
505
  } catch (err) {
531
506
  const transformedError = (0, import_transform_error.transformError)(
532
507
  err,
533
508
  {
534
- spreadPathsToArguments: {},
535
- explicitPathsToArguments: {
536
- productId: "$[0]",
537
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
538
- },
509
+ spreadPathsToArguments: { subscriptionOption: "$[1]" },
510
+ explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
539
511
  singleArgumentUnchanged: false
540
512
  },
541
- ["productId", "options"]
513
+ ["_id", "subscriptionOption"]
542
514
  );
543
515
  sideEffects?.onError?.(err);
544
516
  throw transformedError;
545
517
  }
546
518
  }
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
- );
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);
557
523
  sideEffects?.onSiteCall?.();
558
524
  try {
559
525
  const result = await httpClient.request(reqOpts);
560
526
  sideEffects?.onSuccess?.(result);
561
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
562
527
  } catch (err) {
563
528
  const transformedError = (0, import_transform_error.transformError)(
564
529
  err,
565
530
  {
566
531
  spreadPathsToArguments: {},
567
- explicitPathsToArguments: {
568
- id: "$[0]",
569
- includeHiddenProducts: "$[1].includeHiddenProducts",
570
- paging: "$[1].paging"
571
- },
532
+ explicitPathsToArguments: { id: "$[0]" },
572
533
  singleArgumentUnchanged: false
573
534
  },
574
- ["_id", "options"]
535
+ ["_id"]
575
536
  );
576
537
  sideEffects?.onError?.(err);
577
538
  throw transformedError;
578
539
  }
579
540
  }
580
- async function getOneTimePurchasesStatus2(productId) {
541
+ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
581
542
  const { httpClient, sideEffects } = arguments[1];
582
543
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
583
- productId
544
+ subscriptionOptions
584
545
  });
585
- const reqOpts = getOneTimePurchasesStatus(payload);
546
+ const reqOpts = bulkCreateSubscriptionOptions(
547
+ payload
548
+ );
586
549
  sideEffects?.onSiteCall?.();
587
550
  try {
588
551
  const result = await httpClient.request(reqOpts);
@@ -593,69 +556,48 @@ async function getOneTimePurchasesStatus2(productId) {
593
556
  err,
594
557
  {
595
558
  spreadPathsToArguments: {},
596
- explicitPathsToArguments: { productId: "$[0]" },
559
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
597
560
  singleArgumentUnchanged: false
598
561
  },
599
- ["productId"]
562
+ ["subscriptionOptions"]
600
563
  );
601
564
  sideEffects?.onError?.(err);
602
565
  throw transformedError;
603
566
  }
604
567
  }
605
- async function createSubscriptionOption2(subscriptionOption) {
568
+ async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
606
569
  const { httpClient, sideEffects } = arguments[1];
607
570
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
608
- subscriptionOption
571
+ subscriptionOptions
609
572
  });
610
- const reqOpts = createSubscriptionOption(payload);
573
+ const reqOpts = bulkUpdateSubscriptionOptions(
574
+ payload
575
+ );
611
576
  sideEffects?.onSiteCall?.();
612
577
  try {
613
578
  const result = await httpClient.request(reqOpts);
614
579
  sideEffects?.onSuccess?.(result);
615
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
580
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
616
581
  } catch (err) {
617
582
  const transformedError = (0, import_transform_error.transformError)(
618
583
  err,
619
584
  {
620
585
  spreadPathsToArguments: {},
621
- explicitPathsToArguments: { subscriptionOption: "$[0]" },
622
- singleArgumentUnchanged: false
623
- },
624
- ["subscriptionOption"]
625
- );
626
- sideEffects?.onError?.(err);
627
- throw transformedError;
628
- }
629
- }
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);
636
- sideEffects?.onSiteCall?.();
637
- try {
638
- const result = await httpClient.request(reqOpts);
639
- sideEffects?.onSuccess?.(result);
640
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
641
- } catch (err) {
642
- const transformedError = (0, import_transform_error.transformError)(
643
- err,
644
- {
645
- spreadPathsToArguments: { subscriptionOption: "$[1]" },
646
- explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
586
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
647
587
  singleArgumentUnchanged: false
648
588
  },
649
- ["_id", "subscriptionOption"]
589
+ ["subscriptionOptions"]
650
590
  );
651
591
  sideEffects?.onError?.(err);
652
592
  throw transformedError;
653
593
  }
654
594
  }
655
- async function deleteSubscriptionOption2(_id) {
595
+ async function bulkDeleteSubscriptionOptions2(ids) {
656
596
  const { httpClient, sideEffects } = arguments[1];
657
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
658
- const reqOpts = deleteSubscriptionOption(payload);
597
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
598
+ const reqOpts = bulkDeleteSubscriptionOptions(
599
+ payload
600
+ );
659
601
  sideEffects?.onSiteCall?.();
660
602
  try {
661
603
  const result = await httpClient.request(reqOpts);
@@ -665,106 +607,107 @@ async function deleteSubscriptionOption2(_id) {
665
607
  err,
666
608
  {
667
609
  spreadPathsToArguments: {},
668
- explicitPathsToArguments: { id: "$[0]" },
610
+ explicitPathsToArguments: { ids: "$[0]" },
669
611
  singleArgumentUnchanged: false
670
612
  },
671
- ["_id"]
613
+ ["ids"]
672
614
  );
673
615
  sideEffects?.onError?.(err);
674
616
  throw transformedError;
675
617
  }
676
618
  }
677
- async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
678
- const { httpClient, sideEffects } = arguments[1];
619
+ async function assignSubscriptionOptionsToProduct2(productId, options) {
620
+ const { httpClient, sideEffects } = arguments[2];
679
621
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
680
- subscriptionOptions
622
+ productId,
623
+ assignedSubscriptionOptions: options?.assignedSubscriptionOptions
681
624
  });
682
- const reqOpts = bulkCreateSubscriptionOptions(
625
+ const reqOpts = assignSubscriptionOptionsToProduct(
683
626
  payload
684
627
  );
685
628
  sideEffects?.onSiteCall?.();
686
629
  try {
687
630
  const result = await httpClient.request(reqOpts);
688
631
  sideEffects?.onSuccess?.(result);
689
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
690
632
  } catch (err) {
691
633
  const transformedError = (0, import_transform_error.transformError)(
692
634
  err,
693
635
  {
694
636
  spreadPathsToArguments: {},
695
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
637
+ explicitPathsToArguments: {
638
+ productId: "$[0]",
639
+ assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
640
+ },
696
641
  singleArgumentUnchanged: false
697
642
  },
698
- ["subscriptionOptions"]
643
+ ["productId", "options"]
699
644
  );
700
645
  sideEffects?.onError?.(err);
701
646
  throw transformedError;
702
647
  }
703
648
  }
704
- async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
705
- const { httpClient, sideEffects } = arguments[1];
649
+ async function allowOneTimePurchases2(productId, allowed) {
650
+ const { httpClient, sideEffects } = arguments[2];
706
651
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
707
- subscriptionOptions
652
+ productId,
653
+ allowed
708
654
  });
709
- const reqOpts = bulkUpdateSubscriptionOptions(
710
- payload
711
- );
655
+ const reqOpts = allowOneTimePurchases(payload);
712
656
  sideEffects?.onSiteCall?.();
713
657
  try {
714
658
  const result = await httpClient.request(reqOpts);
715
659
  sideEffects?.onSuccess?.(result);
716
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
717
660
  } catch (err) {
718
661
  const transformedError = (0, import_transform_error.transformError)(
719
662
  err,
720
663
  {
721
664
  spreadPathsToArguments: {},
722
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
665
+ explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
723
666
  singleArgumentUnchanged: false
724
667
  },
725
- ["subscriptionOptions"]
668
+ ["productId", "allowed"]
726
669
  );
727
670
  sideEffects?.onError?.(err);
728
671
  throw transformedError;
729
672
  }
730
673
  }
731
- async function bulkDeleteSubscriptionOptions2(ids) {
674
+ async function getSubscriptionOption2(_id) {
732
675
  const { httpClient, sideEffects } = arguments[1];
733
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
734
- const reqOpts = bulkDeleteSubscriptionOptions(
735
- payload
736
- );
676
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
677
+ const reqOpts = getSubscriptionOption(payload);
737
678
  sideEffects?.onSiteCall?.();
738
679
  try {
739
680
  const result = await httpClient.request(reqOpts);
740
681
  sideEffects?.onSuccess?.(result);
682
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
741
683
  } catch (err) {
742
684
  const transformedError = (0, import_transform_error.transformError)(
743
685
  err,
744
686
  {
745
687
  spreadPathsToArguments: {},
746
- explicitPathsToArguments: { ids: "$[0]" },
688
+ explicitPathsToArguments: { id: "$[0]" },
747
689
  singleArgumentUnchanged: false
748
690
  },
749
- ["ids"]
691
+ ["_id"]
750
692
  );
751
693
  sideEffects?.onError?.(err);
752
694
  throw transformedError;
753
695
  }
754
696
  }
755
- async function assignSubscriptionOptionsToProduct2(productId, options) {
697
+ async function getSubscriptionOptionsForProduct2(productId, options) {
756
698
  const { httpClient, sideEffects } = arguments[2];
757
699
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
758
700
  productId,
759
- assignedSubscriptionOptions: options?.assignedSubscriptionOptions
701
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
760
702
  });
761
- const reqOpts = assignSubscriptionOptionsToProduct(
703
+ const reqOpts = getSubscriptionOptionsForProduct(
762
704
  payload
763
705
  );
764
706
  sideEffects?.onSiteCall?.();
765
707
  try {
766
708
  const result = await httpClient.request(reqOpts);
767
709
  sideEffects?.onSuccess?.(result);
710
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
768
711
  } catch (err) {
769
712
  const transformedError = (0, import_transform_error.transformError)(
770
713
  err,
@@ -772,7 +715,7 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
772
715
  spreadPathsToArguments: {},
773
716
  explicitPathsToArguments: {
774
717
  productId: "$[0]",
775
- assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
718
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
776
719
  },
777
720
  singleArgumentUnchanged: false
778
721
  },
@@ -782,51 +725,59 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
782
725
  throw transformedError;
783
726
  }
784
727
  }
785
- async function allowOneTimePurchases2(productId, allowed) {
728
+ async function getProductIdsForSubscriptionOption2(_id, options) {
786
729
  const { httpClient, sideEffects } = arguments[2];
787
730
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
788
- productId,
789
- allowed
731
+ id: _id,
732
+ includeHiddenProducts: options?.includeHiddenProducts,
733
+ paging: options?.paging
790
734
  });
791
- const reqOpts = allowOneTimePurchases(payload);
735
+ const reqOpts = getProductIdsForSubscriptionOption(
736
+ payload
737
+ );
792
738
  sideEffects?.onSiteCall?.();
793
739
  try {
794
740
  const result = await httpClient.request(reqOpts);
795
741
  sideEffects?.onSuccess?.(result);
742
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
796
743
  } catch (err) {
797
744
  const transformedError = (0, import_transform_error.transformError)(
798
745
  err,
799
746
  {
800
747
  spreadPathsToArguments: {},
801
- explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
748
+ explicitPathsToArguments: {
749
+ id: "$[0]",
750
+ includeHiddenProducts: "$[1].includeHiddenProducts",
751
+ paging: "$[1].paging"
752
+ },
802
753
  singleArgumentUnchanged: false
803
754
  },
804
- ["productId", "allowed"]
755
+ ["_id", "options"]
805
756
  );
806
757
  sideEffects?.onError?.(err);
807
758
  throw transformedError;
808
759
  }
809
760
  }
810
- async function enableCustomerCancellation2(productId, allowed) {
811
- const { httpClient, sideEffects } = arguments[2];
761
+ async function getOneTimePurchasesStatus2(productId) {
762
+ const { httpClient, sideEffects } = arguments[1];
812
763
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
813
- productId,
814
- allowed
764
+ productId
815
765
  });
816
- const reqOpts = enableCustomerCancellation(payload);
766
+ const reqOpts = getOneTimePurchasesStatus(payload);
817
767
  sideEffects?.onSiteCall?.();
818
768
  try {
819
769
  const result = await httpClient.request(reqOpts);
820
770
  sideEffects?.onSuccess?.(result);
771
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
821
772
  } catch (err) {
822
773
  const transformedError = (0, import_transform_error.transformError)(
823
774
  err,
824
775
  {
825
776
  spreadPathsToArguments: {},
826
- explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
777
+ explicitPathsToArguments: { productId: "$[0]" },
827
778
  singleArgumentUnchanged: false
828
779
  },
829
- ["productId", "allowed"]
780
+ ["productId"]
830
781
  );
831
782
  sideEffects?.onError?.(err);
832
783
  throw transformedError;
@@ -843,7 +794,6 @@ async function enableCustomerCancellation2(productId, allowed) {
843
794
  bulkUpdateSubscriptionOptions,
844
795
  createSubscriptionOption,
845
796
  deleteSubscriptionOption,
846
- enableCustomerCancellation,
847
797
  getOneTimePurchasesStatus,
848
798
  getProductIdsForSubscriptionOption,
849
799
  getSubscriptionOption,