@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
@@ -11,76 +11,76 @@ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/f
11
11
  import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
12
12
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
13
13
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
14
- function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
14
+ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
15
15
  const domainToMappings = {
16
16
  "api._api_base_domain_": [
17
17
  {
18
- srcPath: "/wix-ecommerce-plans",
18
+ srcPath: "/wix-ecommerce-plans-reader",
19
19
  destPath: ""
20
20
  }
21
21
  ],
22
- "www.wixapis.com": [
22
+ "www._base_domain_": [
23
23
  {
24
- srcPath: "/stores/v1/subscription-options",
25
- destPath: "/v1/subscription-options"
24
+ srcPath: "/_api/wix-ecommerce-plans-reader",
25
+ destPath: ""
26
26
  }
27
27
  ],
28
- "www._base_domain_": [
28
+ _: [
29
29
  {
30
- srcPath: "/_api/subscription-options-server",
30
+ srcPath: "/_api/subscription-options-reader-server",
31
31
  destPath: ""
32
32
  }
33
33
  ],
34
- "editor._base_domain_": [
34
+ "manage._base_domain_": [
35
35
  {
36
- srcPath: "/_api/subscription-options-server",
36
+ srcPath: "/_api/subscription-options-reader-server",
37
37
  destPath: ""
38
38
  }
39
- ],
40
- "blocks._base_domain_": [
39
+ ]
40
+ };
41
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
42
+ }
43
+ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
44
+ const domainToMappings = {
45
+ "api._api_base_domain_": [
41
46
  {
42
- srcPath: "/_api/subscription-options-server",
47
+ srcPath: "/wix-ecommerce-plans",
43
48
  destPath: ""
44
49
  }
45
50
  ],
46
- "create.editorx": [
51
+ "www.wixapis.com": [
47
52
  {
48
- srcPath: "/_api/subscription-options-server",
49
- destPath: ""
53
+ srcPath: "/stores/v1/subscription-options",
54
+ destPath: "/v1/subscription-options"
50
55
  }
51
56
  ],
52
- "manage._base_domain_": [
57
+ "www._base_domain_": [
53
58
  {
54
59
  srcPath: "/_api/subscription-options-server",
55
60
  destPath: ""
56
61
  }
57
- ]
58
- };
59
- return resolveUrl(Object.assign(opts, { domainToMappings }));
60
- }
61
- function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
62
- const domainToMappings = {
63
- "api._api_base_domain_": [
62
+ ],
63
+ "editor._base_domain_": [
64
64
  {
65
- srcPath: "/wix-ecommerce-plans-reader",
65
+ srcPath: "/_api/subscription-options-server",
66
66
  destPath: ""
67
67
  }
68
68
  ],
69
- "www._base_domain_": [
69
+ "blocks._base_domain_": [
70
70
  {
71
- srcPath: "/_api/wix-ecommerce-plans-reader",
71
+ srcPath: "/_api/subscription-options-server",
72
72
  destPath: ""
73
73
  }
74
74
  ],
75
- _: [
75
+ "create.editorx": [
76
76
  {
77
- srcPath: "/_api/subscription-options-reader-server",
77
+ srcPath: "/_api/subscription-options-server",
78
78
  destPath: ""
79
79
  }
80
80
  ],
81
81
  "manage._base_domain_": [
82
82
  {
83
- srcPath: "/_api/subscription-options-reader-server",
83
+ srcPath: "/_api/subscription-options-server",
84
84
  destPath: ""
85
85
  }
86
86
  ]
@@ -88,106 +88,6 @@ function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl
88
88
  return resolveUrl(Object.assign(opts, { domainToMappings }));
89
89
  }
90
90
  var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
91
- function getSubscriptionOption(payload) {
92
- function __getSubscriptionOption({ host }) {
93
- const metadata = {
94
- entityFqdn: "wix.stores.v1.subscription_option",
95
- method: "GET",
96
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
97
- packageName: PACKAGE_NAME,
98
- migrationOptions: {
99
- optInTransformResponse: true
100
- },
101
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
102
- { protoPath: "/v1/subscription-options/{id}", data: payload, host }
103
- ),
104
- params: toURLSearchParams(payload),
105
- transformResponse: (payload2) => transformPaths(payload2, [
106
- {
107
- transformFn: transformRESTFloatToSDKFloat,
108
- paths: [{ path: "subscriptionOption.discount.value" }]
109
- }
110
- ])
111
- };
112
- return metadata;
113
- }
114
- return __getSubscriptionOption;
115
- }
116
- function getSubscriptionOptionsForProduct(payload) {
117
- function __getSubscriptionOptionsForProduct({ host }) {
118
- const metadata = {
119
- entityFqdn: "wix.stores.v1.subscription_option",
120
- method: "GET",
121
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
122
- packageName: PACKAGE_NAME,
123
- migrationOptions: {
124
- optInTransformResponse: true
125
- },
126
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
127
- {
128
- protoPath: "/v1/subscription-options/byProduct/{productId}",
129
- data: payload,
130
- host
131
- }
132
- ),
133
- params: toURLSearchParams(payload),
134
- transformResponse: (payload2) => transformPaths(payload2, [
135
- {
136
- transformFn: transformRESTFloatToSDKFloat,
137
- paths: [{ path: "subscriptionOptions.discount.value" }]
138
- }
139
- ])
140
- };
141
- return metadata;
142
- }
143
- return __getSubscriptionOptionsForProduct;
144
- }
145
- function getProductIdsForSubscriptionOption(payload) {
146
- function __getProductIdsForSubscriptionOption({ host }) {
147
- const metadata = {
148
- entityFqdn: "wix.stores.v1.subscription_option",
149
- method: "GET",
150
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
151
- packageName: PACKAGE_NAME,
152
- migrationOptions: {
153
- optInTransformResponse: true
154
- },
155
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
156
- {
157
- protoPath: "/v1/subscription-options/{id}/productIds",
158
- data: payload,
159
- host
160
- }
161
- ),
162
- params: toURLSearchParams(payload)
163
- };
164
- return metadata;
165
- }
166
- return __getProductIdsForSubscriptionOption;
167
- }
168
- function getOneTimePurchasesStatus(payload) {
169
- function __getOneTimePurchasesStatus({ host }) {
170
- const metadata = {
171
- entityFqdn: "wix.stores.v1.subscription_option",
172
- method: "GET",
173
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
174
- packageName: PACKAGE_NAME,
175
- migrationOptions: {
176
- optInTransformResponse: true
177
- },
178
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
179
- {
180
- protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
181
- data: payload,
182
- host
183
- }
184
- ),
185
- params: toURLSearchParams(payload)
186
- };
187
- return metadata;
188
- }
189
- return __getOneTimePurchasesStatus;
190
- }
191
91
  function createSubscriptionOption(payload) {
192
92
  function __createSubscriptionOption({ host }) {
193
93
  const serializedData = transformPaths(payload, [
@@ -437,134 +337,122 @@ function enableCustomerCancellation(payload) {
437
337
  }
438
338
  return __enableCustomerCancellation;
439
339
  }
440
-
441
- // src/stores-v1-subscription-option-subscription-options.universal.ts
442
- var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
443
- SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
444
- SubscriptionFrequency2["DAY"] = "DAY";
445
- SubscriptionFrequency2["WEEK"] = "WEEK";
446
- SubscriptionFrequency2["MONTH"] = "MONTH";
447
- SubscriptionFrequency2["YEAR"] = "YEAR";
448
- return SubscriptionFrequency2;
449
- })(SubscriptionFrequency || {});
450
- var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
451
- DiscountType2["UNDEFINED"] = "UNDEFINED";
452
- DiscountType2["AMOUNT"] = "AMOUNT";
453
- DiscountType2["PERCENT"] = "PERCENT";
454
- return DiscountType2;
455
- })(DiscountType || {});
456
- async function getSubscriptionOption2(_id) {
457
- const { httpClient, sideEffects } = arguments[1];
458
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
459
- const reqOpts = getSubscriptionOption(payload);
460
- sideEffects?.onSiteCall?.();
461
- try {
462
- const result = await httpClient.request(reqOpts);
463
- sideEffects?.onSuccess?.(result);
464
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
465
- } catch (err) {
466
- const transformedError = sdkTransformError(
467
- err,
468
- {
469
- spreadPathsToArguments: {},
470
- explicitPathsToArguments: { id: "$[0]" },
471
- singleArgumentUnchanged: false
340
+ function getSubscriptionOption(payload) {
341
+ function __getSubscriptionOption({ host }) {
342
+ const metadata = {
343
+ entityFqdn: "wix.stores.v1.subscription_option",
344
+ method: "GET",
345
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
346
+ packageName: PACKAGE_NAME,
347
+ migrationOptions: {
348
+ optInTransformResponse: true
472
349
  },
473
- ["_id"]
474
- );
475
- sideEffects?.onError?.(err);
476
- throw transformedError;
350
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
351
+ { protoPath: "/v1/subscription-options/{id}", data: payload, host }
352
+ ),
353
+ params: toURLSearchParams(payload),
354
+ transformResponse: (payload2) => transformPaths(payload2, [
355
+ {
356
+ transformFn: transformRESTFloatToSDKFloat,
357
+ paths: [{ path: "subscriptionOption.discount.value" }]
358
+ }
359
+ ])
360
+ };
361
+ return metadata;
477
362
  }
363
+ return __getSubscriptionOption;
478
364
  }
479
- async function getSubscriptionOptionsForProduct2(productId, options) {
480
- const { httpClient, sideEffects } = arguments[2];
481
- const payload = renameKeysFromSDKRequestToRESTRequest({
482
- productId,
483
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
484
- });
485
- const reqOpts = getSubscriptionOptionsForProduct(
486
- payload
487
- );
488
- sideEffects?.onSiteCall?.();
489
- try {
490
- const result = await httpClient.request(reqOpts);
491
- sideEffects?.onSuccess?.(result);
492
- return renameKeysFromRESTResponseToSDKResponse(result.data);
493
- } catch (err) {
494
- const transformedError = sdkTransformError(
495
- err,
496
- {
497
- spreadPathsToArguments: {},
498
- explicitPathsToArguments: {
499
- productId: "$[0]",
500
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
501
- },
502
- singleArgumentUnchanged: false
365
+ function getSubscriptionOptionsForProduct(payload) {
366
+ function __getSubscriptionOptionsForProduct({ host }) {
367
+ const metadata = {
368
+ entityFqdn: "wix.stores.v1.subscription_option",
369
+ method: "GET",
370
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
371
+ packageName: PACKAGE_NAME,
372
+ migrationOptions: {
373
+ optInTransformResponse: true
503
374
  },
504
- ["productId", "options"]
505
- );
506
- sideEffects?.onError?.(err);
507
- throw transformedError;
508
- }
509
- }
510
- async function getProductIdsForSubscriptionOption2(_id, options) {
511
- const { httpClient, sideEffects } = arguments[2];
512
- const payload = renameKeysFromSDKRequestToRESTRequest({
513
- id: _id,
514
- includeHiddenProducts: options?.includeHiddenProducts,
515
- paging: options?.paging
516
- });
517
- const reqOpts = getProductIdsForSubscriptionOption(
518
- payload
519
- );
520
- sideEffects?.onSiteCall?.();
521
- try {
522
- const result = await httpClient.request(reqOpts);
523
- sideEffects?.onSuccess?.(result);
524
- return renameKeysFromRESTResponseToSDKResponse(result.data);
525
- } catch (err) {
526
- const transformedError = sdkTransformError(
527
- err,
528
- {
529
- spreadPathsToArguments: {},
530
- explicitPathsToArguments: {
531
- id: "$[0]",
532
- includeHiddenProducts: "$[1].includeHiddenProducts",
533
- paging: "$[1].paging"
534
- },
535
- singleArgumentUnchanged: false
375
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
376
+ {
377
+ protoPath: "/v1/subscription-options/byProduct/{productId}",
378
+ data: payload,
379
+ host
380
+ }
381
+ ),
382
+ params: toURLSearchParams(payload),
383
+ transformResponse: (payload2) => transformPaths(payload2, [
384
+ {
385
+ transformFn: transformRESTFloatToSDKFloat,
386
+ paths: [{ path: "subscriptionOptions.discount.value" }]
387
+ }
388
+ ])
389
+ };
390
+ return metadata;
391
+ }
392
+ return __getSubscriptionOptionsForProduct;
393
+ }
394
+ function getProductIdsForSubscriptionOption(payload) {
395
+ function __getProductIdsForSubscriptionOption({ host }) {
396
+ const metadata = {
397
+ entityFqdn: "wix.stores.v1.subscription_option",
398
+ method: "GET",
399
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
400
+ packageName: PACKAGE_NAME,
401
+ migrationOptions: {
402
+ optInTransformResponse: true
536
403
  },
537
- ["_id", "options"]
538
- );
539
- sideEffects?.onError?.(err);
540
- throw transformedError;
404
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
405
+ {
406
+ protoPath: "/v1/subscription-options/{id}/productIds",
407
+ data: payload,
408
+ host
409
+ }
410
+ ),
411
+ params: toURLSearchParams(payload)
412
+ };
413
+ return metadata;
541
414
  }
415
+ return __getProductIdsForSubscriptionOption;
542
416
  }
543
- async function getOneTimePurchasesStatus2(productId) {
544
- const { httpClient, sideEffects } = arguments[1];
545
- const payload = renameKeysFromSDKRequestToRESTRequest({
546
- productId
547
- });
548
- const reqOpts = getOneTimePurchasesStatus(payload);
549
- sideEffects?.onSiteCall?.();
550
- try {
551
- const result = await httpClient.request(reqOpts);
552
- sideEffects?.onSuccess?.(result);
553
- return renameKeysFromRESTResponseToSDKResponse(result.data);
554
- } catch (err) {
555
- const transformedError = sdkTransformError(
556
- err,
557
- {
558
- spreadPathsToArguments: {},
559
- explicitPathsToArguments: { productId: "$[0]" },
560
- singleArgumentUnchanged: false
417
+ function getOneTimePurchasesStatus(payload) {
418
+ function __getOneTimePurchasesStatus({ host }) {
419
+ const metadata = {
420
+ entityFqdn: "wix.stores.v1.subscription_option",
421
+ method: "GET",
422
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
423
+ packageName: PACKAGE_NAME,
424
+ migrationOptions: {
425
+ optInTransformResponse: true
561
426
  },
562
- ["productId"]
563
- );
564
- sideEffects?.onError?.(err);
565
- throw transformedError;
427
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
428
+ {
429
+ protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
430
+ data: payload,
431
+ host
432
+ }
433
+ ),
434
+ params: toURLSearchParams(payload)
435
+ };
436
+ return metadata;
566
437
  }
438
+ return __getOneTimePurchasesStatus;
567
439
  }
440
+
441
+ // src/stores-v1-subscription-option-subscription-options.universal.ts
442
+ var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
443
+ SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
444
+ SubscriptionFrequency2["DAY"] = "DAY";
445
+ SubscriptionFrequency2["WEEK"] = "WEEK";
446
+ SubscriptionFrequency2["MONTH"] = "MONTH";
447
+ SubscriptionFrequency2["YEAR"] = "YEAR";
448
+ return SubscriptionFrequency2;
449
+ })(SubscriptionFrequency || {});
450
+ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
451
+ DiscountType2["UNDEFINED"] = "UNDEFINED";
452
+ DiscountType2["AMOUNT"] = "AMOUNT";
453
+ DiscountType2["PERCENT"] = "PERCENT";
454
+ return DiscountType2;
455
+ })(DiscountType || {});
568
456
  async function createSubscriptionOption2(subscriptionOption) {
569
457
  const { httpClient, sideEffects } = arguments[1];
570
458
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -795,38 +683,120 @@ async function enableCustomerCancellation2(productId, allowed) {
795
683
  throw transformedError;
796
684
  }
797
685
  }
798
-
799
- // src/stores-v1-subscription-option-subscription-options.public.ts
800
- function getSubscriptionOption3(httpClient) {
801
- return (_id) => getSubscriptionOption2(
802
- _id,
803
- // @ts-ignore
804
- { httpClient }
805
- );
686
+ async function getSubscriptionOption2(_id) {
687
+ const { httpClient, sideEffects } = arguments[1];
688
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
689
+ const reqOpts = getSubscriptionOption(payload);
690
+ sideEffects?.onSiteCall?.();
691
+ try {
692
+ const result = await httpClient.request(reqOpts);
693
+ sideEffects?.onSuccess?.(result);
694
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
695
+ } catch (err) {
696
+ const transformedError = sdkTransformError(
697
+ err,
698
+ {
699
+ spreadPathsToArguments: {},
700
+ explicitPathsToArguments: { id: "$[0]" },
701
+ singleArgumentUnchanged: false
702
+ },
703
+ ["_id"]
704
+ );
705
+ sideEffects?.onError?.(err);
706
+ throw transformedError;
707
+ }
806
708
  }
807
- function getSubscriptionOptionsForProduct3(httpClient) {
808
- return (productId, options) => getSubscriptionOptionsForProduct2(
709
+ async function getSubscriptionOptionsForProduct2(productId, options) {
710
+ const { httpClient, sideEffects } = arguments[2];
711
+ const payload = renameKeysFromSDKRequestToRESTRequest({
809
712
  productId,
810
- options,
811
- // @ts-ignore
812
- { httpClient }
713
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
714
+ });
715
+ const reqOpts = getSubscriptionOptionsForProduct(
716
+ payload
813
717
  );
718
+ sideEffects?.onSiteCall?.();
719
+ try {
720
+ const result = await httpClient.request(reqOpts);
721
+ sideEffects?.onSuccess?.(result);
722
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
723
+ } catch (err) {
724
+ const transformedError = sdkTransformError(
725
+ err,
726
+ {
727
+ spreadPathsToArguments: {},
728
+ explicitPathsToArguments: {
729
+ productId: "$[0]",
730
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
731
+ },
732
+ singleArgumentUnchanged: false
733
+ },
734
+ ["productId", "options"]
735
+ );
736
+ sideEffects?.onError?.(err);
737
+ throw transformedError;
738
+ }
814
739
  }
815
- function getProductIdsForSubscriptionOption3(httpClient) {
816
- return (_id, options) => getProductIdsForSubscriptionOption2(
817
- _id,
818
- options,
819
- // @ts-ignore
820
- { httpClient }
740
+ async function getProductIdsForSubscriptionOption2(_id, options) {
741
+ const { httpClient, sideEffects } = arguments[2];
742
+ const payload = renameKeysFromSDKRequestToRESTRequest({
743
+ id: _id,
744
+ includeHiddenProducts: options?.includeHiddenProducts,
745
+ paging: options?.paging
746
+ });
747
+ const reqOpts = getProductIdsForSubscriptionOption(
748
+ payload
821
749
  );
750
+ sideEffects?.onSiteCall?.();
751
+ try {
752
+ const result = await httpClient.request(reqOpts);
753
+ sideEffects?.onSuccess?.(result);
754
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
755
+ } catch (err) {
756
+ const transformedError = sdkTransformError(
757
+ err,
758
+ {
759
+ spreadPathsToArguments: {},
760
+ explicitPathsToArguments: {
761
+ id: "$[0]",
762
+ includeHiddenProducts: "$[1].includeHiddenProducts",
763
+ paging: "$[1].paging"
764
+ },
765
+ singleArgumentUnchanged: false
766
+ },
767
+ ["_id", "options"]
768
+ );
769
+ sideEffects?.onError?.(err);
770
+ throw transformedError;
771
+ }
822
772
  }
823
- function getOneTimePurchasesStatus3(httpClient) {
824
- return (productId) => getOneTimePurchasesStatus2(
825
- productId,
826
- // @ts-ignore
827
- { httpClient }
828
- );
773
+ async function getOneTimePurchasesStatus2(productId) {
774
+ const { httpClient, sideEffects } = arguments[1];
775
+ const payload = renameKeysFromSDKRequestToRESTRequest({
776
+ productId
777
+ });
778
+ const reqOpts = getOneTimePurchasesStatus(payload);
779
+ sideEffects?.onSiteCall?.();
780
+ try {
781
+ const result = await httpClient.request(reqOpts);
782
+ sideEffects?.onSuccess?.(result);
783
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
784
+ } catch (err) {
785
+ const transformedError = sdkTransformError(
786
+ err,
787
+ {
788
+ spreadPathsToArguments: {},
789
+ explicitPathsToArguments: { productId: "$[0]" },
790
+ singleArgumentUnchanged: false
791
+ },
792
+ ["productId"]
793
+ );
794
+ sideEffects?.onError?.(err);
795
+ throw transformedError;
796
+ }
829
797
  }
798
+
799
+ // src/stores-v1-subscription-option-subscription-options.public.ts
830
800
  function createSubscriptionOption3(httpClient) {
831
801
  return (subscriptionOption) => createSubscriptionOption2(
832
802
  subscriptionOption,
@@ -894,13 +864,39 @@ function enableCustomerCancellation3(httpClient) {
894
864
  { httpClient }
895
865
  );
896
866
  }
867
+ function getSubscriptionOption3(httpClient) {
868
+ return (_id) => getSubscriptionOption2(
869
+ _id,
870
+ // @ts-ignore
871
+ { httpClient }
872
+ );
873
+ }
874
+ function getSubscriptionOptionsForProduct3(httpClient) {
875
+ return (productId, options) => getSubscriptionOptionsForProduct2(
876
+ productId,
877
+ options,
878
+ // @ts-ignore
879
+ { httpClient }
880
+ );
881
+ }
882
+ function getProductIdsForSubscriptionOption3(httpClient) {
883
+ return (_id, options) => getProductIdsForSubscriptionOption2(
884
+ _id,
885
+ options,
886
+ // @ts-ignore
887
+ { httpClient }
888
+ );
889
+ }
890
+ function getOneTimePurchasesStatus3(httpClient) {
891
+ return (productId) => getOneTimePurchasesStatus2(
892
+ productId,
893
+ // @ts-ignore
894
+ { httpClient }
895
+ );
896
+ }
897
897
 
898
898
  // src/stores-v1-subscription-option-subscription-options.context.ts
899
899
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
900
- var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
901
- var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
902
- var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
903
- var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
904
900
  var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
905
901
  var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
906
902
  var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
@@ -910,6 +906,10 @@ var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDelete
910
906
  var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
911
907
  var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
912
908
  var enableCustomerCancellation4 = /* @__PURE__ */ createRESTModule(enableCustomerCancellation3);
909
+ var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
910
+ var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
911
+ var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
912
+ var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
913
913
  export {
914
914
  DiscountType,
915
915
  SubscriptionFrequency,