@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,134 +374,122 @@ function enableCustomerCancellation(payload) {
474
374
  }
475
375
  return __enableCustomerCancellation;
476
376
  }
477
-
478
- // src/stores-v1-subscription-option-subscription-options.universal.ts
479
- var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
480
- SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
481
- SubscriptionFrequency2["DAY"] = "DAY";
482
- SubscriptionFrequency2["WEEK"] = "WEEK";
483
- SubscriptionFrequency2["MONTH"] = "MONTH";
484
- SubscriptionFrequency2["YEAR"] = "YEAR";
485
- return SubscriptionFrequency2;
486
- })(SubscriptionFrequency || {});
487
- var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
488
- DiscountType2["UNDEFINED"] = "UNDEFINED";
489
- DiscountType2["AMOUNT"] = "AMOUNT";
490
- DiscountType2["PERCENT"] = "PERCENT";
491
- return DiscountType2;
492
- })(DiscountType || {});
493
- async function getSubscriptionOption2(_id) {
494
- const { httpClient, sideEffects } = arguments[1];
495
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
496
- const reqOpts = getSubscriptionOption(payload);
497
- sideEffects?.onSiteCall?.();
498
- try {
499
- const result = await httpClient.request(reqOpts);
500
- sideEffects?.onSuccess?.(result);
501
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
502
- } catch (err) {
503
- const transformedError = (0, import_transform_error.transformError)(
504
- err,
505
- {
506
- spreadPathsToArguments: {},
507
- explicitPathsToArguments: { id: "$[0]" },
508
- singleArgumentUnchanged: false
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
509
386
  },
510
- ["_id"]
511
- );
512
- sideEffects?.onError?.(err);
513
- throw transformedError;
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;
514
399
  }
400
+ return __getSubscriptionOption;
515
401
  }
516
- async function getSubscriptionOptionsForProduct2(productId, options) {
517
- const { httpClient, sideEffects } = arguments[2];
518
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
519
- productId,
520
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
521
- });
522
- const reqOpts = getSubscriptionOptionsForProduct(
523
- payload
524
- );
525
- sideEffects?.onSiteCall?.();
526
- try {
527
- const result = await httpClient.request(reqOpts);
528
- sideEffects?.onSuccess?.(result);
529
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
530
- } catch (err) {
531
- const transformedError = (0, import_transform_error.transformError)(
532
- err,
533
- {
534
- spreadPathsToArguments: {},
535
- explicitPathsToArguments: {
536
- productId: "$[0]",
537
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
538
- },
539
- singleArgumentUnchanged: false
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
540
411
  },
541
- ["productId", "options"]
542
- );
543
- sideEffects?.onError?.(err);
544
- throw transformedError;
545
- }
546
- }
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
- );
557
- sideEffects?.onSiteCall?.();
558
- try {
559
- const result = await httpClient.request(reqOpts);
560
- sideEffects?.onSuccess?.(result);
561
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
562
- } catch (err) {
563
- const transformedError = (0, import_transform_error.transformError)(
564
- err,
565
- {
566
- spreadPathsToArguments: {},
567
- explicitPathsToArguments: {
568
- id: "$[0]",
569
- includeHiddenProducts: "$[1].includeHiddenProducts",
570
- paging: "$[1].paging"
571
- },
572
- singleArgumentUnchanged: false
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
573
440
  },
574
- ["_id", "options"]
575
- );
576
- sideEffects?.onError?.(err);
577
- throw transformedError;
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;
578
451
  }
452
+ return __getProductIdsForSubscriptionOption;
579
453
  }
580
- async function getOneTimePurchasesStatus2(productId) {
581
- const { httpClient, sideEffects } = arguments[1];
582
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
583
- productId
584
- });
585
- const reqOpts = getOneTimePurchasesStatus(payload);
586
- sideEffects?.onSiteCall?.();
587
- try {
588
- const result = await httpClient.request(reqOpts);
589
- sideEffects?.onSuccess?.(result);
590
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
591
- } catch (err) {
592
- const transformedError = (0, import_transform_error.transformError)(
593
- err,
594
- {
595
- spreadPathsToArguments: {},
596
- explicitPathsToArguments: { productId: "$[0]" },
597
- singleArgumentUnchanged: false
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
598
463
  },
599
- ["productId"]
600
- );
601
- sideEffects?.onError?.(err);
602
- throw transformedError;
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;
603
474
  }
475
+ return __getOneTimePurchasesStatus;
604
476
  }
477
+
478
+ // src/stores-v1-subscription-option-subscription-options.universal.ts
479
+ var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
480
+ SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
481
+ SubscriptionFrequency2["DAY"] = "DAY";
482
+ SubscriptionFrequency2["WEEK"] = "WEEK";
483
+ SubscriptionFrequency2["MONTH"] = "MONTH";
484
+ SubscriptionFrequency2["YEAR"] = "YEAR";
485
+ return SubscriptionFrequency2;
486
+ })(SubscriptionFrequency || {});
487
+ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
488
+ DiscountType2["UNDEFINED"] = "UNDEFINED";
489
+ DiscountType2["AMOUNT"] = "AMOUNT";
490
+ DiscountType2["PERCENT"] = "PERCENT";
491
+ return DiscountType2;
492
+ })(DiscountType || {});
605
493
  async function createSubscriptionOption2(subscriptionOption) {
606
494
  const { httpClient, sideEffects } = arguments[1];
607
495
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -832,38 +720,120 @@ async function enableCustomerCancellation2(productId, allowed) {
832
720
  throw transformedError;
833
721
  }
834
722
  }
835
-
836
- // src/stores-v1-subscription-option-subscription-options.public.ts
837
- function getSubscriptionOption3(httpClient) {
838
- return (_id) => getSubscriptionOption2(
839
- _id,
840
- // @ts-ignore
841
- { httpClient }
842
- );
723
+ async function getSubscriptionOption2(_id) {
724
+ const { httpClient, sideEffects } = arguments[1];
725
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
726
+ const reqOpts = getSubscriptionOption(payload);
727
+ sideEffects?.onSiteCall?.();
728
+ try {
729
+ const result = await httpClient.request(reqOpts);
730
+ sideEffects?.onSuccess?.(result);
731
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.subscriptionOption;
732
+ } catch (err) {
733
+ const transformedError = (0, import_transform_error.transformError)(
734
+ err,
735
+ {
736
+ spreadPathsToArguments: {},
737
+ explicitPathsToArguments: { id: "$[0]" },
738
+ singleArgumentUnchanged: false
739
+ },
740
+ ["_id"]
741
+ );
742
+ sideEffects?.onError?.(err);
743
+ throw transformedError;
744
+ }
843
745
  }
844
- function getSubscriptionOptionsForProduct3(httpClient) {
845
- return (productId, options) => getSubscriptionOptionsForProduct2(
746
+ async function getSubscriptionOptionsForProduct2(productId, options) {
747
+ const { httpClient, sideEffects } = arguments[2];
748
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
846
749
  productId,
847
- options,
848
- // @ts-ignore
849
- { httpClient }
750
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
751
+ });
752
+ const reqOpts = getSubscriptionOptionsForProduct(
753
+ payload
850
754
  );
755
+ sideEffects?.onSiteCall?.();
756
+ try {
757
+ const result = await httpClient.request(reqOpts);
758
+ sideEffects?.onSuccess?.(result);
759
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
760
+ } catch (err) {
761
+ const transformedError = (0, import_transform_error.transformError)(
762
+ err,
763
+ {
764
+ spreadPathsToArguments: {},
765
+ explicitPathsToArguments: {
766
+ productId: "$[0]",
767
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
768
+ },
769
+ singleArgumentUnchanged: false
770
+ },
771
+ ["productId", "options"]
772
+ );
773
+ sideEffects?.onError?.(err);
774
+ throw transformedError;
775
+ }
851
776
  }
852
- function getProductIdsForSubscriptionOption3(httpClient) {
853
- return (_id, options) => getProductIdsForSubscriptionOption2(
854
- _id,
855
- options,
856
- // @ts-ignore
857
- { httpClient }
777
+ async function getProductIdsForSubscriptionOption2(_id, options) {
778
+ const { httpClient, sideEffects } = arguments[2];
779
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
780
+ id: _id,
781
+ includeHiddenProducts: options?.includeHiddenProducts,
782
+ paging: options?.paging
783
+ });
784
+ const reqOpts = getProductIdsForSubscriptionOption(
785
+ payload
858
786
  );
787
+ sideEffects?.onSiteCall?.();
788
+ try {
789
+ const result = await httpClient.request(reqOpts);
790
+ sideEffects?.onSuccess?.(result);
791
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
792
+ } catch (err) {
793
+ const transformedError = (0, import_transform_error.transformError)(
794
+ err,
795
+ {
796
+ spreadPathsToArguments: {},
797
+ explicitPathsToArguments: {
798
+ id: "$[0]",
799
+ includeHiddenProducts: "$[1].includeHiddenProducts",
800
+ paging: "$[1].paging"
801
+ },
802
+ singleArgumentUnchanged: false
803
+ },
804
+ ["_id", "options"]
805
+ );
806
+ sideEffects?.onError?.(err);
807
+ throw transformedError;
808
+ }
859
809
  }
860
- function getOneTimePurchasesStatus3(httpClient) {
861
- return (productId) => getOneTimePurchasesStatus2(
862
- productId,
863
- // @ts-ignore
864
- { httpClient }
865
- );
810
+ async function getOneTimePurchasesStatus2(productId) {
811
+ const { httpClient, sideEffects } = arguments[1];
812
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
813
+ productId
814
+ });
815
+ const reqOpts = getOneTimePurchasesStatus(payload);
816
+ sideEffects?.onSiteCall?.();
817
+ try {
818
+ const result = await httpClient.request(reqOpts);
819
+ sideEffects?.onSuccess?.(result);
820
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
821
+ } catch (err) {
822
+ const transformedError = (0, import_transform_error.transformError)(
823
+ err,
824
+ {
825
+ spreadPathsToArguments: {},
826
+ explicitPathsToArguments: { productId: "$[0]" },
827
+ singleArgumentUnchanged: false
828
+ },
829
+ ["productId"]
830
+ );
831
+ sideEffects?.onError?.(err);
832
+ throw transformedError;
833
+ }
866
834
  }
835
+
836
+ // src/stores-v1-subscription-option-subscription-options.public.ts
867
837
  function createSubscriptionOption3(httpClient) {
868
838
  return (subscriptionOption) => createSubscriptionOption2(
869
839
  subscriptionOption,
@@ -931,13 +901,39 @@ function enableCustomerCancellation3(httpClient) {
931
901
  { httpClient }
932
902
  );
933
903
  }
904
+ function getSubscriptionOption3(httpClient) {
905
+ return (_id) => getSubscriptionOption2(
906
+ _id,
907
+ // @ts-ignore
908
+ { httpClient }
909
+ );
910
+ }
911
+ function getSubscriptionOptionsForProduct3(httpClient) {
912
+ return (productId, options) => getSubscriptionOptionsForProduct2(
913
+ productId,
914
+ options,
915
+ // @ts-ignore
916
+ { httpClient }
917
+ );
918
+ }
919
+ function getProductIdsForSubscriptionOption3(httpClient) {
920
+ return (_id, options) => getProductIdsForSubscriptionOption2(
921
+ _id,
922
+ options,
923
+ // @ts-ignore
924
+ { httpClient }
925
+ );
926
+ }
927
+ function getOneTimePurchasesStatus3(httpClient) {
928
+ return (productId) => getOneTimePurchasesStatus2(
929
+ productId,
930
+ // @ts-ignore
931
+ { httpClient }
932
+ );
933
+ }
934
934
 
935
935
  // src/stores-v1-subscription-option-subscription-options.context.ts
936
936
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
937
- var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
938
- var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
939
- var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
940
- var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
941
937
  var createSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSubscriptionOption3);
942
938
  var updateSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSubscriptionOption3);
943
939
  var deleteSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSubscriptionOption3);
@@ -947,6 +943,10 @@ var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ (0, import_rest_modules3.cr
947
943
  var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(assignSubscriptionOptionsToProduct3);
948
944
  var allowOneTimePurchases4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(allowOneTimePurchases3);
949
945
  var enableCustomerCancellation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(enableCustomerCancellation3);
946
+ var getSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOption3);
947
+ var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSubscriptionOptionsForProduct3);
948
+ var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductIdsForSubscriptionOption3);
949
+ var getOneTimePurchasesStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getOneTimePurchasesStatus3);
950
950
  // Annotate the CommonJS export names for ESM import in node:
951
951
  0 && (module.exports = {
952
952
  DiscountType,