@flexprice/mcp-server 2.1.10 → 2.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/bin/mcp-server.js +720 -610
  2. package/bin/mcp-server.js.map +33 -31
  3. package/bun.lock +26 -24
  4. package/esm/lib/config.d.ts +3 -3
  5. package/esm/lib/config.js +3 -3
  6. package/esm/mcp-server/mcp-server.js +1 -1
  7. package/esm/mcp-server/server.d.ts.map +1 -1
  8. package/esm/mcp-server/server.js +1 -3
  9. package/esm/mcp-server/server.js.map +1 -1
  10. package/esm/models/changedsubscription.d.ts +2 -0
  11. package/esm/models/changedsubscription.d.ts.map +1 -1
  12. package/esm/models/changedsubscription.js +2 -0
  13. package/esm/models/changedsubscription.js.map +1 -1
  14. package/esm/models/createinvoicelineitemrequest.d.ts +3 -0
  15. package/esm/models/createinvoicelineitemrequest.d.ts.map +1 -1
  16. package/esm/models/createinvoicelineitemrequest.js +3 -0
  17. package/esm/models/createinvoicelineitemrequest.js.map +1 -1
  18. package/esm/models/createinvoicerequest.d.ts +1 -0
  19. package/esm/models/createinvoicerequest.d.ts.map +1 -1
  20. package/esm/models/createinvoicerequest.js +1 -0
  21. package/esm/models/createinvoicerequest.js.map +1 -1
  22. package/esm/models/creditgrantexpirydurationunit.d.ts +1 -1
  23. package/esm/models/entityintegrationmappingresponse.d.ts +3 -0
  24. package/esm/models/entityintegrationmappingresponse.d.ts.map +1 -1
  25. package/esm/models/entityintegrationmappingresponse.js +1 -0
  26. package/esm/models/entityintegrationmappingresponse.js.map +1 -1
  27. package/esm/models/errorcode.d.ts +32 -0
  28. package/esm/models/errorcode.d.ts.map +1 -0
  29. package/esm/models/errorcode.js +33 -0
  30. package/esm/models/errorcode.js.map +1 -0
  31. package/esm/models/errorresponse.d.ts +2 -34
  32. package/esm/models/errorresponse.d.ts.map +1 -1
  33. package/esm/models/errorresponse.js +2 -29
  34. package/esm/models/errorresponse.js.map +1 -1
  35. package/esm/models/executesubscriptionmodifyrequest.d.ts +2 -0
  36. package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
  37. package/esm/models/executesubscriptionmodifyrequest.js +2 -0
  38. package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
  39. package/esm/models/invoicebillingreason.d.ts +2 -0
  40. package/esm/models/invoicebillingreason.d.ts.map +1 -1
  41. package/esm/models/invoicebillingreason.js +2 -0
  42. package/esm/models/invoicebillingreason.js.map +1 -1
  43. package/esm/models/invoicefilter.d.ts +3 -0
  44. package/esm/models/invoicefilter.d.ts.map +1 -1
  45. package/esm/models/invoicefilter.js +3 -0
  46. package/esm/models/invoicefilter.js.map +1 -1
  47. package/esm/models/invoicelineitemresponse.d.ts +2 -0
  48. package/esm/models/invoicelineitemresponse.d.ts.map +1 -1
  49. package/esm/models/invoicelineitemresponse.js +2 -0
  50. package/esm/models/invoicelineitemresponse.js.map +1 -1
  51. package/esm/models/invoiceresponse.d.ts +1 -0
  52. package/esm/models/invoiceresponse.d.ts.map +1 -1
  53. package/esm/models/invoiceresponse.js +1 -0
  54. package/esm/models/invoiceresponse.js.map +1 -1
  55. package/esm/models/priceprice.d.ts +1 -0
  56. package/esm/models/priceprice.d.ts.map +1 -1
  57. package/esm/models/priceprice.js +1 -0
  58. package/esm/models/priceprice.js.map +1 -1
  59. package/esm/models/priceresponse.d.ts +1 -0
  60. package/esm/models/priceresponse.d.ts.map +1 -1
  61. package/esm/models/priceresponse.js +1 -0
  62. package/esm/models/priceresponse.js.map +1 -1
  63. package/esm/models/submodifytrialendrequest.d.ts +8 -0
  64. package/esm/models/submodifytrialendrequest.d.ts.map +1 -0
  65. package/esm/models/submodifytrialendrequest.js +10 -0
  66. package/esm/models/submodifytrialendrequest.js.map +1 -0
  67. package/esm/models/subscriptionmodifytype.d.ts +2 -0
  68. package/esm/models/subscriptionmodifytype.d.ts.map +1 -1
  69. package/esm/models/subscriptionmodifytype.js +2 -0
  70. package/esm/models/subscriptionmodifytype.js.map +1 -1
  71. package/esm/models/subscriptionresponse.d.ts +1 -0
  72. package/esm/models/subscriptionresponse.d.ts.map +1 -1
  73. package/esm/models/subscriptionresponse.js +1 -0
  74. package/esm/models/subscriptionresponse.js.map +1 -1
  75. package/esm/models/subscriptionresponsev2.d.ts +2 -0
  76. package/esm/models/subscriptionresponsev2.d.ts.map +1 -1
  77. package/esm/models/subscriptionresponsev2.js +2 -0
  78. package/esm/models/subscriptionresponsev2.js.map +1 -1
  79. package/esm/models/trialendaction.d.ts +12 -0
  80. package/esm/models/trialendaction.d.ts.map +1 -0
  81. package/esm/models/trialendaction.js +13 -0
  82. package/esm/models/trialendaction.js.map +1 -0
  83. package/esm/models/userresponse.d.ts +3 -0
  84. package/esm/models/userresponse.d.ts.map +1 -1
  85. package/esm/models/userresponse.js +1 -0
  86. package/esm/models/userresponse.js.map +1 -1
  87. package/esm/models/windowsize.d.ts +2 -2
  88. package/esm/models/windowsize.js +2 -2
  89. package/esm/models/windowsize.js.map +1 -1
  90. package/esm/tool-names.d.ts.map +1 -1
  91. package/esm/tool-names.js +0 -4
  92. package/esm/tool-names.js.map +1 -1
  93. package/esm/tsconfig.tsbuildinfo +1 -1
  94. package/manifest.json +1 -5
  95. package/package.json +1 -1
  96. package/src/lib/config.ts +3 -3
  97. package/src/mcp-server/mcp-server.ts +1 -1
  98. package/src/mcp-server/server.ts +1 -3
  99. package/src/models/changedsubscription.ts +4 -0
  100. package/src/models/createinvoicelineitemrequest.ts +12 -0
  101. package/src/models/createinvoicerequest.ts +4 -0
  102. package/src/models/entityintegrationmappingresponse.ts +2 -0
  103. package/src/models/errorcode.ts +37 -0
  104. package/src/models/errorresponse.ts +3 -38
  105. package/src/models/executesubscriptionmodifyrequest.ts +6 -0
  106. package/src/models/invoicebillingreason.ts +2 -0
  107. package/src/models/invoicefilter.ts +10 -0
  108. package/src/models/invoicelineitemresponse.ts +8 -0
  109. package/src/models/invoiceresponse.ts +4 -0
  110. package/src/models/priceprice.ts +4 -0
  111. package/src/models/priceresponse.ts +4 -0
  112. package/src/models/submodifytrialendrequest.ts +20 -0
  113. package/src/models/subscriptionmodifytype.ts +2 -0
  114. package/src/models/subscriptionresponse.ts +4 -0
  115. package/src/models/subscriptionresponsev2.ts +8 -0
  116. package/src/models/trialendaction.ts +17 -0
  117. package/src/models/userresponse.ts +2 -0
  118. package/src/models/windowsize.ts +2 -2
  119. package/src/tool-names.ts +0 -4
  120. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts +0 -16
  121. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts.map +0 -1
  122. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js +0 -82
  123. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js.map +0 -1
  124. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts +0 -7
  125. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts.map +0 -1
  126. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js +0 -35
  127. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js.map +0 -1
  128. package/esm/models/getmeterusagepreviewinvoiceop.d.ts +0 -6
  129. package/esm/models/getmeterusagepreviewinvoiceop.d.ts.map +0 -1
  130. package/esm/models/getmeterusagepreviewinvoiceop.js +0 -11
  131. package/esm/models/getmeterusagepreviewinvoiceop.js.map +0 -1
  132. package/src/funcs/invoicesGetMeterUsagePreviewInvoice.ts +0 -144
  133. package/src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts +0 -47
  134. package/src/models/getmeterusagepreviewinvoiceop.ts +0 -21
package/manifest.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "sensitive": true
49
49
  }
50
50
  },
51
- "version": "2.1.10",
51
+ "version": "2.1.17",
52
52
  "tools": [
53
53
  {
54
54
  "name": "update-customer",
@@ -94,10 +94,6 @@
94
94
  "name": "create-invoice",
95
95
  "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."
96
96
  },
97
- {
98
- "name": "get-meter-usage-preview-invoice",
99
- "description": "Get invoice preview using meter_usage data\n\nPreview invoice using the meter_usage table for usage data instead of feature_usage."
100
- },
101
97
  {
102
98
  "name": "get-invoice-preview",
103
99
  "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."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/mcp-server",
3
- "version": "2.1.10",
3
+ "version": "2.1.17",
4
4
  "author": "flexprice",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/lib/config.ts CHANGED
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
69
  export const SDK_METADATA = {
70
70
  language: "typescript",
71
71
  openapiDocVersion: "1.0",
72
- sdkVersion: "2.1.10",
73
- genVersion: "2.882.0",
72
+ sdkVersion: "2.1.17",
73
+ genVersion: "2.893.0",
74
74
  userAgent:
75
- "speakeasy-sdk/mcp-typescript 2.1.10 2.882.0 1.0 @flexprice/mcp-server",
75
+ "speakeasy-sdk/mcp-typescript 2.1.17 2.893.0 1.0 @flexprice/mcp-server",
76
76
  } as const;
@@ -21,7 +21,7 @@ const routes = buildRouteMap({
21
21
  export const app = buildApplication(routes, {
22
22
  name: "mcp",
23
23
  versionInfo: {
24
- currentVersion: "2.1.10",
24
+ currentVersion: "2.1.17",
25
25
  },
26
26
  });
27
27
 
@@ -41,7 +41,6 @@ import { tool$invoicesGetCustomerInvoiceSummary } from "./tools/invoicesGetCusto
41
41
  import { tool$invoicesGetInvoice } from "./tools/invoicesGetInvoice.js";
42
42
  import { tool$invoicesGetInvoicePdf } from "./tools/invoicesGetInvoicePdf.js";
43
43
  import { tool$invoicesGetInvoicePreview } from "./tools/invoicesGetInvoicePreview.js";
44
- import { tool$invoicesGetMeterUsagePreviewInvoice } from "./tools/invoicesGetMeterUsagePreviewInvoice.js";
45
44
  import { tool$invoicesQueryInvoice } from "./tools/invoicesQueryInvoice.js";
46
45
  import { tool$invoicesRecalculateInvoice } from "./tools/invoicesRecalculateInvoice.js";
47
46
  import { tool$invoicesRecalculateInvoiceV2 } from "./tools/invoicesRecalculateInvoiceV2.js";
@@ -102,7 +101,7 @@ export function createMCPServer(deps: {
102
101
  }) {
103
102
  const server = new McpServer({
104
103
  name: "Flexprice",
105
- version: "2.1.10",
104
+ version: "2.1.17",
106
105
  });
107
106
 
108
107
  const getClient = deps.getSDK || (() =>
@@ -158,7 +157,6 @@ export function createMCPServer(deps: {
158
157
  tool(tool$customersGetCustomerUpcomingGrants);
159
158
  tool(tool$invoicesGetCustomerInvoiceSummary);
160
159
  tool(tool$invoicesCreateInvoice);
161
- tool(tool$invoicesGetMeterUsagePreviewInvoice);
162
160
  tool(tool$invoicesGetInvoicePreview);
163
161
  tool(tool$invoicesQueryInvoice);
164
162
  tool(tool$invoicesGetInvoice);
@@ -14,8 +14,10 @@ import {
14
14
 
15
15
  export type ChangedSubscription = {
16
16
  action?: ChangedSubscriptionAction | undefined;
17
+ current_period_end?: string | undefined;
17
18
  id?: string | undefined;
18
19
  status?: SubscriptionStatus | undefined;
20
+ trial_end?: string | undefined;
19
21
  };
20
22
 
21
23
  export const ChangedSubscription$zodSchema: z.ZodType<ChangedSubscription> = z
@@ -23,6 +25,8 @@ export const ChangedSubscription$zodSchema: z.ZodType<ChangedSubscription> = z
23
25
  action: ChangedSubscriptionAction$zodSchema.optional().describe(
24
26
  "created | updated",
25
27
  ),
28
+ current_period_end: z.iso.datetime({ offset: true }).optional(),
26
29
  id: z.string().optional(),
27
30
  status: SubscriptionStatus$zodSchema.optional(),
31
+ trial_end: z.iso.datetime({ offset: true }).optional(),
28
32
  });
@@ -6,6 +6,7 @@ import * as z from "zod";
6
6
  import { CommitmentInfo, CommitmentInfo$zodSchema } from "./commitmentinfo.js";
7
7
 
8
8
  export type CreateInvoiceLineItemRequest = {
9
+ adjusted_entitlement_quantity?: string | undefined;
9
10
  amount: string;
10
11
  commitment_info?: CommitmentInfo | undefined;
11
12
  display_name?: string | undefined;
@@ -26,11 +27,16 @@ export type CreateInvoiceLineItemRequest = {
26
27
  price_unit?: string | undefined;
27
28
  price_unit_amount?: string | undefined;
28
29
  quantity: string;
30
+ subscription_id?: string | undefined;
31
+ subscription_line_item_id?: string | undefined;
29
32
  };
30
33
 
31
34
  export const CreateInvoiceLineItemRequest$zodSchema: z.ZodType<
32
35
  CreateInvoiceLineItemRequest
33
36
  > = z.object({
37
+ adjusted_entitlement_quantity: z.string().optional().describe(
38
+ "adjusted_entitlement_quantity is the entitlement-covered units deducted from raw usage.",
39
+ ),
34
40
  amount: z.string().describe(
35
41
  "amount is the monetary amount for this line item",
36
42
  ),
@@ -87,4 +93,10 @@ export const CreateInvoiceLineItemRequest$zodSchema: z.ZodType<
87
93
  quantity: z.string().describe(
88
94
  "quantity is the quantity of units for this line item",
89
95
  ),
96
+ subscription_id: z.string().optional().describe(
97
+ "subscription_id overrides the invoice's subscription_id for this specific line item.\nUsed for grouped invoicing where child line items belong to child subscriptions.",
98
+ ),
99
+ subscription_line_item_id: z.string().optional().describe(
100
+ "sub_line_item_id links this line item to the subscription_line_item that generated it.",
101
+ ),
90
102
  });
@@ -44,6 +44,7 @@ export type CreateInvoiceRequest = {
44
44
  invoice_pdf_url?: string | undefined;
45
45
  invoice_status?: InvoiceStatus | undefined;
46
46
  invoice_type?: InvoiceType | undefined;
47
+ issue_date?: string | undefined;
47
48
  line_item_coupons?: Array<InvoiceLineItemCoupon> | undefined;
48
49
  line_items?: Array<CreateInvoiceLineItemRequest> | undefined;
49
50
  metadata?: { [k: string]: string } | undefined;
@@ -98,6 +99,9 @@ export const CreateInvoiceRequest$zodSchema: z.ZodType<CreateInvoiceRequest> = z
98
99
  ),
99
100
  invoice_status: InvoiceStatus$zodSchema.optional(),
100
101
  invoice_type: InvoiceType$zodSchema.optional(),
102
+ issue_date: z.iso.datetime({ offset: true }).optional().describe(
103
+ "issue_date overrides the user-facing date of the invoice.\nDefaults to created_at if not provided.",
104
+ ),
101
105
  line_item_coupons: z.array(InvoiceLineItemCoupon$zodSchema).optional()
102
106
  .describe("Invoice Line Item Coupons"),
103
107
  line_items: z.array(CreateInvoiceLineItemRequest$zodSchema).optional()
@@ -16,6 +16,7 @@ export type EntityIntegrationMappingResponse = {
16
16
  entity_type?: IntegrationEntityType | undefined;
17
17
  environment_id?: string | undefined;
18
18
  id?: string | undefined;
19
+ metadata?: { [k: string]: any } | undefined;
19
20
  provider_entity_id?: string | undefined;
20
21
  provider_type?: string | undefined;
21
22
  status?: Status | undefined;
@@ -33,6 +34,7 @@ export const EntityIntegrationMappingResponse$zodSchema: z.ZodType<
33
34
  entity_type: IntegrationEntityType$zodSchema.optional(),
34
35
  environment_id: z.string().optional(),
35
36
  id: z.string().optional(),
37
+ metadata: z.record(z.string(), z.any()).optional(),
36
38
  provider_entity_id: z.string().optional(),
37
39
  provider_type: z.string().optional(),
38
40
  status: Status$zodSchema.optional(),
@@ -0,0 +1,37 @@
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 ErrorCode = {
9
+ HttpClientError: "http_client_error",
10
+ SystemError: "system_error",
11
+ InternalError: "internal_error",
12
+ NotFound: "not_found",
13
+ AlreadyExists: "already_exists",
14
+ VersionConflict: "version_conflict",
15
+ ValidationError: "validation_error",
16
+ InvalidOperation: "invalid_operation",
17
+ PermissionDenied: "permission_denied",
18
+ DatabaseError: "database_error",
19
+ ServiceUnavailable: "service_unavailable",
20
+ TooManyRequests: "too_many_requests",
21
+ } as const;
22
+ export type ErrorCode = ClosedEnum<typeof ErrorCode>;
23
+
24
+ export const ErrorCode$zodSchema = z.enum([
25
+ "http_client_error",
26
+ "system_error",
27
+ "internal_error",
28
+ "not_found",
29
+ "already_exists",
30
+ "version_conflict",
31
+ "validation_error",
32
+ "invalid_operation",
33
+ "permission_denied",
34
+ "database_error",
35
+ "service_unavailable",
36
+ "too_many_requests",
37
+ ]);
@@ -3,51 +3,16 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { ClosedEnum } from "../types/enums.js";
7
-
8
- export const Code = {
9
- NotFound: "not_found",
10
- AlreadyExists: "already_exists",
11
- VersionConflict: "version_conflict",
12
- ValidationError: "validation_error",
13
- InvalidOperation: "invalid_operation",
14
- PermissionDenied: "permission_denied",
15
- HttpClientError: "http_client_error",
16
- DatabaseError: "database_error",
17
- SystemError: "system_error",
18
- InternalError: "internal_error",
19
- ServiceUnavailable: "service_unavailable",
20
- } as const;
21
- export type Code = ClosedEnum<typeof Code>;
22
-
23
- export const Code$zodSchema = z.enum([
24
- "not_found",
25
- "already_exists",
26
- "version_conflict",
27
- "validation_error",
28
- "invalid_operation",
29
- "permission_denied",
30
- "http_client_error",
31
- "database_error",
32
- "system_error",
33
- "internal_error",
34
- "service_unavailable",
35
- ]);
36
-
37
- export type Details = {};
38
-
39
- export const Details$zodSchema: z.ZodType<Details> = z.object({});
6
+ import { ErrorCode, ErrorCode$zodSchema } from "./errorcode.js";
40
7
 
41
8
  export type ErrorResponse = {
42
- code?: Code | undefined;
43
- details?: { [k: string]: Details } | undefined;
9
+ code?: ErrorCode | undefined;
44
10
  http_status_code?: number | undefined;
45
11
  message?: string | undefined;
46
12
  };
47
13
 
48
14
  export const ErrorResponse$zodSchema: z.ZodType<ErrorResponse> = z.object({
49
- code: Code$zodSchema.optional(),
50
- details: z.record(z.string(), z.lazy(() => Details$zodSchema)).optional(),
15
+ code: ErrorCode$zodSchema.optional(),
51
16
  http_status_code: z.int().optional(),
52
17
  message: z.string().optional(),
53
18
  });
@@ -15,6 +15,10 @@ import {
15
15
  SubModifyQuantityChangeRequest,
16
16
  SubModifyQuantityChangeRequest$zodSchema,
17
17
  } from "./submodifyquantitychangerequest.js";
18
+ import {
19
+ SubModifyTrialEndRequest,
20
+ SubModifyTrialEndRequest$zodSchema,
21
+ } from "./submodifytrialendrequest.js";
18
22
  import {
19
23
  SubscriptionModifyType,
20
24
  SubscriptionModifyType$zodSchema,
@@ -24,6 +28,7 @@ export type ExecuteSubscriptionModifyRequest = {
24
28
  grouped_invoicing_params?: SubModifyGroupedInvoicingParams | undefined;
25
29
  inheritance_params?: SubModifyInheritanceRequest | undefined;
26
30
  quantity_change_params?: SubModifyQuantityChangeRequest | undefined;
31
+ trial_end_params?: SubModifyTrialEndRequest | undefined;
27
32
  type: SubscriptionModifyType;
28
33
  };
29
34
 
@@ -34,5 +39,6 @@ export const ExecuteSubscriptionModifyRequest$zodSchema: z.ZodType<
34
39
  .optional(),
35
40
  inheritance_params: SubModifyInheritanceRequest$zodSchema.optional(),
36
41
  quantity_change_params: SubModifyQuantityChangeRequest$zodSchema.optional(),
42
+ trial_end_params: SubModifyTrialEndRequest$zodSchema.optional(),
37
43
  type: SubscriptionModifyType$zodSchema,
38
44
  });
@@ -14,6 +14,7 @@ export const InvoiceBillingReason = {
14
14
  Proration: "PRORATION",
15
15
  Manual: "MANUAL",
16
16
  AutoInvoiceThreshold: "AUTO_INVOICE_THRESHOLD",
17
+ WalletAutoTopup: "WALLET_AUTO_TOPUP",
17
18
  } as const;
18
19
  export type InvoiceBillingReason = ClosedEnum<typeof InvoiceBillingReason>;
19
20
 
@@ -26,4 +27,5 @@ export const InvoiceBillingReason$zodSchema = z.enum([
26
27
  "PRORATION",
27
28
  "MANUAL",
28
29
  "AUTO_INVOICE_THRESHOLD",
30
+ "WALLET_AUTO_TOPUP",
29
31
  ]);
@@ -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(),
@@ -52,6 +52,7 @@ export type InvoiceResponse = {
52
52
  invoice_pdf_url?: string | undefined;
53
53
  invoice_status?: InvoiceStatus | undefined;
54
54
  invoice_type?: InvoiceType | undefined;
55
+ issue_date?: string | undefined;
55
56
  last_computed_at?: string | undefined;
56
57
  line_items?: Array<InvoiceLineItemResponse> | undefined;
57
58
  metadata?: { [k: string]: string } | undefined;
@@ -142,6 +143,9 @@ export const InvoiceResponse$zodSchema: z.ZodType<InvoiceResponse> = z.object({
142
143
  ),
143
144
  invoice_status: InvoiceStatus$zodSchema.optional(),
144
145
  invoice_type: InvoiceType$zodSchema.optional(),
146
+ issue_date: z.iso.datetime({ offset: true }).optional().describe(
147
+ "issue_date is the user-facing date of the invoice. Defaults to created_at if not set.",
148
+ ),
145
149
  last_computed_at: z.iso.datetime({ offset: true }).optional().describe(
146
150
  "last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice",
147
151
  ),
@@ -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,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
+ });
@@ -9,6 +9,7 @@ export const SubscriptionModifyType = {
9
9
  Inheritance: "inheritance",
10
10
  QuantityChange: "quantity_change",
11
11
  GroupedInvoicing: "grouped_invoicing",
12
+ TrialEnd: "trial_end",
12
13
  } as const;
13
14
  export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
14
15
 
@@ -16,4 +17,5 @@ export const SubscriptionModifyType$zodSchema = z.enum([
16
17
  "inheritance",
17
18
  "quantity_change",
18
19
  "grouped_invoicing",
20
+ "trial_end",
19
21
  ]);
@@ -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",
@@ -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
+ ]);
@@ -9,6 +9,7 @@ import { UserType, UserType$zodSchema } from "./usertype.js";
9
9
  export type UserResponse = {
10
10
  email?: string | undefined;
11
11
  id?: string | undefined;
12
+ metadata?: { [k: string]: string } | undefined;
12
13
  roles?: Array<string> | undefined;
13
14
  tenant?: TenantResponse | undefined;
14
15
  type?: UserType | undefined;
@@ -17,6 +18,7 @@ export type UserResponse = {
17
18
  export const UserResponse$zodSchema: z.ZodType<UserResponse> = z.object({
18
19
  email: z.string().optional().describe("Empty for service accounts"),
19
20
  id: z.string().optional(),
21
+ metadata: z.record(z.string(), z.string()).optional(),
20
22
  roles: z.array(z.string()).optional(),
21
23
  tenant: TenantResponse$zodSchema.optional(),
22
24
  type: UserType$zodSchema.optional(),
@@ -6,6 +6,7 @@ import * as z from "zod";
6
6
  import { ClosedEnum } from "../types/enums.js";
7
7
 
8
8
  export const WindowSize = {
9
+ Month: "MONTH",
9
10
  Minute: "MINUTE",
10
11
  FifteenMIN: "15MIN",
11
12
  ThirtyMIN: "30MIN",
@@ -15,11 +16,11 @@ export const WindowSize = {
15
16
  TwelveHOUR: "12HOUR",
16
17
  Day: "DAY",
17
18
  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",
23
24
  "MINUTE",
24
25
  "15MIN",
25
26
  "30MIN",
@@ -29,5 +30,4 @@ export const WindowSize$zodSchema = z.enum([
29
30
  "12HOUR",
30
31
  "DAY",
31
32
  "WEEK",
32
- "MONTH",
33
33
  ]);
package/src/tool-names.ts CHANGED
@@ -44,10 +44,6 @@ 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
- },
51
47
  {
52
48
  "name": "get-invoice-preview",
53
49
  "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."
@@ -1,16 +0,0 @@
1
- import { FlexpriceCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { APIError } from "../models/errors/apierror.js";
4
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
6
- import { GetPreviewInvoiceRequest } from "../models/getpreviewinvoicerequest.js";
7
- import { APIPromise } from "../types/async.js";
8
- import { Result } from "../types/fp.js";
9
- /**
10
- * Get invoice preview using meter_usage data
11
- *
12
- * @remarks
13
- * Preview invoice using the meter_usage table for usage data instead of feature_usage.
14
- */
15
- export declare function invoicesGetMeterUsagePreviewInvoice(client$: FlexpriceCore, request: GetPreviewInvoiceRequest, options?: RequestOptions): APIPromise<Result<Response, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
16
- //# sourceMappingURL=invoicesGetMeterUsagePreviewInvoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoicesGetMeterUsagePreviewInvoice.d.ts","sourceRoot":"","sources":["../../src/funcs/invoicesGetMeterUsagePreviewInvoice.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,wBAAwB,EAEzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,wBAAwB,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,QAAQ,EACN,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}