@paygentic/sdk 0.9.13 → 0.9.15
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.
- package/README.md +13 -5
- package/dist/commonjs/funcs/costsGetCostReport.js +1 -0
- package/dist/commonjs/funcs/costsGetCostReport.js.map +1 -1
- package/dist/commonjs/funcs/profitabilityGetProfitability.js +2 -1
- package/dist/commonjs/funcs/profitabilityGetProfitability.js.map +1 -1
- package/dist/commonjs/funcs/revenueGet.js +1 -0
- package/dist/commonjs/funcs/revenueGet.js.map +1 -1
- package/dist/commonjs/funcs/subscriptionsEditSubscriptionIntervals.d.ts +19 -0
- package/dist/commonjs/funcs/subscriptionsEditSubscriptionIntervals.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsEditSubscriptionIntervals.js +127 -0
- package/dist/commonjs/funcs/subscriptionsEditSubscriptionIntervals.js.map +1 -0
- package/dist/commonjs/funcs/subscriptionsGetSubscriptionIntervals.d.ts +19 -0
- package/dist/commonjs/funcs/subscriptionsGetSubscriptionIntervals.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsGetSubscriptionIntervals.js +124 -0
- package/dist/commonjs/funcs/subscriptionsGetSubscriptionIntervals.js.map +1 -0
- package/dist/commonjs/funcs/subscriptionsListIntervalChanges.d.ts +19 -0
- package/dist/commonjs/funcs/subscriptionsListIntervalChanges.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsListIntervalChanges.js +126 -0
- package/dist/commonjs/funcs/subscriptionsListIntervalChanges.js.map +1 -0
- package/dist/commonjs/funcs/subscriptionsListSubscriptionIntervalChanges.d.ts +19 -0
- package/dist/commonjs/funcs/subscriptionsListSubscriptionIntervalChanges.d.ts.map +1 -0
- package/dist/commonjs/funcs/subscriptionsListSubscriptionIntervalChanges.js +129 -0
- package/dist/commonjs/funcs/subscriptionsListSubscriptionIntervalChanges.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/changereason.d.ts +20 -0
- package/dist/commonjs/models/changereason.d.ts.map +1 -0
- package/dist/commonjs/models/changereason.js +54 -0
- package/dist/commonjs/models/changereason.js.map +1 -0
- package/dist/commonjs/models/costreportresponse.d.ts +8 -0
- package/dist/commonjs/models/costreportresponse.d.ts.map +1 -1
- package/dist/commonjs/models/costreportresponse.js +2 -0
- package/dist/commonjs/models/costreportresponse.js.map +1 -1
- package/dist/commonjs/models/editsubscriptionintervalsrequestunion.d.ts +142 -0
- package/dist/commonjs/models/editsubscriptionintervalsrequestunion.d.ts.map +1 -0
- package/dist/commonjs/models/editsubscriptionintervalsrequestunion.js +95 -0
- package/dist/commonjs/models/editsubscriptionintervalsrequestunion.js.map +1 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.d.ts +41 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.js +65 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +14 -1
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +14 -1
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/intervalchangemetadata.d.ts +13 -0
- package/dist/commonjs/models/intervalchangemetadata.d.ts.map +1 -0
- package/dist/commonjs/models/intervalchangemetadata.js +54 -0
- package/dist/commonjs/models/intervalchangemetadata.js.map +1 -0
- package/dist/commonjs/models/invoice.d.ts +4 -0
- package/dist/commonjs/models/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/invoice.js +1 -0
- package/dist/commonjs/models/invoice.js.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.d.ts +24 -0
- package/dist/commonjs/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.js +5 -0
- package/dist/commonjs/models/operations/createsubscription.js.map +1 -1
- package/dist/commonjs/models/operations/editsubscriptionintervals.d.ts +18 -0
- package/dist/commonjs/models/operations/editsubscriptionintervals.d.ts.map +1 -0
- package/dist/commonjs/models/operations/editsubscriptionintervals.js +56 -0
- package/dist/commonjs/models/operations/editsubscriptionintervals.js.map +1 -0
- package/dist/commonjs/models/operations/getcostreport.d.ts +5 -0
- package/dist/commonjs/models/operations/getcostreport.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcostreport.js +1 -0
- package/dist/commonjs/models/operations/getcostreport.js.map +1 -1
- package/dist/commonjs/models/operations/getprofitability.d.ts +8 -18
- package/dist/commonjs/models/operations/getprofitability.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getprofitability.js +3 -12
- package/dist/commonjs/models/operations/getprofitability.js.map +1 -1
- package/dist/commonjs/models/operations/getrevenue.d.ts +18 -0
- package/dist/commonjs/models/operations/getrevenue.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getrevenue.js +12 -1
- package/dist/commonjs/models/operations/getrevenue.js.map +1 -1
- package/dist/commonjs/models/operations/getsubscriptionintervals.d.ts +15 -0
- package/dist/commonjs/models/operations/getsubscriptionintervals.d.ts.map +1 -0
- package/dist/commonjs/models/{profitabilitytrend.js → operations/getsubscriptionintervals.js} +7 -9
- package/dist/commonjs/models/operations/getsubscriptionintervals.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +4 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +4 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listintervalchanges.d.ts +36 -0
- package/dist/commonjs/models/operations/listintervalchanges.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listintervalchanges.js +54 -0
- package/dist/commonjs/models/operations/listintervalchanges.js.map +1 -0
- package/dist/commonjs/models/operations/listsubscriptionintervalchanges.d.ts +25 -0
- package/dist/commonjs/models/operations/listsubscriptionintervalchanges.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listsubscriptionintervalchanges.js +51 -0
- package/dist/commonjs/models/operations/listsubscriptionintervalchanges.js.map +1 -0
- package/dist/commonjs/models/operations/terminatesubscription.d.ts +6 -0
- package/dist/commonjs/models/operations/terminatesubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/terminatesubscription.js +2 -0
- package/dist/commonjs/models/operations/terminatesubscription.js.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.d.ts +6 -0
- package/dist/commonjs/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.js +2 -0
- package/dist/commonjs/models/operations/updatesubscription.js.map +1 -1
- package/dist/commonjs/models/profitabilityrow.d.ts +0 -5
- package/dist/commonjs/models/profitabilityrow.d.ts.map +1 -1
- package/dist/commonjs/models/profitabilityrow.js +0 -2
- package/dist/commonjs/models/profitabilityrow.js.map +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +17 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.js +4 -0
- package/dist/commonjs/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/commonjs/models/subscription.d.ts +25 -1
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +17 -1
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/models/subscriptioninterval.d.ts +80 -0
- package/dist/commonjs/models/subscriptioninterval.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptioninterval.js +86 -0
- package/dist/commonjs/models/subscriptioninterval.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervaladdop.d.ts +85 -0
- package/dist/commonjs/models/subscriptionintervaladdop.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervaladdop.js +74 -0
- package/dist/commonjs/models/subscriptionintervaladdop.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchange.d.ts +34 -0
- package/dist/commonjs/models/subscriptionintervalchange.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchange.js +60 -0
- package/dist/commonjs/models/subscriptionintervalchange.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangecopy.d.ts +54 -0
- package/dist/commonjs/models/subscriptionintervalchangecopy.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangecopy.js +77 -0
- package/dist/commonjs/models/subscriptionintervalchangecopy.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangeentry.d.ts +22 -0
- package/dist/commonjs/models/subscriptionintervalchangeentry.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangeentry.js +53 -0
- package/dist/commonjs/models/subscriptionintervalchangeentry.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangesresponse.d.ts +16 -0
- package/dist/commonjs/models/subscriptionintervalchangesresponse.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalchangesresponse.js +53 -0
- package/dist/commonjs/models/subscriptionintervalchangesresponse.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervaleditop.d.ts +102 -0
- package/dist/commonjs/models/subscriptionintervaleditop.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervaleditop.js +78 -0
- package/dist/commonjs/models/subscriptionintervaleditop.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalremoveop.d.ts +15 -0
- package/dist/commonjs/models/subscriptionintervalremoveop.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalremoveop.js +49 -0
- package/dist/commonjs/models/subscriptionintervalremoveop.js.map +1 -0
- package/dist/commonjs/models/subscriptionintervalsresponse.d.ts +14 -0
- package/dist/commonjs/models/subscriptionintervalsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionintervalsresponse.js +51 -0
- package/dist/commonjs/models/subscriptionintervalsresponse.js.map +1 -0
- package/dist/commonjs/models/subscriptionversionpolicy.d.ts +18 -0
- package/dist/commonjs/models/subscriptionversionpolicy.d.ts.map +1 -0
- package/dist/commonjs/models/subscriptionversionpolicy.js +52 -0
- package/dist/commonjs/models/subscriptionversionpolicy.js.map +1 -0
- package/dist/commonjs/sdk/subscriptions.d.ts +28 -0
- package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
- package/dist/commonjs/sdk/subscriptions.js +40 -0
- package/dist/commonjs/sdk/subscriptions.js.map +1 -1
- package/dist/esm/funcs/costsGetCostReport.js +1 -0
- package/dist/esm/funcs/costsGetCostReport.js.map +1 -1
- package/dist/esm/funcs/profitabilityGetProfitability.js +2 -1
- package/dist/esm/funcs/profitabilityGetProfitability.js.map +1 -1
- package/dist/esm/funcs/revenueGet.js +1 -0
- package/dist/esm/funcs/revenueGet.js.map +1 -1
- package/dist/esm/funcs/subscriptionsEditSubscriptionIntervals.d.ts +19 -0
- package/dist/esm/funcs/subscriptionsEditSubscriptionIntervals.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsEditSubscriptionIntervals.js +91 -0
- package/dist/esm/funcs/subscriptionsEditSubscriptionIntervals.js.map +1 -0
- package/dist/esm/funcs/subscriptionsGetSubscriptionIntervals.d.ts +19 -0
- package/dist/esm/funcs/subscriptionsGetSubscriptionIntervals.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsGetSubscriptionIntervals.js +88 -0
- package/dist/esm/funcs/subscriptionsGetSubscriptionIntervals.js.map +1 -0
- package/dist/esm/funcs/subscriptionsListIntervalChanges.d.ts +19 -0
- package/dist/esm/funcs/subscriptionsListIntervalChanges.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsListIntervalChanges.js +90 -0
- package/dist/esm/funcs/subscriptionsListIntervalChanges.js.map +1 -0
- package/dist/esm/funcs/subscriptionsListSubscriptionIntervalChanges.d.ts +19 -0
- package/dist/esm/funcs/subscriptionsListSubscriptionIntervalChanges.d.ts.map +1 -0
- package/dist/esm/funcs/subscriptionsListSubscriptionIntervalChanges.js +93 -0
- package/dist/esm/funcs/subscriptionsListSubscriptionIntervalChanges.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/changereason.d.ts +20 -0
- package/dist/esm/models/changereason.d.ts.map +1 -0
- package/dist/esm/models/changereason.js +18 -0
- package/dist/esm/models/changereason.js.map +1 -0
- package/dist/esm/models/costreportresponse.d.ts +8 -0
- package/dist/esm/models/costreportresponse.d.ts.map +1 -1
- package/dist/esm/models/costreportresponse.js +2 -0
- package/dist/esm/models/costreportresponse.js.map +1 -1
- package/dist/esm/models/editsubscriptionintervalsrequestunion.d.ts +142 -0
- package/dist/esm/models/editsubscriptionintervalsrequestunion.d.ts.map +1 -0
- package/dist/esm/models/editsubscriptionintervalsrequestunion.js +55 -0
- package/dist/esm/models/editsubscriptionintervalsrequestunion.js.map +1 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.d.ts +41 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.d.ts.map +1 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.js +27 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.js.map +1 -0
- package/dist/esm/models/index.d.ts +14 -1
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +14 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/intervalchangemetadata.d.ts +13 -0
- package/dist/esm/models/intervalchangemetadata.d.ts.map +1 -0
- package/dist/esm/models/intervalchangemetadata.js +16 -0
- package/dist/esm/models/intervalchangemetadata.js.map +1 -0
- package/dist/esm/models/invoice.d.ts +4 -0
- package/dist/esm/models/invoice.d.ts.map +1 -1
- package/dist/esm/models/invoice.js +1 -0
- package/dist/esm/models/invoice.js.map +1 -1
- package/dist/esm/models/operations/createsubscription.d.ts +24 -0
- package/dist/esm/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/createsubscription.js +5 -0
- package/dist/esm/models/operations/createsubscription.js.map +1 -1
- package/dist/esm/models/operations/editsubscriptionintervals.d.ts +18 -0
- package/dist/esm/models/operations/editsubscriptionintervals.d.ts.map +1 -0
- package/dist/esm/models/operations/editsubscriptionintervals.js +19 -0
- package/dist/esm/models/operations/editsubscriptionintervals.js.map +1 -0
- package/dist/esm/models/operations/getcostreport.d.ts +5 -0
- package/dist/esm/models/operations/getcostreport.d.ts.map +1 -1
- package/dist/esm/models/operations/getcostreport.js +1 -0
- package/dist/esm/models/operations/getcostreport.js.map +1 -1
- package/dist/esm/models/operations/getprofitability.d.ts +8 -18
- package/dist/esm/models/operations/getprofitability.d.ts.map +1 -1
- package/dist/esm/models/operations/getprofitability.js +2 -11
- package/dist/esm/models/operations/getprofitability.js.map +1 -1
- package/dist/esm/models/operations/getrevenue.d.ts +18 -0
- package/dist/esm/models/operations/getrevenue.d.ts.map +1 -1
- package/dist/esm/models/operations/getrevenue.js +11 -0
- package/dist/esm/models/operations/getrevenue.js.map +1 -1
- package/dist/esm/models/operations/getsubscriptionintervals.d.ts +15 -0
- package/dist/esm/models/operations/getsubscriptionintervals.d.ts.map +1 -0
- package/dist/esm/models/operations/getsubscriptionintervals.js +12 -0
- package/dist/esm/models/operations/getsubscriptionintervals.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +4 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listintervalchanges.d.ts +36 -0
- package/dist/esm/models/operations/listintervalchanges.d.ts.map +1 -0
- package/dist/esm/models/operations/listintervalchanges.js +17 -0
- package/dist/esm/models/operations/listintervalchanges.js.map +1 -0
- package/dist/esm/models/operations/listsubscriptionintervalchanges.d.ts +25 -0
- package/dist/esm/models/operations/listsubscriptionintervalchanges.d.ts.map +1 -0
- package/dist/esm/models/operations/listsubscriptionintervalchanges.js +14 -0
- package/dist/esm/models/operations/listsubscriptionintervalchanges.js.map +1 -0
- package/dist/esm/models/operations/terminatesubscription.d.ts +6 -0
- package/dist/esm/models/operations/terminatesubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/terminatesubscription.js +2 -0
- package/dist/esm/models/operations/terminatesubscription.js.map +1 -1
- package/dist/esm/models/operations/updatesubscription.d.ts +6 -0
- package/dist/esm/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/updatesubscription.js +2 -0
- package/dist/esm/models/operations/updatesubscription.js.map +1 -1
- package/dist/esm/models/profitabilityrow.d.ts +0 -5
- package/dist/esm/models/profitabilityrow.d.ts.map +1 -1
- package/dist/esm/models/profitabilityrow.js +0 -2
- package/dist/esm/models/profitabilityrow.js.map +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.d.ts +17 -1
- package/dist/esm/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.js +4 -0
- package/dist/esm/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/esm/models/subscription.d.ts +25 -1
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +16 -0
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/models/subscriptioninterval.d.ts +80 -0
- package/dist/esm/models/subscriptioninterval.d.ts.map +1 -0
- package/dist/esm/models/subscriptioninterval.js +48 -0
- package/dist/esm/models/subscriptioninterval.js.map +1 -0
- package/dist/esm/models/subscriptionintervaladdop.d.ts +85 -0
- package/dist/esm/models/subscriptionintervaladdop.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervaladdop.js +36 -0
- package/dist/esm/models/subscriptionintervaladdop.js.map +1 -0
- package/dist/esm/models/subscriptionintervalchange.d.ts +34 -0
- package/dist/esm/models/subscriptionintervalchange.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalchange.js +23 -0
- package/dist/esm/models/subscriptionintervalchange.js.map +1 -0
- package/dist/esm/models/subscriptionintervalchangecopy.d.ts +54 -0
- package/dist/esm/models/subscriptionintervalchangecopy.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalchangecopy.js +39 -0
- package/dist/esm/models/subscriptionintervalchangecopy.js.map +1 -0
- package/dist/esm/models/subscriptionintervalchangeentry.d.ts +22 -0
- package/dist/esm/models/subscriptionintervalchangeentry.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalchangeentry.js +16 -0
- package/dist/esm/models/subscriptionintervalchangeentry.js.map +1 -0
- package/dist/esm/models/subscriptionintervalchangesresponse.d.ts +16 -0
- package/dist/esm/models/subscriptionintervalchangesresponse.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalchangesresponse.js +16 -0
- package/dist/esm/models/subscriptionintervalchangesresponse.js.map +1 -0
- package/dist/esm/models/subscriptionintervaleditop.d.ts +102 -0
- package/dist/esm/models/subscriptionintervaleditop.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervaleditop.js +40 -0
- package/dist/esm/models/subscriptionintervaleditop.js.map +1 -0
- package/dist/esm/models/subscriptionintervalremoveop.d.ts +15 -0
- package/dist/esm/models/subscriptionintervalremoveop.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalremoveop.js +12 -0
- package/dist/esm/models/subscriptionintervalremoveop.js.map +1 -0
- package/dist/esm/models/subscriptionintervalsresponse.d.ts +14 -0
- package/dist/esm/models/subscriptionintervalsresponse.d.ts.map +1 -0
- package/dist/esm/models/subscriptionintervalsresponse.js +14 -0
- package/dist/esm/models/subscriptionintervalsresponse.js.map +1 -0
- package/dist/esm/models/subscriptionversionpolicy.d.ts +18 -0
- package/dist/esm/models/subscriptionversionpolicy.d.ts.map +1 -0
- package/dist/esm/models/subscriptionversionpolicy.js +16 -0
- package/dist/esm/models/subscriptionversionpolicy.js.map +1 -0
- package/dist/esm/sdk/subscriptions.d.ts +28 -0
- package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
- package/dist/esm/sdk/subscriptions.js +40 -0
- package/dist/esm/sdk/subscriptions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/costsGetCostReport.ts +1 -0
- package/src/funcs/profitabilityGetProfitability.ts +2 -1
- package/src/funcs/revenueGet.ts +1 -0
- package/src/funcs/subscriptionsEditSubscriptionIntervals.ts +184 -0
- package/src/funcs/subscriptionsGetSubscriptionIntervals.ts +177 -0
- package/src/funcs/subscriptionsListIntervalChanges.ts +186 -0
- package/src/funcs/subscriptionsListSubscriptionIntervalChanges.ts +185 -0
- package/src/lib/config.ts +2 -2
- package/src/models/changereason.ts +34 -0
- package/src/models/costreportresponse.ts +10 -0
- package/src/models/editsubscriptionintervalsrequestunion.ts +244 -0
- package/src/models/editsubscriptionintervalsresponse.ts +96 -0
- package/src/models/index.ts +14 -1
- package/src/models/intervalchangemetadata.ts +43 -0
- package/src/models/invoice.ts +7 -0
- package/src/models/operations/createsubscription.ts +27 -0
- package/src/models/operations/editsubscriptionintervals.ts +48 -0
- package/src/models/operations/getcostreport.ts +6 -0
- package/src/models/operations/getprofitability.ts +10 -25
- package/src/models/operations/getrevenue.ts +22 -0
- package/src/models/operations/getsubscriptionintervals.ts +36 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listintervalchanges.ts +59 -0
- package/src/models/operations/listsubscriptionintervalchanges.ts +49 -0
- package/src/models/operations/terminatesubscription.ts +7 -0
- package/src/models/operations/updatesubscription.ts +7 -0
- package/src/models/profitabilityrow.ts +0 -9
- package/src/models/profitabilitysummaryresponse.ts +21 -1
- package/src/models/subscription.ts +38 -1
- package/src/models/subscriptioninterval.ts +152 -0
- package/src/models/subscriptionintervaladdop.ts +148 -0
- package/src/models/subscriptionintervalchange.ts +66 -0
- package/src/models/subscriptionintervalchangecopy.ts +130 -0
- package/src/models/subscriptionintervalchangeentry.ts +48 -0
- package/src/models/subscriptionintervalchangesresponse.ts +45 -0
- package/src/models/subscriptionintervaleditop.ts +166 -0
- package/src/models/subscriptionintervalremoveop.ts +36 -0
- package/src/models/subscriptionintervalsresponse.ts +38 -0
- package/src/models/subscriptionversionpolicy.ts +29 -0
- package/src/sdk/subscriptions.ts +72 -0
- package/dist/commonjs/models/profitabilitytrend.d.ts +0 -17
- package/dist/commonjs/models/profitabilitytrend.d.ts.map +0 -1
- package/dist/commonjs/models/profitabilitytrend.js.map +0 -1
- package/dist/esm/models/profitabilitytrend.d.ts +0 -17
- package/dist/esm/models/profitabilitytrend.d.ts.map +0 -1
- package/dist/esm/models/profitabilitytrend.js +0 -14
- package/dist/esm/models/profitabilitytrend.js.map +0 -1
- package/src/models/profitabilitytrend.ts +0 -39
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
8
9
|
|
|
9
10
|
export const UpdateSubscriptionStatus = {
|
|
10
11
|
Active: "active",
|
|
@@ -55,6 +56,10 @@ export type UpdateSubscriptionRequestBody = {
|
|
|
55
56
|
* Payment term in days ("Net X") applied to subsequently generated invoices: invoice dueAt = invoice issue date + paymentTermDays. A non-zero value is only valid alongside bankTransferOnly=true. Set 0 for "due on issue". Already-issued invoices keep their snapshotted dueAt.
|
|
56
57
|
*/
|
|
57
58
|
paymentTermDays?: number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* How the subscription follows new versions of its plan. `floating` follows the plan's default version: when the default changes, the subscription bills from the new default from its next billing period. `pinned` keeps the plan version that the subscription holds. A subscription created without a value is `floating`. A change to this value does not change a billing period that has already started.
|
|
61
|
+
*/
|
|
62
|
+
versionPolicy?: models.SubscriptionVersionPolicy | undefined;
|
|
58
63
|
};
|
|
59
64
|
|
|
60
65
|
export type UpdateSubscriptionRequest = {
|
|
@@ -80,6 +85,7 @@ export type UpdateSubscriptionRequestBody$Outbound = {
|
|
|
80
85
|
renewalReminderEnabled?: boolean | null | undefined;
|
|
81
86
|
renewalReminderDays?: number | null | undefined;
|
|
82
87
|
paymentTermDays?: number | undefined;
|
|
88
|
+
versionPolicy?: string | undefined;
|
|
83
89
|
};
|
|
84
90
|
|
|
85
91
|
/** @internal */
|
|
@@ -99,6 +105,7 @@ export const UpdateSubscriptionRequestBody$outboundSchema: z.ZodType<
|
|
|
99
105
|
renewalReminderEnabled: z.nullable(z.boolean()).optional(),
|
|
100
106
|
renewalReminderDays: z.nullable(z.number().int()).optional(),
|
|
101
107
|
paymentTermDays: z.number().int().optional(),
|
|
108
|
+
versionPolicy: models.SubscriptionVersionPolicy$outboundSchema.optional(),
|
|
102
109
|
});
|
|
103
110
|
|
|
104
111
|
export function updateSubscriptionRequestBodyToJSON(
|
|
@@ -6,10 +6,6 @@ import * as z from "zod/v3";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
-
import {
|
|
10
|
-
ProfitabilityTrend,
|
|
11
|
-
ProfitabilityTrend$inboundSchema,
|
|
12
|
-
} from "./profitabilitytrend.js";
|
|
13
9
|
|
|
14
10
|
export type ProfitabilityRow = {
|
|
15
11
|
/**
|
|
@@ -36,10 +32,6 @@ export type ProfitabilityRow = {
|
|
|
36
32
|
* Margin percent (profit / revenue × 100), with two decimals. Null when revenue is zero.
|
|
37
33
|
*/
|
|
38
34
|
marginPct: string | null;
|
|
39
|
-
/**
|
|
40
|
-
* Per-customer revenue trend over the period. Null for the 'Other' row and when there's insufficient data.
|
|
41
|
-
*/
|
|
42
|
-
trend: ProfitabilityTrend | null;
|
|
43
35
|
};
|
|
44
36
|
|
|
45
37
|
/** @internal */
|
|
@@ -54,7 +46,6 @@ export const ProfitabilityRow$inboundSchema: z.ZodType<
|
|
|
54
46
|
totalCost: z.string(),
|
|
55
47
|
profit: z.string(),
|
|
56
48
|
marginPct: z.nullable(z.string()),
|
|
57
|
-
trend: z.nullable(ProfitabilityTrend$inboundSchema),
|
|
58
49
|
});
|
|
59
50
|
|
|
60
51
|
export function profitabilityRowFromJSON(
|
|
@@ -49,9 +49,25 @@ export type ProfitabilitySummaryResponse = {
|
|
|
49
49
|
*/
|
|
50
50
|
currency: string;
|
|
51
51
|
/**
|
|
52
|
-
* Top-N customer rows by profit descending, optionally followed by a single 'Other' row when more than topN customers contributed.
|
|
52
|
+
* Top-N customer rows by profit descending, optionally followed by a single 'Other' row when more than topN customers contributed. With `excludeEmpty=true`, customers with neither revenue nor cost in the period are left out.
|
|
53
53
|
*/
|
|
54
54
|
rows: Array<ProfitabilityRow>;
|
|
55
|
+
/**
|
|
56
|
+
* The merchant's customers this summary scored, whether or not they made a row.
|
|
57
|
+
*/
|
|
58
|
+
customerCount?: number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Customers with neither revenue nor cost in the period, counted whether or not `excludeEmpty` left them out of `rows`. Null when a cost read failed: their cost was never established, so none is counted and `excludeEmpty` leaves nobody out.
|
|
61
|
+
*/
|
|
62
|
+
emptyCustomerCount?: number | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Customers `rows` does not carry because a cost read failed (see `warnings`) and they had no revenue in the period. Null when every cost read settled.
|
|
65
|
+
*/
|
|
66
|
+
unloadedCustomerCount?: number | null | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The customers `emptyCustomerCount` counts that `rows` does not carry, either as a row or folded into the 'Other' row, sorted by name, each reading zero with a null margin. Present only when `includeEmpty=true` and the count is answered. They are never ranked, never part of the top-N and never folded into the 'Other' row.
|
|
69
|
+
*/
|
|
70
|
+
emptyCustomers?: Array<ProfitabilityRow> | undefined;
|
|
55
71
|
/**
|
|
56
72
|
* Non-fatal warnings collected during cost discovery (e.g. an individual cost query failed). Empty array on a clean run.
|
|
57
73
|
*/
|
|
@@ -122,6 +138,10 @@ export const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<
|
|
|
122
138
|
object: z.literal("profitability_summary"),
|
|
123
139
|
currency: z.string(),
|
|
124
140
|
rows: z.array(ProfitabilityRow$inboundSchema),
|
|
141
|
+
customerCount: z.number().int().optional(),
|
|
142
|
+
emptyCustomerCount: z.nullable(z.number().int()).optional(),
|
|
143
|
+
unloadedCustomerCount: z.nullable(z.number().int()).optional(),
|
|
144
|
+
emptyCustomers: z.array(ProfitabilityRow$inboundSchema).optional(),
|
|
125
145
|
warnings: z.array(z.string()).optional(),
|
|
126
146
|
revenueRange: z.nullable(
|
|
127
147
|
z.lazy(() => ProfitabilitySummaryResponseRevenueRange$inboundSchema),
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
11
|
import {
|
|
11
12
|
SubscriptionMetadata,
|
|
12
13
|
SubscriptionMetadata$inboundSchema,
|
|
13
14
|
} from "./subscriptionmetadata.js";
|
|
15
|
+
import {
|
|
16
|
+
SubscriptionVersionPolicy,
|
|
17
|
+
SubscriptionVersionPolicy$inboundSchema,
|
|
18
|
+
} from "./subscriptionversionpolicy.js";
|
|
14
19
|
|
|
15
20
|
export const SubscriptionObject = {
|
|
16
21
|
Subscription: "subscription",
|
|
@@ -109,6 +114,20 @@ export const SubscriptionStatusEnum = {
|
|
|
109
114
|
} as const;
|
|
110
115
|
export type SubscriptionStatusEnum = ClosedEnum<typeof SubscriptionStatusEnum>;
|
|
111
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Why the subscription was terminated. Null while it is not terminated.
|
|
119
|
+
*/
|
|
120
|
+
export const TerminationChangeReason = {
|
|
121
|
+
Commercial: "commercial",
|
|
122
|
+
Correction: "correction",
|
|
123
|
+
Migration: "migration",
|
|
124
|
+
Unspecified: "unspecified",
|
|
125
|
+
} as const;
|
|
126
|
+
/**
|
|
127
|
+
* Why the subscription was terminated. Null while it is not terminated.
|
|
128
|
+
*/
|
|
129
|
+
export type TerminationChangeReason = OpenEnum<typeof TerminationChangeReason>;
|
|
130
|
+
|
|
112
131
|
export type Merchant = {
|
|
113
132
|
id: string;
|
|
114
133
|
name: string;
|
|
@@ -173,6 +192,10 @@ export type Subscription = {
|
|
|
173
192
|
* The version number of the plan version referenced by planVersionId, as of subscription creation.
|
|
174
193
|
*/
|
|
175
194
|
versionNumber?: number | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* How the subscription follows new versions of its plan. `floating` follows the plan's default version: when the default changes, the subscription bills from the new default from its next billing period. `pinned` keeps the plan version that the subscription holds. A subscription created without a value is `floating`. A change to this value does not change a billing period that has already started.
|
|
197
|
+
*/
|
|
198
|
+
versionPolicy: SubscriptionVersionPolicy;
|
|
176
199
|
/**
|
|
177
200
|
* Deprecated. Legacy-only, not populated for new subscriptions.
|
|
178
201
|
*
|
|
@@ -196,6 +219,10 @@ export type Subscription = {
|
|
|
196
219
|
* Reason for termination
|
|
197
220
|
*/
|
|
198
221
|
terminationReason?: string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Why the subscription was terminated. Null while it is not terminated.
|
|
224
|
+
*/
|
|
225
|
+
terminationChangeReason?: TerminationChangeReason | null | undefined;
|
|
199
226
|
/**
|
|
200
227
|
* Test clock ID if this subscription is attached to a test clock. Only present in non-production environments.
|
|
201
228
|
*/
|
|
@@ -350,6 +377,13 @@ export const SubscriptionStatusEnum$inboundSchema: z.ZodNativeEnum<
|
|
|
350
377
|
typeof SubscriptionStatusEnum
|
|
351
378
|
> = z.nativeEnum(SubscriptionStatusEnum);
|
|
352
379
|
|
|
380
|
+
/** @internal */
|
|
381
|
+
export const TerminationChangeReason$inboundSchema: z.ZodType<
|
|
382
|
+
TerminationChangeReason,
|
|
383
|
+
z.ZodTypeDef,
|
|
384
|
+
unknown
|
|
385
|
+
> = openEnums.inboundSchema(TerminationChangeReason);
|
|
386
|
+
|
|
353
387
|
/** @internal */
|
|
354
388
|
export const Merchant$inboundSchema: z.ZodType<
|
|
355
389
|
Merchant,
|
|
@@ -439,6 +473,7 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
439
473
|
planId: z.string(),
|
|
440
474
|
planVersionId: z.string().optional(),
|
|
441
475
|
versionNumber: z.number().int().optional(),
|
|
476
|
+
versionPolicy: SubscriptionVersionPolicy$inboundSchema,
|
|
442
477
|
prefundAmount: z.string().optional(),
|
|
443
478
|
minimumAccountBalance: z.string().optional(),
|
|
444
479
|
startedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
@@ -448,6 +483,8 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
448
483
|
).optional(),
|
|
449
484
|
terminatedBy: z.string().optional(),
|
|
450
485
|
terminationReason: z.string().optional(),
|
|
486
|
+
terminationChangeReason: z.nullable(TerminationChangeReason$inboundSchema)
|
|
487
|
+
.optional(),
|
|
451
488
|
testClockId: z.string().optional(),
|
|
452
489
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
453
490
|
walletId: z.string().optional(),
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* plan_line if the plan version has a line with this priceKey. subscription_owned if it does not, so the interval belongs to this subscription only. After an add, check the kind. A mistyped priceKey creates a subscription_owned interval.
|
|
13
|
+
*/
|
|
14
|
+
export const SubscriptionIntervalKind = {
|
|
15
|
+
PlanLine: "plan_line",
|
|
16
|
+
SubscriptionOwned: "subscription_owned",
|
|
17
|
+
} as const;
|
|
18
|
+
/**
|
|
19
|
+
* plan_line if the plan version has a line with this priceKey. subscription_owned if it does not, so the interval belongs to this subscription only. After an add, check the kind. A mistyped priceKey creates a subscription_owned interval.
|
|
20
|
+
*/
|
|
21
|
+
export type SubscriptionIntervalKind = ClosedEnum<
|
|
22
|
+
typeof SubscriptionIntervalKind
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
export type SubscriptionIntervalQuantityTransition = {
|
|
26
|
+
effectiveDate: Date;
|
|
27
|
+
quantity: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const SubscriptionIntervalBillingMode = {
|
|
31
|
+
Advance: "advance",
|
|
32
|
+
Arrears: "arrears",
|
|
33
|
+
} as const;
|
|
34
|
+
export type SubscriptionIntervalBillingMode = ClosedEnum<
|
|
35
|
+
typeof SubscriptionIntervalBillingMode
|
|
36
|
+
>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A price interval of the subscription.
|
|
40
|
+
*/
|
|
41
|
+
export type SubscriptionInterval = {
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The catalog price this interval bills.
|
|
45
|
+
*/
|
|
46
|
+
priceId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Identifies the price line. An override keeps the key of the plan price that it replaces.
|
|
49
|
+
*/
|
|
50
|
+
priceKey: string;
|
|
51
|
+
/**
|
|
52
|
+
* plan_line if the plan version has a line with this priceKey. subscription_owned if it does not, so the interval belongs to this subscription only. After an add, check the kind. A mistyped priceKey creates a subscription_owned interval.
|
|
53
|
+
*/
|
|
54
|
+
kind: SubscriptionIntervalKind;
|
|
55
|
+
/**
|
|
56
|
+
* The plan version of this interval.
|
|
57
|
+
*/
|
|
58
|
+
planVersionId: string;
|
|
59
|
+
/**
|
|
60
|
+
* Signed net unit price for each period, as a decimal string. Null means the interval bills the catalog price.
|
|
61
|
+
*/
|
|
62
|
+
unitPrice: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Quantity at interval start, as a decimal string.
|
|
65
|
+
*/
|
|
66
|
+
baseQuantity: string;
|
|
67
|
+
quantityTransitions: Array<SubscriptionIntervalQuantityTransition>;
|
|
68
|
+
/**
|
|
69
|
+
* ISO-8601 duration or 'one_off'
|
|
70
|
+
*/
|
|
71
|
+
billingCadence: string;
|
|
72
|
+
billingMode: SubscriptionIntervalBillingMode;
|
|
73
|
+
/**
|
|
74
|
+
* The one-time date this interval bills on. Set iff billingCadence is 'one_off'; null for a recurring interval.
|
|
75
|
+
*/
|
|
76
|
+
billDate: Date | null;
|
|
77
|
+
startDate: Date;
|
|
78
|
+
/**
|
|
79
|
+
* Null for an open-ended interval.
|
|
80
|
+
*/
|
|
81
|
+
endDate: Date | null;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const SubscriptionIntervalKind$inboundSchema: z.ZodNativeEnum<
|
|
86
|
+
typeof SubscriptionIntervalKind
|
|
87
|
+
> = z.nativeEnum(SubscriptionIntervalKind);
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const SubscriptionIntervalQuantityTransition$inboundSchema: z.ZodType<
|
|
91
|
+
SubscriptionIntervalQuantityTransition,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
unknown
|
|
94
|
+
> = z.object({
|
|
95
|
+
effectiveDate: z.string().datetime({ offset: true }).transform(v =>
|
|
96
|
+
new Date(v)
|
|
97
|
+
),
|
|
98
|
+
quantity: z.string(),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export function subscriptionIntervalQuantityTransitionFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<SubscriptionIntervalQuantityTransition, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) =>
|
|
107
|
+
SubscriptionIntervalQuantityTransition$inboundSchema.parse(JSON.parse(x)),
|
|
108
|
+
`Failed to parse 'SubscriptionIntervalQuantityTransition' from JSON`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @internal */
|
|
113
|
+
export const SubscriptionIntervalBillingMode$inboundSchema: z.ZodNativeEnum<
|
|
114
|
+
typeof SubscriptionIntervalBillingMode
|
|
115
|
+
> = z.nativeEnum(SubscriptionIntervalBillingMode);
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export const SubscriptionInterval$inboundSchema: z.ZodType<
|
|
119
|
+
SubscriptionInterval,
|
|
120
|
+
z.ZodTypeDef,
|
|
121
|
+
unknown
|
|
122
|
+
> = z.object({
|
|
123
|
+
id: z.string(),
|
|
124
|
+
priceId: z.string(),
|
|
125
|
+
priceKey: z.string(),
|
|
126
|
+
kind: SubscriptionIntervalKind$inboundSchema,
|
|
127
|
+
planVersionId: z.string(),
|
|
128
|
+
unitPrice: z.nullable(z.string()),
|
|
129
|
+
baseQuantity: z.string(),
|
|
130
|
+
quantityTransitions: z.array(
|
|
131
|
+
z.lazy(() => SubscriptionIntervalQuantityTransition$inboundSchema),
|
|
132
|
+
),
|
|
133
|
+
billingCadence: z.string(),
|
|
134
|
+
billingMode: SubscriptionIntervalBillingMode$inboundSchema,
|
|
135
|
+
billDate: z.nullable(
|
|
136
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
137
|
+
),
|
|
138
|
+
startDate: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
139
|
+
endDate: z.nullable(
|
|
140
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
141
|
+
),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export function subscriptionIntervalFromJSON(
|
|
145
|
+
jsonString: string,
|
|
146
|
+
): SafeParseResult<SubscriptionInterval, SDKValidationError> {
|
|
147
|
+
return safeParse(
|
|
148
|
+
jsonString,
|
|
149
|
+
(x) => SubscriptionInterval$inboundSchema.parse(JSON.parse(x)),
|
|
150
|
+
`Failed to parse 'SubscriptionInterval' from JSON`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export type SubscriptionIntervalAddOpQuantityTransition = {
|
|
9
|
+
effectiveDate: Date;
|
|
10
|
+
/**
|
|
11
|
+
* Non-negative decimal string.
|
|
12
|
+
*/
|
|
13
|
+
quantity: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const SubscriptionIntervalAddOpBillingMode = {
|
|
17
|
+
Advance: "advance",
|
|
18
|
+
Arrears: "arrears",
|
|
19
|
+
} as const;
|
|
20
|
+
export type SubscriptionIntervalAddOpBillingMode = ClosedEnum<
|
|
21
|
+
typeof SubscriptionIntervalAddOpBillingMode
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Adds an interval. If the plan version has a line with this priceKey, the interval overrides that line. If not, send priceId. The interval then belongs to this subscription only and keeps the rate that you write. A plan version change does not carry it forward, so it stops billing at the version boundary. If a later plan version adds the same priceKey, the change is refused until the plan drops the key or the interval ends on or before the boundary.
|
|
26
|
+
*/
|
|
27
|
+
export type SubscriptionIntervalAddOp = {
|
|
28
|
+
/**
|
|
29
|
+
* The price line that this interval bills. Use a priceKey from the plan version. A new key must start with a lowercase letter or a digit, use only lowercase letters, digits, hyphens, and underscores, and have 64 characters or fewer.
|
|
30
|
+
*/
|
|
31
|
+
priceKey: string;
|
|
32
|
+
/**
|
|
33
|
+
* The catalog price to bill. Required if priceKey is not on the plan version. If it is on the plan, omit this field or send the price of that line. The price must belong to your merchant account.
|
|
34
|
+
*/
|
|
35
|
+
priceId?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Optional. If the subscription is on a different plan version, the request fails with 409.
|
|
38
|
+
*/
|
|
39
|
+
planVersionId?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Signed net unit price for each period, as a decimal string. Null bills the catalog price. For a subscription-only interval, null saves the current catalog price.
|
|
42
|
+
*/
|
|
43
|
+
unitPrice: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Quantity at interval start, as a non-negative decimal string.
|
|
46
|
+
*/
|
|
47
|
+
baseQuantity: string;
|
|
48
|
+
/**
|
|
49
|
+
* Step changes in quantity partway through the interval.
|
|
50
|
+
*/
|
|
51
|
+
quantityTransitions?:
|
|
52
|
+
| Array<SubscriptionIntervalAddOpQuantityTransition>
|
|
53
|
+
| undefined;
|
|
54
|
+
/**
|
|
55
|
+
* ISO-8601 duration or 'one_off'
|
|
56
|
+
*/
|
|
57
|
+
billingCadence: string;
|
|
58
|
+
billingMode: SubscriptionIntervalAddOpBillingMode;
|
|
59
|
+
/**
|
|
60
|
+
* Required when billingCadence is 'one_off'; must be absent otherwise.
|
|
61
|
+
*/
|
|
62
|
+
billDate?: Date | null | undefined;
|
|
63
|
+
startDate: Date;
|
|
64
|
+
/**
|
|
65
|
+
* Null for an open-ended interval; when set, must be strictly after startDate.
|
|
66
|
+
*/
|
|
67
|
+
endDate?: Date | null | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type SubscriptionIntervalAddOpQuantityTransition$Outbound = {
|
|
72
|
+
effectiveDate: string;
|
|
73
|
+
quantity: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const SubscriptionIntervalAddOpQuantityTransition$outboundSchema:
|
|
78
|
+
z.ZodType<
|
|
79
|
+
SubscriptionIntervalAddOpQuantityTransition$Outbound,
|
|
80
|
+
z.ZodTypeDef,
|
|
81
|
+
SubscriptionIntervalAddOpQuantityTransition
|
|
82
|
+
> = z.object({
|
|
83
|
+
effectiveDate: z.date().transform(v => v.toISOString()),
|
|
84
|
+
quantity: z.string(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function subscriptionIntervalAddOpQuantityTransitionToJSON(
|
|
88
|
+
subscriptionIntervalAddOpQuantityTransition:
|
|
89
|
+
SubscriptionIntervalAddOpQuantityTransition,
|
|
90
|
+
): string {
|
|
91
|
+
return JSON.stringify(
|
|
92
|
+
SubscriptionIntervalAddOpQuantityTransition$outboundSchema.parse(
|
|
93
|
+
subscriptionIntervalAddOpQuantityTransition,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export const SubscriptionIntervalAddOpBillingMode$outboundSchema:
|
|
100
|
+
z.ZodNativeEnum<typeof SubscriptionIntervalAddOpBillingMode> = z.nativeEnum(
|
|
101
|
+
SubscriptionIntervalAddOpBillingMode,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export type SubscriptionIntervalAddOp$Outbound = {
|
|
106
|
+
priceKey: string;
|
|
107
|
+
priceId?: string | undefined;
|
|
108
|
+
planVersionId?: string | undefined;
|
|
109
|
+
unitPrice: string | null;
|
|
110
|
+
baseQuantity: string;
|
|
111
|
+
quantityTransitions?:
|
|
112
|
+
| Array<SubscriptionIntervalAddOpQuantityTransition$Outbound>
|
|
113
|
+
| undefined;
|
|
114
|
+
billingCadence: string;
|
|
115
|
+
billingMode: string;
|
|
116
|
+
billDate?: string | null | undefined;
|
|
117
|
+
startDate: string;
|
|
118
|
+
endDate?: string | null | undefined;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/** @internal */
|
|
122
|
+
export const SubscriptionIntervalAddOp$outboundSchema: z.ZodType<
|
|
123
|
+
SubscriptionIntervalAddOp$Outbound,
|
|
124
|
+
z.ZodTypeDef,
|
|
125
|
+
SubscriptionIntervalAddOp
|
|
126
|
+
> = z.object({
|
|
127
|
+
priceKey: z.string(),
|
|
128
|
+
priceId: z.string().optional(),
|
|
129
|
+
planVersionId: z.string().optional(),
|
|
130
|
+
unitPrice: z.nullable(z.string()),
|
|
131
|
+
baseQuantity: z.string(),
|
|
132
|
+
quantityTransitions: z.array(
|
|
133
|
+
z.lazy(() => SubscriptionIntervalAddOpQuantityTransition$outboundSchema),
|
|
134
|
+
).optional(),
|
|
135
|
+
billingCadence: z.string(),
|
|
136
|
+
billingMode: SubscriptionIntervalAddOpBillingMode$outboundSchema,
|
|
137
|
+
billDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
138
|
+
startDate: z.date().transform(v => v.toISOString()),
|
|
139
|
+
endDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export function subscriptionIntervalAddOpToJSON(
|
|
143
|
+
subscriptionIntervalAddOp: SubscriptionIntervalAddOp,
|
|
144
|
+
): string {
|
|
145
|
+
return JSON.stringify(
|
|
146
|
+
SubscriptionIntervalAddOp$outboundSchema.parse(subscriptionIntervalAddOp),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { ChangeReason, ChangeReason$inboundSchema } from "./changereason.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
IntervalChangeMetadata,
|
|
12
|
+
IntervalChangeMetadata$inboundSchema,
|
|
13
|
+
} from "./intervalchangemetadata.js";
|
|
14
|
+
import {
|
|
15
|
+
SubscriptionIntervalChangeEntry,
|
|
16
|
+
SubscriptionIntervalChangeEntry$inboundSchema,
|
|
17
|
+
} from "./subscriptionintervalchangeentry.js";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The record of one change to a subscription's price intervals: what changed, and why.
|
|
21
|
+
*/
|
|
22
|
+
export type SubscriptionIntervalChange = {
|
|
23
|
+
id: string;
|
|
24
|
+
merchantId: string;
|
|
25
|
+
subscriptionId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Why a change was made. `correction` fixes data to match what was agreed; `migration` moves a contract from another system; `commercial` is a real change to the deal. Defaults to `unspecified`.
|
|
28
|
+
*/
|
|
29
|
+
changeReason: ChangeReason;
|
|
30
|
+
description: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Your own key-value data about the change, such as a CRM deal ID.
|
|
33
|
+
*/
|
|
34
|
+
metadata: { [k: string]: IntervalChangeMetadata };
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
/**
|
|
37
|
+
* One entry per interval the edit added, changed or removed.
|
|
38
|
+
*/
|
|
39
|
+
intervals: Array<SubscriptionIntervalChangeEntry>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const SubscriptionIntervalChange$inboundSchema: z.ZodType<
|
|
44
|
+
SubscriptionIntervalChange,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
unknown
|
|
47
|
+
> = z.object({
|
|
48
|
+
id: z.string(),
|
|
49
|
+
merchantId: z.string(),
|
|
50
|
+
subscriptionId: z.string(),
|
|
51
|
+
changeReason: ChangeReason$inboundSchema,
|
|
52
|
+
description: z.nullable(z.string()),
|
|
53
|
+
metadata: z.record(IntervalChangeMetadata$inboundSchema),
|
|
54
|
+
createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
55
|
+
intervals: z.array(SubscriptionIntervalChangeEntry$inboundSchema),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function subscriptionIntervalChangeFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<SubscriptionIntervalChange, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => SubscriptionIntervalChange$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'SubscriptionIntervalChange' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type SubscriptionIntervalChangeCopyQuantityTransition = {
|
|
13
|
+
effectiveDate: Date;
|
|
14
|
+
quantity: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const SubscriptionIntervalChangeCopyBillingMode = {
|
|
18
|
+
Advance: "advance",
|
|
19
|
+
Arrears: "arrears",
|
|
20
|
+
} as const;
|
|
21
|
+
export type SubscriptionIntervalChangeCopyBillingMode = OpenEnum<
|
|
22
|
+
typeof SubscriptionIntervalChangeCopyBillingMode
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* What an interval billed at one point in time.
|
|
27
|
+
*/
|
|
28
|
+
export type SubscriptionIntervalChangeCopy = {
|
|
29
|
+
priceId: string;
|
|
30
|
+
priceKey: string;
|
|
31
|
+
/**
|
|
32
|
+
* The plan version the interval belongs to.
|
|
33
|
+
*/
|
|
34
|
+
planVersionId: string;
|
|
35
|
+
/**
|
|
36
|
+
* The rate as a decimal string, or null when the interval bills the catalog rate.
|
|
37
|
+
*/
|
|
38
|
+
unitPrice: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The per-unit rate the interval charged when the change was made.
|
|
41
|
+
*/
|
|
42
|
+
resolvedUnitPrice: string;
|
|
43
|
+
baseQuantity: string;
|
|
44
|
+
quantityTransitions: Array<SubscriptionIntervalChangeCopyQuantityTransition>;
|
|
45
|
+
/**
|
|
46
|
+
* ISO-8601 duration or 'one_off'
|
|
47
|
+
*/
|
|
48
|
+
billingCadence: string;
|
|
49
|
+
billingMode: SubscriptionIntervalChangeCopyBillingMode;
|
|
50
|
+
/**
|
|
51
|
+
* When a one-off interval bills. Null for every other cadence.
|
|
52
|
+
*/
|
|
53
|
+
billDate: Date | null;
|
|
54
|
+
startDate: Date;
|
|
55
|
+
endDate: Date | null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const SubscriptionIntervalChangeCopyQuantityTransition$inboundSchema:
|
|
60
|
+
z.ZodType<
|
|
61
|
+
SubscriptionIntervalChangeCopyQuantityTransition,
|
|
62
|
+
z.ZodTypeDef,
|
|
63
|
+
unknown
|
|
64
|
+
> = z.object({
|
|
65
|
+
effectiveDate: z.string().datetime({ offset: true }).transform(v =>
|
|
66
|
+
new Date(v)
|
|
67
|
+
),
|
|
68
|
+
quantity: z.string(),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function subscriptionIntervalChangeCopyQuantityTransitionFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<
|
|
74
|
+
SubscriptionIntervalChangeCopyQuantityTransition,
|
|
75
|
+
SDKValidationError
|
|
76
|
+
> {
|
|
77
|
+
return safeParse(
|
|
78
|
+
jsonString,
|
|
79
|
+
(x) =>
|
|
80
|
+
SubscriptionIntervalChangeCopyQuantityTransition$inboundSchema.parse(
|
|
81
|
+
JSON.parse(x),
|
|
82
|
+
),
|
|
83
|
+
`Failed to parse 'SubscriptionIntervalChangeCopyQuantityTransition' from JSON`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const SubscriptionIntervalChangeCopyBillingMode$inboundSchema: z.ZodType<
|
|
89
|
+
SubscriptionIntervalChangeCopyBillingMode,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
unknown
|
|
92
|
+
> = openEnums.inboundSchema(SubscriptionIntervalChangeCopyBillingMode);
|
|
93
|
+
|
|
94
|
+
/** @internal */
|
|
95
|
+
export const SubscriptionIntervalChangeCopy$inboundSchema: z.ZodType<
|
|
96
|
+
SubscriptionIntervalChangeCopy,
|
|
97
|
+
z.ZodTypeDef,
|
|
98
|
+
unknown
|
|
99
|
+
> = z.object({
|
|
100
|
+
priceId: z.string(),
|
|
101
|
+
priceKey: z.string(),
|
|
102
|
+
planVersionId: z.string(),
|
|
103
|
+
unitPrice: z.nullable(z.string()),
|
|
104
|
+
resolvedUnitPrice: z.string(),
|
|
105
|
+
baseQuantity: z.string(),
|
|
106
|
+
quantityTransitions: z.array(
|
|
107
|
+
z.lazy(() =>
|
|
108
|
+
SubscriptionIntervalChangeCopyQuantityTransition$inboundSchema
|
|
109
|
+
),
|
|
110
|
+
),
|
|
111
|
+
billingCadence: z.string(),
|
|
112
|
+
billingMode: SubscriptionIntervalChangeCopyBillingMode$inboundSchema,
|
|
113
|
+
billDate: z.nullable(
|
|
114
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
115
|
+
),
|
|
116
|
+
startDate: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
117
|
+
endDate: z.nullable(
|
|
118
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
119
|
+
),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export function subscriptionIntervalChangeCopyFromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<SubscriptionIntervalChangeCopy, SDKValidationError> {
|
|
125
|
+
return safeParse(
|
|
126
|
+
jsonString,
|
|
127
|
+
(x) => SubscriptionIntervalChangeCopy$inboundSchema.parse(JSON.parse(x)),
|
|
128
|
+
`Failed to parse 'SubscriptionIntervalChangeCopy' from JSON`,
|
|
129
|
+
);
|
|
130
|
+
}
|