@flexprice/mcp-server 2.1.0 → 2.1.2
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 +800 -390
- package/bin/mcp-server.js.map +38 -24
- package/bun.lock +32 -32
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts +16 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js +82 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +4 -4
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts.map +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +4 -4
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +16 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +88 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +6 -0
- package/esm/lib/encodings.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +5 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts +7 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js +35 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +4 -4
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts +7 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +35 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -0
- package/esm/models/billingcadence.d.ts +0 -2
- package/esm/models/billingcadence.d.ts.map +1 -1
- package/esm/models/billingcadence.js +0 -2
- package/esm/models/billingcadence.js.map +1 -1
- package/esm/models/billingperiod.d.ts +2 -0
- package/esm/models/billingperiod.d.ts.map +1 -1
- package/esm/models/billingperiod.js +2 -0
- package/esm/models/billingperiod.js.map +1 -1
- package/esm/models/changedinvoice.d.ts +8 -0
- package/esm/models/changedinvoice.d.ts.map +1 -0
- package/esm/models/changedinvoice.js +10 -0
- package/esm/models/changedinvoice.js.map +1 -0
- package/esm/models/changedlineitem.d.ts +11 -0
- package/esm/models/changedlineitem.d.ts.map +1 -0
- package/esm/models/changedlineitem.js +13 -0
- package/esm/models/changedlineitem.js.map +1 -0
- package/esm/models/changedresources.d.ts +11 -0
- package/esm/models/changedresources.d.ts.map +1 -0
- package/esm/models/changedresources.js +13 -0
- package/esm/models/changedresources.js.map +1 -0
- package/esm/models/changedsubscription.d.ts +9 -0
- package/esm/models/changedsubscription.d.ts.map +1 -0
- package/esm/models/changedsubscription.js +12 -0
- package/esm/models/changedsubscription.js.map +1 -0
- package/esm/models/createpricerequest.d.ts +0 -2
- package/esm/models/createpricerequest.d.ts.map +1 -1
- package/esm/models/createpricerequest.js +0 -2
- package/esm/models/createpricerequest.js.map +1 -1
- package/esm/models/createsubscriptionrequest.d.ts +0 -2
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +0 -2
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/creditgrantcadence.d.ts +1 -1
- package/esm/models/creditgrantexpirydurationunit.d.ts +1 -1
- package/esm/models/executesubscriptionmodifyop.d.ts +6 -6
- package/esm/models/executesubscriptionmodifyop.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyop.js +5 -5
- package/esm/models/executesubscriptionmodifyop.js.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +11 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -0
- package/esm/models/executesubscriptionmodifyrequest.js +13 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -0
- package/esm/models/getmeterusagepreviewinvoiceop.d.ts +6 -0
- package/esm/models/getmeterusagepreviewinvoiceop.d.ts.map +1 -0
- package/esm/models/getmeterusagepreviewinvoiceop.js +11 -0
- package/esm/models/getmeterusagepreviewinvoiceop.js.map +1 -0
- package/esm/models/invoicefilter.d.ts +1 -0
- package/esm/models/invoicefilter.d.ts.map +1 -1
- package/esm/models/invoicefilter.js +1 -0
- package/esm/models/invoicefilter.js.map +1 -1
- package/esm/models/invoiceresponse.d.ts +1 -0
- package/esm/models/invoiceresponse.d.ts.map +1 -1
- package/esm/models/invoiceresponse.js +1 -0
- package/esm/models/invoiceresponse.js.map +1 -1
- package/esm/models/lineitemquantitychange.d.ts +8 -0
- package/esm/models/lineitemquantitychange.d.ts.map +1 -0
- package/esm/models/lineitemquantitychange.js +10 -0
- package/esm/models/lineitemquantitychange.js.map +1 -0
- package/esm/models/previewsubscriptionmodifyop.d.ts +12 -0
- package/esm/models/previewsubscriptionmodifyop.d.ts.map +1 -0
- package/esm/models/previewsubscriptionmodifyop.js +16 -0
- package/esm/models/previewsubscriptionmodifyop.js.map +1 -0
- package/esm/models/submodifyinheritancerequest.d.ts +6 -0
- package/esm/models/submodifyinheritancerequest.d.ts.map +1 -0
- package/esm/models/{executesubscriptioninheritancerequest.js → submodifyinheritancerequest.js} +2 -2
- package/esm/models/submodifyinheritancerequest.js.map +1 -0
- package/esm/models/submodifyquantitychangerequest.d.ts +7 -0
- package/esm/models/submodifyquantitychangerequest.d.ts.map +1 -0
- package/esm/models/submodifyquantitychangerequest.js +9 -0
- package/esm/models/submodifyquantitychangerequest.js.map +1 -0
- package/esm/models/subscriptionmodifyresponse.d.ts +9 -0
- package/esm/models/subscriptionmodifyresponse.d.ts.map +1 -0
- package/esm/models/subscriptionmodifyresponse.js +11 -0
- package/esm/models/subscriptionmodifyresponse.js.map +1 -0
- package/esm/models/subscriptionmodifytype.d.ts +12 -0
- package/esm/models/subscriptionmodifytype.d.ts.map +1 -0
- package/esm/models/subscriptionmodifytype.js +13 -0
- package/esm/models/subscriptionmodifytype.js.map +1 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts +2 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.js +3 -0
- package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
- package/esm/models/subscriptionpricecreaterequest.d.ts +0 -2
- package/esm/models/subscriptionpricecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionpricecreaterequest.js +0 -2
- package/esm/models/subscriptionpricecreaterequest.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.d.ts.map +1 -1
- package/esm/tool-names.js +9 -1
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +10 -2
- package/package.json +1 -1
- package/src/funcs/invoicesGetMeterUsagePreviewInvoice.ts +144 -0
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +7 -7
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +153 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts +47 -0
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +4 -4
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +45 -0
- package/src/models/billingcadence.ts +0 -2
- package/src/models/billingperiod.ts +2 -0
- package/src/models/changedinvoice.ts +17 -0
- package/src/models/changedlineitem.ts +25 -0
- package/src/models/changedresources.ts +28 -0
- package/src/models/changedsubscription.ts +22 -0
- package/src/models/createpricerequest.ts +0 -3
- package/src/models/createsubscriptionrequest.ts +0 -3
- package/src/models/executesubscriptionmodifyop.ts +14 -14
- package/src/models/executesubscriptionmodifyrequest.ts +31 -0
- package/src/models/getmeterusagepreviewinvoiceop.ts +21 -0
- package/src/models/invoicefilter.ts +4 -0
- package/src/models/invoiceresponse.ts +4 -0
- package/src/models/lineitemquantitychange.ts +21 -0
- package/src/models/previewsubscriptionmodifyop.ts +39 -0
- package/src/models/{executesubscriptioninheritancerequest.ts → submodifyinheritancerequest.ts} +3 -3
- package/src/models/submodifyquantitychangerequest.ts +19 -0
- package/src/models/subscriptionmodifyresponse.ts +25 -0
- package/src/models/subscriptionmodifytype.ts +17 -0
- package/src/models/subscriptionphasecreaterequest.ts +9 -0
- package/src/models/subscriptionpricecreaterequest.ts +0 -3
- package/src/models/windowsize.ts +2 -2
- package/src/tool-names.ts +9 -1
- package/esm/models/executesubscriptioninheritancerequest.d.ts +0 -6
- package/esm/models/executesubscriptioninheritancerequest.d.ts.map +0 -1
- package/esm/models/executesubscriptioninheritancerequest.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
SubscriptionStatus,
|
|
8
|
+
SubscriptionStatus$zodSchema,
|
|
9
|
+
} from "./subscriptionstatus.js";
|
|
10
|
+
|
|
11
|
+
export type ChangedSubscription = {
|
|
12
|
+
action?: string | undefined;
|
|
13
|
+
id?: string | undefined;
|
|
14
|
+
status?: SubscriptionStatus | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ChangedSubscription$zodSchema: z.ZodType<ChangedSubscription> = z
|
|
18
|
+
.object({
|
|
19
|
+
action: z.string().optional().describe("\"created\" | \"updated\""),
|
|
20
|
+
id: z.string().optional(),
|
|
21
|
+
status: SubscriptionStatus$zodSchema.optional(),
|
|
22
|
+
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { BillingCadence, BillingCadence$zodSchema } from "./billingcadence.js";
|
|
7
6
|
import { BillingModel, BillingModel$zodSchema } from "./billingmodel.js";
|
|
8
7
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
9
8
|
import { BillingTier, BillingTier$zodSchema } from "./billingtier.js";
|
|
@@ -29,7 +28,6 @@ import { PriceUnitType, PriceUnitType$zodSchema } from "./priceunittype.js";
|
|
|
29
28
|
|
|
30
29
|
export type CreatePriceRequest = {
|
|
31
30
|
amount?: string | undefined;
|
|
32
|
-
billing_cadence: BillingCadence;
|
|
33
31
|
billing_model: BillingModel;
|
|
34
32
|
billing_period: BillingPeriod;
|
|
35
33
|
billing_period_count?: number | undefined;
|
|
@@ -59,7 +57,6 @@ export type CreatePriceRequest = {
|
|
|
59
57
|
export const CreatePriceRequest$zodSchema: z.ZodType<CreatePriceRequest> = z
|
|
60
58
|
.object({
|
|
61
59
|
amount: z.string().optional(),
|
|
62
|
-
billing_cadence: BillingCadence$zodSchema,
|
|
63
60
|
billing_model: BillingModel$zodSchema,
|
|
64
61
|
billing_period: BillingPeriod$zodSchema,
|
|
65
62
|
billing_period_count: z.int().optional(),
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
AddAddonToSubscriptionRequest,
|
|
8
8
|
AddAddonToSubscriptionRequest$zodSchema,
|
|
9
9
|
} from "./addaddontosubscriptionrequest.js";
|
|
10
|
-
import { BillingCadence, BillingCadence$zodSchema } from "./billingcadence.js";
|
|
11
10
|
import { BillingCycle, BillingCycle$zodSchema } from "./billingcycle.js";
|
|
12
11
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
13
12
|
import {
|
|
@@ -62,7 +61,6 @@ import {
|
|
|
62
61
|
|
|
63
62
|
export type CreateSubscriptionRequest = {
|
|
64
63
|
addons?: Array<AddAddonToSubscriptionRequest> | undefined;
|
|
65
|
-
billing_cadence: BillingCadence;
|
|
66
64
|
billing_cycle?: BillingCycle | undefined;
|
|
67
65
|
billing_period: BillingPeriod;
|
|
68
66
|
billing_period_count?: number | undefined;
|
|
@@ -105,7 +103,6 @@ export const CreateSubscriptionRequest$zodSchema: z.ZodType<
|
|
|
105
103
|
addons: z.array(AddAddonToSubscriptionRequest$zodSchema).optional().describe(
|
|
106
104
|
"Addons represents addons to be added to the subscription during creation",
|
|
107
105
|
),
|
|
108
|
-
billing_cadence: BillingCadence$zodSchema,
|
|
109
106
|
billing_cycle: BillingCycle$zodSchema.optional(),
|
|
110
107
|
billing_period: BillingPeriod$zodSchema,
|
|
111
108
|
billing_period_count: z.int().optional(),
|
|
@@ -5,35 +5,35 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { ErrorResponse, ErrorResponse$zodSchema } from "./errorresponse.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "./
|
|
8
|
+
ExecuteSubscriptionModifyRequest,
|
|
9
|
+
ExecuteSubscriptionModifyRequest$zodSchema,
|
|
10
|
+
} from "./executesubscriptionmodifyrequest.js";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "./
|
|
12
|
+
SubscriptionModifyResponse,
|
|
13
|
+
SubscriptionModifyResponse$zodSchema,
|
|
14
|
+
} from "./subscriptionmodifyresponse.js";
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type ExecuteSubscriptionModifyRequestRequest = {
|
|
17
17
|
id: string;
|
|
18
|
-
body:
|
|
18
|
+
body: ExecuteSubscriptionModifyRequest;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
21
|
+
export const ExecuteSubscriptionModifyRequestRequest$zodSchema: z.ZodType<
|
|
22
|
+
ExecuteSubscriptionModifyRequestRequest
|
|
23
23
|
> = z.object({
|
|
24
|
-
body:
|
|
25
|
-
"
|
|
24
|
+
body: ExecuteSubscriptionModifyRequest$zodSchema.describe(
|
|
25
|
+
"Modification request",
|
|
26
26
|
),
|
|
27
27
|
id: z.string().describe("Subscription ID"),
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export type ExecuteSubscriptionModifyResponse =
|
|
31
|
-
|
|
|
31
|
+
| SubscriptionModifyResponse
|
|
32
32
|
| ErrorResponse;
|
|
33
33
|
|
|
34
34
|
export const ExecuteSubscriptionModifyResponse$zodSchema: z.ZodType<
|
|
35
35
|
ExecuteSubscriptionModifyResponse
|
|
36
36
|
> = z.union([
|
|
37
|
-
|
|
37
|
+
SubscriptionModifyResponse$zodSchema,
|
|
38
38
|
ErrorResponse$zodSchema,
|
|
39
39
|
]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
SubModifyInheritanceRequest,
|
|
8
|
+
SubModifyInheritanceRequest$zodSchema,
|
|
9
|
+
} from "./submodifyinheritancerequest.js";
|
|
10
|
+
import {
|
|
11
|
+
SubModifyQuantityChangeRequest,
|
|
12
|
+
SubModifyQuantityChangeRequest$zodSchema,
|
|
13
|
+
} from "./submodifyquantitychangerequest.js";
|
|
14
|
+
import {
|
|
15
|
+
SubscriptionModifyType,
|
|
16
|
+
SubscriptionModifyType$zodSchema,
|
|
17
|
+
} from "./subscriptionmodifytype.js";
|
|
18
|
+
|
|
19
|
+
export type ExecuteSubscriptionModifyRequest = {
|
|
20
|
+
inheritance_params?: SubModifyInheritanceRequest | undefined;
|
|
21
|
+
quantity_change_params?: SubModifyQuantityChangeRequest | undefined;
|
|
22
|
+
type: SubscriptionModifyType;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const ExecuteSubscriptionModifyRequest$zodSchema: z.ZodType<
|
|
26
|
+
ExecuteSubscriptionModifyRequest
|
|
27
|
+
> = z.object({
|
|
28
|
+
inheritance_params: SubModifyInheritanceRequest$zodSchema.optional(),
|
|
29
|
+
quantity_change_params: SubModifyQuantityChangeRequest$zodSchema.optional(),
|
|
30
|
+
type: SubscriptionModifyType$zodSchema,
|
|
31
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ErrorResponse, ErrorResponse$zodSchema } from "./errorresponse.js";
|
|
7
|
+
import {
|
|
8
|
+
InvoiceResponse,
|
|
9
|
+
InvoiceResponse$zodSchema,
|
|
10
|
+
} from "./invoiceresponse.js";
|
|
11
|
+
|
|
12
|
+
export type GetMeterUsagePreviewInvoiceResponse =
|
|
13
|
+
| InvoiceResponse
|
|
14
|
+
| ErrorResponse;
|
|
15
|
+
|
|
16
|
+
export const GetMeterUsagePreviewInvoiceResponse$zodSchema: z.ZodType<
|
|
17
|
+
GetMeterUsagePreviewInvoiceResponse
|
|
18
|
+
> = z.union([
|
|
19
|
+
InvoiceResponse$zodSchema,
|
|
20
|
+
ErrorResponse$zodSchema,
|
|
21
|
+
]);
|
|
@@ -48,6 +48,7 @@ export type InvoiceFilter = {
|
|
|
48
48
|
sort?: Array<SortCondition> | undefined;
|
|
49
49
|
start_time?: string | undefined;
|
|
50
50
|
status?: Status | undefined;
|
|
51
|
+
subscription_customer_id?: Array<string> | undefined;
|
|
51
52
|
subscription_id?: string | undefined;
|
|
52
53
|
};
|
|
53
54
|
|
|
@@ -98,6 +99,9 @@ export const InvoiceFilter$zodSchema: z.ZodType<InvoiceFilter> = z.object({
|
|
|
98
99
|
sort: z.array(SortCondition$zodSchema).optional(),
|
|
99
100
|
start_time: z.iso.datetime({ offset: true }).optional(),
|
|
100
101
|
status: Status$zodSchema.optional(),
|
|
102
|
+
subscription_customer_id: z.array(z.string()).optional().describe(
|
|
103
|
+
"subscription_customer_id filters invoices by the subscription owner's customer ID",
|
|
104
|
+
),
|
|
101
105
|
subscription_id: z.string().optional().describe(
|
|
102
106
|
"subscription_id filters invoices generated for a specific subscription\nOnly returns invoices that were created as part of the specified subscription's billing",
|
|
103
107
|
),
|
|
@@ -64,6 +64,7 @@ export type InvoiceResponse = {
|
|
|
64
64
|
refunded_amount?: string | undefined;
|
|
65
65
|
status?: Status | undefined;
|
|
66
66
|
subscription?: SubscriptionResponse | undefined;
|
|
67
|
+
subscription_customer_id?: string | undefined;
|
|
67
68
|
subscription_id?: string | undefined;
|
|
68
69
|
subtotal?: string | undefined;
|
|
69
70
|
taxes?: Array<TaxAppliedResponse> | undefined;
|
|
@@ -169,6 +170,9 @@ export const InvoiceResponse$zodSchema: z.ZodType<InvoiceResponse> = z.object({
|
|
|
169
170
|
),
|
|
170
171
|
status: Status$zodSchema.optional(),
|
|
171
172
|
subscription: z.lazy(() => SubscriptionResponse$zodSchema).optional(),
|
|
173
|
+
subscription_customer_id: z.string().optional().describe(
|
|
174
|
+
"subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).\nIt may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB.",
|
|
175
|
+
),
|
|
172
176
|
subscription_id: z.string().optional().describe(
|
|
173
177
|
"subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)",
|
|
174
178
|
),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type LineItemQuantityChange = {
|
|
8
|
+
effective_date?: string | undefined;
|
|
9
|
+
id: string;
|
|
10
|
+
quantity: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const LineItemQuantityChange$zodSchema: z.ZodType<
|
|
14
|
+
LineItemQuantityChange
|
|
15
|
+
> = z.object({
|
|
16
|
+
effective_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
17
|
+
"EffectiveDate is when the quantity change takes effect.\nIf omitted, the change is effective immediately (now).",
|
|
18
|
+
),
|
|
19
|
+
id: z.string(),
|
|
20
|
+
quantity: z.string(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ErrorResponse, ErrorResponse$zodSchema } from "./errorresponse.js";
|
|
7
|
+
import {
|
|
8
|
+
ExecuteSubscriptionModifyRequest,
|
|
9
|
+
ExecuteSubscriptionModifyRequest$zodSchema,
|
|
10
|
+
} from "./executesubscriptionmodifyrequest.js";
|
|
11
|
+
import {
|
|
12
|
+
SubscriptionModifyResponse,
|
|
13
|
+
SubscriptionModifyResponse$zodSchema,
|
|
14
|
+
} from "./subscriptionmodifyresponse.js";
|
|
15
|
+
|
|
16
|
+
export type PreviewSubscriptionModifyRequest = {
|
|
17
|
+
id: string;
|
|
18
|
+
body: ExecuteSubscriptionModifyRequest;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const PreviewSubscriptionModifyRequest$zodSchema: z.ZodType<
|
|
22
|
+
PreviewSubscriptionModifyRequest
|
|
23
|
+
> = z.object({
|
|
24
|
+
body: ExecuteSubscriptionModifyRequest$zodSchema.describe(
|
|
25
|
+
"Modification preview request",
|
|
26
|
+
),
|
|
27
|
+
id: z.string().describe("Subscription ID"),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export type PreviewSubscriptionModifyResponse =
|
|
31
|
+
| SubscriptionModifyResponse
|
|
32
|
+
| ErrorResponse;
|
|
33
|
+
|
|
34
|
+
export const PreviewSubscriptionModifyResponse$zodSchema: z.ZodType<
|
|
35
|
+
PreviewSubscriptionModifyResponse
|
|
36
|
+
> = z.union([
|
|
37
|
+
SubscriptionModifyResponse$zodSchema,
|
|
38
|
+
ErrorResponse$zodSchema,
|
|
39
|
+
]);
|
package/src/models/{executesubscriptioninheritancerequest.ts → submodifyinheritancerequest.ts}
RENAMED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type SubModifyInheritanceRequest = {
|
|
8
8
|
external_customer_ids_to_inherit_subscription?: Array<string> | undefined;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
11
|
+
export const SubModifyInheritanceRequest$zodSchema: z.ZodType<
|
|
12
|
+
SubModifyInheritanceRequest
|
|
13
13
|
> = z.object({
|
|
14
14
|
external_customer_ids_to_inherit_subscription: z.array(z.string()).optional(),
|
|
15
15
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
LineItemQuantityChange,
|
|
8
|
+
LineItemQuantityChange$zodSchema,
|
|
9
|
+
} from "./lineitemquantitychange.js";
|
|
10
|
+
|
|
11
|
+
export type SubModifyQuantityChangeRequest = {
|
|
12
|
+
line_items: Array<LineItemQuantityChange>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const SubModifyQuantityChangeRequest$zodSchema: z.ZodType<
|
|
16
|
+
SubModifyQuantityChangeRequest
|
|
17
|
+
> = z.object({
|
|
18
|
+
line_items: z.array(LineItemQuantityChange$zodSchema),
|
|
19
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
ChangedResources,
|
|
8
|
+
ChangedResources$zodSchema,
|
|
9
|
+
} from "./changedresources.js";
|
|
10
|
+
import {
|
|
11
|
+
SubscriptionResponse,
|
|
12
|
+
SubscriptionResponse$zodSchema,
|
|
13
|
+
} from "./subscriptionresponse.js";
|
|
14
|
+
|
|
15
|
+
export type SubscriptionModifyResponse = {
|
|
16
|
+
changed_resources?: ChangedResources | undefined;
|
|
17
|
+
subscription?: SubscriptionResponse | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const SubscriptionModifyResponse$zodSchema: z.ZodType<
|
|
21
|
+
SubscriptionModifyResponse
|
|
22
|
+
> = z.object({
|
|
23
|
+
changed_resources: ChangedResources$zodSchema.optional(),
|
|
24
|
+
subscription: SubscriptionResponse$zodSchema.optional(),
|
|
25
|
+
});
|
|
@@ -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 SubscriptionModifyType = {
|
|
9
|
+
Inheritance: "inheritance",
|
|
10
|
+
QuantityChange: "quantity_change",
|
|
11
|
+
} as const;
|
|
12
|
+
export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
|
|
13
|
+
|
|
14
|
+
export const SubscriptionModifyType$zodSchema = z.enum([
|
|
15
|
+
"inheritance",
|
|
16
|
+
"quantity_change",
|
|
17
|
+
]);
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
CreateSubscriptionLineItemRequest,
|
|
8
|
+
CreateSubscriptionLineItemRequest$zodSchema,
|
|
9
|
+
} from "./createsubscriptionlineitemrequest.js";
|
|
6
10
|
import {
|
|
7
11
|
OverrideLineItemRequest,
|
|
8
12
|
OverrideLineItemRequest$zodSchema,
|
|
@@ -12,6 +16,7 @@ export type SubscriptionPhaseCreateRequest = {
|
|
|
12
16
|
coupons?: Array<string> | undefined;
|
|
13
17
|
end_date?: string | undefined;
|
|
14
18
|
line_item_coupons?: { [k: string]: Array<string> } | undefined;
|
|
19
|
+
line_items?: Array<CreateSubscriptionLineItemRequest> | undefined;
|
|
15
20
|
metadata?: { [k: string]: string } | undefined;
|
|
16
21
|
override_line_items?: Array<OverrideLineItemRequest> | undefined;
|
|
17
22
|
start_date: string;
|
|
@@ -28,6 +33,10 @@ export const SubscriptionPhaseCreateRequest$zodSchema: z.ZodType<
|
|
|
28
33
|
.describe(
|
|
29
34
|
"LineItemCoupons represents line item-level coupons (map of line_item_id to coupon IDs)",
|
|
30
35
|
),
|
|
36
|
+
line_items: z.array(CreateSubscriptionLineItemRequest$zodSchema).optional()
|
|
37
|
+
.describe(
|
|
38
|
+
"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.",
|
|
39
|
+
),
|
|
31
40
|
metadata: z.record(z.string(), z.string()).optional(),
|
|
32
41
|
override_line_items: z.array(OverrideLineItemRequest$zodSchema).optional()
|
|
33
42
|
.describe(
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { BillingCadence, BillingCadence$zodSchema } from "./billingcadence.js";
|
|
7
6
|
import { BillingModel, BillingModel$zodSchema } from "./billingmodel.js";
|
|
8
7
|
import { BillingPeriod, BillingPeriod$zodSchema } from "./billingperiod.js";
|
|
9
8
|
import { BillingTier, BillingTier$zodSchema } from "./billingtier.js";
|
|
@@ -25,7 +24,6 @@ import { PriceUnitType, PriceUnitType$zodSchema } from "./priceunittype.js";
|
|
|
25
24
|
|
|
26
25
|
export type SubscriptionPriceCreateRequest = {
|
|
27
26
|
amount?: string | undefined;
|
|
28
|
-
billing_cadence: BillingCadence;
|
|
29
27
|
billing_model: BillingModel;
|
|
30
28
|
billing_period: BillingPeriod;
|
|
31
29
|
billing_period_count?: number | undefined;
|
|
@@ -52,7 +50,6 @@ export const SubscriptionPriceCreateRequest$zodSchema: z.ZodType<
|
|
|
52
50
|
SubscriptionPriceCreateRequest
|
|
53
51
|
> = z.object({
|
|
54
52
|
amount: z.string().optional(),
|
|
55
|
-
billing_cadence: BillingCadence$zodSchema,
|
|
56
53
|
billing_model: BillingModel$zodSchema,
|
|
57
54
|
billing_period: BillingPeriod$zodSchema,
|
|
58
55
|
billing_period_count: z.int().optional(),
|
package/src/models/windowsize.ts
CHANGED
|
@@ -6,7 +6,6 @@ import * as z from "zod";
|
|
|
6
6
|
import { ClosedEnum } from "../types/enums.js";
|
|
7
7
|
|
|
8
8
|
export const WindowSize = {
|
|
9
|
-
Month: "MONTH",
|
|
10
9
|
Minute: "MINUTE",
|
|
11
10
|
FifteenMIN: "15MIN",
|
|
12
11
|
ThirtyMIN: "30MIN",
|
|
@@ -16,11 +15,11 @@ export const WindowSize = {
|
|
|
16
15
|
TwelveHOUR: "12HOUR",
|
|
17
16
|
Day: "DAY",
|
|
18
17
|
Week: "WEEK",
|
|
18
|
+
Month: "MONTH",
|
|
19
19
|
} as const;
|
|
20
20
|
export type WindowSize = ClosedEnum<typeof WindowSize>;
|
|
21
21
|
|
|
22
22
|
export const WindowSize$zodSchema = z.enum([
|
|
23
|
-
"MONTH",
|
|
24
23
|
"MINUTE",
|
|
25
24
|
"15MIN",
|
|
26
25
|
"30MIN",
|
|
@@ -30,4 +29,5 @@ export const WindowSize$zodSchema = z.enum([
|
|
|
30
29
|
"12HOUR",
|
|
31
30
|
"DAY",
|
|
32
31
|
"WEEK",
|
|
32
|
+
"MONTH",
|
|
33
33
|
]);
|
package/src/tool-names.ts
CHANGED
|
@@ -44,6 +44,10 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
44
44
|
"name": "create-invoice",
|
|
45
45
|
"description": "Create one-off invoice\n\nUse when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready."
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"name": "get-meter-usage-preview-invoice",
|
|
49
|
+
"description": "Get invoice preview using meter_usage data\n\nPreview invoice using the meter_usage table for usage data instead of feature_usage."
|
|
50
|
+
},
|
|
47
51
|
{
|
|
48
52
|
"name": "get-invoice-preview",
|
|
49
53
|
"description": "Get invoice preview\n\nUse when showing a customer what they will be charged (e.g. preview before checkout or plan change). No invoice is created."
|
|
@@ -250,7 +254,11 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
250
254
|
},
|
|
251
255
|
{
|
|
252
256
|
"name": "execute-subscription-modify",
|
|
253
|
-
"description": "
|
|
257
|
+
"description": "Execute subscription modification\n\nExecute a mid-cycle subscription modification (inheritance or quantity change)."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "preview-subscription-modify",
|
|
261
|
+
"description": "Preview subscription modification\n\nPreview the impact of a mid-cycle subscription modification without committing changes."
|
|
254
262
|
},
|
|
255
263
|
{
|
|
256
264
|
"name": "pause-subscription",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
export type ExecuteSubscriptionInheritanceRequest = {
|
|
3
|
-
external_customer_ids_to_inherit_subscription?: Array<string> | undefined;
|
|
4
|
-
};
|
|
5
|
-
export declare const ExecuteSubscriptionInheritanceRequest$zodSchema: z.ZodType<ExecuteSubscriptionInheritanceRequest>;
|
|
6
|
-
//# sourceMappingURL=executesubscriptioninheritancerequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executesubscriptioninheritancerequest.d.ts","sourceRoot":"","sources":["../../src/models/executesubscriptioninheritancerequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,qCAAqC,GAAG;IAClD,6CAA6C,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAC3E,CAAC;AAEF,eAAO,MAAM,+CAA+C,EAAE,CAAC,CAAC,OAAO,CACrE,qCAAqC,CAGrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executesubscriptioninheritancerequest.js","sourceRoot":"","sources":["../../src/models/executesubscriptioninheritancerequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAMzB,MAAM,CAAC,MAAM,+CAA+C,GAExD,CAAC,CAAC,MAAM,CAAC;IACX,6CAA6C,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC9E,CAAC,CAAC"}
|