@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
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  // src/billing-v1-subscription-subscriptions.http.ts
9
9
  import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
10
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
10
11
  import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
11
12
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
12
13
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
@@ -93,47 +94,6 @@ function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl(opts
93
94
  };
94
95
  return resolveUrl(Object.assign(opts, { domainToMappings }));
95
96
  }
96
- function resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(opts) {
97
- const domainToMappings = {
98
- "www._base_domain_": [
99
- {
100
- srcPath: "/_api/billing-subscriptions",
101
- destPath: ""
102
- }
103
- ],
104
- _: [
105
- {
106
- srcPath: "/_api/billing-subscriptions",
107
- destPath: ""
108
- }
109
- ],
110
- "*.dev.wix-code.com": [
111
- {
112
- srcPath: "/_api/billing-subscriptions",
113
- destPath: ""
114
- }
115
- ],
116
- "*.pub.wix-code.com": [
117
- {
118
- srcPath: "/_api/billing-subscriptions",
119
- destPath: ""
120
- }
121
- ],
122
- "manage._base_domain_": [
123
- {
124
- srcPath: "/_api/billing-subscriptions",
125
- destPath: ""
126
- }
127
- ],
128
- "payments.base44.com": [
129
- {
130
- srcPath: "/_api/billing-subscriptions",
131
- destPath: ""
132
- }
133
- ]
134
- };
135
- return resolveUrl(Object.assign(opts, { domainToMappings }));
136
- }
137
97
  function resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(opts) {
138
98
  const domainToMappings = {
139
99
  "www._base_domain_": [
@@ -434,6 +394,15 @@ function customerExtendSubscription(payload) {
434
394
  }
435
395
  function customerQuerySubscriptions(payload) {
436
396
  function __customerQuerySubscriptions({ host }) {
397
+ const serializedData = transformPaths(payload, [
398
+ {
399
+ transformFn: transformSDKFloatToRESTFloat,
400
+ paths: [
401
+ { path: "query.sort.origin.latitude" },
402
+ { path: "query.sort.origin.longitude" }
403
+ ]
404
+ }
405
+ ]);
437
406
  const metadata = {
438
407
  entityFqdn: "wix.billing.v1.subscription",
439
408
  method: "POST",
@@ -443,9 +412,13 @@ function customerQuerySubscriptions(payload) {
443
412
  optInTransformResponse: true
444
413
  },
445
414
  url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
446
- { protoPath: "/v1/customer_subscriptions/query", data: payload, host }
415
+ {
416
+ protoPath: "/v1/customer_subscriptions/query",
417
+ data: serializedData,
418
+ host
419
+ }
447
420
  ),
448
- data: payload,
421
+ data: serializedData,
449
422
  transformResponse: (payload2) => transformPaths(payload2, [
450
423
  {
451
424
  transformFn: transformRESTTimestampToSDKTimestamp,
@@ -949,19 +922,19 @@ function customerUpdateBillingDate(payload) {
949
922
  }
950
923
  return __customerUpdateBillingDate;
951
924
  }
952
- function payCycle(payload) {
953
- function __payCycle({ host }) {
925
+ function customerChangeSubscription(payload) {
926
+ function __customerChangeSubscription({ host }) {
954
927
  const metadata = {
955
928
  entityFqdn: "wix.billing.v1.subscription",
956
929
  method: "POST",
957
- methodFqn: "com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle",
930
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerChangeSubscription",
958
931
  packageName: PACKAGE_NAME,
959
932
  migrationOptions: {
960
933
  optInTransformResponse: true
961
934
  },
962
- url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsBackOfficeServiceUrl(
935
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
963
936
  {
964
- protoPath: "/v1/subscriptions-bo/{subscriptionId}/pay-cycle",
937
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/change",
965
938
  data: payload,
966
939
  host
967
940
  }
@@ -999,7 +972,95 @@ function payCycle(payload) {
999
972
  };
1000
973
  return metadata;
1001
974
  }
1002
- return __payCycle;
975
+ return __customerChangeSubscription;
976
+ }
977
+ function customerPreviewChangeSubscription(payload) {
978
+ function __customerPreviewChangeSubscription({ host }) {
979
+ const metadata = {
980
+ entityFqdn: "wix.billing.v1.subscription",
981
+ method: "POST",
982
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerPreviewChangeSubscription",
983
+ packageName: PACKAGE_NAME,
984
+ migrationOptions: {
985
+ optInTransformResponse: true
986
+ },
987
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
988
+ {
989
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/preview_change",
990
+ data: payload,
991
+ host
992
+ }
993
+ ),
994
+ data: payload,
995
+ transformResponse: (payload2) => transformPaths(payload2, [
996
+ {
997
+ transformFn: transformRESTTimestampToSDKTimestamp,
998
+ paths: [
999
+ { path: "preview.current.periodStart" },
1000
+ { path: "preview.current.periodEnd" },
1001
+ { path: "preview.proposed.periodStart" },
1002
+ { path: "preview.proposed.periodEnd" },
1003
+ { path: "preview.proration.newPeriodEnd" },
1004
+ { path: "preview.renewalPreview.nextRenewalDate" }
1005
+ ]
1006
+ }
1007
+ ])
1008
+ };
1009
+ return metadata;
1010
+ }
1011
+ return __customerPreviewChangeSubscription;
1012
+ }
1013
+ function customerCancelPendingChange(payload) {
1014
+ function __customerCancelPendingChange({ host }) {
1015
+ const metadata = {
1016
+ entityFqdn: "wix.billing.v1.subscription",
1017
+ method: "POST",
1018
+ methodFqn: "com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CustomerCancelPendingChange",
1019
+ packageName: PACKAGE_NAME,
1020
+ migrationOptions: {
1021
+ optInTransformResponse: true
1022
+ },
1023
+ url: resolveComWixpressBillingSubscriptionsApiV1CustomerSubscriptionsServiceUrl(
1024
+ {
1025
+ protoPath: "/v1/customer_subscriptions/{subscriptionId}/cancel_pending_change",
1026
+ data: payload,
1027
+ host
1028
+ }
1029
+ ),
1030
+ data: payload,
1031
+ transformResponse: (payload2) => transformPaths(payload2, [
1032
+ {
1033
+ transformFn: transformRESTTimestampToSDKTimestamp,
1034
+ paths: [
1035
+ { path: "subscription.createdDate" },
1036
+ { path: "subscription.updatedDate" },
1037
+ { path: "subscription.startDate" },
1038
+ { path: "subscription.endDate" },
1039
+ { path: "subscription.billingStatus.nextBillingDate" },
1040
+ { path: "subscription.billingStatus.previousBillingDate" },
1041
+ {
1042
+ path: "subscription.billingStatus.latestPaymentData.initialFailedPaymentDate"
1043
+ },
1044
+ { path: "subscription.billingStatus.freeTrialData.startDate" },
1045
+ { path: "subscription.billingStatus.freeTrialData.endDate" },
1046
+ {
1047
+ path: "subscription.billingStatus.updateBillingDateData.paidUntil"
1048
+ },
1049
+ { path: "subscription.billingStatus.gracePeriodData.startDate" },
1050
+ { path: "subscription.billingStatus.gracePeriodData.endDate" },
1051
+ { path: "subscription.pauseInfo.startDate" },
1052
+ { path: "subscription.pauseInfo.resumeDate" },
1053
+ { path: "subscription.cancellationInfo.cancellationDate" },
1054
+ {
1055
+ path: "subscription.specificDatePendingUpdateData.executionDate"
1056
+ }
1057
+ ]
1058
+ }
1059
+ ])
1060
+ };
1061
+ return metadata;
1062
+ }
1063
+ return __customerCancelPendingChange;
1003
1064
  }
1004
1065
  function getSubscription(payload) {
1005
1066
  function __getSubscription({ host }) {
@@ -1374,6 +1435,15 @@ function resumeSubscription(payload) {
1374
1435
  }
1375
1436
  function querySubscriptions(payload) {
1376
1437
  function __querySubscriptions({ host }) {
1438
+ const serializedData = transformPaths(payload, [
1439
+ {
1440
+ transformFn: transformSDKFloatToRESTFloat,
1441
+ paths: [
1442
+ { path: "query.sort.origin.latitude" },
1443
+ { path: "query.sort.origin.longitude" }
1444
+ ]
1445
+ }
1446
+ ]);
1377
1447
  const metadata = {
1378
1448
  entityFqdn: "wix.billing.v1.subscription",
1379
1449
  method: "POST",
@@ -1384,10 +1454,10 @@ function querySubscriptions(payload) {
1384
1454
  },
1385
1455
  url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1386
1456
  protoPath: "/v1/subscriptions/query",
1387
- data: payload,
1457
+ data: serializedData,
1388
1458
  host
1389
1459
  }),
1390
- data: payload,
1460
+ data: serializedData,
1391
1461
  transformResponse: (payload2) => transformPaths(payload2, [
1392
1462
  {
1393
1463
  transformFn: transformRESTTimestampToSDKTimestamp,
@@ -1424,6 +1494,15 @@ function querySubscriptions(payload) {
1424
1494
  }
1425
1495
  function searchSubscriptions(payload) {
1426
1496
  function __searchSubscriptions({ host }) {
1497
+ const serializedData = transformPaths(payload, [
1498
+ {
1499
+ transformFn: transformSDKFloatToRESTFloat,
1500
+ paths: [
1501
+ { path: "sorting.sorting.origin.latitude" },
1502
+ { path: "sorting.sorting.origin.longitude" }
1503
+ ]
1504
+ }
1505
+ ]);
1427
1506
  const metadata = {
1428
1507
  entityFqdn: "wix.billing.v1.subscription",
1429
1508
  method: "POST",
@@ -1434,10 +1513,10 @@ function searchSubscriptions(payload) {
1434
1513
  },
1435
1514
  url: resolveComWixpressBillingSubscriptionsApiV1SubscriptionsServiceUrl({
1436
1515
  protoPath: "/v1/subscriptions/search",
1437
- data: payload,
1516
+ data: serializedData,
1438
1517
  host
1439
1518
  }),
1440
- data: payload,
1519
+ data: serializedData,
1441
1520
  transformResponse: (payload2) => transformPaths(payload2, [
1442
1521
  {
1443
1522
  transformFn: transformRESTTimestampToSDKTimestamp,
@@ -3447,6 +3526,54 @@ function listSubscriptionHistory(payload) {
3447
3526
  {
3448
3527
  path: "historyEntries.event.futurePriceUpdatesRequested.subscription.specificDatePendingUpdateData.executionDate"
3449
3528
  },
3529
+ {
3530
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.createdDate"
3531
+ },
3532
+ {
3533
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.updatedDate"
3534
+ },
3535
+ {
3536
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.startDate"
3537
+ },
3538
+ {
3539
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.endDate"
3540
+ },
3541
+ {
3542
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.nextBillingDate"
3543
+ },
3544
+ {
3545
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.previousBillingDate"
3546
+ },
3547
+ {
3548
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.latestPaymentData.initialFailedPaymentDate"
3549
+ },
3550
+ {
3551
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.freeTrialData.startDate"
3552
+ },
3553
+ {
3554
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.freeTrialData.endDate"
3555
+ },
3556
+ {
3557
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.updateBillingDateData.paidUntil"
3558
+ },
3559
+ {
3560
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.gracePeriodData.startDate"
3561
+ },
3562
+ {
3563
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingStatus.gracePeriodData.endDate"
3564
+ },
3565
+ {
3566
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.pauseInfo.startDate"
3567
+ },
3568
+ {
3569
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.pauseInfo.resumeDate"
3570
+ },
3571
+ {
3572
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.cancellationInfo.cancellationDate"
3573
+ },
3574
+ {
3575
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.specificDatePendingUpdateData.executionDate"
3576
+ },
3450
3577
  {
3451
3578
  path: "historyEntries.event.subscriptionBoAction.subscription.createdDate"
3452
3579
  },
@@ -3597,6 +3724,7 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
3597
3724
  return SortOrder2;
3598
3725
  })(SortOrder || {});
3599
3726
  var SubscriptionStatusGroup = /* @__PURE__ */ ((SubscriptionStatusGroup2) => {
3727
+ SubscriptionStatusGroup2["UNKNOWN_STATUS_GROUP"] = "UNKNOWN_STATUS_GROUP";
3600
3728
  SubscriptionStatusGroup2["ALL"] = "ALL";
3601
3729
  SubscriptionStatusGroup2["LIVE"] = "LIVE";
3602
3730
  return SubscriptionStatusGroup2;
@@ -3618,6 +3746,7 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
3618
3746
  ActionType2["UPDATE_COLLECTION_METHOD"] = "UPDATE_COLLECTION_METHOD";
3619
3747
  ActionType2["SKIP_CYCLE"] = "SKIP_CYCLE";
3620
3748
  ActionType2["CUSTOMER_UPDATE_BILLING_DATE"] = "CUSTOMER_UPDATE_BILLING_DATE";
3749
+ ActionType2["CHANGE_SUBSCRIPTION"] = "CHANGE_SUBSCRIPTION";
3621
3750
  return ActionType2;
3622
3751
  })(ActionType || {});
3623
3752
  var ExtendPolicyType = /* @__PURE__ */ ((ExtendPolicyType2) => {
@@ -3637,6 +3766,20 @@ var OrderMethod = /* @__PURE__ */ ((OrderMethod2) => {
3637
3766
  OrderMethod2["NOT_MOTO"] = "NOT_MOTO";
3638
3767
  return OrderMethod2;
3639
3768
  })(OrderMethod || {});
3769
+ var ChangeEffectiveTime = /* @__PURE__ */ ((ChangeEffectiveTime2) => {
3770
+ ChangeEffectiveTime2["UNKNOWN"] = "UNKNOWN";
3771
+ ChangeEffectiveTime2["IMMEDIATELY"] = "IMMEDIATELY";
3772
+ ChangeEffectiveTime2["AT_NEXT_RENEWAL"] = "AT_NEXT_RENEWAL";
3773
+ return ChangeEffectiveTime2;
3774
+ })(ChangeEffectiveTime || {});
3775
+ var ProrationAction = /* @__PURE__ */ ((ProrationAction2) => {
3776
+ ProrationAction2["UNKNOWN"] = "UNKNOWN";
3777
+ ProrationAction2["CHARGE"] = "CHARGE";
3778
+ ProrationAction2["REFUND"] = "REFUND";
3779
+ ProrationAction2["EXTEND_PERIOD"] = "EXTEND_PERIOD";
3780
+ ProrationAction2["NO_CHANGE"] = "NO_CHANGE";
3781
+ return ProrationAction2;
3782
+ })(ProrationAction || {});
3640
3783
  var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
3641
3784
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
3642
3785
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -3645,25 +3788,6 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
3645
3788
  WebhookIdentityType2["APP"] = "APP";
3646
3789
  return WebhookIdentityType2;
3647
3790
  })(WebhookIdentityType || {});
3648
- var PaymentTestMode = /* @__PURE__ */ ((PaymentTestMode2) => {
3649
- PaymentTestMode2["REGULAR"] = "REGULAR";
3650
- PaymentTestMode2["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
3651
- PaymentTestMode2["FAIL_DECLINE"] = "FAIL_DECLINE";
3652
- PaymentTestMode2["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
3653
- return PaymentTestMode2;
3654
- })(PaymentTestMode || {});
3655
- var RevivePolicy = /* @__PURE__ */ ((RevivePolicy2) => {
3656
- RevivePolicy2["SIMPLE"] = "SIMPLE";
3657
- RevivePolicy2["RESUME"] = "RESUME";
3658
- return RevivePolicy2;
3659
- })(RevivePolicy || {});
3660
- var ActionInitiator = /* @__PURE__ */ ((ActionInitiator2) => {
3661
- ActionInitiator2["UNDEFINED"] = "UNDEFINED";
3662
- ActionInitiator2["BUSINESS"] = "BUSINESS";
3663
- ActionInitiator2["CUSTOMER"] = "CUSTOMER";
3664
- ActionInitiator2["SYSTEM"] = "SYSTEM";
3665
- return ActionInitiator2;
3666
- })(ActionInitiator || {});
3667
3791
  var UpdateAction = /* @__PURE__ */ ((UpdateAction2) => {
3668
3792
  UpdateAction2["NONE"] = "NONE";
3669
3793
  UpdateAction2["IMMEDIATELY"] = "IMMEDIATELY";
@@ -3672,6 +3796,19 @@ var UpdateAction = /* @__PURE__ */ ((UpdateAction2) => {
3672
3796
  UpdateAction2["SPECIFIC_DATE"] = "SPECIFIC_DATE";
3673
3797
  return UpdateAction2;
3674
3798
  })(UpdateAction || {});
3799
+ var ActionInitiator = /* @__PURE__ */ ((ActionInitiator2) => {
3800
+ ActionInitiator2["UNDEFINED"] = "UNDEFINED";
3801
+ ActionInitiator2["BUSINESS"] = "BUSINESS";
3802
+ ActionInitiator2["CUSTOMER"] = "CUSTOMER";
3803
+ ActionInitiator2["SYSTEM"] = "SYSTEM";
3804
+ return ActionInitiator2;
3805
+ })(ActionInitiator || {});
3806
+ var MissingPreviousBillingDateResumeStrategy = /* @__PURE__ */ ((MissingPreviousBillingDateResumeStrategy2) => {
3807
+ MissingPreviousBillingDateResumeStrategy2["UNKNOWN"] = "UNKNOWN";
3808
+ MissingPreviousBillingDateResumeStrategy2["START_BILLING_IMMEDIATELY"] = "START_BILLING_IMMEDIATELY";
3809
+ MissingPreviousBillingDateResumeStrategy2["START_BILLING_AFTER_ONE_FULL_CYCLE"] = "START_BILLING_AFTER_ONE_FULL_CYCLE";
3810
+ return MissingPreviousBillingDateResumeStrategy2;
3811
+ })(MissingPreviousBillingDateResumeStrategy || {});
3675
3812
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
3676
3813
  RequestedFields2["UNSUPPORTED_ACTION"] = "UNSUPPORTED_ACTION";
3677
3814
  return RequestedFields2;
@@ -3730,28 +3867,30 @@ var RefundReason = /* @__PURE__ */ ((RefundReason2) => {
3730
3867
  RefundReason2["OTHER"] = "OTHER";
3731
3868
  return RefundReason2;
3732
3869
  })(RefundReason || {});
3733
- var ChangeEffectiveTime = /* @__PURE__ */ ((ChangeEffectiveTime2) => {
3734
- ChangeEffectiveTime2["UNKNOWN"] = "UNKNOWN";
3735
- ChangeEffectiveTime2["IMMEDIATELY"] = "IMMEDIATELY";
3736
- ChangeEffectiveTime2["AT_NEXT_RENEWAL"] = "AT_NEXT_RENEWAL";
3737
- return ChangeEffectiveTime2;
3738
- })(ChangeEffectiveTime || {});
3870
+ var ProrationBehaviorEnumProrationBehavior = /* @__PURE__ */ ((ProrationBehaviorEnumProrationBehavior2) => {
3871
+ ProrationBehaviorEnumProrationBehavior2["UNKNOWN"] = "UNKNOWN";
3872
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_CHARGE"] = "PRORATE_AND_CHARGE";
3873
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_REFUND"] = "PRORATE_AND_REFUND";
3874
+ ProrationBehaviorEnumProrationBehavior2["PRORATE_AND_EXTEND"] = "PRORATE_AND_EXTEND";
3875
+ ProrationBehaviorEnumProrationBehavior2["NO_PRORATION"] = "NO_PRORATION";
3876
+ return ProrationBehaviorEnumProrationBehavior2;
3877
+ })(ProrationBehaviorEnumProrationBehavior || {});
3878
+ var ChangeType = /* @__PURE__ */ ((ChangeType2) => {
3879
+ ChangeType2["CHANGE_TYPE_UNKNOWN"] = "CHANGE_TYPE_UNKNOWN";
3880
+ ChangeType2["UPGRADE"] = "UPGRADE";
3881
+ ChangeType2["DOWNGRADE"] = "DOWNGRADE";
3882
+ ChangeType2["CYCLE_CHANGE"] = "CYCLE_CHANGE";
3883
+ ChangeType2["QUANTITY_CHANGE"] = "QUANTITY_CHANGE";
3884
+ return ChangeType2;
3885
+ })(ChangeType || {});
3739
3886
  var ProrationBehavior = /* @__PURE__ */ ((ProrationBehavior2) => {
3740
- ProrationBehavior2["UNKNOWN"] = "UNKNOWN";
3887
+ ProrationBehavior2["PRORATION_BEHAVIOR_UNKNOWN"] = "PRORATION_BEHAVIOR_UNKNOWN";
3741
3888
  ProrationBehavior2["PRORATE_AND_CHARGE"] = "PRORATE_AND_CHARGE";
3742
3889
  ProrationBehavior2["PRORATE_AND_REFUND"] = "PRORATE_AND_REFUND";
3743
3890
  ProrationBehavior2["PRORATE_AND_EXTEND"] = "PRORATE_AND_EXTEND";
3744
3891
  ProrationBehavior2["NO_PRORATION"] = "NO_PRORATION";
3745
3892
  return ProrationBehavior2;
3746
3893
  })(ProrationBehavior || {});
3747
- var ProrationAction = /* @__PURE__ */ ((ProrationAction2) => {
3748
- ProrationAction2["UNKNOWN"] = "UNKNOWN";
3749
- ProrationAction2["CHARGE"] = "CHARGE";
3750
- ProrationAction2["REFUND"] = "REFUND";
3751
- ProrationAction2["EXTEND_PERIOD"] = "EXTEND_PERIOD";
3752
- ProrationAction2["NO_CHANGE"] = "NO_CHANGE";
3753
- return ProrationAction2;
3754
- })(ProrationAction || {});
3755
3894
  var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
3756
3895
  IdentityType2["UNDEFINED"] = "UNDEFINED";
3757
3896
  IdentityType2["MEMBER"] = "MEMBER";
@@ -3806,6 +3945,18 @@ var Status = /* @__PURE__ */ ((Status2) => {
3806
3945
  Status2["ENDED"] = "ENDED";
3807
3946
  return Status2;
3808
3947
  })(Status || {});
3948
+ var PaymentTestMode = /* @__PURE__ */ ((PaymentTestMode2) => {
3949
+ PaymentTestMode2["REGULAR"] = "REGULAR";
3950
+ PaymentTestMode2["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
3951
+ PaymentTestMode2["FAIL_DECLINE"] = "FAIL_DECLINE";
3952
+ PaymentTestMode2["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
3953
+ return PaymentTestMode2;
3954
+ })(PaymentTestMode || {});
3955
+ var RevivePolicy = /* @__PURE__ */ ((RevivePolicy2) => {
3956
+ RevivePolicy2["SIMPLE"] = "SIMPLE";
3957
+ RevivePolicy2["RESUME"] = "RESUME";
3958
+ return RevivePolicy2;
3959
+ })(RevivePolicy || {});
3809
3960
  var HistoryViewMode = /* @__PURE__ */ ((HistoryViewMode2) => {
3810
3961
  HistoryViewMode2["UNKNOWN"] = "UNKNOWN";
3811
3962
  HistoryViewMode2["BACKOFFICE"] = "BACKOFFICE";
@@ -4407,14 +4558,15 @@ async function customerUpdateBillingDate2(_id, billingDate, options) {
4407
4558
  throw transformedError;
4408
4559
  }
4409
4560
  }
4410
- async function payCycle2(subscriptionId, options) {
4561
+ async function customerChangeSubscription2(subscriptionId, options) {
4411
4562
  const { httpClient, sideEffects } = arguments[2];
4412
4563
  const payload = renameKeysFromSDKRequestToRESTRequest({
4413
4564
  subscriptionId,
4414
- paymentTestMode: options?.paymentTestMode,
4415
- tenantId: options?.tenantId
4565
+ itemChanges: options?.itemChanges,
4566
+ newCycle: options?.newCycle,
4567
+ effectiveTime: options?.effectiveTime
4416
4568
  });
4417
- const reqOpts = payCycle(payload);
4569
+ const reqOpts = customerChangeSubscription(payload);
4418
4570
  sideEffects?.onSiteCall?.();
4419
4571
  try {
4420
4572
  const result = await httpClient.request(reqOpts);
@@ -4437,8 +4589,9 @@ async function payCycle2(subscriptionId, options) {
4437
4589
  spreadPathsToArguments: {},
4438
4590
  explicitPathsToArguments: {
4439
4591
  subscriptionId: "$[0]",
4440
- paymentTestMode: "$[1].paymentTestMode",
4441
- tenantId: "$[1].tenantId"
4592
+ itemChanges: "$[1].itemChanges",
4593
+ newCycle: "$[1].newCycle",
4594
+ effectiveTime: "$[1].effectiveTime"
4442
4595
  },
4443
4596
  singleArgumentUnchanged: false
4444
4597
  },
@@ -4448,6 +4601,76 @@ async function payCycle2(subscriptionId, options) {
4448
4601
  throw transformedError;
4449
4602
  }
4450
4603
  }
4604
+ async function customerPreviewChangeSubscription2(subscriptionId, options) {
4605
+ const { httpClient, sideEffects } = arguments[2];
4606
+ const payload = renameKeysFromSDKRequestToRESTRequest({
4607
+ subscriptionId,
4608
+ itemChanges: options?.itemChanges,
4609
+ newCycle: options?.newCycle,
4610
+ effectiveTime: options?.effectiveTime
4611
+ });
4612
+ const reqOpts = customerPreviewChangeSubscription(
4613
+ payload
4614
+ );
4615
+ sideEffects?.onSiteCall?.();
4616
+ try {
4617
+ const result = await httpClient.request(reqOpts);
4618
+ sideEffects?.onSuccess?.(result);
4619
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
4620
+ } catch (err) {
4621
+ const transformedError = sdkTransformError(
4622
+ err,
4623
+ {
4624
+ spreadPathsToArguments: {},
4625
+ explicitPathsToArguments: {
4626
+ subscriptionId: "$[0]",
4627
+ itemChanges: "$[1].itemChanges",
4628
+ newCycle: "$[1].newCycle",
4629
+ effectiveTime: "$[1].effectiveTime"
4630
+ },
4631
+ singleArgumentUnchanged: false
4632
+ },
4633
+ ["subscriptionId", "options"]
4634
+ );
4635
+ sideEffects?.onError?.(err);
4636
+ throw transformedError;
4637
+ }
4638
+ }
4639
+ async function customerCancelPendingChange2(subscriptionId) {
4640
+ const { httpClient, sideEffects } = arguments[1];
4641
+ const payload = renameKeysFromSDKRequestToRESTRequest({
4642
+ subscriptionId
4643
+ });
4644
+ const reqOpts = customerCancelPendingChange(payload);
4645
+ sideEffects?.onSiteCall?.();
4646
+ try {
4647
+ const result = await httpClient.request(reqOpts);
4648
+ sideEffects?.onSuccess?.(result);
4649
+ return renameKeysFromRESTResponseToSDKResponse(
4650
+ transformPaths2(result.data, [
4651
+ {
4652
+ transformFn: transformRESTAddressToSDKAddress,
4653
+ paths: [
4654
+ { path: "subscription.billingSettings.billingAddress.address" },
4655
+ { path: "subscription.shippingAddress.address" }
4656
+ ]
4657
+ }
4658
+ ])
4659
+ );
4660
+ } catch (err) {
4661
+ const transformedError = sdkTransformError(
4662
+ err,
4663
+ {
4664
+ spreadPathsToArguments: {},
4665
+ explicitPathsToArguments: { subscriptionId: "$[0]" },
4666
+ singleArgumentUnchanged: false
4667
+ },
4668
+ ["subscriptionId"]
4669
+ );
4670
+ sideEffects?.onError?.(err);
4671
+ throw transformedError;
4672
+ }
4673
+ }
4451
4674
  async function getSubscription2(_id) {
4452
4675
  const { httpClient, sideEffects } = arguments[1];
4453
4676
  const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
@@ -4683,7 +4906,8 @@ async function resumeSubscription2(_id, options) {
4683
4906
  id: _id,
4684
4907
  resumeAt: options?.resumeAt,
4685
4908
  resumeAtSchedule: options?.resumeAtSchedule,
4686
- actionContext: options?.actionContext
4909
+ actionContext: options?.actionContext,
4910
+ missingPreviousBillingDateResumeStrategy: options?.missingPreviousBillingDateResumeStrategy
4687
4911
  });
4688
4912
  const reqOpts = resumeSubscription(payload);
4689
4913
  sideEffects?.onSiteCall?.();
@@ -4710,7 +4934,8 @@ async function resumeSubscription2(_id, options) {
4710
4934
  id: "$[0]",
4711
4935
  resumeAt: "$[1].resumeAt",
4712
4936
  resumeAtSchedule: "$[1].resumeAtSchedule",
4713
- actionContext: "$[1].actionContext"
4937
+ actionContext: "$[1].actionContext",
4938
+ missingPreviousBillingDateResumeStrategy: "$[1].missingPreviousBillingDateResumeStrategy"
4714
4939
  },
4715
4940
  singleArgumentUnchanged: false
4716
4941
  },
@@ -5413,6 +5638,12 @@ async function listSubscriptionHistory2(subscriptionId, options) {
5413
5638
  {
5414
5639
  path: "historyEntries.event.futurePriceUpdatesRequested.subscription.shippingAddress.address"
5415
5640
  },
5641
+ {
5642
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.billingSettings.billingAddress.address"
5643
+ },
5644
+ {
5645
+ path: "historyEntries.event.offlinePurchaseCompleted.subscription.shippingAddress.address"
5646
+ },
5416
5647
  {
5417
5648
  path: "historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address"
5418
5649
  },
@@ -5447,6 +5678,7 @@ export {
5447
5678
  AdditionalFeeTrigger,
5448
5679
  CancellationInitiator,
5449
5680
  ChangeEffectiveTime,
5681
+ ChangeType,
5450
5682
  CollectionMethod,
5451
5683
  CollectionMethodEnumCollectionMethod,
5452
5684
  CreationMode,
@@ -5457,6 +5689,7 @@ export {
5457
5689
  IdentityType,
5458
5690
  InvoiceStatus,
5459
5691
  ItemCategory,
5692
+ MissingPreviousBillingDateResumeStrategy,
5460
5693
  OrderMethod,
5461
5694
  PauseAt,
5462
5695
  PausePolicy,
@@ -5469,6 +5702,7 @@ export {
5469
5702
  PriceAdjustmentReason,
5470
5703
  ProrationAction,
5471
5704
  ProrationBehavior,
5705
+ ProrationBehaviorEnumProrationBehavior,
5472
5706
  RefundReason,
5473
5707
  RequestedFields,
5474
5708
  ResumeAt,
@@ -5487,14 +5721,17 @@ export {
5487
5721
  cancelSubscription2 as cancelSubscription,
5488
5722
  countSubscriptions2 as countSubscriptions,
5489
5723
  customerAllowedActions2 as customerAllowedActions,
5724
+ customerCancelPendingChange2 as customerCancelPendingChange,
5490
5725
  customerCancelScheduledPause2 as customerCancelScheduledPause,
5491
5726
  customerCancelScheduledSkip2 as customerCancelScheduledSkip,
5492
5727
  customerCancelSubscription2 as customerCancelSubscription,
5728
+ customerChangeSubscription2 as customerChangeSubscription,
5493
5729
  customerExtendSubscription2 as customerExtendSubscription,
5494
5730
  customerGetSubscription2 as customerGetSubscription,
5495
5731
  customerInitiatePaymentMethodSetup2 as customerInitiatePaymentMethodSetup,
5496
5732
  customerListUpcomingCharges2 as customerListUpcomingCharges,
5497
5733
  customerPauseSubscription2 as customerPauseSubscription,
5734
+ customerPreviewChangeSubscription2 as customerPreviewChangeSubscription,
5498
5735
  customerQuerySubscriptions2 as customerQuerySubscriptions,
5499
5736
  customerResumeSubscription2 as customerResumeSubscription,
5500
5737
  customerSkipCycle2 as customerSkipCycle,
@@ -5511,7 +5748,6 @@ export {
5511
5748
  markBillingCycleAsPaid2 as markBillingCycleAsPaid,
5512
5749
  markLatestInvoiceAsPaid2 as markLatestInvoiceAsPaid,
5513
5750
  pauseSubscription2 as pauseSubscription,
5514
- payCycle2 as payCycle,
5515
5751
  previewSubscriptionCharges2 as previewSubscriptionCharges,
5516
5752
  previewSubscriptionsCharges2 as previewSubscriptionsCharges,
5517
5753
  querySubscriptions2 as querySubscriptions,