@paygentic/sdk 0.9.14 → 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 +9 -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/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 +5 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.d.ts.map +1 -1
- package/dist/commonjs/models/editsubscriptionintervalsresponse.js +2 -0
- package/dist/commonjs/models/editsubscriptionintervalsresponse.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +7 -2
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +7 -2
- 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 +19 -0
- package/dist/commonjs/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.js +4 -0
- package/dist/commonjs/models/operations/createsubscription.js.map +1 -1
- package/dist/commonjs/models/operations/editsubscriptionintervals.d.ts +2 -2
- package/dist/commonjs/models/operations/editsubscriptionintervals.d.ts.map +1 -1
- package/dist/commonjs/models/operations/editsubscriptionintervals.js +1 -1
- package/dist/commonjs/models/operations/editsubscriptionintervals.js.map +1 -1
- 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/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -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/{editsubscriptionintervalsrequest.js → operations/listintervalchanges.js} +12 -12
- 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/{profitabilitytrend.js → operations/listsubscriptionintervalchanges.js} +9 -9
- 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/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 +20 -1
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +15 -1
- package/dist/commonjs/models/subscription.js.map +1 -1
- 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/sdk/subscriptions.d.ts +14 -0
- package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
- package/dist/commonjs/sdk/subscriptions.js +20 -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/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 +5 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.d.ts.map +1 -1
- package/dist/esm/models/editsubscriptionintervalsresponse.js +2 -0
- package/dist/esm/models/editsubscriptionintervalsresponse.js.map +1 -1
- package/dist/esm/models/index.d.ts +7 -2
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +7 -2
- 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 +19 -0
- package/dist/esm/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/createsubscription.js +4 -0
- package/dist/esm/models/operations/createsubscription.js.map +1 -1
- package/dist/esm/models/operations/editsubscriptionintervals.d.ts +2 -2
- package/dist/esm/models/operations/editsubscriptionintervals.d.ts.map +1 -1
- package/dist/esm/models/operations/editsubscriptionintervals.js +1 -1
- package/dist/esm/models/operations/editsubscriptionintervals.js.map +1 -1
- 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/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -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/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 +20 -1
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +14 -0
- package/dist/esm/models/subscription.js.map +1 -1
- 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/sdk/subscriptions.d.ts +14 -0
- package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
- package/dist/esm/sdk/subscriptions.js +20 -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/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 +9 -0
- package/src/models/index.ts +7 -2
- package/src/models/intervalchangemetadata.ts +43 -0
- package/src/models/invoice.ts +7 -0
- package/src/models/operations/createsubscription.ts +21 -0
- package/src/models/operations/editsubscriptionintervals.ts +4 -3
- package/src/models/operations/getcostreport.ts +6 -0
- package/src/models/operations/getprofitability.ts +10 -25
- package/src/models/operations/index.ts +2 -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/profitabilityrow.ts +0 -9
- package/src/models/profitabilitysummaryresponse.ts +21 -1
- package/src/models/subscription.ts +29 -1
- 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/sdk/subscriptions.ts +36 -0
- package/dist/commonjs/models/editsubscriptionintervalsrequest.d.ts +0 -31
- package/dist/commonjs/models/editsubscriptionintervalsrequest.d.ts.map +0 -1
- package/dist/commonjs/models/editsubscriptionintervalsrequest.js.map +0 -1
- 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/editsubscriptionintervalsrequest.d.ts +0 -31
- package/dist/esm/models/editsubscriptionintervalsrequest.d.ts.map +0 -1
- package/dist/esm/models/editsubscriptionintervalsrequest.js +0 -17
- package/dist/esm/models/editsubscriptionintervalsrequest.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/editsubscriptionintervalsrequest.ts +0 -66
- package/src/models/profitabilitytrend.ts +0 -39
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
SubscriptionInterval,
|
|
11
11
|
SubscriptionInterval$inboundSchema,
|
|
12
12
|
} from "./subscriptioninterval.js";
|
|
13
|
+
import {
|
|
14
|
+
SubscriptionIntervalChange,
|
|
15
|
+
SubscriptionIntervalChange$inboundSchema,
|
|
16
|
+
} from "./subscriptionintervalchange.js";
|
|
13
17
|
|
|
14
18
|
export type EditSubscriptionIntervalsResponseLineItems = {
|
|
15
19
|
/**
|
|
@@ -36,6 +40,10 @@ export type EditSubscriptionIntervalsResponse = {
|
|
|
36
40
|
*/
|
|
37
41
|
unchanged: boolean;
|
|
38
42
|
lineItems: EditSubscriptionIntervalsResponseLineItems;
|
|
43
|
+
/**
|
|
44
|
+
* The record this edit wrote. Null when the edit changed nothing.
|
|
45
|
+
*/
|
|
46
|
+
intervalChange: SubscriptionIntervalChange | null;
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
/** @internal */
|
|
@@ -74,6 +82,7 @@ export const EditSubscriptionIntervalsResponse$inboundSchema: z.ZodType<
|
|
|
74
82
|
lineItems: z.lazy(() =>
|
|
75
83
|
EditSubscriptionIntervalsResponseLineItems$inboundSchema
|
|
76
84
|
),
|
|
85
|
+
intervalChange: z.nullable(SubscriptionIntervalChange$inboundSchema),
|
|
77
86
|
});
|
|
78
87
|
|
|
79
88
|
export function editSubscriptionIntervalsResponseFromJSON(
|
package/src/models/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./billablemetric.js";
|
|
|
9
9
|
export * from "./billingschedule.js";
|
|
10
10
|
export * from "./booleanentitlementdetail.js";
|
|
11
11
|
export * from "./booleanentitlementlistitem.js";
|
|
12
|
+
export * from "./changereason.js";
|
|
12
13
|
export * from "./cost.js";
|
|
13
14
|
export * from "./costreportgroup.js";
|
|
14
15
|
export * from "./costreportresponse.js";
|
|
@@ -30,7 +31,7 @@ export * from "./createusagediscountadjustment.js";
|
|
|
30
31
|
export * from "./currencybreakdownentry.js";
|
|
31
32
|
export * from "./customer.js";
|
|
32
33
|
export * from "./customerpaymentsession.js";
|
|
33
|
-
export * from "./
|
|
34
|
+
export * from "./editsubscriptionintervalsrequestunion.js";
|
|
34
35
|
export * from "./editsubscriptionintervalsresponse.js";
|
|
35
36
|
export * from "./entitlementdetail.js";
|
|
36
37
|
export * from "./entitlementlistitem.js";
|
|
@@ -44,6 +45,7 @@ export * from "./fee.js";
|
|
|
44
45
|
export * from "./grant.js";
|
|
45
46
|
export * from "./groupinvoicesummary.js";
|
|
46
47
|
export * from "./grouptrendentry.js";
|
|
48
|
+
export * from "./intervalchangemetadata.js";
|
|
47
49
|
export * from "./invoice.js";
|
|
48
50
|
export * from "./invoicecategorysummary.js";
|
|
49
51
|
export * from "./invoicelineitem.js";
|
|
@@ -95,7 +97,6 @@ export * from "./pricetax.js";
|
|
|
95
97
|
export * from "./product.js";
|
|
96
98
|
export * from "./profitabilityrow.js";
|
|
97
99
|
export * from "./profitabilitysummaryresponse.js";
|
|
98
|
-
export * from "./profitabilitytrend.js";
|
|
99
100
|
export * from "./purchasegrantrequest.js";
|
|
100
101
|
export * from "./purchasegrantresponse.js";
|
|
101
102
|
export * from "./ratetype.js";
|
|
@@ -121,6 +122,10 @@ export * from "./subscriptionadjustment.js";
|
|
|
121
122
|
export * from "./subscriptionadjustmentsresponse.js";
|
|
122
123
|
export * from "./subscriptioninterval.js";
|
|
123
124
|
export * from "./subscriptionintervaladdop.js";
|
|
125
|
+
export * from "./subscriptionintervalchange.js";
|
|
126
|
+
export * from "./subscriptionintervalchangecopy.js";
|
|
127
|
+
export * from "./subscriptionintervalchangeentry.js";
|
|
128
|
+
export * from "./subscriptionintervalchangesresponse.js";
|
|
124
129
|
export * from "./subscriptionintervaleditop.js";
|
|
125
130
|
export * from "./subscriptionintervalremoveop.js";
|
|
126
131
|
export * from "./subscriptionintervalsresponse.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type IntervalChangeMetadata = string | number | boolean;
|
|
11
|
+
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const IntervalChangeMetadata$inboundSchema: z.ZodType<
|
|
14
|
+
IntervalChangeMetadata,
|
|
15
|
+
z.ZodTypeDef,
|
|
16
|
+
unknown
|
|
17
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export type IntervalChangeMetadata$Outbound = string | number | boolean;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const IntervalChangeMetadata$outboundSchema: z.ZodType<
|
|
23
|
+
IntervalChangeMetadata$Outbound,
|
|
24
|
+
z.ZodTypeDef,
|
|
25
|
+
IntervalChangeMetadata
|
|
26
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
27
|
+
|
|
28
|
+
export function intervalChangeMetadataToJSON(
|
|
29
|
+
intervalChangeMetadata: IntervalChangeMetadata,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
IntervalChangeMetadata$outboundSchema.parse(intervalChangeMetadata),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export function intervalChangeMetadataFromJSON(
|
|
36
|
+
jsonString: string,
|
|
37
|
+
): SafeParseResult<IntervalChangeMetadata, SDKValidationError> {
|
|
38
|
+
return safeParse(
|
|
39
|
+
jsonString,
|
|
40
|
+
(x) => IntervalChangeMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
+
`Failed to parse 'IntervalChangeMetadata' from JSON`,
|
|
42
|
+
);
|
|
43
|
+
}
|
package/src/models/invoice.ts
CHANGED
|
@@ -210,6 +210,10 @@ export type Invoice = {
|
|
|
210
210
|
* When the invoice was paid (null if not yet paid)
|
|
211
211
|
*/
|
|
212
212
|
paidAt?: Date | null | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* When the invoice was issued, in the subscription's effective time (test-clock time on a test clock). Revenue and profitability windows count the invoice by this instant. Null until the invoice is issued.
|
|
215
|
+
*/
|
|
216
|
+
issuedAt?: Date | null | undefined;
|
|
213
217
|
/**
|
|
214
218
|
* Payment due date snapshotted at invoice-create time as the issue date + subscription.paymentTermDays, anchored to midnight UTC. Null only for invoices created before this feature shipped (no backfill).
|
|
215
219
|
*/
|
|
@@ -381,6 +385,9 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
381
385
|
paidAt: z.nullable(
|
|
382
386
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
383
387
|
).optional(),
|
|
388
|
+
issuedAt: z.nullable(
|
|
389
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
390
|
+
).optional(),
|
|
384
391
|
dueAt: z.nullable(
|
|
385
392
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
386
393
|
).optional(),
|
|
@@ -125,6 +125,18 @@ export type CreateSubscriptionRequest = {
|
|
|
125
125
|
* Free-form merchant metadata to attach to the subscription. Values must be strings, numbers, or booleans.
|
|
126
126
|
*/
|
|
127
127
|
metadata?: { [k: string]: models.SubscriptionMetadata } | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* 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`.
|
|
130
|
+
*/
|
|
131
|
+
changeReason?: models.ChangeReason | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* A free-text note on why these intervals are changing.
|
|
134
|
+
*/
|
|
135
|
+
changeDescription?: string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Your own key-value data about the change, such as a CRM deal ID.
|
|
138
|
+
*/
|
|
139
|
+
changeMetadata?: { [k: string]: models.IntervalChangeMetadata } | undefined;
|
|
128
140
|
};
|
|
129
141
|
|
|
130
142
|
/** @internal */
|
|
@@ -221,6 +233,11 @@ export type CreateSubscriptionRequest$Outbound = {
|
|
|
221
233
|
sessionExpiryMinutes?: number | undefined;
|
|
222
234
|
versionPolicy?: string | undefined;
|
|
223
235
|
metadata?: { [k: string]: models.SubscriptionMetadata$Outbound } | undefined;
|
|
236
|
+
changeReason?: string | undefined;
|
|
237
|
+
changeDescription?: string | undefined;
|
|
238
|
+
changeMetadata?:
|
|
239
|
+
| { [k: string]: models.IntervalChangeMetadata$Outbound }
|
|
240
|
+
| undefined;
|
|
224
241
|
};
|
|
225
242
|
|
|
226
243
|
/** @internal */
|
|
@@ -247,6 +264,10 @@ export const CreateSubscriptionRequest$outboundSchema: z.ZodType<
|
|
|
247
264
|
sessionExpiryMinutes: z.number().optional(),
|
|
248
265
|
versionPolicy: models.SubscriptionVersionPolicy$outboundSchema.optional(),
|
|
249
266
|
metadata: z.record(models.SubscriptionMetadata$outboundSchema).optional(),
|
|
267
|
+
changeReason: models.ChangeReason$outboundSchema.optional(),
|
|
268
|
+
changeDescription: z.string().optional(),
|
|
269
|
+
changeMetadata: z.record(models.IntervalChangeMetadata$outboundSchema)
|
|
270
|
+
.optional(),
|
|
250
271
|
});
|
|
251
272
|
|
|
252
273
|
export function createSubscriptionRequestToJSON(
|
|
@@ -11,14 +11,15 @@ export type EditSubscriptionIntervalsRequest = {
|
|
|
11
11
|
* The subscription ID
|
|
12
12
|
*/
|
|
13
13
|
id: string;
|
|
14
|
-
editSubscriptionIntervalsRequest:
|
|
14
|
+
editSubscriptionIntervalsRequest:
|
|
15
|
+
models.EditSubscriptionIntervalsRequestUnion;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
/** @internal */
|
|
18
19
|
export type EditSubscriptionIntervalsRequest$Outbound = {
|
|
19
20
|
id: string;
|
|
20
21
|
EditSubscriptionIntervalsRequest:
|
|
21
|
-
models.
|
|
22
|
+
models.EditSubscriptionIntervalsRequestUnion$Outbound;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
/** @internal */
|
|
@@ -29,7 +30,7 @@ export const EditSubscriptionIntervalsRequest$outboundSchema: z.ZodType<
|
|
|
29
30
|
> = z.object({
|
|
30
31
|
id: z.string(),
|
|
31
32
|
editSubscriptionIntervalsRequest:
|
|
32
|
-
models.
|
|
33
|
+
models.EditSubscriptionIntervalsRequestUnion$outboundSchema,
|
|
33
34
|
}).transform((v) => {
|
|
34
35
|
return remap$(v, {
|
|
35
36
|
editSubscriptionIntervalsRequest: "EditSubscriptionIntervalsRequest",
|
|
@@ -81,6 +81,10 @@ export type GetCostReportRequest = {
|
|
|
81
81
|
* When true, include prior-period comparison data in each group.
|
|
82
82
|
*/
|
|
83
83
|
comparePriorPeriod?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* When true, leave out groups with neither cost nor usage in the period. They are dropped before ranking, so they take no top-N slot, do not appear in the 'Other' bucket and are not counted in `pagination.total`. `emptyGroupCount` says how many were left out.
|
|
86
|
+
*/
|
|
87
|
+
excludeEmpty?: boolean | undefined;
|
|
84
88
|
/**
|
|
85
89
|
* Time window granularity for the time-series breakdown.
|
|
86
90
|
*/
|
|
@@ -132,6 +136,7 @@ export type GetCostReportRequest$Outbound = {
|
|
|
132
136
|
filterGroupBy?: string | undefined;
|
|
133
137
|
topN: number;
|
|
134
138
|
comparePriorPeriod: boolean;
|
|
139
|
+
excludeEmpty: boolean;
|
|
135
140
|
windowSize?: string | undefined;
|
|
136
141
|
sort: string;
|
|
137
142
|
sortDir: string;
|
|
@@ -155,6 +160,7 @@ export const GetCostReportRequest$outboundSchema: z.ZodType<
|
|
|
155
160
|
filterGroupBy: z.string().optional(),
|
|
156
161
|
topN: z.number().int().default(9),
|
|
157
162
|
comparePriorPeriod: z.boolean().default(false),
|
|
163
|
+
excludeEmpty: z.boolean().default(false),
|
|
158
164
|
windowSize: GetCostReportWindowSize$outboundSchema.optional(),
|
|
159
165
|
sort: Sort$outboundSchema.default("totalCost"),
|
|
160
166
|
sortDir: SortDir$outboundSchema.default("desc"),
|
|
@@ -3,22 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Time bucket granularity for the per-customer revenue trend. When omitted, the server picks a reasonable bucket from the window length.
|
|
10
|
-
*/
|
|
11
|
-
export const GetProfitabilityBucketWidth = {
|
|
12
|
-
Hour: "hour",
|
|
13
|
-
Day: "day",
|
|
14
|
-
Week: "week",
|
|
15
|
-
} as const;
|
|
16
|
-
/**
|
|
17
|
-
* Time bucket granularity for the per-customer revenue trend. When omitted, the server picks a reasonable bucket from the window length.
|
|
18
|
-
*/
|
|
19
|
-
export type GetProfitabilityBucketWidth = ClosedEnum<
|
|
20
|
-
typeof GetProfitabilityBucketWidth
|
|
21
|
-
>;
|
|
22
6
|
|
|
23
7
|
export type GetProfitabilityRequest = {
|
|
24
8
|
/**
|
|
@@ -42,16 +26,15 @@ export type GetProfitabilityRequest = {
|
|
|
42
26
|
*/
|
|
43
27
|
currency?: string | undefined;
|
|
44
28
|
/**
|
|
45
|
-
*
|
|
29
|
+
* When true, leave customers with neither revenue nor cost in the period out of `rows`. They are dropped before ranking, so they take no top-N slot and are not folded into the 'Other' row. `emptyCustomerCount` says how many there are either way.
|
|
46
30
|
*/
|
|
47
|
-
|
|
31
|
+
excludeEmpty?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* When true, also return in `emptyCustomers` the customers counted in `emptyCustomerCount` that `rows` does not carry, so a caller can show the complete customer list.
|
|
34
|
+
*/
|
|
35
|
+
includeEmpty?: boolean | undefined;
|
|
48
36
|
};
|
|
49
37
|
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const GetProfitabilityBucketWidth$outboundSchema: z.ZodNativeEnum<
|
|
52
|
-
typeof GetProfitabilityBucketWidth
|
|
53
|
-
> = z.nativeEnum(GetProfitabilityBucketWidth);
|
|
54
|
-
|
|
55
38
|
/** @internal */
|
|
56
39
|
export type GetProfitabilityRequest$Outbound = {
|
|
57
40
|
merchantId: string;
|
|
@@ -59,7 +42,8 @@ export type GetProfitabilityRequest$Outbound = {
|
|
|
59
42
|
to: string;
|
|
60
43
|
topN: number;
|
|
61
44
|
currency?: string | undefined;
|
|
62
|
-
|
|
45
|
+
excludeEmpty: boolean;
|
|
46
|
+
includeEmpty: boolean;
|
|
63
47
|
};
|
|
64
48
|
|
|
65
49
|
/** @internal */
|
|
@@ -73,7 +57,8 @@ export const GetProfitabilityRequest$outboundSchema: z.ZodType<
|
|
|
73
57
|
to: z.date().transform(v => v.toISOString()),
|
|
74
58
|
topN: z.number().int().default(10),
|
|
75
59
|
currency: z.string().optional(),
|
|
76
|
-
|
|
60
|
+
excludeEmpty: z.boolean().default(false),
|
|
61
|
+
includeEmpty: z.boolean().default(false),
|
|
77
62
|
});
|
|
78
63
|
|
|
79
64
|
export function getProfitabilityRequestToJSON(
|
|
@@ -89,6 +89,7 @@ export * from "./listentitlements.js";
|
|
|
89
89
|
export * from "./listexternalreferences.js";
|
|
90
90
|
export * from "./listfeatures.js";
|
|
91
91
|
export * from "./listfees.js";
|
|
92
|
+
export * from "./listintervalchanges.js";
|
|
92
93
|
export * from "./listinvoicerefunds.js";
|
|
93
94
|
export * from "./listinvoices.js";
|
|
94
95
|
export * from "./listitems.js";
|
|
@@ -108,6 +109,7 @@ export * from "./listsourceevents.js";
|
|
|
108
109
|
export * from "./listsourcerules.js";
|
|
109
110
|
export * from "./listsources.js";
|
|
110
111
|
export * from "./listsubscriptionadjustments.js";
|
|
112
|
+
export * from "./listsubscriptionintervalchanges.js";
|
|
111
113
|
export * from "./listsubscriptions.js";
|
|
112
114
|
export * from "./listtestclocks.js";
|
|
113
115
|
export * from "./mintplanversion.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
|
|
8
|
+
export type ListIntervalChangesRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* Number of interval changes to return
|
|
11
|
+
*/
|
|
12
|
+
limit?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Number of interval changes to skip
|
|
15
|
+
*/
|
|
16
|
+
offset?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Only return changes recorded at or after this time
|
|
19
|
+
*/
|
|
20
|
+
from?: Date | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Only return changes recorded before this time
|
|
23
|
+
*/
|
|
24
|
+
to?: Date | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Only return changes with this reason.
|
|
27
|
+
*/
|
|
28
|
+
changeReason?: models.ChangeReason | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type ListIntervalChangesRequest$Outbound = {
|
|
33
|
+
limit: string;
|
|
34
|
+
offset: string;
|
|
35
|
+
from?: string | undefined;
|
|
36
|
+
to?: string | undefined;
|
|
37
|
+
changeReason?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ListIntervalChangesRequest$outboundSchema: z.ZodType<
|
|
42
|
+
ListIntervalChangesRequest$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ListIntervalChangesRequest
|
|
45
|
+
> = z.object({
|
|
46
|
+
limit: z.string().default("10"),
|
|
47
|
+
offset: z.string().default("0"),
|
|
48
|
+
from: z.date().transform(v => v.toISOString()).optional(),
|
|
49
|
+
to: z.date().transform(v => v.toISOString()).optional(),
|
|
50
|
+
changeReason: models.ChangeReason$outboundSchema.optional(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export function listIntervalChangesRequestToJSON(
|
|
54
|
+
listIntervalChangesRequest: ListIntervalChangesRequest,
|
|
55
|
+
): string {
|
|
56
|
+
return JSON.stringify(
|
|
57
|
+
ListIntervalChangesRequest$outboundSchema.parse(listIntervalChangesRequest),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type ListSubscriptionIntervalChangesRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* The subscription ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* Number of interval changes to return
|
|
14
|
+
*/
|
|
15
|
+
limit?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Number of interval changes to skip
|
|
18
|
+
*/
|
|
19
|
+
offset?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type ListSubscriptionIntervalChangesRequest$Outbound = {
|
|
24
|
+
id: string;
|
|
25
|
+
limit: string;
|
|
26
|
+
offset: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ListSubscriptionIntervalChangesRequest$outboundSchema: z.ZodType<
|
|
31
|
+
ListSubscriptionIntervalChangesRequest$Outbound,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
ListSubscriptionIntervalChangesRequest
|
|
34
|
+
> = z.object({
|
|
35
|
+
id: z.string(),
|
|
36
|
+
limit: z.string().default("10"),
|
|
37
|
+
offset: z.string().default("0"),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function listSubscriptionIntervalChangesRequestToJSON(
|
|
41
|
+
listSubscriptionIntervalChangesRequest:
|
|
42
|
+
ListSubscriptionIntervalChangesRequest,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
ListSubscriptionIntervalChangesRequest$outboundSchema.parse(
|
|
46
|
+
listSubscriptionIntervalChangesRequest,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
7
8
|
|
|
8
9
|
export type TerminateSubscriptionRequestBody = {
|
|
9
10
|
/**
|
|
10
11
|
* Cancellation explanation text. Sample values: 'Customer requested cancellation', 'Payment failure', 'Service migration', 'Contract expiration'
|
|
11
12
|
*/
|
|
12
13
|
reason: string;
|
|
14
|
+
/**
|
|
15
|
+
* 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`.
|
|
16
|
+
*/
|
|
17
|
+
changeReason?: models.ChangeReason | undefined;
|
|
13
18
|
};
|
|
14
19
|
|
|
15
20
|
export type TerminateSubscriptionRequest = {
|
|
@@ -23,6 +28,7 @@ export type TerminateSubscriptionRequest = {
|
|
|
23
28
|
/** @internal */
|
|
24
29
|
export type TerminateSubscriptionRequestBody$Outbound = {
|
|
25
30
|
reason: string;
|
|
31
|
+
changeReason?: string | undefined;
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
/** @internal */
|
|
@@ -32,6 +38,7 @@ export const TerminateSubscriptionRequestBody$outboundSchema: z.ZodType<
|
|
|
32
38
|
TerminateSubscriptionRequestBody
|
|
33
39
|
> = z.object({
|
|
34
40
|
reason: z.string(),
|
|
41
|
+
changeReason: models.ChangeReason$outboundSchema.optional(),
|
|
35
42
|
});
|
|
36
43
|
|
|
37
44
|
export function terminateSubscriptionRequestBodyToJSON(
|
|
@@ -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,7 +4,8 @@
|
|
|
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 {
|
|
@@ -113,6 +114,20 @@ export const SubscriptionStatusEnum = {
|
|
|
113
114
|
} as const;
|
|
114
115
|
export type SubscriptionStatusEnum = ClosedEnum<typeof SubscriptionStatusEnum>;
|
|
115
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
|
+
|
|
116
131
|
export type Merchant = {
|
|
117
132
|
id: string;
|
|
118
133
|
name: string;
|
|
@@ -204,6 +219,10 @@ export type Subscription = {
|
|
|
204
219
|
* Reason for termination
|
|
205
220
|
*/
|
|
206
221
|
terminationReason?: string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Why the subscription was terminated. Null while it is not terminated.
|
|
224
|
+
*/
|
|
225
|
+
terminationChangeReason?: TerminationChangeReason | null | undefined;
|
|
207
226
|
/**
|
|
208
227
|
* Test clock ID if this subscription is attached to a test clock. Only present in non-production environments.
|
|
209
228
|
*/
|
|
@@ -358,6 +377,13 @@ export const SubscriptionStatusEnum$inboundSchema: z.ZodNativeEnum<
|
|
|
358
377
|
typeof SubscriptionStatusEnum
|
|
359
378
|
> = z.nativeEnum(SubscriptionStatusEnum);
|
|
360
379
|
|
|
380
|
+
/** @internal */
|
|
381
|
+
export const TerminationChangeReason$inboundSchema: z.ZodType<
|
|
382
|
+
TerminationChangeReason,
|
|
383
|
+
z.ZodTypeDef,
|
|
384
|
+
unknown
|
|
385
|
+
> = openEnums.inboundSchema(TerminationChangeReason);
|
|
386
|
+
|
|
361
387
|
/** @internal */
|
|
362
388
|
export const Merchant$inboundSchema: z.ZodType<
|
|
363
389
|
Merchant,
|
|
@@ -457,6 +483,8 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
457
483
|
).optional(),
|
|
458
484
|
terminatedBy: z.string().optional(),
|
|
459
485
|
terminationReason: z.string().optional(),
|
|
486
|
+
terminationChangeReason: z.nullable(TerminationChangeReason$inboundSchema)
|
|
487
|
+
.optional(),
|
|
460
488
|
testClockId: z.string().optional(),
|
|
461
489
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
462
490
|
walletId: z.string().optional(),
|
|
@@ -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
|
+
}
|