@wix/auto_sdk_subscription_subscriptions 1.0.47 → 1.0.49

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 +3 -11
  2. package/build/cjs/index.js +402 -142
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +2020 -1771
  5. package/build/cjs/index.typings.js +338 -97
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1991 -1762
  8. package/build/cjs/meta.js +291 -92
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +3 -11
  11. package/build/es/index.mjs +396 -141
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +2020 -1771
  14. package/build/es/index.typings.mjs +332 -96
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +1991 -1762
  17. package/build/es/meta.mjs +285 -91
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +28 -10
  20. package/build/internal/cjs/index.typings.d.ts +1713 -1383
  21. package/build/internal/cjs/meta.d.ts +2124 -1783
  22. package/build/internal/es/index.d.mts +28 -10
  23. package/build/internal/es/index.typings.d.mts +1713 -1383
  24. package/build/internal/es/meta.d.mts +2124 -1783
  25. package/package.json +4 -4
  26. package/build/internal/cjs/index.js +0 -6659
  27. package/build/internal/cjs/index.js.map +0 -1
  28. package/build/internal/cjs/index.typings.js +0 -5629
  29. package/build/internal/cjs/index.typings.js.map +0 -1
  30. package/build/internal/cjs/meta.js +0 -4712
  31. package/build/internal/cjs/meta.js.map +0 -1
  32. package/build/internal/es/index.mjs +0 -6543
  33. package/build/internal/es/index.mjs.map +0 -1
  34. package/build/internal/es/index.typings.mjs +0 -5526
  35. package/build/internal/es/index.typings.mjs.map +0 -1
  36. package/build/internal/es/meta.mjs +0 -4606
  37. package/build/internal/es/meta.mjs.map +0 -1
@@ -25,6 +25,7 @@ __export(index_typings_exports, {
25
25
  AdditionalFeeTrigger: () => AdditionalFeeTrigger,
26
26
  CancellationInitiator: () => CancellationInitiator,
27
27
  ChangeEffectiveTime: () => ChangeEffectiveTime,
28
+ ChangeType: () => ChangeType,
28
29
  CollectionMethod: () => CollectionMethod,
29
30
  CollectionMethodEnumCollectionMethod: () => CollectionMethodEnumCollectionMethod,
30
31
  CreationMode: () => CreationMode,
@@ -35,6 +36,7 @@ __export(index_typings_exports, {
35
36
  IdentityType: () => IdentityType,
36
37
  InvoiceStatus: () => InvoiceStatus,
37
38
  ItemCategory: () => ItemCategory,
39
+ MissingPreviousBillingDateResumeStrategy: () => MissingPreviousBillingDateResumeStrategy,
38
40
  OrderMethod: () => OrderMethod,
39
41
  PauseAt: () => PauseAt,
40
42
  PausePolicy: () => PausePolicy,
@@ -47,6 +49,7 @@ __export(index_typings_exports, {
47
49
  PriceAdjustmentReason: () => PriceAdjustmentReason,
48
50
  ProrationAction: () => ProrationAction,
49
51
  ProrationBehavior: () => ProrationBehavior,
52
+ ProrationBehaviorEnumProrationBehavior: () => ProrationBehaviorEnumProrationBehavior,
50
53
  RefundReason: () => RefundReason,
51
54
  RequestedFields: () => RequestedFields,
52
55
  ResumeAt: () => ResumeAt,
@@ -65,14 +68,17 @@ __export(index_typings_exports, {
65
68
  cancelSubscription: () => cancelSubscription2,
66
69
  countSubscriptions: () => countSubscriptions2,
67
70
  customerAllowedActions: () => customerAllowedActions2,
71
+ customerCancelPendingChange: () => customerCancelPendingChange2,
68
72
  customerCancelScheduledPause: () => customerCancelScheduledPause2,
69
73
  customerCancelScheduledSkip: () => customerCancelScheduledSkip2,
70
74
  customerCancelSubscription: () => customerCancelSubscription2,
75
+ customerChangeSubscription: () => customerChangeSubscription2,
71
76
  customerExtendSubscription: () => customerExtendSubscription2,
72
77
  customerGetSubscription: () => customerGetSubscription2,
73
78
  customerInitiatePaymentMethodSetup: () => customerInitiatePaymentMethodSetup2,
74
79
  customerListUpcomingCharges: () => customerListUpcomingCharges2,
75
80
  customerPauseSubscription: () => customerPauseSubscription2,
81
+ customerPreviewChangeSubscription: () => customerPreviewChangeSubscription2,
76
82
  customerQuerySubscriptions: () => customerQuerySubscriptions2,
77
83
  customerResumeSubscription: () => customerResumeSubscription2,
78
84
  customerSkipCycle: () => customerSkipCycle2,
@@ -89,7 +95,6 @@ __export(index_typings_exports, {
89
95
  markBillingCycleAsPaid: () => markBillingCycleAsPaid2,
90
96
  markLatestInvoiceAsPaid: () => markLatestInvoiceAsPaid2,
91
97
  pauseSubscription: () => pauseSubscription2,
92
- payCycle: () => payCycle2,
93
98
  previewSubscriptionCharges: () => previewSubscriptionCharges2,
94
99
  previewSubscriptionsCharges: () => previewSubscriptionsCharges2,
95
100
  querySubscriptions: () => querySubscriptions2,
@@ -109,6 +114,7 @@ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-
109
114
 
110
115
  // src/billing-v1-subscription-subscriptions.http.ts
111
116
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
117
+ var import_float = require("@wix/sdk-runtime/transformations/float");
112
118
  var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
113
119
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
114
120
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -195,47 +201,6 @@ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl(opts
195
201
  };
196
202
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
197
203
  }
198
- function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(opts) {
199
- const domainToMappings = {
200
- "www._base_domain_": [
201
- {
202
- srcPath: "/_api/billing-subscriptions",
203
- destPath: ""
204
- }
205
- ],
206
- _: [
207
- {
208
- srcPath: "/_api/billing-subscriptions",
209
- destPath: ""
210
- }
211
- ],
212
- "*.dev.wix-code.com": [
213
- {
214
- srcPath: "/_api/billing-subscriptions",
215
- destPath: ""
216
- }
217
- ],
218
- "*.pub.wix-code.com": [
219
- {
220
- srcPath: "/_api/billing-subscriptions",
221
- destPath: ""
222
- }
223
- ],
224
- "manage._base_domain_": [
225
- {
226
- srcPath: "/_api/billing-subscriptions",
227
- destPath: ""
228
- }
229
- ],
230
- "payments.base44.com": [
231
- {
232
- srcPath: "/_api/billing-subscriptions",
233
- destPath: ""
234
- }
235
- ]
236
- };
237
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
238
- }
239
204
  function resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(opts) {
240
205
  const domainToMappings = {
241
206
  "www._base_domain_": [
@@ -536,6 +501,15 @@ function customerExtendSubscription(payload) {
536
501
  }
537
502
  function customerQuerySubscriptions(payload) {
538
503
  function __customerQuerySubscriptions({ host }) {
504
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
505
+ {
506
+ transformFn: import_float.transformSDKFloatToRESTFloat,
507
+ paths: [
508
+ { path: "query.sort.origin.latitude" },
509
+ { path: "query.sort.origin.longitude" }
510
+ ]
511
+ }
512
+ ]);
539
513
  const metadata = {
540
514
  entityFqdn: "wix.billing.v1.subscription",
541
515
  method: "POST",
@@ -545,9 +519,13 @@ function customerQuerySubscriptions(payload) {
545
519
  optInTransformResponse: true
546
520
  },
547
521
  url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
548
- { protoPath: "/v1/customer_subscriptions/query", data: payload, host }
522
+ {
523
+ protoPath: "/v1/customer_subscriptions/query",
524
+ data: serializedData,
525
+ host
526
+ }
549
527
  ),
550
- data: payload,
528
+ data: serializedData,
551
529
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
552
530
  {
553
531
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
@@ -1051,19 +1029,19 @@ function customerUpdateBillingDate(payload) {
1051
1029
  }
1052
1030
  return __customerUpdateBillingDate;
1053
1031
  }
1054
- function payCycle(payload) {
1055
- function __payCycle({ host }) {
1032
+ function customerChangeSubscription(payload) {
1033
+ function __customerChangeSubscription({ host }) {
1056
1034
  const metadata = {
1057
1035
  entityFqdn: "wix.billing.v1.subscription",
1058
1036
  method: "POST",
1059
- methodFqn: "com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle",
1037
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerChangeSubscription",
1060
1038
  packageName: PACKAGE_NAME,
1061
1039
  migrationOptions: {
1062
1040
  optInTransformResponse: true
1063
1041
  },
1064
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(
1042
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
1065
1043
  {
1066
- protoPath: "/v1/subscriptions-bo/{subscriptionId}/pay-cycle",
1044
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/change",
1067
1045
  data: payload,
1068
1046
  host
1069
1047
  }
@@ -1101,7 +1079,95 @@ function payCycle(payload) {
1101
1079
  };
1102
1080
  return metadata;
1103
1081
  }
1104
- return __payCycle;
1082
+ return __customerChangeSubscription;
1083
+ }
1084
+ function customerPreviewChangeSubscription(payload) {
1085
+ function __customerPreviewChangeSubscription({ host }) {
1086
+ const metadata = {
1087
+ entityFqdn: "wix.billing.v1.subscription",
1088
+ method: "POST",
1089
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerPreviewChangeSubscription",
1090
+ packageName: PACKAGE_NAME,
1091
+ migrationOptions: {
1092
+ optInTransformResponse: true
1093
+ },
1094
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
1095
+ {
1096
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/preview_change",
1097
+ data: payload,
1098
+ host
1099
+ }
1100
+ ),
1101
+ data: payload,
1102
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
1103
+ {
1104
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
1105
+ paths: [
1106
+ { path: "preview.current.periodStart" },
1107
+ { path: "preview.current.periodEnd" },
1108
+ { path: "preview.proposed.periodStart" },
1109
+ { path: "preview.proposed.periodEnd" },
1110
+ { path: "preview.proration.newPeriodEnd" },
1111
+ { path: "preview.renewalPreview.nextRenewalDate" }
1112
+ ]
1113
+ }
1114
+ ])
1115
+ };
1116
+ return metadata;
1117
+ }
1118
+ return __customerPreviewChangeSubscription;
1119
+ }
1120
+ function customerCancelPendingChange(payload) {
1121
+ function __customerCancelPendingChange({ host }) {
1122
+ const metadata = {
1123
+ entityFqdn: "wix.billing.v1.subscription",
1124
+ method: "POST",
1125
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerCancelPendingChange",
1126
+ packageName: PACKAGE_NAME,
1127
+ migrationOptions: {
1128
+ optInTransformResponse: true
1129
+ },
1130
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
1131
+ {
1132
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/cancel_pending_change",
1133
+ data: payload,
1134
+ host
1135
+ }
1136
+ ),
1137
+ data: payload,
1138
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
1139
+ {
1140
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
1141
+ paths: [
1142
+ { path: "subscription.createdDate" },
1143
+ { path: "subscription.updatedDate" },
1144
+ { path: "subscription.startDate" },
1145
+ { path: "subscription.endDate" },
1146
+ { path: "subscription.billingStatus.nextBillingDate" },
1147
+ { path: "subscription.billingStatus.previousBillingDate" },
1148
+ {
1149
+ path: "subscription.billingStatus.latestPaymentData.initialFailedPaymentDate"
1150
+ },
1151
+ { path: "subscription.billingStatus.freeTrialData.startDate" },
1152
+ { path: "subscription.billingStatus.freeTrialData.endDate" },
1153
+ {
1154
+ path: "subscription.billingStatus.updateBillingDateData.paidUntil"
1155
+ },
1156
+ { path: "subscription.billingStatus.gracePeriodData.startDate" },
1157
+ { path: "subscription.billingStatus.gracePeriodData.endDate" },
1158
+ { path: "subscription.pauseInfo.startDate" },
1159
+ { path: "subscription.pauseInfo.resumeDate" },
1160
+ { path: "subscription.cancellationInfo.cancellationDate" },
1161
+ {
1162
+ path: "subscription.specificDatePendingUpdateData.executionDate"
1163
+ }
1164
+ ]
1165
+ }
1166
+ ])
1167
+ };
1168
+ return metadata;
1169
+ }
1170
+ return __customerCancelPendingChange;
1105
1171
  }
1106
1172
  function getSubscription(payload) {
1107
1173
  function __getSubscription({ host }) {
@@ -1476,6 +1542,15 @@ function resumeSubscription(payload) {
1476
1542
  }
1477
1543
  function querySubscriptions(payload) {
1478
1544
  function __querySubscriptions({ host }) {
1545
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
1546
+ {
1547
+ transformFn: import_float.transformSDKFloatToRESTFloat,
1548
+ paths: [
1549
+ { path: "query.sort.origin.latitude" },
1550
+ { path: "query.sort.origin.longitude" }
1551
+ ]
1552
+ }
1553
+ ]);
1479
1554
  const metadata = {
1480
1555
  entityFqdn: "wix.billing.v1.subscription",
1481
1556
  method: "POST",
@@ -1486,10 +1561,10 @@ function querySubscriptions(payload) {
1486
1561
  },
1487
1562
  url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1488
1563
  protoPath: "/v1/subscriptions/query",
1489
- data: payload,
1564
+ data: serializedData,
1490
1565
  host
1491
1566
  }),
1492
- data: payload,
1567
+ data: serializedData,
1493
1568
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
1494
1569
  {
1495
1570
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
@@ -1526,6 +1601,15 @@ function querySubscriptions(payload) {
1526
1601
  }
1527
1602
  function searchSubscriptions(payload) {
1528
1603
  function __searchSubscriptions({ host }) {
1604
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
1605
+ {
1606
+ transformFn: import_float.transformSDKFloatToRESTFloat,
1607
+ paths: [
1608
+ { path: "sorting.sorting.origin.latitude" },
1609
+ { path: "sorting.sorting.origin.longitude" }
1610
+ ]
1611
+ }
1612
+ ]);
1529
1613
  const metadata = {
1530
1614
  entityFqdn: "wix.billing.v1.subscription",
1531
1615
  method: "POST",
@@ -1536,10 +1620,10 @@ function searchSubscriptions(payload) {
1536
1620
  },
1537
1621
  url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1538
1622
  protoPath: "/v1/subscriptions/search",
1539
- data: payload,
1623
+ data: serializedData,
1540
1624
  host
1541
1625
  }),
1542
- data: payload,
1626
+ data: serializedData,
1543
1627
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
1544
1628
  {
1545
1629
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
@@ -3549,6 +3633,54 @@ function listSubscriptionHistory(payload) {
3549
3633
  {
3550
3634
  path: "historyEntries.event.futurePriceUpdatesRequested.subscription.specificDatePendingUpdateData.executionDate"
3551
3635
  },
3636
+ {
3637
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.createdDate"
3638
+ },
3639
+ {
3640
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.updatedDate"
3641
+ },
3642
+ {
3643
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.startDate"
3644
+ },
3645
+ {
3646
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.endDate"
3647
+ },
3648
+ {
3649
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.nextBillingDate"
3650
+ },
3651
+ {
3652
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.previousBillingDate"
3653
+ },
3654
+ {
3655
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate"
3656
+ },
3657
+ {
3658
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.freeTrialData.startDate"
3659
+ },
3660
+ {
3661
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.freeTrialData.endDate"
3662
+ },
3663
+ {
3664
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.updateBillingDateData.paidUntil"
3665
+ },
3666
+ {
3667
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.gracePeriodData.startDate"
3668
+ },
3669
+ {
3670
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.gracePeriodData.endDate"
3671
+ },
3672
+ {
3673
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.pauseInfo.startDate"
3674
+ },
3675
+ {
3676
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.pauseInfo.resumeDate"
3677
+ },
3678
+ {
3679
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.cancellationInfo.cancellationDate"
3680
+ },
3681
+ {
3682
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.specificDatePendingUpdateData.executionDate"
3683
+ },
3552
3684
  {
3553
3685
  path: "historyEntries.event.subscriptionBoAction.subscription.createdDate"
3554
3686
  },
@@ -3699,6 +3831,7 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
3699
3831
  return SortOrder2;
3700
3832
  })(SortOrder || {});
3701
3833
  var SubscriptionStatusGroup = /* @__PURE__ */ ((SubscriptionStatusGroup2) => {
3834
+ SubscriptionStatusGroup2["UNKNOWN_STATUS_GROUP"] = "UNKNOWN_STATUS_GROUP";
3702
3835
  SubscriptionStatusGroup2["ALL"] = "ALL";
3703
3836
  SubscriptionStatusGroup2["LIVE"] = "LIVE";
3704
3837
  return SubscriptionStatusGroup2;
@@ -3720,6 +3853,7 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
3720
3853
  ActionType2["UPDATE_COLLECTION_METHOD"] = "UPDATE_COLLECTION_METHOD";
3721
3854
  ActionType2["SKIP_CYCLE"] = "SKIP_CYCLE";
3722
3855
  ActionType2["CUSTOMER_UPDATE_BILLING_DATE"] = "CUSTOMER_UPDATE_BILLING_DATE";
3856
+ ActionType2["CHANGE_SUBSCRIPTION"] = "CHANGE_SUBSCRIPTION";
3723
3857
  return ActionType2;
3724
3858
  })(ActionType || {});
3725
3859
  var ExtendPolicyType = /* @__PURE__ */ ((ExtendPolicyType2) => {
@@ -3739,6 +3873,20 @@ var OrderMethod = /* @__PURE__ */ ((OrderMethod2) => {
3739
3873
  OrderMethod2["NOT_MOTO"] = "NOT_MOTO";
3740
3874
  return OrderMethod2;
3741
3875
  })(OrderMethod || {});
3876
+ var ChangeEffectiveTime = /* @__PURE__ */ ((ChangeEffectiveTime2) => {
3877
+ ChangeEffectiveTime2["UNKNOWN"] = "UNKNOWN";
3878
+ ChangeEffectiveTime2["IMMEDIATELY"] = "IMMEDIATELY";
3879
+ ChangeEffectiveTime2["AT_NEXT_RENEWAL"] = "AT_NEXT_RENEWAL";
3880
+ return ChangeEffectiveTime2;
3881
+ })(ChangeEffectiveTime || {});
3882
+ var ProrationAction = /* @__PURE__ */ ((ProrationAction2) => {
3883
+ ProrationAction2["UNKNOWN"] = "UNKNOWN";
3884
+ ProrationAction2["CHARGE"] = "CHARGE";
3885
+ ProrationAction2["REFUND"] = "REFUND";
3886
+ ProrationAction2["EXTEND_PERIOD"] = "EXTEND_PERIOD";
3887
+ ProrationAction2["NO_CHANGE"] = "NO_CHANGE";
3888
+ return ProrationAction2;
3889
+ })(ProrationAction || {});
3742
3890
  var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
3743
3891
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
3744
3892
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -3747,25 +3895,6 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
3747
3895
  WebhookIdentityType2["APP"] = "APP";
3748
3896
  return WebhookIdentityType2;
3749
3897
  })(WebhookIdentityType || {});
3750
- var PaymentTestMode = /* @__PURE__ */ ((PaymentTestMode2) => {
3751
- PaymentTestMode2["REGULAR"] = "REGULAR";
3752
- PaymentTestMode2["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
3753
- PaymentTestMode2["FAIL_DECLINE"] = "FAIL_DECLINE";
3754
- PaymentTestMode2["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
3755
- return PaymentTestMode2;
3756
- })(PaymentTestMode || {});
3757
- var RevivePolicy = /* @__PURE__ */ ((RevivePolicy2) => {
3758
- RevivePolicy2["SIMPLE"] = "SIMPLE";
3759
- RevivePolicy2["RESUME"] = "RESUME";
3760
- return RevivePolicy2;
3761
- })(RevivePolicy || {});
3762
- var ActionInitiator = /* @__PURE__ */ ((ActionInitiator2) => {
3763
- ActionInitiator2["UNDEFINED"] = "UNDEFINED";
3764
- ActionInitiator2["BUSINESS"] = "BUSINESS";
3765
- ActionInitiator2["CUSTOMER"] = "CUSTOMER";
3766
- ActionInitiator2["SYSTEM"] = "SYSTEM";
3767
- return ActionInitiator2;
3768
- })(ActionInitiator || {});
3769
3898
  var UpdateAction = /* @__PURE__ */ ((UpdateAction2) => {
3770
3899
  UpdateAction2["NONE"] = "NONE";
3771
3900
  UpdateAction2["IMMEDIATELY"] = "IMMEDIATELY";
@@ -3774,6 +3903,19 @@ var UpdateAction = /* @__PURE__ */ ((UpdateAction2) => {
3774
3903
  UpdateAction2["SPECIFIC_DATE"] = "SPECIFIC_DATE";
3775
3904
  return UpdateAction2;
3776
3905
  })(UpdateAction || {});
3906
+ var ActionInitiator = /* @__PURE__ */ ((ActionInitiator2) => {
3907
+ ActionInitiator2["UNDEFINED"] = "UNDEFINED";
3908
+ ActionInitiator2["BUSINESS"] = "BUSINESS";
3909
+ ActionInitiator2["CUSTOMER"] = "CUSTOMER";
3910
+ ActionInitiator2["SYSTEM"] = "SYSTEM";
3911
+ return ActionInitiator2;
3912
+ })(ActionInitiator || {});
3913
+ var MissingPreviousBillingDateResumeStrategy = /* @__PURE__ */ ((MissingPreviousBillingDateResumeStrategy2) => {
3914
+ MissingPreviousBillingDateResumeStrategy2["UNKNOWN"] = "UNKNOWN";
3915
+ MissingPreviousBillingDateResumeStrategy2["START_BILLING_IMMEDIATELY"] = "START_BILLING_IMMEDIATELY";
3916
+ MissingPreviousBillingDateResumeStrategy2["START_BILLING_AFTER_ONE_FULL_CYCLE"] = "START_BILLING_AFTER_ONE_FULL_CYCLE";
3917
+ return MissingPreviousBillingDateResumeStrategy2;
3918
+ })(MissingPreviousBillingDateResumeStrategy || {});
3777
3919
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
3778
3920
  RequestedFields2["UNSUPPORTED_ACTION"] = "UNSUPPORTED_ACTION";
3779
3921
  return RequestedFields2;
@@ -3832,28 +3974,30 @@ var RefundReason = /* @__PURE__ */ ((RefundReason2) => {
3832
3974
  RefundReason2["OTHER"] = "OTHER";
3833
3975
  return RefundReason2;
3834
3976
  })(RefundReason || {});
3835
- var ChangeEffectiveTime = /* @__PURE__ */ ((ChangeEffectiveTime2) => {
3836
- ChangeEffectiveTime2["UNKNOWN"] = "UNKNOWN";
3837
- ChangeEffectiveTime2["IMMEDIATELY"] = "IMMEDIATELY";
3838
- ChangeEffectiveTime2["AT_NEXT_RENEWAL"] = "AT_NEXT_RENEWAL";
3839
- return ChangeEffectiveTime2;
3840
- })(ChangeEffectiveTime || {});
3977
+ var ProrationBehaviorEnumProrationBehavior = /* @__PURE__ */ ((ProrationBehaviorEnumProrationBehavior2) => {
3978
+ ProrationBehaviorEnumProrationBehavior2["UNKNOWN"] = "UNKNOWN";
3979
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_CHARGE"] = "PRORATE_AND_CHARGE";
3980
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_REFUND"] = "PRORATE_AND_REFUND";
3981
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_EXTEND"] = "PRORATE_AND_EXTEND";
3982
+ ProrationBehaviorEnumProrationBehavior2["NO_PRORATION"] = "NO_PRORATION";
3983
+ return ProrationBehaviorEnumProrationBehavior2;
3984
+ })(ProrationBehaviorEnumProrationBehavior || {});
3985
+ var ChangeType = /* @__PURE__ */ ((ChangeType2) => {
3986
+ ChangeType2["CHANGE_TYPE_UNKNOWN"] = "CHANGE_TYPE_UNKNOWN";
3987
+ ChangeType2["UPGRADE"] = "UPGRADE";
3988
+ ChangeType2["DOWNGRADE"] = "DOWNGRADE";
3989
+ ChangeType2["CYCLE_CHANGE"] = "CYCLE_CHANGE";
3990
+ ChangeType2["QUANTITY_CHANGE"] = "QUANTITY_CHANGE";
3991
+ return ChangeType2;
3992
+ })(ChangeType || {});
3841
3993
  var ProrationBehavior = /* @__PURE__ */ ((ProrationBehavior2) => {
3842
- ProrationBehavior2["UNKNOWN"] = "UNKNOWN";
3994
+ ProrationBehavior2["PRORATION_BEHAVIOR_UNKNOWN"] = "PRORATION_BEHAVIOR_UNKNOWN";
3843
3995
  ProrationBehavior2["PRORATE_AND_CHARGE"] = "PRORATE_AND_CHARGE";
3844
3996
  ProrationBehavior2["PRORATE_AND_REFUND"] = "PRORATE_AND_REFUND";
3845
3997
  ProrationBehavior2["PRORATE_AND_EXTEND"] = "PRORATE_AND_EXTEND";
3846
3998
  ProrationBehavior2["NO_PRORATION"] = "NO_PRORATION";
3847
3999
  return ProrationBehavior2;
3848
4000
  })(ProrationBehavior || {});
3849
- var ProrationAction = /* @__PURE__ */ ((ProrationAction2) => {
3850
- ProrationAction2["UNKNOWN"] = "UNKNOWN";
3851
- ProrationAction2["CHARGE"] = "CHARGE";
3852
- ProrationAction2["REFUND"] = "REFUND";
3853
- ProrationAction2["EXTEND_PERIOD"] = "EXTEND_PERIOD";
3854
- ProrationAction2["NO_CHANGE"] = "NO_CHANGE";
3855
- return ProrationAction2;
3856
- })(ProrationAction || {});
3857
4001
  var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
3858
4002
  IdentityType2["UNDEFINED"] = "UNDEFINED";
3859
4003
  IdentityType2["MEMBER"] = "MEMBER";
@@ -3908,6 +4052,18 @@ var Status = /* @__PURE__ */ ((Status2) => {
3908
4052
  Status2["ENDED"] = "ENDED";
3909
4053
  return Status2;
3910
4054
  })(Status || {});
4055
+ var PaymentTestMode = /* @__PURE__ */ ((PaymentTestMode2) => {
4056
+ PaymentTestMode2["REGULAR"] = "REGULAR";
4057
+ PaymentTestMode2["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
4058
+ PaymentTestMode2["FAIL_DECLINE"] = "FAIL_DECLINE";
4059
+ PaymentTestMode2["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
4060
+ return PaymentTestMode2;
4061
+ })(PaymentTestMode || {});
4062
+ var RevivePolicy = /* @__PURE__ */ ((RevivePolicy2) => {
4063
+ RevivePolicy2["SIMPLE"] = "SIMPLE";
4064
+ RevivePolicy2["RESUME"] = "RESUME";
4065
+ return RevivePolicy2;
4066
+ })(RevivePolicy || {});
3911
4067
  var HistoryViewMode = /* @__PURE__ */ ((HistoryViewMode2) => {
3912
4068
  HistoryViewMode2["UNKNOWN"] = "UNKNOWN";
3913
4069
  HistoryViewMode2["BACKOFFICE"] = "BACKOFFICE";
@@ -4509,14 +4665,15 @@ async function customerUpdateBillingDate2(_id, billingDate, options) {
4509
4665
  throw transformedError;
4510
4666
  }
4511
4667
  }
4512
- async function payCycle2(subscriptionId, options) {
4668
+ async function customerChangeSubscription2(subscriptionId, options) {
4513
4669
  const { httpClient, sideEffects } = arguments[2];
4514
4670
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
4515
4671
  subscriptionId,
4516
- paymentTestMode: options?.paymentTestMode,
4517
- tenantId: options?.tenantId
4672
+ itemChanges: options?.itemChanges,
4673
+ newCycle: options?.newCycle,
4674
+ effectiveTime: options?.effectiveTime
4518
4675
  });
4519
- const reqOpts = payCycle(payload);
4676
+ const reqOpts = customerChangeSubscription(payload);
4520
4677
  sideEffects?.onSiteCall?.();
4521
4678
  try {
4522
4679
  const result = await httpClient.request(reqOpts);
@@ -4539,8 +4696,9 @@ async function payCycle2(subscriptionId, options) {
4539
4696
  spreadPathsToArguments: {},
4540
4697
  explicitPathsToArguments: {
4541
4698
  subscriptionId: "$[0]",
4542
- paymentTestMode: "$[1].paymentTestMode",
4543
- tenantId: "$[1].tenantId"
4699
+ itemChanges: "$[1].itemChanges",
4700
+ newCycle: "$[1].newCycle",
4701
+ effectiveTime: "$[1].effectiveTime"
4544
4702
  },
4545
4703
  singleArgumentUnchanged: false
4546
4704
  },
@@ -4550,6 +4708,76 @@ async function payCycle2(subscriptionId, options) {
4550
4708
  throw transformedError;
4551
4709
  }
4552
4710
  }
4711
+ async function customerPreviewChangeSubscription2(subscriptionId, options) {
4712
+ const { httpClient, sideEffects } = arguments[2];
4713
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
4714
+ subscriptionId,
4715
+ itemChanges: options?.itemChanges,
4716
+ newCycle: options?.newCycle,
4717
+ effectiveTime: options?.effectiveTime
4718
+ });
4719
+ const reqOpts = customerPreviewChangeSubscription(
4720
+ payload
4721
+ );
4722
+ sideEffects?.onSiteCall?.();
4723
+ try {
4724
+ const result = await httpClient.request(reqOpts);
4725
+ sideEffects?.onSuccess?.(result);
4726
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
4727
+ } catch (err) {
4728
+ const transformedError = (0, import_transform_error.transformError)(
4729
+ err,
4730
+ {
4731
+ spreadPathsToArguments: {},
4732
+ explicitPathsToArguments: {
4733
+ subscriptionId: "$[0]",
4734
+ itemChanges: "$[1].itemChanges",
4735
+ newCycle: "$[1].newCycle",
4736
+ effectiveTime: "$[1].effectiveTime"
4737
+ },
4738
+ singleArgumentUnchanged: false
4739
+ },
4740
+ ["subscriptionId", "options"]
4741
+ );
4742
+ sideEffects?.onError?.(err);
4743
+ throw transformedError;
4744
+ }
4745
+ }
4746
+ async function customerCancelPendingChange2(subscriptionId) {
4747
+ const { httpClient, sideEffects } = arguments[1];
4748
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
4749
+ subscriptionId
4750
+ });
4751
+ const reqOpts = customerCancelPendingChange(payload);
4752
+ sideEffects?.onSiteCall?.();
4753
+ try {
4754
+ const result = await httpClient.request(reqOpts);
4755
+ sideEffects?.onSuccess?.(result);
4756
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
4757
+ (0, import_transform_paths2.transformPaths)(result.data, [
4758
+ {
4759
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
4760
+ paths: [
4761
+ { path: "subscription.billingSettings.billingAddress.address" },
4762
+ { path: "subscription.shippingAddress.address" }
4763
+ ]
4764
+ }
4765
+ ])
4766
+ );
4767
+ } catch (err) {
4768
+ const transformedError = (0, import_transform_error.transformError)(
4769
+ err,
4770
+ {
4771
+ spreadPathsToArguments: {},
4772
+ explicitPathsToArguments: { subscriptionId: "$[0]" },
4773
+ singleArgumentUnchanged: false
4774
+ },
4775
+ ["subscriptionId"]
4776
+ );
4777
+ sideEffects?.onError?.(err);
4778
+ throw transformedError;
4779
+ }
4780
+ }
4553
4781
  async function getSubscription2(_id) {
4554
4782
  const { httpClient, sideEffects } = arguments[1];
4555
4783
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
@@ -4785,7 +5013,8 @@ async function resumeSubscription2(_id, options) {
4785
5013
  id: _id,
4786
5014
  resumeAt: options?.resumeAt,
4787
5015
  resumeAtSchedule: options?.resumeAtSchedule,
4788
- actionContext: options?.actionContext
5016
+ actionContext: options?.actionContext,
5017
+ missingPreviousBillingDateResumeStrategy: options?.missingPreviousBillingDateResumeStrategy
4789
5018
  });
4790
5019
  const reqOpts = resumeSubscription(payload);
4791
5020
  sideEffects?.onSiteCall?.();
@@ -4812,7 +5041,8 @@ async function resumeSubscription2(_id, options) {
4812
5041
  id: "$[0]",
4813
5042
  resumeAt: "$[1].resumeAt",
4814
5043
  resumeAtSchedule: "$[1].resumeAtSchedule",
4815
- actionContext: "$[1].actionContext"
5044
+ actionContext: "$[1].actionContext",
5045
+ missingPreviousBillingDateResumeStrategy: "$[1].missingPreviousBillingDateResumeStrategy"
4816
5046
  },
4817
5047
  singleArgumentUnchanged: false
4818
5048
  },
@@ -5515,6 +5745,12 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5515
5745
  {
5516
5746
  path: "historyEntries.event.futurePriceUpdatesRequested.subscription.shippingAddress.address"
5517
5747
  },
5748
+ {
5749
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingSettings.billingAddress.address"
5750
+ },
5751
+ {
5752
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.shippingAddress.address"
5753
+ },
5518
5754
  {
5519
5755
  path: "historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address"
5520
5756
  },
@@ -5550,6 +5786,7 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5550
5786
  AdditionalFeeTrigger,
5551
5787
  CancellationInitiator,
5552
5788
  ChangeEffectiveTime,
5789
+ ChangeType,
5553
5790
  CollectionMethod,
5554
5791
  CollectionMethodEnumCollectionMethod,
5555
5792
  CreationMode,
@@ -5560,6 +5797,7 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5560
5797
  IdentityType,
5561
5798
  InvoiceStatus,
5562
5799
  ItemCategory,
5800
+ MissingPreviousBillingDateResumeStrategy,
5563
5801
  OrderMethod,
5564
5802
  PauseAt,
5565
5803
  PausePolicy,
@@ -5572,6 +5810,7 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5572
5810
  PriceAdjustmentReason,
5573
5811
  ProrationAction,
5574
5812
  ProrationBehavior,
5813
+ ProrationBehaviorEnumProrationBehavior,
5575
5814
  RefundReason,
5576
5815
  RequestedFields,
5577
5816
  ResumeAt,
@@ -5590,14 +5829,17 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5590
5829
  cancelSubscription,
5591
5830
  countSubscriptions,
5592
5831
  customerAllowedActions,
5832
+ customerCancelPendingChange,
5593
5833
  customerCancelScheduledPause,
5594
5834
  customerCancelScheduledSkip,
5595
5835
  customerCancelSubscription,
5836
+ customerChangeSubscription,
5596
5837
  customerExtendSubscription,
5597
5838
  customerGetSubscription,
5598
5839
  customerInitiatePaymentMethodSetup,
5599
5840
  customerListUpcomingCharges,
5600
5841
  customerPauseSubscription,
5842
+ customerPreviewChangeSubscription,
5601
5843
  customerQuerySubscriptions,
5602
5844
  customerResumeSubscription,
5603
5845
  customerSkipCycle,
@@ -5614,7 +5856,6 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5614
5856
  markBillingCycleAsPaid,
5615
5857
  markLatestInvoiceAsPaid,
5616
5858
  pauseSubscription,
5617
- payCycle,
5618
5859
  previewSubscriptionCharges,
5619
5860
  previewSubscriptionsCharges,
5620
5861
  querySubscriptions,