@flexprice/mcp-server 2.0.12 → 2.0.14

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 (64) hide show
  1. package/bin/mcp-server.js +219 -127
  2. package/bin/mcp-server.js.map +16 -15
  3. package/bun.lock +17 -17
  4. package/esm/lib/config.d.ts +3 -3
  5. package/esm/lib/config.js +3 -3
  6. package/esm/lib/config.js.map +1 -1
  7. package/esm/lib/security.d.ts +1 -1
  8. package/esm/lib/security.d.ts.map +1 -1
  9. package/esm/lib/security.js +19 -8
  10. package/esm/lib/security.js.map +1 -1
  11. package/esm/mcp-server/mcp-server.js +1 -1
  12. package/esm/mcp-server/server.js +1 -1
  13. package/esm/models/addonassociationentitytype.d.ts +1 -1
  14. package/esm/models/dtocreatecustomerrequest.d.ts +0 -2
  15. package/esm/models/dtocreatecustomerrequest.d.ts.map +1 -1
  16. package/esm/models/dtocreatecustomerrequest.js +0 -3
  17. package/esm/models/dtocreatecustomerrequest.js.map +1 -1
  18. package/esm/models/dtocustomerresponse.d.ts +2 -0
  19. package/esm/models/dtocustomerresponse.d.ts.map +1 -1
  20. package/esm/models/dtocustomerresponse.js +3 -0
  21. package/esm/models/dtocustomerresponse.js.map +1 -1
  22. package/esm/models/dtoentitlementsourceentitytype.d.ts +1 -1
  23. package/esm/models/dtoentityintegrationmappingresponse.d.ts +19 -0
  24. package/esm/models/dtoentityintegrationmappingresponse.d.ts.map +1 -0
  25. package/esm/models/dtoentityintegrationmappingresponse.js +21 -0
  26. package/esm/models/dtoentityintegrationmappingresponse.js.map +1 -0
  27. package/esm/models/dtoinvoiceresponse.d.ts +1 -0
  28. package/esm/models/dtoinvoiceresponse.d.ts.map +1 -1
  29. package/esm/models/dtoinvoiceresponse.js +1 -0
  30. package/esm/models/dtoinvoiceresponse.js.map +1 -1
  31. package/esm/models/dtoupdatecustomerrequest.d.ts +0 -2
  32. package/esm/models/dtoupdatecustomerrequest.d.ts.map +1 -1
  33. package/esm/models/dtoupdatecustomerrequest.js +0 -3
  34. package/esm/models/dtoupdatecustomerrequest.js.map +1 -1
  35. package/esm/models/groupentitytype.d.ts +1 -1
  36. package/esm/models/integrationentitytype.d.ts +28 -0
  37. package/esm/models/integrationentitytype.d.ts.map +1 -0
  38. package/esm/models/integrationentitytype.js +29 -0
  39. package/esm/models/integrationentitytype.js.map +1 -0
  40. package/esm/models/invoicestatus.d.ts +2 -0
  41. package/esm/models/invoicestatus.d.ts.map +1 -1
  42. package/esm/models/invoicestatus.js +2 -0
  43. package/esm/models/invoicestatus.js.map +1 -1
  44. package/esm/models/subscriptionlineitementitytype.d.ts +1 -1
  45. package/esm/models/taxrateentitytype.d.ts +1 -1
  46. package/esm/tsconfig.tsbuildinfo +1 -1
  47. package/manifest.json +1 -1
  48. package/package.json +1 -1
  49. package/src/lib/config.ts +3 -3
  50. package/src/lib/security.ts +14 -2
  51. package/src/mcp-server/mcp-server.ts +1 -1
  52. package/src/mcp-server/server.ts +1 -1
  53. package/src/models/dtocreatecustomerrequest.ts +0 -9
  54. package/src/models/dtocustomerresponse.ts +7 -0
  55. package/src/models/dtoentityintegrationmappingresponse.ts +42 -0
  56. package/src/models/dtoinvoiceresponse.ts +4 -0
  57. package/src/models/dtoupdatecustomerrequest.ts +0 -9
  58. package/src/models/integrationentitytype.ts +33 -0
  59. package/src/models/invoicestatus.ts +2 -0
  60. package/esm/models/dtointegrationentitymapping.d.ts +0 -28
  61. package/esm/models/dtointegrationentitymapping.d.ts.map +0 -1
  62. package/esm/models/dtointegrationentitymapping.js +0 -22
  63. package/esm/models/dtointegrationentitymapping.js.map +0 -1
  64. package/src/models/dtointegrationentitymapping.ts +0 -41
package/manifest.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "sensitive": true
49
49
  }
50
50
  },
51
- "version": "2.0.12",
51
+ "version": "2.0.14",
52
52
  "tools": [
53
53
  {
54
54
  "name": "update-customer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/mcp-server",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
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.0.12",
73
- genVersion: "2.869.23",
72
+ sdkVersion: "2.0.14",
73
+ genVersion: "2.879.1",
74
74
  userAgent:
75
- "speakeasy-sdk/mcp-typescript 2.0.12 2.869.23 1.0 @flexprice/mcp-server",
75
+ "speakeasy-sdk/mcp-typescript 2.0.14 2.879.1 1.0 @flexprice/mcp-server",
76
76
  } as const;
@@ -239,8 +239,9 @@ function applyBearer(
239
239
  }
240
240
  export function resolveGlobalSecurity(
241
241
  security: Partial<Security> | null | undefined,
242
+ allowedFields?: number[],
242
243
  ): SecurityState | null {
243
- return resolveSecurity(
244
+ let inputs: SecurityInput[][] = [
244
245
  [
245
246
  {
246
247
  fieldName: "x-api-key",
@@ -248,7 +249,18 @@ export function resolveGlobalSecurity(
248
249
  value: security?.ApiKeyAuth,
249
250
  },
250
251
  ],
251
- );
252
+ ];
253
+
254
+ if (allowedFields) {
255
+ inputs = allowedFields.map((i) => {
256
+ if (i < 0 || i >= inputs.length) {
257
+ throw new RangeError(`invalid allowedFields index ${i}`);
258
+ }
259
+ return inputs[i]!;
260
+ });
261
+ }
262
+
263
+ return resolveSecurity(...inputs);
252
264
  }
253
265
 
254
266
  export async function extractSecurity<
@@ -21,7 +21,7 @@ const routes = buildRouteMap({
21
21
  export const app = buildApplication(routes, {
22
22
  name: "mcp",
23
23
  versionInfo: {
24
- currentVersion: "2.0.12",
24
+ currentVersion: "2.0.14",
25
25
  },
26
26
  });
27
27
 
@@ -101,7 +101,7 @@ export function createMCPServer(deps: {
101
101
  }) {
102
102
  const server = new McpServer({
103
103
  name: "Flexprice",
104
- version: "2.0.12",
104
+ version: "2.0.14",
105
105
  });
106
106
 
107
107
  const getClient = deps.getSDK || (() =>
@@ -3,10 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import {
7
- DtoIntegrationEntityMapping,
8
- DtoIntegrationEntityMapping$zodSchema,
9
- } from "./dtointegrationentitymapping.js";
10
6
  import {
11
7
  DtoTaxRateOverride,
12
8
  DtoTaxRateOverride$zodSchema,
@@ -24,7 +20,6 @@ export type DtoCreateCustomerRequest = {
24
20
  address_state?: string | undefined;
25
21
  email?: string | undefined;
26
22
  external_id: string;
27
- integration_entity_mapping?: Array<DtoIntegrationEntityMapping> | undefined;
28
23
  metadata?: { [k: string]: string } | undefined;
29
24
  name?: string | undefined;
30
25
  parent_customer_external_id?: string | undefined;
@@ -60,10 +55,6 @@ export const DtoCreateCustomerRequest$zodSchema: z.ZodType<
60
55
  external_id: z.string().describe(
61
56
  "external_id is the unique identifier from your system to reference this customer (required)",
62
57
  ),
63
- integration_entity_mapping: z.array(DtoIntegrationEntityMapping$zodSchema)
64
- .optional().describe(
65
- "integration_entity_mapping contains provider integration mappings for this customer",
66
- ),
67
58
  metadata: z.record(z.string(), z.string()).optional().describe(
68
59
  "metadata contains additional key-value pairs for storing extra information",
69
60
  ),
@@ -3,6 +3,10 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import {
7
+ DtoEntityIntegrationMappingResponse,
8
+ DtoEntityIntegrationMappingResponse$zodSchema,
9
+ } from "./dtoentityintegrationmappingresponse.js";
6
10
  import { Status, Status$zodSchema } from "./status.js";
7
11
 
8
12
  /**
@@ -21,6 +25,7 @@ export type DtoCustomerResponse = {
21
25
  environment_id?: string | undefined;
22
26
  external_id?: string | undefined;
23
27
  id?: string | undefined;
28
+ integrations?: Array<DtoEntityIntegrationMappingResponse> | undefined;
24
29
  metadata?: { [k: string]: string } | undefined;
25
30
  name?: string | undefined;
26
31
  parent_customer?: DtoCustomerResponse | undefined;
@@ -63,6 +68,8 @@ export const DtoCustomerResponse$zodSchema: z.ZodType<DtoCustomerResponse> = z
63
68
  id: z.string().optional().describe(
64
69
  "ID is the unique identifier for the customer",
65
70
  ),
71
+ integrations: z.array(DtoEntityIntegrationMappingResponse$zodSchema)
72
+ .optional(),
66
73
  metadata: z.record(z.string(), z.string()).optional().describe("Metadata"),
67
74
  name: z.string().optional().describe("Name is the name of the customer"),
68
75
  parent_customer: z.lazy(() => DtoCustomerResponse$zodSchema).optional()
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ IntegrationEntityType,
8
+ IntegrationEntityType$zodSchema,
9
+ } from "./integrationentitytype.js";
10
+ import { Status, Status$zodSchema } from "./status.js";
11
+
12
+ export type DtoEntityIntegrationMappingResponse = {
13
+ created_at?: string | undefined;
14
+ created_by?: string | undefined;
15
+ entity_id?: string | undefined;
16
+ entity_type?: IntegrationEntityType | undefined;
17
+ environment_id?: string | undefined;
18
+ id?: string | undefined;
19
+ provider_entity_id?: string | undefined;
20
+ provider_type?: string | undefined;
21
+ status?: Status | undefined;
22
+ tenant_id?: string | undefined;
23
+ updated_at?: string | undefined;
24
+ updated_by?: string | undefined;
25
+ };
26
+
27
+ export const DtoEntityIntegrationMappingResponse$zodSchema: z.ZodType<
28
+ DtoEntityIntegrationMappingResponse
29
+ > = z.object({
30
+ created_at: z.string().optional(),
31
+ created_by: z.string().optional(),
32
+ entity_id: z.string().optional(),
33
+ entity_type: IntegrationEntityType$zodSchema.optional(),
34
+ environment_id: z.string().optional(),
35
+ id: z.string().optional(),
36
+ provider_entity_id: z.string().optional(),
37
+ provider_type: z.string().optional(),
38
+ status: Status$zodSchema.optional(),
39
+ tenant_id: z.string().optional(),
40
+ updated_at: z.string().optional(),
41
+ updated_by: z.string().optional(),
42
+ });
@@ -52,6 +52,7 @@ export type DtoInvoiceResponse = {
52
52
  invoice_pdf_url?: string | undefined;
53
53
  invoice_status?: InvoiceStatus | undefined;
54
54
  invoice_type?: InvoiceType | undefined;
55
+ last_computed_at?: string | undefined;
55
56
  line_items?: Array<DtoInvoiceLineItemResponse> | undefined;
56
57
  metadata?: { [k: string]: string } | undefined;
57
58
  overpaid_amount?: string | undefined;
@@ -141,6 +142,9 @@ export const DtoInvoiceResponse$zodSchema: z.ZodType<DtoInvoiceResponse> = z
141
142
  ),
142
143
  invoice_status: InvoiceStatus$zodSchema.optional(),
143
144
  invoice_type: InvoiceType$zodSchema.optional(),
145
+ last_computed_at: z.string().optional().describe(
146
+ "last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice",
147
+ ),
144
148
  line_items: z.array(DtoInvoiceLineItemResponse$zodSchema).optional()
145
149
  .describe(
146
150
  "line_items contains the individual items that make up this invoice (overrides embedded field)",
@@ -3,10 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import {
7
- DtoIntegrationEntityMapping,
8
- DtoIntegrationEntityMapping$zodSchema,
9
- } from "./dtointegrationentitymapping.js";
10
6
 
11
7
  /**
12
8
  * Request object for updating an existing customer. All fields are optional - only provided fields will be updated
@@ -20,7 +16,6 @@ export type DtoUpdateCustomerRequest = {
20
16
  address_state?: string | undefined;
21
17
  email?: string | undefined;
22
18
  external_id?: string | undefined;
23
- integration_entity_mapping?: Array<DtoIntegrationEntityMapping> | undefined;
24
19
  metadata?: { [k: string]: string } | undefined;
25
20
  name?: string | undefined;
26
21
  parent_customer_external_id?: string | undefined;
@@ -54,10 +49,6 @@ export const DtoUpdateCustomerRequest$zodSchema: z.ZodType<
54
49
  external_id: z.string().optional().describe(
55
50
  "external_id is the updated external identifier for the customer",
56
51
  ),
57
- integration_entity_mapping: z.array(DtoIntegrationEntityMapping$zodSchema)
58
- .optional().describe(
59
- "integration_entity_mapping contains provider integration mappings for this customer",
60
- ),
61
52
  metadata: z.record(z.string(), z.string()).optional().describe(
62
53
  "metadata contains updated key-value pairs that will replace existing metadata",
63
54
  ),
@@ -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 { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const IntegrationEntityType = {
9
+ Customer: "customer",
10
+ Plan: "plan",
11
+ Invoice: "invoice",
12
+ Subscription: "subscription",
13
+ Payment: "payment",
14
+ CreditNote: "credit_note",
15
+ Addon: "addon",
16
+ Item: "item",
17
+ ItemPrice: "item_price",
18
+ Price: "price",
19
+ } as const;
20
+ export type IntegrationEntityType = ClosedEnum<typeof IntegrationEntityType>;
21
+
22
+ export const IntegrationEntityType$zodSchema = z.enum([
23
+ "customer",
24
+ "plan",
25
+ "invoice",
26
+ "subscription",
27
+ "payment",
28
+ "credit_note",
29
+ "addon",
30
+ "item",
31
+ "item_price",
32
+ "price",
33
+ ]);
@@ -9,6 +9,7 @@ export const InvoiceStatus = {
9
9
  Draft: "DRAFT",
10
10
  Finalized: "FINALIZED",
11
11
  Voided: "VOIDED",
12
+ Skipped: "SKIPPED",
12
13
  } as const;
13
14
  export type InvoiceStatus = ClosedEnum<typeof InvoiceStatus>;
14
15
 
@@ -16,4 +17,5 @@ export const InvoiceStatus$zodSchema = z.enum([
16
17
  "DRAFT",
17
18
  "FINALIZED",
18
19
  "VOIDED",
20
+ "SKIPPED",
19
21
  ]);
@@ -1,28 +0,0 @@
1
- import * as z from "zod";
2
- import { ClosedEnum } from "../types/enums.js";
3
- /**
4
- * provider is the integration provider name (e.g., "stripe", "razorpay")
5
- */
6
- export declare const Provider: {
7
- readonly Stripe: "stripe";
8
- readonly Razorpay: "razorpay";
9
- readonly Paypal: "paypal";
10
- };
11
- /**
12
- * provider is the integration provider name (e.g., "stripe", "razorpay")
13
- */
14
- export type Provider = ClosedEnum<typeof Provider>;
15
- export declare const Provider$zodSchema: z.ZodEnum<{
16
- stripe: "stripe";
17
- razorpay: "razorpay";
18
- paypal: "paypal";
19
- }>;
20
- /**
21
- * Integration entity mapping for external provider systems
22
- */
23
- export type DtoIntegrationEntityMapping = {
24
- id: string;
25
- provider: Provider;
26
- };
27
- export declare const DtoIntegrationEntityMapping$zodSchema: z.ZodType<DtoIntegrationEntityMapping>;
28
- //# sourceMappingURL=dtointegrationentitymapping.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dtointegrationentitymapping.d.ts","sourceRoot":"","sources":["../../src/models/dtointegrationentitymapping.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;;EAM9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE7E,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAC3D,2BAA2B,CAM0C,CAAC"}
@@ -1,22 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import * as z from "zod";
5
- /**
6
- * provider is the integration provider name (e.g., "stripe", "razorpay")
7
- */
8
- export const Provider = {
9
- Stripe: "stripe",
10
- Razorpay: "razorpay",
11
- Paypal: "paypal",
12
- };
13
- export const Provider$zodSchema = z.enum([
14
- "stripe",
15
- "razorpay",
16
- "paypal",
17
- ]).describe("provider is the integration provider name (e.g., \"stripe\", \"razorpay\")");
18
- export const DtoIntegrationEntityMapping$zodSchema = z.object({
19
- id: z.string().describe("id is the external entity ID from the provider"),
20
- provider: Provider$zodSchema.describe("provider is the integration provider name (e.g., \"stripe\", \"razorpay\")"),
21
- }).describe("Integration entity mapping for external provider systems");
22
- //# sourceMappingURL=dtointegrationentitymapping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dtointegrationentitymapping.js","sourceRoot":"","sources":["../../src/models/dtointegrationentitymapping.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAMX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,QAAQ;IACR,UAAU;IACV,QAAQ;CACT,CAAC,CAAC,QAAQ,CACT,4EAA4E,CAC7E,CAAC;AAOF,MAAM,CAAC,MAAM,qCAAqC,GAE9C,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACzE,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CACnC,4EAA4E,CAC7E;CACF,CAAC,CAAC,QAAQ,CAAC,0DAA0D,CAAC,CAAC"}
@@ -1,41 +0,0 @@
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
- /**
9
- * provider is the integration provider name (e.g., "stripe", "razorpay")
10
- */
11
- export const Provider = {
12
- Stripe: "stripe",
13
- Razorpay: "razorpay",
14
- Paypal: "paypal",
15
- } as const;
16
- /**
17
- * provider is the integration provider name (e.g., "stripe", "razorpay")
18
- */
19
- export type Provider = ClosedEnum<typeof Provider>;
20
-
21
- export const Provider$zodSchema = z.enum([
22
- "stripe",
23
- "razorpay",
24
- "paypal",
25
- ]).describe(
26
- "provider is the integration provider name (e.g., \"stripe\", \"razorpay\")",
27
- );
28
-
29
- /**
30
- * Integration entity mapping for external provider systems
31
- */
32
- export type DtoIntegrationEntityMapping = { id: string; provider: Provider };
33
-
34
- export const DtoIntegrationEntityMapping$zodSchema: z.ZodType<
35
- DtoIntegrationEntityMapping
36
- > = z.object({
37
- id: z.string().describe("id is the external entity ID from the provider"),
38
- provider: Provider$zodSchema.describe(
39
- "provider is the integration provider name (e.g., \"stripe\", \"razorpay\")",
40
- ),
41
- }).describe("Integration entity mapping for external provider systems");