@flexprice/mcp-server 2.1.11 → 2.1.18
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/bin/mcp-server.js +604 -213
- package/bin/mcp-server.js.map +66 -53
- package/bun.lock +25 -23
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.js +1 -1
- package/esm/lib/encodings.js.map +1 -1
- package/esm/lib/primitives.d.ts +1 -0
- package/esm/lib/primitives.d.ts.map +1 -1
- package/esm/lib/primitives.js +17 -0
- package/esm/lib/primitives.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -1
- package/esm/models/attributedtocustomerresult.d.ts +11 -0
- package/esm/models/attributedtocustomerresult.d.ts.map +1 -0
- package/esm/models/attributedtocustomerresult.js +13 -0
- package/esm/models/attributedtocustomerresult.js.map +1 -0
- package/esm/models/bucket.d.ts +7 -0
- package/esm/models/bucket.d.ts.map +1 -0
- package/esm/models/bucket.js +9 -0
- package/esm/models/bucket.js.map +1 -0
- package/esm/models/bucketsummary.d.ts +18 -0
- package/esm/models/bucketsummary.d.ts.map +1 -0
- package/esm/models/bucketsummary.js +20 -0
- package/esm/models/bucketsummary.js.map +1 -0
- package/esm/models/cancelsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/cancelsubscriptionrequest.js +1 -1
- package/esm/models/cancelsubscriptionrequest.js.map +1 -1
- package/esm/models/changedsubscription.d.ts +2 -0
- package/esm/models/changedsubscription.d.ts.map +1 -1
- package/esm/models/changedsubscription.js +2 -0
- package/esm/models/changedsubscription.js.map +1 -1
- package/esm/models/commitmentbucketrequest.d.ts +16 -0
- package/esm/models/commitmentbucketrequest.d.ts.map +1 -0
- package/esm/models/commitmentbucketrequest.js +18 -0
- package/esm/models/commitmentbucketrequest.js.map +1 -0
- package/esm/models/coupon.d.ts +1 -0
- package/esm/models/coupon.d.ts.map +1 -1
- package/esm/models/coupon.js +1 -0
- package/esm/models/coupon.js.map +1 -1
- package/esm/models/createinvoicelineitemrequest.d.ts +3 -0
- package/esm/models/createinvoicelineitemrequest.d.ts.map +1 -1
- package/esm/models/createinvoicelineitemrequest.js +3 -0
- package/esm/models/createinvoicelineitemrequest.js.map +1 -1
- package/esm/models/createsubscriptionlineitemrequest.d.ts +2 -0
- package/esm/models/createsubscriptionlineitemrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionlineitemrequest.js +3 -0
- package/esm/models/createsubscriptionlineitemrequest.js.map +1 -1
- package/esm/models/createsubscriptionrequest.d.ts +2 -0
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +6 -2
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/creditgrantexpirydurationunit.d.ts +1 -1
- package/esm/models/debugtracker.d.ts +2 -0
- package/esm/models/debugtracker.d.ts.map +1 -1
- package/esm/models/debugtracker.js +2 -0
- package/esm/models/debugtracker.js.map +1 -1
- package/esm/models/debugtrackerstatus.d.ts +4 -0
- package/esm/models/debugtrackerstatus.d.ts.map +1 -1
- package/esm/models/debugtrackerstatus.js +4 -0
- package/esm/models/debugtrackerstatus.js.map +1 -1
- package/esm/models/entityintegrationmappingresponse.d.ts +3 -0
- package/esm/models/entityintegrationmappingresponse.d.ts.map +1 -1
- package/esm/models/entityintegrationmappingresponse.js +1 -0
- package/esm/models/entityintegrationmappingresponse.js.map +1 -1
- package/esm/models/eventprocessingstatustype.d.ts +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +6 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.js +6 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
- package/esm/models/failurepointtype.d.ts +2 -0
- package/esm/models/failurepointtype.d.ts.map +1 -1
- package/esm/models/failurepointtype.js +2 -0
- package/esm/models/failurepointtype.js.map +1 -1
- package/esm/models/getusageanalyticsrequest.d.ts +1 -0
- package/esm/models/getusageanalyticsrequest.d.ts.map +1 -1
- package/esm/models/getusageanalyticsrequest.js +1 -0
- package/esm/models/getusageanalyticsrequest.js.map +1 -1
- package/esm/models/inheritanceaction.d.ts +12 -0
- package/esm/models/inheritanceaction.d.ts.map +1 -0
- package/esm/models/inheritanceaction.js +13 -0
- package/esm/models/inheritanceaction.js.map +1 -0
- package/esm/models/invoicebillingreason.d.ts +2 -0
- package/esm/models/invoicebillingreason.d.ts.map +1 -1
- package/esm/models/invoicebillingreason.js +2 -0
- package/esm/models/invoicebillingreason.js.map +1 -1
- package/esm/models/invoicefilter.d.ts +3 -0
- package/esm/models/invoicefilter.d.ts.map +1 -1
- package/esm/models/invoicefilter.js +3 -0
- package/esm/models/invoicefilter.js.map +1 -1
- package/esm/models/invoicelineitemresponse.d.ts +2 -0
- package/esm/models/invoicelineitemresponse.d.ts.map +1 -1
- package/esm/models/invoicelineitemresponse.js +2 -0
- package/esm/models/invoicelineitemresponse.js.map +1 -1
- package/esm/models/lineitemcommitmentconfig.d.ts +2 -0
- package/esm/models/lineitemcommitmentconfig.d.ts.map +1 -1
- package/esm/models/lineitemcommitmentconfig.js +3 -0
- package/esm/models/lineitemcommitmentconfig.js.map +1 -1
- package/esm/models/meterusageattribution.d.ts +8 -0
- package/esm/models/meterusageattribution.d.ts.map +1 -0
- package/esm/models/meterusageattribution.js +10 -0
- package/esm/models/meterusageattribution.js.map +1 -0
- package/esm/models/pricefilter.d.ts +2 -0
- package/esm/models/pricefilter.d.ts.map +1 -1
- package/esm/models/pricefilter.js +2 -0
- package/esm/models/pricefilter.js.map +1 -1
- package/esm/models/priceprice.d.ts +1 -0
- package/esm/models/priceprice.d.ts.map +1 -1
- package/esm/models/priceprice.js +1 -0
- package/esm/models/priceprice.js.map +1 -1
- package/esm/models/priceresponse.d.ts +1 -0
- package/esm/models/priceresponse.d.ts.map +1 -1
- package/esm/models/priceresponse.js +1 -0
- package/esm/models/priceresponse.js.map +1 -1
- package/esm/models/submodifycouponaction.d.ts +12 -0
- package/esm/models/submodifycouponaction.d.ts.map +1 -0
- package/esm/models/submodifycouponaction.js +13 -0
- package/esm/models/submodifycouponaction.js.map +1 -0
- package/esm/models/submodifycouponparams.d.ts +14 -0
- package/esm/models/submodifycouponparams.d.ts.map +1 -0
- package/esm/models/submodifycouponparams.js +16 -0
- package/esm/models/submodifycouponparams.js.map +1 -0
- package/esm/models/submodifyinheritancerequest.d.ts +3 -0
- package/esm/models/submodifyinheritancerequest.d.ts.map +1 -1
- package/esm/models/submodifyinheritancerequest.js +5 -1
- package/esm/models/submodifyinheritancerequest.js.map +1 -1
- package/esm/models/submodifytaxaction.d.ts +12 -0
- package/esm/models/submodifytaxaction.d.ts.map +1 -0
- package/esm/models/submodifytaxaction.js +13 -0
- package/esm/models/submodifytaxaction.js.map +1 -0
- package/esm/models/submodifytaxparams.d.ts +10 -0
- package/esm/models/submodifytaxparams.d.ts.map +1 -0
- package/esm/models/submodifytaxparams.js +13 -0
- package/esm/models/submodifytaxparams.js.map +1 -0
- package/esm/models/submodifytrialendrequest.d.ts +8 -0
- package/esm/models/submodifytrialendrequest.d.ts.map +1 -0
- package/esm/models/submodifytrialendrequest.js +10 -0
- package/esm/models/submodifytrialendrequest.js.map +1 -0
- package/esm/models/subscriptioncouponinput.d.ts +9 -0
- package/esm/models/subscriptioncouponinput.d.ts.map +1 -0
- package/esm/models/subscriptioncouponinput.js +11 -0
- package/esm/models/subscriptioncouponinput.js.map +1 -0
- package/esm/models/subscriptionlineitemresponse.d.ts +2 -0
- package/esm/models/subscriptionlineitemresponse.d.ts.map +1 -1
- package/esm/models/subscriptionlineitemresponse.js +2 -0
- package/esm/models/subscriptionlineitemresponse.js.map +1 -1
- package/esm/models/subscriptionmodifytype.d.ts +6 -0
- package/esm/models/subscriptionmodifytype.d.ts.map +1 -1
- package/esm/models/subscriptionmodifytype.js +6 -0
- package/esm/models/subscriptionmodifytype.js.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.d.ts +2 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.js +5 -2
- package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
- package/esm/models/subscriptionresponse.d.ts +1 -0
- package/esm/models/subscriptionresponse.d.ts.map +1 -1
- package/esm/models/subscriptionresponse.js +1 -0
- package/esm/models/subscriptionresponse.js.map +1 -1
- package/esm/models/subscriptionresponsev2.d.ts +2 -0
- package/esm/models/subscriptionresponsev2.d.ts.map +1 -1
- package/esm/models/subscriptionresponsev2.js +2 -0
- package/esm/models/subscriptionresponsev2.js.map +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.d.ts +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.d.ts.map +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.js +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.js.map +1 -1
- package/esm/models/timeofdaybucket.d.ts +15 -0
- package/esm/models/timeofdaybucket.d.ts.map +1 -0
- package/esm/models/timeofdaybucket.js +17 -0
- package/esm/models/timeofdaybucket.js.map +1 -0
- package/esm/models/trialendaction.d.ts +12 -0
- package/esm/models/trialendaction.d.ts.map +1 -0
- package/esm/models/trialendaction.js +13 -0
- package/esm/models/trialendaction.js.map +1 -0
- package/esm/models/updatesubscriptionlineitemrequest.d.ts +2 -0
- package/esm/models/updatesubscriptionlineitemrequest.d.ts.map +1 -1
- package/esm/models/updatesubscriptionlineitemrequest.js +3 -0
- package/esm/models/updatesubscriptionlineitemrequest.js.map +1 -1
- package/esm/models/usageanalyticitem.d.ts +2 -0
- package/esm/models/usageanalyticitem.d.ts.map +1 -1
- package/esm/models/usageanalyticitem.js +2 -0
- package/esm/models/usageanalyticitem.js.map +1 -1
- package/esm/models/usageanalyticpoint.d.ts +2 -0
- package/esm/models/usageanalyticpoint.d.ts.map +1 -1
- package/esm/models/usageanalyticpoint.js +2 -0
- package/esm/models/usageanalyticpoint.js.map +1 -1
- package/esm/models/userresponse.d.ts +4 -0
- package/esm/models/userresponse.d.ts.map +1 -1
- package/esm/models/userresponse.js +2 -0
- package/esm/models/userresponse.js.map +1 -1
- package/esm/models/windowsize.d.ts +2 -2
- package/esm/models/windowsize.js +2 -2
- package/esm/models/windowsize.js.map +1 -1
- package/esm/tool-names.js +2 -2
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types/async.d.ts.map +1 -1
- package/esm/types/async.js +6 -6
- package/esm/types/async.js.map +1 -1
- package/manifest.json +3 -3
- package/package.json +1 -1
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/models/attributedtocustomerresult.ts +28 -0
- package/src/models/bucket.ts +12 -0
- package/src/models/bucketsummary.ts +40 -0
- package/src/models/cancelsubscriptionrequest.ts +3 -1
- package/src/models/changedsubscription.ts +4 -0
- package/src/models/commitmentbucketrequest.ts +35 -0
- package/src/models/coupon.ts +2 -0
- package/src/models/createinvoicelineitemrequest.ts +12 -0
- package/src/models/createsubscriptionlineitemrequest.ts +7 -0
- package/src/models/createsubscriptionrequest.ts +14 -2
- package/src/models/debugtracker.ts +6 -0
- package/src/models/debugtrackerstatus.ts +4 -0
- package/src/models/entityintegrationmappingresponse.ts +2 -0
- package/src/models/executesubscriptionmodifyrequest.ts +18 -0
- package/src/models/failurepointtype.ts +2 -0
- package/src/models/getusageanalyticsrequest.ts +4 -0
- package/src/models/inheritanceaction.ts +17 -0
- package/src/models/invoicebillingreason.ts +2 -0
- package/src/models/invoicefilter.ts +10 -0
- package/src/models/invoicelineitemresponse.ts +8 -0
- package/src/models/lineitemcommitmentconfig.ts +9 -0
- package/src/models/meterusageattribution.ts +18 -0
- package/src/models/pricefilter.ts +3 -0
- package/src/models/priceprice.ts +4 -0
- package/src/models/priceresponse.ts +4 -0
- package/src/models/submodifycouponaction.ts +17 -0
- package/src/models/submodifycouponparams.ts +46 -0
- package/src/models/submodifyinheritancerequest.ts +14 -1
- package/src/models/submodifytaxaction.ts +17 -0
- package/src/models/submodifytaxparams.ts +30 -0
- package/src/models/submodifytrialendrequest.ts +20 -0
- package/src/models/subscriptioncouponinput.ts +29 -0
- package/src/models/subscriptionlineitemresponse.ts +6 -0
- package/src/models/subscriptionmodifytype.ts +6 -0
- package/src/models/subscriptionphasecreaterequest.ts +11 -4
- package/src/models/subscriptionresponse.ts +4 -0
- package/src/models/subscriptionresponsev2.ts +8 -0
- package/src/models/subscriptionsubscriptionlineitem.ts +6 -0
- package/src/models/timeofdaybucket.ts +33 -0
- package/src/models/trialendaction.ts +17 -0
- package/src/models/updatesubscriptionlineitemrequest.ts +9 -0
- package/src/models/usageanalyticitem.ts +5 -0
- package/src/models/usageanalyticpoint.ts +6 -0
- package/src/models/userresponse.ts +4 -0
- package/src/models/windowsize.ts +2 -2
- package/src/tool-names.ts +2 -2
- package/src/types/async.ts +8 -7
- package/esm/lib/dlv.d.ts +0 -14
- package/esm/lib/dlv.d.ts.map +0 -1
- package/esm/lib/dlv.js +0 -46
- package/esm/lib/dlv.js.map +0 -1
- package/esm/lib/is-plain-object.d.ts +0 -2
- package/esm/lib/is-plain-object.d.ts.map +0 -1
- package/esm/lib/is-plain-object.js +0 -38
- package/esm/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
|
@@ -8,6 +8,10 @@ import {
|
|
|
8
8
|
FilterCondition,
|
|
9
9
|
FilterCondition$zodSchema,
|
|
10
10
|
} from "./filtercondition.js";
|
|
11
|
+
import {
|
|
12
|
+
InvoiceBillingReason,
|
|
13
|
+
InvoiceBillingReason$zodSchema,
|
|
14
|
+
} from "./invoicebillingreason.js";
|
|
11
15
|
import { InvoiceStatus, InvoiceStatus$zodSchema } from "./invoicestatus.js";
|
|
12
16
|
import { InvoiceType, InvoiceType$zodSchema } from "./invoicetype.js";
|
|
13
17
|
import { PaymentStatus, PaymentStatus$zodSchema } from "./paymentstatus.js";
|
|
@@ -28,6 +32,8 @@ export const InvoiceFilterOrder$zodSchema = z.enum([
|
|
|
28
32
|
export type InvoiceFilter = {
|
|
29
33
|
amount_due_gt?: number | undefined;
|
|
30
34
|
amount_remaining_gt?: number | undefined;
|
|
35
|
+
billing_reason?: InvoiceBillingReason | undefined;
|
|
36
|
+
currency?: string | undefined;
|
|
31
37
|
customer_id?: string | undefined;
|
|
32
38
|
end_time?: string | undefined;
|
|
33
39
|
expand?: string | undefined;
|
|
@@ -59,6 +65,10 @@ export const InvoiceFilter$zodSchema: z.ZodType<InvoiceFilter> = z.object({
|
|
|
59
65
|
amount_remaining_gt: z.number().optional().describe(
|
|
60
66
|
"amount_remaining_gt filters invoices with an outstanding balance greater than the specified value\nUseful for finding invoices that still have significant unpaid amounts",
|
|
61
67
|
),
|
|
68
|
+
billing_reason: InvoiceBillingReason$zodSchema.optional(),
|
|
69
|
+
currency: z.string().optional().describe(
|
|
70
|
+
"currency filters invoices by their currency (ISO 4217 code, e.g. \"usd\", \"eur\").\nMatches on the invoices.currency column exactly.",
|
|
71
|
+
),
|
|
62
72
|
customer_id: z.string().optional().describe(
|
|
63
73
|
"customer_id filters invoices for a specific customer using FlexPrice's internal customer ID\nThis is the ID returned by FlexPrice when creating or retrieving customers",
|
|
64
74
|
),
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from "./usagebreakdownitem.js";
|
|
16
16
|
|
|
17
17
|
export type InvoiceLineItemResponse = {
|
|
18
|
+
adjusted_entitlement_quantity?: string | undefined;
|
|
18
19
|
amount?: string | undefined;
|
|
19
20
|
commitment_info?: CommitmentInfo | undefined;
|
|
20
21
|
created_at?: string | undefined;
|
|
@@ -44,6 +45,7 @@ export type InvoiceLineItemResponse = {
|
|
|
44
45
|
quantity?: string | undefined;
|
|
45
46
|
status?: Status | undefined;
|
|
46
47
|
subscription_id?: string | undefined;
|
|
48
|
+
subscription_line_item_id?: string | undefined;
|
|
47
49
|
tenant_id?: string | undefined;
|
|
48
50
|
updated_at?: string | undefined;
|
|
49
51
|
updated_by?: string | undefined;
|
|
@@ -54,6 +56,9 @@ export type InvoiceLineItemResponse = {
|
|
|
54
56
|
export const InvoiceLineItemResponse$zodSchema: z.ZodType<
|
|
55
57
|
InvoiceLineItemResponse
|
|
56
58
|
> = z.object({
|
|
59
|
+
adjusted_entitlement_quantity: z.string().optional().describe(
|
|
60
|
+
"adjusted_entitlement_quantity is the entitlement-covered portion deducted from raw usage.\nNil when no entitlement was applied. Raw usage = Quantity + AdjustedEntitlementQuantity.",
|
|
61
|
+
),
|
|
57
62
|
amount: z.string().optional(),
|
|
58
63
|
commitment_info: CommitmentInfo$zodSchema.optional(),
|
|
59
64
|
created_at: z.iso.datetime({ offset: true }).optional(),
|
|
@@ -89,6 +94,9 @@ export const InvoiceLineItemResponse$zodSchema: z.ZodType<
|
|
|
89
94
|
quantity: z.string().optional(),
|
|
90
95
|
status: Status$zodSchema.optional(),
|
|
91
96
|
subscription_id: z.string().optional(),
|
|
97
|
+
subscription_line_item_id: z.string().optional().describe(
|
|
98
|
+
"sub_line_item_id links this invoice line item to the subscription_line_item that generated it.",
|
|
99
|
+
),
|
|
92
100
|
tenant_id: z.string().optional(),
|
|
93
101
|
updated_at: z.iso.datetime({ offset: true }).optional(),
|
|
94
102
|
updated_by: z.string().optional(),
|
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
7
|
+
import {
|
|
8
|
+
CommitmentBucketRequest,
|
|
9
|
+
CommitmentBucketRequest$zodSchema,
|
|
10
|
+
} from "./commitmentbucketrequest.js";
|
|
7
11
|
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
8
12
|
|
|
9
13
|
export type LineItemCommitmentConfig = {
|
|
10
14
|
commitment_amount?: number | undefined;
|
|
11
15
|
commitment_duration?: BillingPeriod | undefined;
|
|
12
16
|
commitment_quantity?: number | undefined;
|
|
17
|
+
commitment_time_buckets?: Array<CommitmentBucketRequest> | undefined;
|
|
13
18
|
commitment_type?: CommitmentType | undefined;
|
|
14
19
|
enable_true_up?: boolean | undefined;
|
|
15
20
|
is_window_commitment?: boolean | undefined;
|
|
@@ -26,6 +31,10 @@ export const LineItemCommitmentConfig$zodSchema: z.ZodType<
|
|
|
26
31
|
commitment_quantity: z.number().optional().describe(
|
|
27
32
|
"CommitmentQuantity is the minimum quantity committed for this line item",
|
|
28
33
|
),
|
|
34
|
+
commitment_time_buckets: z.array(CommitmentBucketRequest$zodSchema).optional()
|
|
35
|
+
.describe(
|
|
36
|
+
"CommitmentTimeBuckets defines per-bucket commitment + inline price for\nwindows whose start UTC hour falls within each configured bucket. Each\nbucket carries its own price (materialized by the service). Requires\nIsWindowCommitment=true.",
|
|
37
|
+
),
|
|
29
38
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
30
39
|
enable_true_up: z.boolean().optional().describe(
|
|
31
40
|
"EnableTrueUp determines if true-up fee should be applied when usage is below commitment",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type MeterUsageAttribution = {
|
|
8
|
+
external_customer_id?: string | undefined;
|
|
9
|
+
meter_id?: string | undefined;
|
|
10
|
+
qty_total?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const MeterUsageAttribution$zodSchema: z.ZodType<MeterUsageAttribution> =
|
|
14
|
+
z.object({
|
|
15
|
+
external_customer_id: z.string().optional(),
|
|
16
|
+
meter_id: z.string().optional(),
|
|
17
|
+
qty_total: z.string().optional(),
|
|
18
|
+
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
7
8
|
import {
|
|
8
9
|
FilterCondition,
|
|
9
10
|
FilterCondition$zodSchema,
|
|
@@ -27,6 +28,7 @@ export const PriceFilterOrder$zodSchema = z.enum([
|
|
|
27
28
|
|
|
28
29
|
export type PriceFilter = {
|
|
29
30
|
allow_expired_prices?: boolean | undefined;
|
|
31
|
+
billing_periods?: Array<BillingPeriod> | undefined;
|
|
30
32
|
end_time?: string | undefined;
|
|
31
33
|
entity_ids?: Array<string> | undefined;
|
|
32
34
|
entity_type?: PriceEntityType | undefined;
|
|
@@ -48,6 +50,7 @@ export type PriceFilter = {
|
|
|
48
50
|
|
|
49
51
|
export const PriceFilter$zodSchema: z.ZodType<PriceFilter> = z.object({
|
|
50
52
|
allow_expired_prices: z.boolean().default(false),
|
|
53
|
+
billing_periods: z.array(BillingPeriod$zodSchema).optional(),
|
|
51
54
|
end_time: z.iso.datetime({ offset: true }).optional(),
|
|
52
55
|
entity_ids: z.array(z.string()).optional(),
|
|
53
56
|
entity_type: PriceEntityType$zodSchema.optional(),
|
package/src/models/priceprice.ts
CHANGED
|
@@ -52,6 +52,7 @@ export type PricePrice = {
|
|
|
52
52
|
price_unit_id?: string | undefined;
|
|
53
53
|
price_unit_tiers?: Array<PricePriceTier> | undefined;
|
|
54
54
|
price_unit_type?: PriceUnitType | undefined;
|
|
55
|
+
sequence?: number | undefined;
|
|
55
56
|
start_date?: string | undefined;
|
|
56
57
|
status?: Status | undefined;
|
|
57
58
|
tenant_id?: string | undefined;
|
|
@@ -133,6 +134,9 @@ export const PricePrice$zodSchema: z.ZodType<PricePrice> = z.object({
|
|
|
133
134
|
"PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED",
|
|
134
135
|
),
|
|
135
136
|
price_unit_type: PriceUnitType$zodSchema.optional(),
|
|
137
|
+
sequence: z.int().optional().describe(
|
|
138
|
+
"Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits.",
|
|
139
|
+
),
|
|
136
140
|
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
137
141
|
"StartDate is the start date of the price",
|
|
138
142
|
),
|
|
@@ -65,6 +65,7 @@ export type PriceResponse = {
|
|
|
65
65
|
price_unit_tiers?: Array<PricePriceTier> | undefined;
|
|
66
66
|
price_unit_type?: PriceUnitType | undefined;
|
|
67
67
|
pricing_unit?: PriceUnitResponse | undefined;
|
|
68
|
+
sequence?: number | undefined;
|
|
68
69
|
start_date?: string | undefined;
|
|
69
70
|
status?: Status | undefined;
|
|
70
71
|
tenant_id?: string | undefined;
|
|
@@ -151,6 +152,9 @@ export const PriceResponse$zodSchema: z.ZodType<PriceResponse> = z.object({
|
|
|
151
152
|
),
|
|
152
153
|
price_unit_type: PriceUnitType$zodSchema.optional(),
|
|
153
154
|
pricing_unit: PriceUnitResponse$zodSchema.optional(),
|
|
155
|
+
sequence: z.int().optional().describe(
|
|
156
|
+
"Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits.",
|
|
157
|
+
),
|
|
154
158
|
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
155
159
|
"StartDate is the start date of the price",
|
|
156
160
|
),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const SubModifyCouponAction = {
|
|
9
|
+
Add: "add",
|
|
10
|
+
Remove: "remove",
|
|
11
|
+
} as const;
|
|
12
|
+
export type SubModifyCouponAction = ClosedEnum<typeof SubModifyCouponAction>;
|
|
13
|
+
|
|
14
|
+
export const SubModifyCouponAction$zodSchema = z.enum([
|
|
15
|
+
"add",
|
|
16
|
+
"remove",
|
|
17
|
+
]);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
SubModifyCouponAction,
|
|
8
|
+
SubModifyCouponAction$zodSchema,
|
|
9
|
+
} from "./submodifycouponaction.js";
|
|
10
|
+
|
|
11
|
+
export type SubModifyCouponParams = {
|
|
12
|
+
action: SubModifyCouponAction;
|
|
13
|
+
association_id?: string | undefined;
|
|
14
|
+
coupon_code?: string | undefined;
|
|
15
|
+
effective_date?: string | undefined;
|
|
16
|
+
end_date?: string | undefined;
|
|
17
|
+
start_date?: string | undefined;
|
|
18
|
+
subscription_id?: string | undefined;
|
|
19
|
+
subscription_line_item_id?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const SubModifyCouponParams$zodSchema: z.ZodType<SubModifyCouponParams> =
|
|
23
|
+
z.object({
|
|
24
|
+
action: SubModifyCouponAction$zodSchema,
|
|
25
|
+
association_id: z.string().optional().describe(
|
|
26
|
+
"Required when action=\"remove\". ID of the CouponAssociation to soft-delete.",
|
|
27
|
+
),
|
|
28
|
+
coupon_code: z.string().optional().describe(
|
|
29
|
+
"Required for action=\"add\". Coupon code of the coupon to attach.",
|
|
30
|
+
),
|
|
31
|
+
effective_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
32
|
+
"Optional. When to apply the change; defaults to now if omitted.",
|
|
33
|
+
),
|
|
34
|
+
end_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
35
|
+
"Optional. When the coupon association ends.",
|
|
36
|
+
),
|
|
37
|
+
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
38
|
+
"Optional. When the coupon association starts; defaults to EffectiveDate.",
|
|
39
|
+
),
|
|
40
|
+
subscription_id: z.string().optional().describe(
|
|
41
|
+
"Optional. Apply at subscription level. Mutually exclusive with SubscriptionLineItemID.",
|
|
42
|
+
),
|
|
43
|
+
subscription_line_item_id: z.string().optional().describe(
|
|
44
|
+
"Optional. Apply at a specific line item. Mutually exclusive with SubscriptionID.",
|
|
45
|
+
),
|
|
46
|
+
});
|
|
@@ -3,13 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
InheritanceAction,
|
|
8
|
+
InheritanceAction$zodSchema,
|
|
9
|
+
} from "./inheritanceaction.js";
|
|
6
10
|
|
|
7
11
|
export type SubModifyInheritanceRequest = {
|
|
12
|
+
action?: InheritanceAction | undefined;
|
|
8
13
|
external_customer_ids_to_inherit_subscription?: Array<string> | undefined;
|
|
14
|
+
external_customer_ids_to_remove?: Array<string> | undefined;
|
|
9
15
|
};
|
|
10
16
|
|
|
11
17
|
export const SubModifyInheritanceRequest$zodSchema: z.ZodType<
|
|
12
18
|
SubModifyInheritanceRequest
|
|
13
19
|
> = z.object({
|
|
14
|
-
|
|
20
|
+
action: InheritanceAction$zodSchema.optional(),
|
|
21
|
+
external_customer_ids_to_inherit_subscription: z.array(z.string()).optional()
|
|
22
|
+
.describe(
|
|
23
|
+
"ExternalCustomerIDsToInheritSubscription is used for action=\"add\".",
|
|
24
|
+
),
|
|
25
|
+
external_customer_ids_to_remove: z.array(z.string()).optional().describe(
|
|
26
|
+
"ExternalCustomerIDsToRemove is used for action=\"remove\".",
|
|
27
|
+
),
|
|
15
28
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const SubModifyTaxAction = {
|
|
9
|
+
Add: "add",
|
|
10
|
+
Remove: "remove",
|
|
11
|
+
} as const;
|
|
12
|
+
export type SubModifyTaxAction = ClosedEnum<typeof SubModifyTaxAction>;
|
|
13
|
+
|
|
14
|
+
export const SubModifyTaxAction$zodSchema = z.enum([
|
|
15
|
+
"add",
|
|
16
|
+
"remove",
|
|
17
|
+
]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
SubModifyTaxAction,
|
|
8
|
+
SubModifyTaxAction$zodSchema,
|
|
9
|
+
} from "./submodifytaxaction.js";
|
|
10
|
+
|
|
11
|
+
export type SubModifyTaxParams = {
|
|
12
|
+
action: SubModifyTaxAction;
|
|
13
|
+
association_id?: string | undefined;
|
|
14
|
+
effective_date?: string | undefined;
|
|
15
|
+
tax_rate_id?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const SubModifyTaxParams$zodSchema: z.ZodType<SubModifyTaxParams> = z
|
|
19
|
+
.object({
|
|
20
|
+
action: SubModifyTaxAction$zodSchema,
|
|
21
|
+
association_id: z.string().optional().describe(
|
|
22
|
+
"Required when action=\"remove\". ID of the TaxAssociation to soft-delete.",
|
|
23
|
+
),
|
|
24
|
+
effective_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
25
|
+
"Optional. When to apply the change; defaults to now if omitted.",
|
|
26
|
+
),
|
|
27
|
+
tax_rate_id: z.string().optional().describe(
|
|
28
|
+
"Required when action=\"add\". ID of the active tax rate to attach.",
|
|
29
|
+
),
|
|
30
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { TrialEndAction, TrialEndAction$zodSchema } from "./trialendaction.js";
|
|
7
|
+
|
|
8
|
+
export type SubModifyTrialEndRequest = {
|
|
9
|
+
action: TrialEndAction;
|
|
10
|
+
new_trial_end?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const SubModifyTrialEndRequest$zodSchema: z.ZodType<
|
|
14
|
+
SubModifyTrialEndRequest
|
|
15
|
+
> = z.object({
|
|
16
|
+
action: TrialEndAction$zodSchema,
|
|
17
|
+
new_trial_end: z.iso.datetime({ offset: true }).optional().describe(
|
|
18
|
+
"NewTrialEnd is the new trial end date. Required when action is \"scheduled_date\".",
|
|
19
|
+
),
|
|
20
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type SubscriptionCouponInput = {
|
|
8
|
+
coupon_code: string;
|
|
9
|
+
end_date?: string | undefined;
|
|
10
|
+
price_id?: string | undefined;
|
|
11
|
+
start_date?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const SubscriptionCouponInput$zodSchema: z.ZodType<
|
|
15
|
+
SubscriptionCouponInput
|
|
16
|
+
> = z.object({
|
|
17
|
+
coupon_code: z.string().describe(
|
|
18
|
+
"CouponCode is the coupon's human-readable code (case-insensitive). Required.",
|
|
19
|
+
),
|
|
20
|
+
end_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
21
|
+
"EndDate is when the coupon ends; overrides duration_in_periods calculation.",
|
|
22
|
+
),
|
|
23
|
+
price_id: z.string().optional().describe(
|
|
24
|
+
"PriceID is the price ID of the line item to target; omit for subscription-level.",
|
|
25
|
+
),
|
|
26
|
+
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
27
|
+
"StartDate is when the coupon starts; defaults to subscription/phase StartDate.",
|
|
28
|
+
),
|
|
29
|
+
});
|
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
SubscriptionLineItemEntityType,
|
|
14
14
|
SubscriptionLineItemEntityType$zodSchema,
|
|
15
15
|
} from "./subscriptionlineitementitytype.js";
|
|
16
|
+
import {
|
|
17
|
+
TimeOfDayBucket,
|
|
18
|
+
TimeOfDayBucket$zodSchema,
|
|
19
|
+
} from "./timeofdaybucket.js";
|
|
16
20
|
|
|
17
21
|
export type SubscriptionLineItemResponse = {
|
|
18
22
|
addon_association_id?: string | undefined;
|
|
@@ -22,6 +26,7 @@ export type SubscriptionLineItemResponse = {
|
|
|
22
26
|
commitment_duration?: BillingPeriod | undefined;
|
|
23
27
|
commitment_overage_factor?: string | undefined;
|
|
24
28
|
commitment_quantity?: string | undefined;
|
|
29
|
+
commitment_time_buckets?: Array<TimeOfDayBucket> | undefined;
|
|
25
30
|
commitment_true_up_enabled?: boolean | undefined;
|
|
26
31
|
commitment_type?: CommitmentType | undefined;
|
|
27
32
|
commitment_windowed?: boolean | undefined;
|
|
@@ -67,6 +72,7 @@ export const SubscriptionLineItemResponse$zodSchema: z.ZodType<
|
|
|
67
72
|
commitment_duration: BillingPeriod$zodSchema.optional(),
|
|
68
73
|
commitment_overage_factor: z.string().optional(),
|
|
69
74
|
commitment_quantity: z.string().optional(),
|
|
75
|
+
commitment_time_buckets: z.array(TimeOfDayBucket$zodSchema).optional(),
|
|
70
76
|
commitment_true_up_enabled: z.boolean().optional(),
|
|
71
77
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
72
78
|
commitment_windowed: z.boolean().optional(),
|
|
@@ -9,6 +9,9 @@ export const SubscriptionModifyType = {
|
|
|
9
9
|
Inheritance: "inheritance",
|
|
10
10
|
QuantityChange: "quantity_change",
|
|
11
11
|
GroupedInvoicing: "grouped_invoicing",
|
|
12
|
+
TrialEnd: "trial_end",
|
|
13
|
+
Coupon: "coupon",
|
|
14
|
+
Tax: "tax",
|
|
12
15
|
} as const;
|
|
13
16
|
export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
|
|
14
17
|
|
|
@@ -16,4 +19,7 @@ export const SubscriptionModifyType$zodSchema = z.enum([
|
|
|
16
19
|
"inheritance",
|
|
17
20
|
"quantity_change",
|
|
18
21
|
"grouped_invoicing",
|
|
22
|
+
"trial_end",
|
|
23
|
+
"coupon",
|
|
24
|
+
"tax",
|
|
19
25
|
]);
|
|
@@ -11,6 +11,10 @@ import {
|
|
|
11
11
|
OverrideLineItemRequest,
|
|
12
12
|
OverrideLineItemRequest$zodSchema,
|
|
13
13
|
} from "./overridelineitemrequest.js";
|
|
14
|
+
import {
|
|
15
|
+
SubscriptionCouponInput,
|
|
16
|
+
SubscriptionCouponInput$zodSchema,
|
|
17
|
+
} from "./subscriptioncouponinput.js";
|
|
14
18
|
|
|
15
19
|
export type SubscriptionPhaseCreateRequest = {
|
|
16
20
|
coupons?: Array<string> | undefined;
|
|
@@ -20,19 +24,18 @@ export type SubscriptionPhaseCreateRequest = {
|
|
|
20
24
|
metadata?: { [k: string]: string } | undefined;
|
|
21
25
|
override_line_items?: Array<OverrideLineItemRequest> | undefined;
|
|
22
26
|
start_date: string;
|
|
27
|
+
subscription_coupons?: Array<SubscriptionCouponInput> | undefined;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
export const SubscriptionPhaseCreateRequest$zodSchema: z.ZodType<
|
|
26
31
|
SubscriptionPhaseCreateRequest
|
|
27
32
|
> = z.object({
|
|
28
33
|
coupons: z.array(z.string()).optional().describe(
|
|
29
|
-
"
|
|
34
|
+
"Deprecated: use SubscriptionCoupons instead.",
|
|
30
35
|
),
|
|
31
36
|
end_date: z.iso.datetime({ offset: true }).optional(),
|
|
32
37
|
line_item_coupons: z.record(z.string(), z.array(z.string())).optional()
|
|
33
|
-
.describe(
|
|
34
|
-
"LineItemCoupons represents line item-level coupons (map of line_item_id to coupon IDs)",
|
|
35
|
-
),
|
|
38
|
+
.describe("Deprecated: use SubscriptionCoupons instead."),
|
|
36
39
|
line_items: z.array(CreateSubscriptionLineItemRequest$zodSchema).optional()
|
|
37
40
|
.describe(
|
|
38
41
|
"LineItems are extra line items to add during this phase, primarily one-time charges.\nEach item's start_date defaults to the phase's start_date when not provided.",
|
|
@@ -43,4 +46,8 @@ export const SubscriptionPhaseCreateRequest$zodSchema: z.ZodType<
|
|
|
43
46
|
"OverrideLineItems allows customizing specific prices for this phase\nIf not provided, phase will use the same line items as the subscription (plan prices)",
|
|
44
47
|
),
|
|
45
48
|
start_date: z.iso.datetime({ offset: true }),
|
|
49
|
+
subscription_coupons: z.array(SubscriptionCouponInput$zodSchema).optional()
|
|
50
|
+
.describe(
|
|
51
|
+
"SubscriptionCoupons is the preferred way to attach coupons to this phase.",
|
|
52
|
+
),
|
|
46
53
|
});
|
|
@@ -99,6 +99,7 @@ export type SubscriptionResponse = {
|
|
|
99
99
|
status?: Status | undefined;
|
|
100
100
|
subscription_status?: SubscriptionStatus | undefined;
|
|
101
101
|
subscription_type?: SubscriptionType | undefined;
|
|
102
|
+
synced_price_sequence?: number | undefined;
|
|
102
103
|
tenant_id?: string | undefined;
|
|
103
104
|
trial_end?: string | undefined;
|
|
104
105
|
trial_start?: string | undefined;
|
|
@@ -213,6 +214,9 @@ export const SubscriptionResponse$zodSchema: z.ZodType<SubscriptionResponse> = z
|
|
|
213
214
|
status: Status$zodSchema.optional(),
|
|
214
215
|
subscription_status: SubscriptionStatus$zodSchema.optional(),
|
|
215
216
|
subscription_type: SubscriptionType$zodSchema.optional(),
|
|
217
|
+
synced_price_sequence: z.int().optional().describe(
|
|
218
|
+
"SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass.",
|
|
219
|
+
),
|
|
216
220
|
tenant_id: z.string().optional(),
|
|
217
221
|
trial_end: z.iso.datetime({ offset: true }).optional().describe(
|
|
218
222
|
"TrialEnd is the end date of the trial period",
|
|
@@ -89,11 +89,13 @@ export type SubscriptionResponseV2 = {
|
|
|
89
89
|
phases?: Array<SubscriptionPhaseResponse> | undefined;
|
|
90
90
|
plan?: PlanResponse | undefined;
|
|
91
91
|
plan_id?: string | undefined;
|
|
92
|
+
plan_prices_out_of_sync?: boolean | undefined;
|
|
92
93
|
proration_behavior?: ProrationBehavior | undefined;
|
|
93
94
|
start_date?: string | undefined;
|
|
94
95
|
status?: Status | undefined;
|
|
95
96
|
subscription_status?: SubscriptionStatus | undefined;
|
|
96
97
|
subscription_type?: SubscriptionType | undefined;
|
|
98
|
+
synced_price_sequence?: number | undefined;
|
|
97
99
|
tenant_id?: string | undefined;
|
|
98
100
|
trial_end?: string | undefined;
|
|
99
101
|
trial_start?: string | undefined;
|
|
@@ -206,6 +208,9 @@ export const SubscriptionResponseV2$zodSchema: z.ZodType<
|
|
|
206
208
|
plan_id: z.string().optional().describe(
|
|
207
209
|
"PlanID is the identifier for the plan in our system",
|
|
208
210
|
),
|
|
211
|
+
plan_prices_out_of_sync: z.boolean().optional().describe(
|
|
212
|
+
"PlanPricesOutOfSync is true when the subscription's synced_price_sequence\nis behind the plan's current max prices.sequence — i.e. plan-price\nchanges have not yet been reconciled into this subscription's line items.",
|
|
213
|
+
),
|
|
209
214
|
proration_behavior: ProrationBehavior$zodSchema.optional(),
|
|
210
215
|
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
211
216
|
"StartDate is the start date of the subscription",
|
|
@@ -213,6 +218,9 @@ export const SubscriptionResponseV2$zodSchema: z.ZodType<
|
|
|
213
218
|
status: Status$zodSchema.optional(),
|
|
214
219
|
subscription_status: SubscriptionStatus$zodSchema.optional(),
|
|
215
220
|
subscription_type: SubscriptionType$zodSchema.optional(),
|
|
221
|
+
synced_price_sequence: z.int().optional().describe(
|
|
222
|
+
"SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass.",
|
|
223
|
+
),
|
|
216
224
|
tenant_id: z.string().optional(),
|
|
217
225
|
trial_end: z.iso.datetime({ offset: true }).optional().describe(
|
|
218
226
|
"TrialEnd is the end date of the trial period",
|
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
SubscriptionLineItemEntityType,
|
|
14
14
|
SubscriptionLineItemEntityType$zodSchema,
|
|
15
15
|
} from "./subscriptionlineitementitytype.js";
|
|
16
|
+
import {
|
|
17
|
+
TimeOfDayBucket,
|
|
18
|
+
TimeOfDayBucket$zodSchema,
|
|
19
|
+
} from "./timeofdaybucket.js";
|
|
16
20
|
|
|
17
21
|
export type SubscriptionSubscriptionLineItem = {
|
|
18
22
|
addon_association_id?: string | undefined;
|
|
@@ -22,6 +26,7 @@ export type SubscriptionSubscriptionLineItem = {
|
|
|
22
26
|
commitment_duration?: BillingPeriod | undefined;
|
|
23
27
|
commitment_overage_factor?: string | undefined;
|
|
24
28
|
commitment_quantity?: string | undefined;
|
|
29
|
+
commitment_time_buckets?: Array<TimeOfDayBucket> | undefined;
|
|
25
30
|
commitment_true_up_enabled?: boolean | undefined;
|
|
26
31
|
commitment_type?: CommitmentType | undefined;
|
|
27
32
|
commitment_windowed?: boolean | undefined;
|
|
@@ -67,6 +72,7 @@ export const SubscriptionSubscriptionLineItem$zodSchema: z.ZodType<
|
|
|
67
72
|
commitment_duration: BillingPeriod$zodSchema.optional(),
|
|
68
73
|
commitment_overage_factor: z.string().optional(),
|
|
69
74
|
commitment_quantity: z.string().optional(),
|
|
75
|
+
commitment_time_buckets: z.array(TimeOfDayBucket$zodSchema).optional(),
|
|
70
76
|
commitment_true_up_enabled: z.boolean().optional(),
|
|
71
77
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
72
78
|
commitment_windowed: z.boolean().optional(),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { Bucket, Bucket$zodSchema } from "./bucket.js";
|
|
7
|
+
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
8
|
+
|
|
9
|
+
export type TimeOfDayBucket = {
|
|
10
|
+
commitment_type?: CommitmentType | undefined;
|
|
11
|
+
commitment_value?: string | undefined;
|
|
12
|
+
end?: Bucket | undefined;
|
|
13
|
+
id?: string | undefined;
|
|
14
|
+
overage_factor?: number | undefined;
|
|
15
|
+
price_id?: string | undefined;
|
|
16
|
+
start?: Bucket | undefined;
|
|
17
|
+
true_up_enabled?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const TimeOfDayBucket$zodSchema: z.ZodType<TimeOfDayBucket> = z.object({
|
|
21
|
+
commitment_type: CommitmentType$zodSchema.optional(),
|
|
22
|
+
commitment_value: z.string().optional(),
|
|
23
|
+
end: Bucket$zodSchema.optional(),
|
|
24
|
+
id: z.string().optional().describe(
|
|
25
|
+
"ID is server-assigned. Stable for the lifetime of the line item;\ninvoice breakdown and analytics responses reference this ID.",
|
|
26
|
+
),
|
|
27
|
+
overage_factor: z.number().optional(),
|
|
28
|
+
price_id: z.string().optional().describe(
|
|
29
|
+
"PriceID is the SUBSCRIPTION-scoped price created at bucket-creation time.\nImmutable post-create; changing pricing requires a successor line item.",
|
|
30
|
+
),
|
|
31
|
+
start: Bucket$zodSchema.optional(),
|
|
32
|
+
true_up_enabled: z.boolean().optional(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const TrialEndAction = {
|
|
9
|
+
Immediate: "immediate",
|
|
10
|
+
ScheduledDate: "scheduled_date",
|
|
11
|
+
} as const;
|
|
12
|
+
export type TrialEndAction = ClosedEnum<typeof TrialEndAction>;
|
|
13
|
+
|
|
14
|
+
export const TrialEndAction$zodSchema = z.enum([
|
|
15
|
+
"immediate",
|
|
16
|
+
"scheduled_date",
|
|
17
|
+
]);
|
|
@@ -6,6 +6,10 @@ import * as z from "zod";
|
|
|
6
6
|
import { BillingModel, BillingModel$zodSchema } from "./billingmodel.js";
|
|
7
7
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
8
8
|
import { BillingTier, BillingTier$zodSchema } from "./billingtier.js";
|
|
9
|
+
import {
|
|
10
|
+
CommitmentBucketRequest,
|
|
11
|
+
CommitmentBucketRequest$zodSchema,
|
|
12
|
+
} from "./commitmentbucketrequest.js";
|
|
9
13
|
import { CommitmentType, CommitmentType$zodSchema } from "./commitmenttype.js";
|
|
10
14
|
import {
|
|
11
15
|
CreatePriceTier,
|
|
@@ -23,6 +27,7 @@ export type UpdateSubscriptionLineItemRequest = {
|
|
|
23
27
|
commitment_duration?: BillingPeriod | undefined;
|
|
24
28
|
commitment_overage_factor?: number | undefined;
|
|
25
29
|
commitment_quantity?: number | undefined;
|
|
30
|
+
commitment_time_buckets?: Array<CommitmentBucketRequest> | undefined;
|
|
26
31
|
commitment_true_up_enabled?: boolean | undefined;
|
|
27
32
|
commitment_type?: CommitmentType | undefined;
|
|
28
33
|
commitment_windowed?: boolean | undefined;
|
|
@@ -44,6 +49,10 @@ export const UpdateSubscriptionLineItemRequest$zodSchema: z.ZodType<
|
|
|
44
49
|
commitment_duration: BillingPeriod$zodSchema.optional(),
|
|
45
50
|
commitment_overage_factor: z.number().optional(),
|
|
46
51
|
commitment_quantity: z.number().optional(),
|
|
52
|
+
commitment_time_buckets: z.array(CommitmentBucketRequest$zodSchema).optional()
|
|
53
|
+
.describe(
|
|
54
|
+
"Pointer so an explicit empty array can clear existing buckets (omission keeps them).",
|
|
55
|
+
),
|
|
47
56
|
commitment_true_up_enabled: z.boolean().optional(),
|
|
48
57
|
commitment_type: CommitmentType$zodSchema.optional(),
|
|
49
58
|
commitment_windowed: z.boolean().optional(),
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
AggregationType,
|
|
9
9
|
AggregationType$zodSchema,
|
|
10
10
|
} from "./aggregationtype.js";
|
|
11
|
+
import { BucketSummary, BucketSummary$zodSchema } from "./bucketsummary.js";
|
|
11
12
|
import { CommitmentInfo, CommitmentInfo$zodSchema } from "./commitmentinfo.js";
|
|
12
13
|
import { Feature, Feature$zodSchema } from "./feature.js";
|
|
13
14
|
import { GroupGroup, GroupGroup$zodSchema } from "./groupgroup.js";
|
|
@@ -29,6 +30,7 @@ export type UsageAnalyticItem = {
|
|
|
29
30
|
add_on_id?: string | undefined;
|
|
30
31
|
addon?: Addon | undefined;
|
|
31
32
|
aggregation_type?: AggregationType | undefined;
|
|
33
|
+
bucket_summaries?: Array<BucketSummary> | undefined;
|
|
32
34
|
commitment_info?: CommitmentInfo | undefined;
|
|
33
35
|
currency?: string | undefined;
|
|
34
36
|
event_count?: number | undefined;
|
|
@@ -64,6 +66,9 @@ export const UsageAnalyticItem$zodSchema: z.ZodType<UsageAnalyticItem> = z
|
|
|
64
66
|
add_on_id: z.string().optional(),
|
|
65
67
|
addon: Addon$zodSchema.optional(),
|
|
66
68
|
aggregation_type: AggregationType$zodSchema.optional(),
|
|
69
|
+
bucket_summaries: z.array(BucketSummary$zodSchema).optional().describe(
|
|
70
|
+
"BucketSummaries is populated only when BreakdownBucket=true. Contains one\nentry per defined CommitmentTimeBucket plus one for out-of-bucket usage.",
|
|
71
|
+
),
|
|
67
72
|
commitment_info: CommitmentInfo$zodSchema.optional(),
|
|
68
73
|
currency: z.string().optional(),
|
|
69
74
|
event_count: z.int().optional().describe(
|