@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
@@ -1,82 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import { encodeJSON } from "../lib/encodings.js";
5
- import { compactMap } from "../lib/primitives.js";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
8
- import { pathToFunc } from "../lib/url.js";
9
- import { GetPreviewInvoiceRequest$zodSchema, } from "../models/getpreviewinvoicerequest.js";
10
- import { APIPromise } from "../types/async.js";
11
- /**
12
- * Get invoice preview using meter_usage data
13
- *
14
- * @remarks
15
- * Preview invoice using the meter_usage table for usage data instead of feature_usage.
16
- */
17
- export function invoicesGetMeterUsagePreviewInvoice(client$, request, options) {
18
- return new APIPromise($do(client$, request, options));
19
- }
20
- async function $do(client$, request, options) {
21
- const parsed$ = safeParse(request, (value$) => GetPreviewInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
22
- if (!parsed$.ok) {
23
- return [parsed$, { status: "invalid" }];
24
- }
25
- const payload$ = parsed$.value;
26
- const body$ = encodeJSON("body", payload$, { explode: true });
27
- const path$ = pathToFunc("/invoices/meter-usage-preview")();
28
- const headers$ = new Headers(compactMap({
29
- "Content-Type": "application/json",
30
- Accept: "application/json",
31
- }));
32
- const securityInput = await extractSecurity(client$._options.security);
33
- const requestSecurity = resolveGlobalSecurity(securityInput);
34
- const context = {
35
- options: client$._options,
36
- baseURL: options?.serverURL ?? client$._baseURL ?? "",
37
- operationID: "getMeterUsagePreviewInvoice",
38
- oAuth2Scopes: null,
39
- resolvedSecurity: requestSecurity,
40
- securitySource: client$._options.security,
41
- retryConfig: options?.retries
42
- || client$._options.retryConfig
43
- || { strategy: "none" },
44
- retryCodes: options?.retryCodes || [
45
- "429",
46
- "500",
47
- "502",
48
- "503",
49
- "504",
50
- ],
51
- };
52
- const requestRes = client$._createRequest(context, {
53
- security: requestSecurity,
54
- method: "POST",
55
- baseURL: options?.serverURL,
56
- path: path$,
57
- headers: headers$,
58
- body: body$,
59
- userAgent: client$._options.userAgent,
60
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs
61
- || -1,
62
- }, options);
63
- if (!requestRes.ok) {
64
- return [requestRes, { status: "invalid" }];
65
- }
66
- const req$ = requestRes.value;
67
- const doResult = await client$._do(req$, {
68
- context,
69
- errorCodes: [],
70
- retryConfig: context.retryConfig,
71
- retryCodes: context.retryCodes,
72
- });
73
- if (!doResult.ok) {
74
- return [doResult, { status: "request-error", request: req$ }];
75
- }
76
- return [doResult, {
77
- status: "complete",
78
- "request": req$,
79
- response: doResult.value,
80
- }];
81
- }
82
- //# sourceMappingURL=invoicesGetMeterUsagePreviewInvoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoicesGetMeterUsagePreviewInvoice.js","sourceRoot":"","sources":["../../src/funcs/invoicesGetMeterUsagePreviewInvoice.ts"],"names":[],"mappings":"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"}
@@ -1,7 +0,0 @@
1
- import { ToolDefinition } from "../tools.js";
2
- declare const args: {
3
- request: import("zod").ZodType<import("../../models/getpreviewinvoicerequest.js").GetPreviewInvoiceRequest, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../models/getpreviewinvoicerequest.js").GetPreviewInvoiceRequest, unknown>>;
4
- };
5
- export declare const tool$invoicesGetMeterUsagePreviewInvoice: ToolDefinition<typeof args>;
6
- export {};
7
- //# sourceMappingURL=invoicesGetMeterUsagePreviewInvoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoicesGetMeterUsagePreviewInvoice.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAIT,CAAC;AAEF,eAAO,MAAM,wCAAwC,EAAE,cAAc,CACnE,OAAO,IAAI,CA+BZ,CAAC"}
@@ -1,35 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import { invoicesGetMeterUsagePreviewInvoice } from "../../funcs/invoicesGetMeterUsagePreviewInvoice.js";
5
- import { GetPreviewInvoiceRequest$zodSchema } from "../../models/getpreviewinvoicerequest.js";
6
- import { formatResult } from "../tools.js";
7
- const args = {
8
- request: GetPreviewInvoiceRequest$zodSchema.describe(`Preview Invoice Request`),
9
- };
10
- export const tool$invoicesGetMeterUsagePreviewInvoice = {
11
- name: "get-meter-usage-preview-invoice",
12
- description: `Get invoice preview using meter_usage data
13
-
14
- Preview invoice using the meter_usage table for usage data instead of feature_usage.`,
15
- scopes: ["write"],
16
- annotations: {
17
- "title": "",
18
- "destructiveHint": false,
19
- "idempotentHint": false,
20
- "openWorldHint": false,
21
- "readOnlyHint": false,
22
- },
23
- args,
24
- tool: async (client, args, ctx) => {
25
- const [result] = await invoicesGetMeterUsagePreviewInvoice(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
26
- if (!result.ok) {
27
- return {
28
- content: [{ type: "text", text: result.error.message }],
29
- isError: true,
30
- };
31
- }
32
- return formatResult(result.value);
33
- },
34
- };
35
- //# sourceMappingURL=invoicesGetMeterUsagePreviewInvoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoicesGetMeterUsagePreviewInvoice.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mCAAmC,EAAE,MAAM,oDAAoD,CAAC;AACzG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,kCAAkC,CAAC,QAAQ,CAClD,yBAAyB,CAC1B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wCAAwC,GAEjD;IACF,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE;;qFAEsE;IACnF,MAAM,EAAE,CAAC,OAAO,CAAC;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,EAAE;QACX,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,KAAK;QACvB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;KACtB;IACD,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,mCAAmC,CACxD,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF,CAAC"}
@@ -1,6 +0,0 @@
1
- import * as z from "zod";
2
- import { ErrorResponse } from "./errorresponse.js";
3
- import { InvoiceResponse } from "./invoiceresponse.js";
4
- export type GetMeterUsagePreviewInvoiceResponse = InvoiceResponse | ErrorResponse;
5
- export declare const GetMeterUsagePreviewInvoiceResponse$zodSchema: z.ZodType<GetMeterUsagePreviewInvoiceResponse>;
6
- //# sourceMappingURL=getmeterusagepreviewinvoiceop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getmeterusagepreviewinvoiceop.d.ts","sourceRoot":"","sources":["../../src/models/getmeterusagepreviewinvoiceop.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EACL,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,mCAAmC,GAC3C,eAAe,GACf,aAAa,CAAC;AAElB,eAAO,MAAM,6CAA6C,EAAE,CAAC,CAAC,OAAO,CACnE,mCAAmC,CAInC,CAAC"}
@@ -1,11 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import * as z from "zod";
5
- import { ErrorResponse$zodSchema } from "./errorresponse.js";
6
- import { InvoiceResponse$zodSchema, } from "./invoiceresponse.js";
7
- export const GetMeterUsagePreviewInvoiceResponse$zodSchema = z.union([
8
- InvoiceResponse$zodSchema,
9
- ErrorResponse$zodSchema,
10
- ]);
11
- //# sourceMappingURL=getmeterusagepreviewinvoiceop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getmeterusagepreviewinvoiceop.js","sourceRoot":"","sources":["../../src/models/getmeterusagepreviewinvoiceop.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAiB,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAM9B,MAAM,CAAC,MAAM,6CAA6C,GAEtD,CAAC,CAAC,KAAK,CAAC;IACV,yBAAyB;IACzB,uBAAuB;CACxB,CAAC,CAAC"}
@@ -1,144 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { FlexpriceCore } from "../core.js";
6
- import { encodeJSON } from "../lib/encodings.js";
7
- import { compactMap } from "../lib/primitives.js";
8
- import { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { APIError } from "../models/errors/apierror.js";
13
- import {
14
- ConnectionError,
15
- InvalidRequestError,
16
- RequestAbortedError,
17
- RequestTimeoutError,
18
- UnexpectedClientError,
19
- } from "../models/errors/httpclienterrors.js";
20
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
- import {
22
- GetPreviewInvoiceRequest,
23
- GetPreviewInvoiceRequest$zodSchema,
24
- } from "../models/getpreviewinvoicerequest.js";
25
- import { APICall, APIPromise } from "../types/async.js";
26
- import { Result } from "../types/fp.js";
27
-
28
- /**
29
- * Get invoice preview using meter_usage data
30
- *
31
- * @remarks
32
- * Preview invoice using the meter_usage table for usage data instead of feature_usage.
33
- */
34
- export function invoicesGetMeterUsagePreviewInvoice(
35
- client$: FlexpriceCore,
36
- request: GetPreviewInvoiceRequest,
37
- options?: RequestOptions,
38
- ): APIPromise<
39
- Result<
40
- Response,
41
- | APIError
42
- | SDKValidationError
43
- | UnexpectedClientError
44
- | InvalidRequestError
45
- | RequestAbortedError
46
- | RequestTimeoutError
47
- | ConnectionError
48
- >
49
- > {
50
- return new APIPromise($do(
51
- client$,
52
- request,
53
- options,
54
- ));
55
- }
56
-
57
- async function $do(
58
- client$: FlexpriceCore,
59
- request: GetPreviewInvoiceRequest,
60
- options?: RequestOptions,
61
- ): Promise<
62
- [
63
- Result<
64
- Response,
65
- | APIError
66
- | SDKValidationError
67
- | UnexpectedClientError
68
- | InvalidRequestError
69
- | RequestAbortedError
70
- | RequestTimeoutError
71
- | ConnectionError
72
- >,
73
- APICall,
74
- ]
75
- > {
76
- const parsed$ = safeParse(
77
- request,
78
- (value$) => GetPreviewInvoiceRequest$zodSchema.parse(value$),
79
- "Input validation failed",
80
- );
81
- if (!parsed$.ok) {
82
- return [parsed$, { status: "invalid" }];
83
- }
84
- const payload$ = parsed$.value;
85
- const body$ = encodeJSON("body", payload$, { explode: true });
86
- const path$ = pathToFunc("/invoices/meter-usage-preview")();
87
-
88
- const headers$ = new Headers(compactMap({
89
- "Content-Type": "application/json",
90
- Accept: "application/json",
91
- }));
92
- const securityInput = await extractSecurity(client$._options.security);
93
- const requestSecurity = resolveGlobalSecurity(securityInput);
94
-
95
- const context = {
96
- options: client$._options,
97
- baseURL: options?.serverURL ?? client$._baseURL ?? "",
98
- operationID: "getMeterUsagePreviewInvoice",
99
- oAuth2Scopes: null,
100
- resolvedSecurity: requestSecurity,
101
- securitySource: client$._options.security,
102
- retryConfig: options?.retries
103
- || client$._options.retryConfig
104
- || { strategy: "none" },
105
- retryCodes: options?.retryCodes || [
106
- "429",
107
- "500",
108
- "502",
109
- "503",
110
- "504",
111
- ],
112
- };
113
-
114
- const requestRes = client$._createRequest(context, {
115
- security: requestSecurity,
116
- method: "POST",
117
- baseURL: options?.serverURL,
118
- path: path$,
119
- headers: headers$,
120
- body: body$,
121
- userAgent: client$._options.userAgent,
122
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs
123
- || -1,
124
- }, options);
125
- if (!requestRes.ok) {
126
- return [requestRes, { status: "invalid" }];
127
- }
128
- const req$ = requestRes.value;
129
-
130
- const doResult = await client$._do(req$, {
131
- context,
132
- errorCodes: [],
133
- retryConfig: context.retryConfig,
134
- retryCodes: context.retryCodes,
135
- });
136
- if (!doResult.ok) {
137
- return [doResult, { status: "request-error", request: req$ }];
138
- }
139
- return [doResult, {
140
- status: "complete",
141
- "request": req$,
142
- response: doResult.value,
143
- }];
144
- }
@@ -1,47 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { invoicesGetMeterUsagePreviewInvoice } from "../../funcs/invoicesGetMeterUsagePreviewInvoice.js";
6
- import { GetPreviewInvoiceRequest$zodSchema } from "../../models/getpreviewinvoicerequest.js";
7
- import { formatResult, ToolDefinition } from "../tools.js";
8
-
9
- const args = {
10
- request: GetPreviewInvoiceRequest$zodSchema.describe(
11
- `Preview Invoice Request`,
12
- ),
13
- };
14
-
15
- export const tool$invoicesGetMeterUsagePreviewInvoice: ToolDefinition<
16
- typeof args
17
- > = {
18
- name: "get-meter-usage-preview-invoice",
19
- description: `Get invoice preview using meter_usage data
20
-
21
- Preview invoice using the meter_usage table for usage data instead of feature_usage.`,
22
- scopes: ["write"],
23
- annotations: {
24
- "title": "",
25
- "destructiveHint": false,
26
- "idempotentHint": false,
27
- "openWorldHint": false,
28
- "readOnlyHint": false,
29
- },
30
- args,
31
- tool: async (client, args, ctx) => {
32
- const [result] = await invoicesGetMeterUsagePreviewInvoice(
33
- client,
34
- args.request,
35
- { fetchOptions: { signal: ctx.signal } },
36
- ).$inspect();
37
-
38
- if (!result.ok) {
39
- return {
40
- content: [{ type: "text", text: result.error.message }],
41
- isError: true,
42
- };
43
- }
44
-
45
- return formatResult(result.value);
46
- },
47
- };
@@ -1,21 +0,0 @@
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
- ]);