@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
@@ -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,28 +314,105 @@ function allowOneTimePurchases(payload) {
414
314
  }
415
315
  return __allowOneTimePurchases;
416
316
  }
417
- function enableCustomerCancellation(payload) {
418
- function __enableCustomerCancellation({ host }) {
317
+ function getSubscriptionOption(payload) {
318
+ function __getSubscriptionOption({ host }) {
419
319
  const metadata = {
420
320
  entityFqdn: "wix.stores.v1.subscription_option",
421
- method: "PATCH",
422
- methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.EnableCustomerCancellation",
321
+ method: "GET",
322
+ methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
423
323
  packageName: PACKAGE_NAME,
424
324
  migrationOptions: {
425
325
  optInTransformResponse: true
426
326
  },
427
- url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
327
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
328
+ { protoPath: "/v1/subscription-options/{id}", data: payload, host }
329
+ ),
330
+ params: toURLSearchParams(payload),
331
+ transformResponse: (payload2) => transformPaths(payload2, [
428
332
  {
429
- protoPath: "/v1/subscription-options/product/{productId}/enableCustomerCancellation",
333
+ transformFn: transformRESTFloatToSDKFloat,
334
+ paths: [{ path: "subscriptionOption.discount.value" }]
335
+ }
336
+ ])
337
+ };
338
+ return metadata;
339
+ }
340
+ return __getSubscriptionOption;
341
+ }
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
351
+ },
352
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
353
+ {
354
+ protoPath: "/v1/subscription-options/byProduct/{productId}",
430
355
  data: payload,
431
356
  host
432
357
  }
433
358
  ),
434
- data: payload
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
380
+ },
381
+ url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
382
+ {
383
+ protoPath: "/v1/subscription-options/{id}/productIds",
384
+ data: payload,
385
+ host
386
+ }
387
+ ),
388
+ params: toURLSearchParams(payload)
435
389
  };
436
390
  return metadata;
437
391
  }
438
- return __enableCustomerCancellation;
392
+ return __getProductIdsForSubscriptionOption;
393
+ }
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
403
+ },
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;
414
+ }
415
+ return __getOneTimePurchasesStatus;
439
416
  }
440
417
 
441
418
  // src/stores-v1-subscription-option-subscription-options.universal.ts
@@ -453,10 +430,12 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
453
430
  DiscountType2["PERCENT"] = "PERCENT";
454
431
  return DiscountType2;
455
432
  })(DiscountType || {});
456
- async function getSubscriptionOption2(_id) {
433
+ async function createSubscriptionOption2(subscriptionOption) {
457
434
  const { httpClient, sideEffects } = arguments[1];
458
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
459
- const reqOpts = getSubscriptionOption(payload);
435
+ const payload = renameKeysFromSDKRequestToRESTRequest({
436
+ subscriptionOption
437
+ });
438
+ const reqOpts = createSubscriptionOption(payload);
460
439
  sideEffects?.onSiteCall?.();
461
440
  try {
462
441
  const result = await httpClient.request(reqOpts);
@@ -467,85 +446,70 @@ async function getSubscriptionOption2(_id) {
467
446
  err,
468
447
  {
469
448
  spreadPathsToArguments: {},
470
- explicitPathsToArguments: { id: "$[0]" },
449
+ explicitPathsToArguments: { subscriptionOption: "$[0]" },
471
450
  singleArgumentUnchanged: false
472
451
  },
473
- ["_id"]
452
+ ["subscriptionOption"]
474
453
  );
475
454
  sideEffects?.onError?.(err);
476
455
  throw transformedError;
477
456
  }
478
457
  }
479
- async function getSubscriptionOptionsForProduct2(productId, options) {
458
+ async function updateSubscriptionOption2(_id, subscriptionOption) {
480
459
  const { httpClient, sideEffects } = arguments[2];
481
460
  const payload = renameKeysFromSDKRequestToRESTRequest({
482
- productId,
483
- includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
461
+ subscriptionOption: { ...subscriptionOption, id: _id }
484
462
  });
485
- const reqOpts = getSubscriptionOptionsForProduct(
486
- payload
487
- );
463
+ const reqOpts = updateSubscriptionOption(payload);
488
464
  sideEffects?.onSiteCall?.();
489
465
  try {
490
466
  const result = await httpClient.request(reqOpts);
491
467
  sideEffects?.onSuccess?.(result);
492
- return renameKeysFromRESTResponseToSDKResponse(result.data);
468
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
493
469
  } catch (err) {
494
470
  const transformedError = sdkTransformError(
495
471
  err,
496
472
  {
497
- spreadPathsToArguments: {},
498
- explicitPathsToArguments: {
499
- productId: "$[0]",
500
- includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
501
- },
473
+ spreadPathsToArguments: { subscriptionOption: "$[1]" },
474
+ explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
502
475
  singleArgumentUnchanged: false
503
476
  },
504
- ["productId", "options"]
477
+ ["_id", "subscriptionOption"]
505
478
  );
506
479
  sideEffects?.onError?.(err);
507
480
  throw transformedError;
508
481
  }
509
482
  }
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
- );
483
+ async function deleteSubscriptionOption2(_id) {
484
+ const { httpClient, sideEffects } = arguments[1];
485
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
486
+ const reqOpts = deleteSubscriptionOption(payload);
520
487
  sideEffects?.onSiteCall?.();
521
488
  try {
522
489
  const result = await httpClient.request(reqOpts);
523
490
  sideEffects?.onSuccess?.(result);
524
- return renameKeysFromRESTResponseToSDKResponse(result.data);
525
491
  } catch (err) {
526
492
  const transformedError = sdkTransformError(
527
493
  err,
528
494
  {
529
495
  spreadPathsToArguments: {},
530
- explicitPathsToArguments: {
531
- id: "$[0]",
532
- includeHiddenProducts: "$[1].includeHiddenProducts",
533
- paging: "$[1].paging"
534
- },
496
+ explicitPathsToArguments: { id: "$[0]" },
535
497
  singleArgumentUnchanged: false
536
498
  },
537
- ["_id", "options"]
499
+ ["_id"]
538
500
  );
539
501
  sideEffects?.onError?.(err);
540
502
  throw transformedError;
541
503
  }
542
504
  }
543
- async function getOneTimePurchasesStatus2(productId) {
505
+ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
544
506
  const { httpClient, sideEffects } = arguments[1];
545
507
  const payload = renameKeysFromSDKRequestToRESTRequest({
546
- productId
508
+ subscriptionOptions
547
509
  });
548
- const reqOpts = getOneTimePurchasesStatus(payload);
510
+ const reqOpts = bulkCreateSubscriptionOptions(
511
+ payload
512
+ );
549
513
  sideEffects?.onSiteCall?.();
550
514
  try {
551
515
  const result = await httpClient.request(reqOpts);
@@ -556,69 +520,48 @@ async function getOneTimePurchasesStatus2(productId) {
556
520
  err,
557
521
  {
558
522
  spreadPathsToArguments: {},
559
- explicitPathsToArguments: { productId: "$[0]" },
523
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
560
524
  singleArgumentUnchanged: false
561
525
  },
562
- ["productId"]
526
+ ["subscriptionOptions"]
563
527
  );
564
528
  sideEffects?.onError?.(err);
565
529
  throw transformedError;
566
530
  }
567
531
  }
568
- async function createSubscriptionOption2(subscriptionOption) {
532
+ async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
569
533
  const { httpClient, sideEffects } = arguments[1];
570
534
  const payload = renameKeysFromSDKRequestToRESTRequest({
571
- subscriptionOption
535
+ subscriptionOptions
572
536
  });
573
- const reqOpts = createSubscriptionOption(payload);
537
+ const reqOpts = bulkUpdateSubscriptionOptions(
538
+ payload
539
+ );
574
540
  sideEffects?.onSiteCall?.();
575
541
  try {
576
542
  const result = await httpClient.request(reqOpts);
577
543
  sideEffects?.onSuccess?.(result);
578
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
544
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
579
545
  } catch (err) {
580
546
  const transformedError = sdkTransformError(
581
547
  err,
582
548
  {
583
549
  spreadPathsToArguments: {},
584
- explicitPathsToArguments: { subscriptionOption: "$[0]" },
585
- singleArgumentUnchanged: false
586
- },
587
- ["subscriptionOption"]
588
- );
589
- sideEffects?.onError?.(err);
590
- throw transformedError;
591
- }
592
- }
593
- async function updateSubscriptionOption2(_id, subscriptionOption) {
594
- const { httpClient, sideEffects } = arguments[2];
595
- const payload = renameKeysFromSDKRequestToRESTRequest({
596
- subscriptionOption: { ...subscriptionOption, id: _id }
597
- });
598
- const reqOpts = updateSubscriptionOption(payload);
599
- sideEffects?.onSiteCall?.();
600
- try {
601
- const result = await httpClient.request(reqOpts);
602
- sideEffects?.onSuccess?.(result);
603
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
604
- } catch (err) {
605
- const transformedError = sdkTransformError(
606
- err,
607
- {
608
- spreadPathsToArguments: { subscriptionOption: "$[1]" },
609
- explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
550
+ explicitPathsToArguments: { subscriptionOptions: "$[0]" },
610
551
  singleArgumentUnchanged: false
611
552
  },
612
- ["_id", "subscriptionOption"]
553
+ ["subscriptionOptions"]
613
554
  );
614
555
  sideEffects?.onError?.(err);
615
556
  throw transformedError;
616
557
  }
617
558
  }
618
- async function deleteSubscriptionOption2(_id) {
559
+ async function bulkDeleteSubscriptionOptions2(ids) {
619
560
  const { httpClient, sideEffects } = arguments[1];
620
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
621
- const reqOpts = deleteSubscriptionOption(payload);
561
+ const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
562
+ const reqOpts = bulkDeleteSubscriptionOptions(
563
+ payload
564
+ );
622
565
  sideEffects?.onSiteCall?.();
623
566
  try {
624
567
  const result = await httpClient.request(reqOpts);
@@ -628,106 +571,107 @@ async function deleteSubscriptionOption2(_id) {
628
571
  err,
629
572
  {
630
573
  spreadPathsToArguments: {},
631
- explicitPathsToArguments: { id: "$[0]" },
574
+ explicitPathsToArguments: { ids: "$[0]" },
632
575
  singleArgumentUnchanged: false
633
576
  },
634
- ["_id"]
577
+ ["ids"]
635
578
  );
636
579
  sideEffects?.onError?.(err);
637
580
  throw transformedError;
638
581
  }
639
582
  }
640
- async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
641
- const { httpClient, sideEffects } = arguments[1];
583
+ async function assignSubscriptionOptionsToProduct2(productId, options) {
584
+ const { httpClient, sideEffects } = arguments[2];
642
585
  const payload = renameKeysFromSDKRequestToRESTRequest({
643
- subscriptionOptions
586
+ productId,
587
+ assignedSubscriptionOptions: options?.assignedSubscriptionOptions
644
588
  });
645
- const reqOpts = bulkCreateSubscriptionOptions(
589
+ const reqOpts = assignSubscriptionOptionsToProduct(
646
590
  payload
647
591
  );
648
592
  sideEffects?.onSiteCall?.();
649
593
  try {
650
594
  const result = await httpClient.request(reqOpts);
651
595
  sideEffects?.onSuccess?.(result);
652
- return renameKeysFromRESTResponseToSDKResponse(result.data);
653
596
  } catch (err) {
654
597
  const transformedError = sdkTransformError(
655
598
  err,
656
599
  {
657
600
  spreadPathsToArguments: {},
658
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
601
+ explicitPathsToArguments: {
602
+ productId: "$[0]",
603
+ assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
604
+ },
659
605
  singleArgumentUnchanged: false
660
606
  },
661
- ["subscriptionOptions"]
607
+ ["productId", "options"]
662
608
  );
663
609
  sideEffects?.onError?.(err);
664
610
  throw transformedError;
665
611
  }
666
612
  }
667
- async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
668
- const { httpClient, sideEffects } = arguments[1];
613
+ async function allowOneTimePurchases2(productId, allowed) {
614
+ const { httpClient, sideEffects } = arguments[2];
669
615
  const payload = renameKeysFromSDKRequestToRESTRequest({
670
- subscriptionOptions
616
+ productId,
617
+ allowed
671
618
  });
672
- const reqOpts = bulkUpdateSubscriptionOptions(
673
- payload
674
- );
619
+ const reqOpts = allowOneTimePurchases(payload);
675
620
  sideEffects?.onSiteCall?.();
676
621
  try {
677
622
  const result = await httpClient.request(reqOpts);
678
623
  sideEffects?.onSuccess?.(result);
679
- return renameKeysFromRESTResponseToSDKResponse(result.data);
680
624
  } catch (err) {
681
625
  const transformedError = sdkTransformError(
682
626
  err,
683
627
  {
684
628
  spreadPathsToArguments: {},
685
- explicitPathsToArguments: { subscriptionOptions: "$[0]" },
629
+ explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
686
630
  singleArgumentUnchanged: false
687
631
  },
688
- ["subscriptionOptions"]
632
+ ["productId", "allowed"]
689
633
  );
690
634
  sideEffects?.onError?.(err);
691
635
  throw transformedError;
692
636
  }
693
637
  }
694
- async function bulkDeleteSubscriptionOptions2(ids) {
638
+ async function getSubscriptionOption2(_id) {
695
639
  const { httpClient, sideEffects } = arguments[1];
696
- const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
697
- const reqOpts = bulkDeleteSubscriptionOptions(
698
- payload
699
- );
640
+ const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
641
+ const reqOpts = getSubscriptionOption(payload);
700
642
  sideEffects?.onSiteCall?.();
701
643
  try {
702
644
  const result = await httpClient.request(reqOpts);
703
645
  sideEffects?.onSuccess?.(result);
646
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
704
647
  } catch (err) {
705
648
  const transformedError = sdkTransformError(
706
649
  err,
707
650
  {
708
651
  spreadPathsToArguments: {},
709
- explicitPathsToArguments: { ids: "$[0]" },
652
+ explicitPathsToArguments: { id: "$[0]" },
710
653
  singleArgumentUnchanged: false
711
654
  },
712
- ["ids"]
655
+ ["_id"]
713
656
  );
714
657
  sideEffects?.onError?.(err);
715
658
  throw transformedError;
716
659
  }
717
660
  }
718
- async function assignSubscriptionOptionsToProduct2(productId, options) {
661
+ async function getSubscriptionOptionsForProduct2(productId, options) {
719
662
  const { httpClient, sideEffects } = arguments[2];
720
663
  const payload = renameKeysFromSDKRequestToRESTRequest({
721
664
  productId,
722
- assignedSubscriptionOptions: options?.assignedSubscriptionOptions
665
+ includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
723
666
  });
724
- const reqOpts = assignSubscriptionOptionsToProduct(
667
+ const reqOpts = getSubscriptionOptionsForProduct(
725
668
  payload
726
669
  );
727
670
  sideEffects?.onSiteCall?.();
728
671
  try {
729
672
  const result = await httpClient.request(reqOpts);
730
673
  sideEffects?.onSuccess?.(result);
674
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
731
675
  } catch (err) {
732
676
  const transformedError = sdkTransformError(
733
677
  err,
@@ -735,7 +679,7 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
735
679
  spreadPathsToArguments: {},
736
680
  explicitPathsToArguments: {
737
681
  productId: "$[0]",
738
- assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
682
+ includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
739
683
  },
740
684
  singleArgumentUnchanged: false
741
685
  },
@@ -745,51 +689,59 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
745
689
  throw transformedError;
746
690
  }
747
691
  }
748
- async function allowOneTimePurchases2(productId, allowed) {
692
+ async function getProductIdsForSubscriptionOption2(_id, options) {
749
693
  const { httpClient, sideEffects } = arguments[2];
750
694
  const payload = renameKeysFromSDKRequestToRESTRequest({
751
- productId,
752
- allowed
695
+ id: _id,
696
+ includeHiddenProducts: options?.includeHiddenProducts,
697
+ paging: options?.paging
753
698
  });
754
- const reqOpts = allowOneTimePurchases(payload);
699
+ const reqOpts = getProductIdsForSubscriptionOption(
700
+ payload
701
+ );
755
702
  sideEffects?.onSiteCall?.();
756
703
  try {
757
704
  const result = await httpClient.request(reqOpts);
758
705
  sideEffects?.onSuccess?.(result);
706
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
759
707
  } catch (err) {
760
708
  const transformedError = sdkTransformError(
761
709
  err,
762
710
  {
763
711
  spreadPathsToArguments: {},
764
- explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
712
+ explicitPathsToArguments: {
713
+ id: "$[0]",
714
+ includeHiddenProducts: "$[1].includeHiddenProducts",
715
+ paging: "$[1].paging"
716
+ },
765
717
  singleArgumentUnchanged: false
766
718
  },
767
- ["productId", "allowed"]
719
+ ["_id", "options"]
768
720
  );
769
721
  sideEffects?.onError?.(err);
770
722
  throw transformedError;
771
723
  }
772
724
  }
773
- async function enableCustomerCancellation2(productId, allowed) {
774
- const { httpClient, sideEffects } = arguments[2];
725
+ async function getOneTimePurchasesStatus2(productId) {
726
+ const { httpClient, sideEffects } = arguments[1];
775
727
  const payload = renameKeysFromSDKRequestToRESTRequest({
776
- productId,
777
- allowed
728
+ productId
778
729
  });
779
- const reqOpts = enableCustomerCancellation(payload);
730
+ const reqOpts = getOneTimePurchasesStatus(payload);
780
731
  sideEffects?.onSiteCall?.();
781
732
  try {
782
733
  const result = await httpClient.request(reqOpts);
783
734
  sideEffects?.onSuccess?.(result);
735
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
784
736
  } catch (err) {
785
737
  const transformedError = sdkTransformError(
786
738
  err,
787
739
  {
788
740
  spreadPathsToArguments: {},
789
- explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
741
+ explicitPathsToArguments: { productId: "$[0]" },
790
742
  singleArgumentUnchanged: false
791
743
  },
792
- ["productId", "allowed"]
744
+ ["productId"]
793
745
  );
794
746
  sideEffects?.onError?.(err);
795
747
  throw transformedError;
@@ -805,7 +757,6 @@ export {
805
757
  bulkUpdateSubscriptionOptions2 as bulkUpdateSubscriptionOptions,
806
758
  createSubscriptionOption2 as createSubscriptionOption,
807
759
  deleteSubscriptionOption2 as deleteSubscriptionOption,
808
- enableCustomerCancellation2 as enableCustomerCancellation,
809
760
  getOneTimePurchasesStatus2 as getOneTimePurchasesStatus,
810
761
  getProductIdsForSubscriptionOption2 as getProductIdsForSubscriptionOption,
811
762
  getSubscriptionOption2 as getSubscriptionOption,