@wix/auto_sdk_stores_subscription-options 1.0.41 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +45 -45
  2. package/build/cjs/index.js +276 -276
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +157 -157
  5. package/build/cjs/index.typings.js +230 -230
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +108 -108
  8. package/build/cjs/meta.js +204 -204
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +45 -45
  11. package/build/es/index.mjs +276 -276
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +157 -157
  14. package/build/es/index.typings.mjs +230 -230
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +108 -108
  17. package/build/es/meta.mjs +204 -204
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +45 -45
  20. package/build/internal/cjs/index.js +276 -276
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +157 -157
  23. package/build/internal/cjs/index.typings.js +230 -230
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +108 -108
  26. package/build/internal/cjs/meta.js +204 -204
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +45 -45
  29. package/build/internal/es/index.mjs +276 -276
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +157 -157
  32. package/build/internal/es/index.typings.mjs +230 -230
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +108 -108
  35. package/build/internal/es/meta.mjs +204 -204
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -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, [
@@ -414,134 +314,122 @@ function allowOneTimePurchases(payload) {
414
314
  }
415
315
  return __allowOneTimePurchases;
416
316
  }
417
-
418
- // src/stores-v1-subscription-option-subscription-options.universal.ts
419
- var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
420
- SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
421
- SubscriptionFrequency2["DAY"] = "DAY";
422
- SubscriptionFrequency2["WEEK"] = "WEEK";
423
- SubscriptionFrequency2["MONTH"] = "MONTH";
424
- SubscriptionFrequency2["YEAR"] = "YEAR";
425
- return SubscriptionFrequency2;
426
- })(SubscriptionFrequency || {});
427
- var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
428
- DiscountType2["UNDEFINED"] = "UNDEFINED";
429
- DiscountType2["AMOUNT"] = "AMOUNT";
430
- DiscountType2["PERCENT"] = "PERCENT";
431
- return DiscountType2;
432
- })(DiscountType || {});
433
- async function getSubscriptionOption2(_id) {
434
- const { httpClient, sideEffects } = arguments[1];
435
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
436
- const reqOpts = getSubscriptionOption(payload);
437
- sideEffects?.onSiteCall?.();
438
- try {
439
- const result = await httpClient.request(reqOpts);
440
- sideEffects?.onSuccess?.(result);
441
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
442
- } catch (err) {
443
- const transformedError = sdkTransformError(
444
- err,
445
- {
446
- spreadPathsToArguments: {},
447
- explicitPathsToArguments: { id: "$[0]" },
448
- singleArgumentUnchanged: false
317
+ function getSubscriptionOption(payload) {
318
+ function __getSubscriptionOption({ host }) {
319
+ const metadata = {
320
+ entityFqdn: "wix.stores.v1.subscription_option",
321
+ method: "GET",
322
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
323
+ packageName: PACKAGE_NAME,
324
+ migrationOptions: {
325
+ optInTransformResponse: true
449
326
  },
450
- ["_id"]
451
- );
452
- sideEffects?.onError?.(err);
453
- throw transformedError;
327
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
328
+ { protoPath: "/v1/subscription-options/{id}", data: payload, host }
329
+ ),
330
+ params: toURLSearchParams(payload),
331
+ transformResponse: (payload2) => transformPaths(payload2, [
332
+ {
333
+ transformFn: transformRESTFloatToSDKFloat,
334
+ paths: [{ path: "subscriptionOption.discount.value" }]
335
+ }
336
+ ])
337
+ };
338
+ return metadata;
454
339
  }
340
+ return __getSubscriptionOption;
455
341
  }
456
- async function getSubscriptionOptionsForProduct2(productId, options) {
457
- const { httpClient, sideEffects } = arguments[2];
458
- const payload = renameKeysFromSDKRequestToRESTRequest({
459
- productId,
460
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
461
- });
462
- const reqOpts = getSubscriptionOptionsForProduct(
463
- payload
464
- );
465
- sideEffects?.onSiteCall?.();
466
- try {
467
- const result = await httpClient.request(reqOpts);
468
- sideEffects?.onSuccess?.(result);
469
- return renameKeysFromRESTResponseToSDKResponse(result.data);
470
- } catch (err) {
471
- const transformedError = sdkTransformError(
472
- err,
473
- {
474
- spreadPathsToArguments: {},
475
- explicitPathsToArguments: {
476
- productId: "$[0]",
477
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
478
- },
479
- singleArgumentUnchanged: false
342
+ function getSubscriptionOptionsForProduct(payload) {
343
+ function __getSubscriptionOptionsForProduct({ host }) {
344
+ const metadata = {
345
+ entityFqdn: "wix.stores.v1.subscription_option",
346
+ method: "GET",
347
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
348
+ packageName: PACKAGE_NAME,
349
+ migrationOptions: {
350
+ optInTransformResponse: true
480
351
  },
481
- ["productId", "options"]
482
- );
483
- sideEffects?.onError?.(err);
484
- throw transformedError;
485
- }
486
- }
487
- async function getProductIdsForSubscriptionOption2(_id, options) {
488
- const { httpClient, sideEffects } = arguments[2];
489
- const payload = renameKeysFromSDKRequestToRESTRequest({
490
- id: _id,
491
- includeHiddenProducts: options?.includeHiddenProducts,
492
- paging: options?.paging
493
- });
494
- const reqOpts = getProductIdsForSubscriptionOption(
495
- payload
496
- );
497
- sideEffects?.onSiteCall?.();
498
- try {
499
- const result = await httpClient.request(reqOpts);
500
- sideEffects?.onSuccess?.(result);
501
- return renameKeysFromRESTResponseToSDKResponse(result.data);
502
- } catch (err) {
503
- const transformedError = sdkTransformError(
504
- err,
505
- {
506
- spreadPathsToArguments: {},
507
- explicitPathsToArguments: {
508
- id: "$[0]",
509
- includeHiddenProducts: "$[1].includeHiddenProducts",
510
- paging: "$[1].paging"
511
- },
512
- singleArgumentUnchanged: false
352
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
353
+ {
354
+ protoPath: "/v1/subscription-options/byProduct/{productId}",
355
+ data: payload,
356
+ host
357
+ }
358
+ ),
359
+ params: toURLSearchParams(payload),
360
+ transformResponse: (payload2) => transformPaths(payload2, [
361
+ {
362
+ transformFn: transformRESTFloatToSDKFloat,
363
+ paths: [{ path: "subscriptionOptions.discount.value" }]
364
+ }
365
+ ])
366
+ };
367
+ return metadata;
368
+ }
369
+ return __getSubscriptionOptionsForProduct;
370
+ }
371
+ function getProductIdsForSubscriptionOption(payload) {
372
+ function __getProductIdsForSubscriptionOption({ host }) {
373
+ const metadata = {
374
+ entityFqdn: "wix.stores.v1.subscription_option",
375
+ method: "GET",
376
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
377
+ packageName: PACKAGE_NAME,
378
+ migrationOptions: {
379
+ optInTransformResponse: true
513
380
  },
514
- ["_id", "options"]
515
- );
516
- sideEffects?.onError?.(err);
517
- throw transformedError;
381
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
382
+ {
383
+ protoPath: "/v1/subscription-options/{id}/productIds",
384
+ data: payload,
385
+ host
386
+ }
387
+ ),
388
+ params: toURLSearchParams(payload)
389
+ };
390
+ return metadata;
518
391
  }
392
+ return __getProductIdsForSubscriptionOption;
519
393
  }
520
- async function getOneTimePurchasesStatus2(productId) {
521
- const { httpClient, sideEffects } = arguments[1];
522
- const payload = renameKeysFromSDKRequestToRESTRequest({
523
- productId
524
- });
525
- const reqOpts = getOneTimePurchasesStatus(payload);
526
- sideEffects?.onSiteCall?.();
527
- try {
528
- const result = await httpClient.request(reqOpts);
529
- sideEffects?.onSuccess?.(result);
530
- return renameKeysFromRESTResponseToSDKResponse(result.data);
531
- } catch (err) {
532
- const transformedError = sdkTransformError(
533
- err,
534
- {
535
- spreadPathsToArguments: {},
536
- explicitPathsToArguments: { productId: "$[0]" },
537
- singleArgumentUnchanged: false
394
+ function getOneTimePurchasesStatus(payload) {
395
+ function __getOneTimePurchasesStatus({ host }) {
396
+ const metadata = {
397
+ entityFqdn: "wix.stores.v1.subscription_option",
398
+ method: "GET",
399
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
400
+ packageName: PACKAGE_NAME,
401
+ migrationOptions: {
402
+ optInTransformResponse: true
538
403
  },
539
- ["productId"]
540
- );
541
- sideEffects?.onError?.(err);
542
- throw transformedError;
404
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
405
+ {
406
+ protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
407
+ data: payload,
408
+ host
409
+ }
410
+ ),
411
+ params: toURLSearchParams(payload)
412
+ };
413
+ return metadata;
543
414
  }
415
+ return __getOneTimePurchasesStatus;
544
416
  }
417
+
418
+ // src/stores-v1-subscription-option-subscription-options.universal.ts
419
+ var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
420
+ SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
421
+ SubscriptionFrequency2["DAY"] = "DAY";
422
+ SubscriptionFrequency2["WEEK"] = "WEEK";
423
+ SubscriptionFrequency2["MONTH"] = "MONTH";
424
+ SubscriptionFrequency2["YEAR"] = "YEAR";
425
+ return SubscriptionFrequency2;
426
+ })(SubscriptionFrequency || {});
427
+ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
428
+ DiscountType2["UNDEFINED"] = "UNDEFINED";
429
+ DiscountType2["AMOUNT"] = "AMOUNT";
430
+ DiscountType2["PERCENT"] = "PERCENT";
431
+ return DiscountType2;
432
+ })(DiscountType || {});
545
433
  async function createSubscriptionOption2(subscriptionOption) {
546
434
  const { httpClient, sideEffects } = arguments[1];
547
435
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -747,38 +635,120 @@ async function allowOneTimePurchases2(productId, allowed) {
747
635
  throw transformedError;
748
636
  }
749
637
  }
750
-
751
- // src/stores-v1-subscription-option-subscription-options.public.ts
752
- function getSubscriptionOption3(httpClient) {
753
- return (_id) => getSubscriptionOption2(
754
- _id,
755
- // @ts-ignore
756
- { httpClient }
757
- );
638
+ async function getSubscriptionOption2(_id) {
639
+ const { httpClient, sideEffects } = arguments[1];
640
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
641
+ const reqOpts = getSubscriptionOption(payload);
642
+ sideEffects?.onSiteCall?.();
643
+ try {
644
+ const result = await httpClient.request(reqOpts);
645
+ sideEffects?.onSuccess?.(result);
646
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
647
+ } catch (err) {
648
+ const transformedError = sdkTransformError(
649
+ err,
650
+ {
651
+ spreadPathsToArguments: {},
652
+ explicitPathsToArguments: { id: "$[0]" },
653
+ singleArgumentUnchanged: false
654
+ },
655
+ ["_id"]
656
+ );
657
+ sideEffects?.onError?.(err);
658
+ throw transformedError;
659
+ }
758
660
  }
759
- function getSubscriptionOptionsForProduct3(httpClient) {
760
- return (productId, options) => getSubscriptionOptionsForProduct2(
661
+ async function getSubscriptionOptionsForProduct2(productId, options) {
662
+ const { httpClient, sideEffects } = arguments[2];
663
+ const payload = renameKeysFromSDKRequestToRESTRequest({
761
664
  productId,
762
- options,
763
- // @ts-ignore
764
- { httpClient }
665
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
666
+ });
667
+ const reqOpts = getSubscriptionOptionsForProduct(
668
+ payload
765
669
  );
670
+ sideEffects?.onSiteCall?.();
671
+ try {
672
+ const result = await httpClient.request(reqOpts);
673
+ sideEffects?.onSuccess?.(result);
674
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
675
+ } catch (err) {
676
+ const transformedError = sdkTransformError(
677
+ err,
678
+ {
679
+ spreadPathsToArguments: {},
680
+ explicitPathsToArguments: {
681
+ productId: "$[0]",
682
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
683
+ },
684
+ singleArgumentUnchanged: false
685
+ },
686
+ ["productId", "options"]
687
+ );
688
+ sideEffects?.onError?.(err);
689
+ throw transformedError;
690
+ }
766
691
  }
767
- function getProductIdsForSubscriptionOption3(httpClient) {
768
- return (_id, options) => getProductIdsForSubscriptionOption2(
769
- _id,
770
- options,
771
- // @ts-ignore
772
- { httpClient }
692
+ async function getProductIdsForSubscriptionOption2(_id, options) {
693
+ const { httpClient, sideEffects } = arguments[2];
694
+ const payload = renameKeysFromSDKRequestToRESTRequest({
695
+ id: _id,
696
+ includeHiddenProducts: options?.includeHiddenProducts,
697
+ paging: options?.paging
698
+ });
699
+ const reqOpts = getProductIdsForSubscriptionOption(
700
+ payload
773
701
  );
702
+ sideEffects?.onSiteCall?.();
703
+ try {
704
+ const result = await httpClient.request(reqOpts);
705
+ sideEffects?.onSuccess?.(result);
706
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
707
+ } catch (err) {
708
+ const transformedError = sdkTransformError(
709
+ err,
710
+ {
711
+ spreadPathsToArguments: {},
712
+ explicitPathsToArguments: {
713
+ id: "$[0]",
714
+ includeHiddenProducts: "$[1].includeHiddenProducts",
715
+ paging: "$[1].paging"
716
+ },
717
+ singleArgumentUnchanged: false
718
+ },
719
+ ["_id", "options"]
720
+ );
721
+ sideEffects?.onError?.(err);
722
+ throw transformedError;
723
+ }
774
724
  }
775
- function getOneTimePurchasesStatus3(httpClient) {
776
- return (productId) => getOneTimePurchasesStatus2(
777
- productId,
778
- // @ts-ignore
779
- { httpClient }
780
- );
725
+ async function getOneTimePurchasesStatus2(productId) {
726
+ const { httpClient, sideEffects } = arguments[1];
727
+ const payload = renameKeysFromSDKRequestToRESTRequest({
728
+ productId
729
+ });
730
+ const reqOpts = getOneTimePurchasesStatus(payload);
731
+ sideEffects?.onSiteCall?.();
732
+ try {
733
+ const result = await httpClient.request(reqOpts);
734
+ sideEffects?.onSuccess?.(result);
735
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
736
+ } catch (err) {
737
+ const transformedError = sdkTransformError(
738
+ err,
739
+ {
740
+ spreadPathsToArguments: {},
741
+ explicitPathsToArguments: { productId: "$[0]" },
742
+ singleArgumentUnchanged: false
743
+ },
744
+ ["productId"]
745
+ );
746
+ sideEffects?.onError?.(err);
747
+ throw transformedError;
748
+ }
781
749
  }
750
+
751
+ // src/stores-v1-subscription-option-subscription-options.public.ts
782
752
  function createSubscriptionOption3(httpClient) {
783
753
  return (subscriptionOption) => createSubscriptionOption2(
784
754
  subscriptionOption,
@@ -838,13 +808,39 @@ function allowOneTimePurchases3(httpClient) {
838
808
  { httpClient }
839
809
  );
840
810
  }
811
+ function getSubscriptionOption3(httpClient) {
812
+ return (_id) => getSubscriptionOption2(
813
+ _id,
814
+ // @ts-ignore
815
+ { httpClient }
816
+ );
817
+ }
818
+ function getSubscriptionOptionsForProduct3(httpClient) {
819
+ return (productId, options) => getSubscriptionOptionsForProduct2(
820
+ productId,
821
+ options,
822
+ // @ts-ignore
823
+ { httpClient }
824
+ );
825
+ }
826
+ function getProductIdsForSubscriptionOption3(httpClient) {
827
+ return (_id, options) => getProductIdsForSubscriptionOption2(
828
+ _id,
829
+ options,
830
+ // @ts-ignore
831
+ { httpClient }
832
+ );
833
+ }
834
+ function getOneTimePurchasesStatus3(httpClient) {
835
+ return (productId) => getOneTimePurchasesStatus2(
836
+ productId,
837
+ // @ts-ignore
838
+ { httpClient }
839
+ );
840
+ }
841
841
 
842
842
  // src/stores-v1-subscription-option-subscription-options.context.ts
843
843
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
844
- var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
845
- var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
846
- var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
847
- var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
848
844
  var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
849
845
  var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
850
846
  var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
@@ -853,6 +849,10 @@ var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkUpdate
853
849
  var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDeleteSubscriptionOptions3);
854
850
  var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
855
851
  var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
852
+ var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
853
+ var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
854
+ var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
855
+ var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
856
856
  export {
857
857
  DiscountType,
858
858
  SubscriptionFrequency,