diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 8239114..3b9cdae 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal rmdir samples || true mkdir samples -npm install -npm install -g ts-node +npm install --ignore-scripts +npm install -g ts-node --ignore-scripts npm link npm link @speakeasyapi/code-samples TS_CONFIG_CONTENT=$(cat <", "operationId": "", "language": "php,", "code": ""}, {"path": "/root", "method": "", "operationId": "", "language": "unity,", "code": ""}]} + application/json: {"snippets": []} 4XX: - application/json: {"message": "", "status_code": 521235} + application/json: {"message": "", "status_code": 887801} default: parameters: query: @@ -143,5 +150,5 @@ examples: responses: 2XX: application/json: {"snippets": [{"path": "/pet/{id}", "method": "get", "operationId": "getPetById", "language": "typescript", "code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}]} -examplesVersion: 1.0.0 +examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8d48545..0b805af 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -7,17 +7,28 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false securityFeb2025: false + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false typescript: - version: 2.4.0-beta + version: 2.4.0-beta.1 + acceptHeaderEnum: true additionalDependencies: dependencies: '@emotion/css': ^11.13.5 @@ -27,15 +38,22 @@ typescript: '@types/react': ^18.3.18 peerDependencies: {} additionalPackageJSON: {} + additionalScripts: {} + alwaysIncludeInboundAndOutbound: false author: Speakeasy + baseErrorName: SpeakeasyCodeSamplesError clientServerStatusCodesAsErrors: true + constFieldsAlwaysOptional: true defaultErrorName: APIError enableCustomCodeRegions: false enableMCPServer: true enableReactQuery: true enumFormat: union + exportZodModelNamespace: false flattenGlobalSecurity: true flatteningOrder: body-first + forwardCompatibleEnumsByDefault: false + generateExamples: true imports: option: openapi paths: @@ -46,11 +64,17 @@ typescript: webhooks: models/webhooks inputModelSuffix: input jsonpath: legacy + laxMode: strict maxMethodParams: 1 methodArguments: require-security-and-request + modelPropertyCasing: camel moduleFormat: esm outputModelSuffix: output packageName: '@speakeasyapi/code-samples' responseFormat: flat + sseFlatResponse: false templateVersion: v2 + unionStrategy: left-to-right + usageSDKInitImports: [] useIndexModules: true + zodVersion: v3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 191051e..0dd658b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.514.0 +speakeasyVersion: 1.660.0 sources: speakeasy-OAS: sourceNamespace: speakeasy-oas - sourceRevisionDigest: sha256:c95b7bde7a889f8d6461e405347f2dac28defaaf6a36cc19709b4ce29f4eaefb - sourceBlobDigest: sha256:706c912b2e5755fdaff8d2a95ca3ce6fb1fff777a7aa49a8afcb0b909cc22892 + sourceRevisionDigest: sha256:6b8652973fd0a9bf346a3af06472bc616830e9e3c881a0f583f3bfd12979591a + sourceBlobDigest: sha256:63f67500135f962b2c56c1d0664fef7f7d040d733c89169633eae8ec2f9d1b85 tags: - latest - - speakeasy-sdk-regen-1741642416 + - speakeasy-sdk-regen-1746489958 - 0.4.0 targets: code_samples_typescript_sdk: source: speakeasy-OAS sourceNamespace: speakeasy-oas - sourceRevisionDigest: sha256:c95b7bde7a889f8d6461e405347f2dac28defaaf6a36cc19709b4ce29f4eaefb - sourceBlobDigest: sha256:706c912b2e5755fdaff8d2a95ca3ce6fb1fff777a7aa49a8afcb0b909cc22892 + sourceRevisionDigest: sha256:6b8652973fd0a9bf346a3af06472bc616830e9e3c881a0f583f3bfd12979591a + sourceBlobDigest: sha256:63f67500135f962b2c56c1d0664fef7f7d040d733c89169633eae8ec2f9d1b85 codeSamplesNamespace: speakeasy-oas-typescript-code-samples - codeSamplesRevisionDigest: sha256:73a780b60ccc00d5344b505208070173d62dfcb9013e97f8f123e322230d6afe + codeSamplesRevisionDigest: sha256:b1dd14a70682337921089bf92025cbdb2a0175f13250e07d113bb9aa979db52a workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/FUNCTIONS.md b/FUNCTIONS.md index e65b4a7..effd358 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -21,20 +21,24 @@ specific category of applications. ```typescript import { SpeakeasyCodeSamplesCore } from "@speakeasyapi/code-samples/core.js"; import { codeSamplesGet } from "@speakeasyapi/code-samples/funcs/codeSamplesGet.js"; -import { SDKValidationError } from "@speakeasyapi/code-samples/models/errors/sdkvalidationerror.js"; // Use `SpeakeasyCodeSamplesCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const res = await codeSamplesGet(speakeasyCodeSamples, { - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -47,28 +51,12 @@ async function run() { "javascript", ], }); - - switch (true) { - case res.ok: - // The success case will be handled outside of the switch block - break; - case res.error instanceof SDKValidationError: - // Pretty-print validation errors. - return console.log(res.error.pretty()); - case res.error instanceof Error: - return console.log(res.error); - default: - // TypeScript's type checking will fail on the following line if the above - // cases were not exhaustive. - res.error satisfies never; - throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("codeSamplesGet failed:", res.error); } - - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); diff --git a/REACT_QUERY.md b/REACT_QUERY.md index 5e40ddb..f257693 100644 --- a/REACT_QUERY.md +++ b/REACT_QUERY.md @@ -23,8 +23,8 @@ import { SpeakeasyCodeSamplesProvider } from "@speakeasyapi/code-samples/react-q const queryClient = new QueryClient(); const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); // Retries are handled by the underlying SDK. @@ -55,9 +55,14 @@ import { useCodeSamples } from "@speakeasyapi/code-samples/react-query/codeSampl export function Example() { const { data, error, status } = useCodeSamples({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -88,9 +93,14 @@ export function ExampleWithOptions() { const [enabled, setEnabled] = useState(true); const { data, error, status } = useCodeSamples( { - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -189,8 +199,8 @@ import { useCodeSamplesSuspense } from "@speakeasyapi/code-samples/react-query/c const queryClient = new QueryClient(); const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); export function App() { @@ -222,9 +232,14 @@ export function App() { function Example() { const { data } = useCodeSamplesSuspense({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -261,14 +276,19 @@ import { prefetchCodeSamples } from "@speakeasyapi/code-samples/react-query/code export default async function Page() { const queryClient = new QueryClient(); const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); await prefetchCodeSamples(queryClient, speakeasyCodeSamples, { - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { diff --git a/README.md b/README.md index 6fca927..85c3707 100644 --- a/README.md +++ b/README.md @@ -86,12 +86,9 @@ bun add @tanstack/react-query react react-dom ### Yarn ```bash -yarn add @speakeasyapi/code-samples zod +yarn add @speakeasyapi/code-samples # Install optional peer dependencies if you plan to use React hooks yarn add @tanstack/react-query react react-dom - -# Note that Yarn does not install peer dependencies automatically. You will need -# to install zod as shown above. ``` > [!NOTE] @@ -103,7 +100,7 @@ yarn add @tanstack/react-query react react-dom This SDK is also an installable MCP server where the various SDK methods are exposed as tools that can be invoked by AI applications. -> Node.js v20 or greater is required to run the MCP server. +> Node.js v20 or greater is required to run the MCP server from npm.
Claude installation steps @@ -132,17 +129,51 @@ Add the following server definition to your `claude_desktop_config.json` file:
Cursor installation steps -Go to `Cursor Settings > Features > MCP Servers > Add new MCP server` and use the following settings: +Create a `.cursor/mcp.json` file in your project root with the following content: -- Name: SpeakeasyCodeSamples -- Type: `command` -- Command: -```sh -npx -y --package @speakeasyapi/code-samples -- mcp start --api-key ... --registry-url ... +```json +{ + "mcpServers": { + "SpeakeasyCodeSamples": { + "command": "npx", + "args": [ + "-y", "--package", "@speakeasyapi/code-samples", + "--", + "mcp", "start", + "--api-key", "...", + "--registry-url", "..." + ] + } + } +} ```
+You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases: + +```bash +curl -L -o mcp-server \ + https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \ +chmod +x mcp-server +``` + +If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`. + + +```json +{ + "mcpServers": { + "Todos": { + "command": "./DOWNLOAD/PATH/mcp-server", + "args": [ + "start" + ] + } + } +} +``` + For a full list of server arguments, run: ```sh @@ -165,15 +196,20 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -187,7 +223,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -249,14 +284,19 @@ import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -270,7 +310,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -289,7 +328,6 @@ run(); * [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets -
@@ -362,15 +400,20 @@ The following global parameter is available. import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -384,7 +427,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -403,15 +445,20 @@ To change the default retry strategy for a single API call, simply provide a ret import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -436,7 +483,6 @@ async function run() { }, }); - // Handle the result console.log(result); } @@ -459,15 +505,20 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({ }, retryConnectionErrors: false, }, + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -481,7 +532,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -493,34 +543,38 @@ run(); ## Error Handling -Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `get` method may throw the following errors: +[`SpeakeasyCodeSamplesError`](./src/models/errors/speakeasycodesampleserror.ts) is the base class for all HTTP error responses. It has the following properties: -| Error Type | Status Code | Content Type | -| --------------- | ----------- | ---------------- | -| errors.ErrorT | 4XX | application/json | -| errors.APIError | 5XX | \*/\* | - -If the method throws an error and it is not captured by the known errors, it will default to throwing a `APIError`. +| Property | Type | Description | +| ------------------- | ---------- | --------------------------------------------------------------------------------------- | +| `error.message` | `string` | Error message | +| `error.statusCode` | `number` | HTTP response status code eg `404` | +| `error.headers` | `Headers` | HTTP response headers | +| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. | +| `error.rawResponse` | `Response` | Raw HTTP response | +| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | +### Example ```typescript import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; -import { - ErrorT, - SDKValidationError, -} from "@speakeasyapi/code-samples/models/errors"; +import * as errors from "@speakeasyapi/code-samples/models/errors"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { - let result; try { - result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", + const result = await speakeasyCodeSamples.codeSamples.get({ operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -534,26 +588,19 @@ async function run() { ], }); - // Handle the result console.log(result); - } catch (err) { - switch (true) { - // The server response does not match the expected SDK schema - case (err instanceof SDKValidationError): { - // Pretty-print will provide a human-readable multi-line error message - console.error(err.pretty()); - // Raw value may also be inspected - console.error(err.rawValue); - return; - } - case (err instanceof ErrorT): { - // Handle err.data$: ErrorTData - console.error(err); - return; - } - default: { - // Other errors such as network errors, see HTTPClientErrors for more details - throw err; + } catch (error) { + // The base class for HTTP error responses + if (error instanceof errors.SpeakeasyCodeSamplesError) { + console.log(error.message); + console.log(error.statusCode); + console.log(error.body); + console.log(error.headers); + + // Depending on the method different errors may be thrown + if (error instanceof errors.ErrorT) { + console.log(error.data$.message); // string + console.log(error.data$.statusCode); // number } } } @@ -563,17 +610,27 @@ run(); ``` -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging. +### Error Classes +**Primary errors:** +* [`SpeakeasyCodeSamplesError`](./src/models/errors/speakeasycodesampleserror.ts): The base class for HTTP error responses. + * [`ErrorT`](./src/models/errors/errort.ts): The `Status` type defines a logical error model. Status code `4XX`. + +
Less common errors (6) -In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module: +
-| HTTP Client Error | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | -| RequestAbortedError | HTTP request was aborted by the client | -| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | -| ConnectionError | HTTP client was unable to make a request to a server | -| InvalidRequestError | Any input used to create a request is invalid | -| UnexpectedClientError | Unrecognised or unexpected error | +**Network errors:** +* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server. +* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal. +* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client. +* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid. +* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error. + + +**Inherit from [`SpeakeasyCodeSamplesError`](./src/models/errors/speakeasycodesampleserror.ts)**: +* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string. + +
@@ -583,9 +640,9 @@ In some rare cases, the SDK can fail to get a response from the server or even m You can override the default server globally by passing a server name to the `server: keyof typeof ServerList` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: -| Name | Server | Description | -| ------ | ----------------------------------- | ----------- | -| `prod` | `https://api.prod.speakeasyapi.dev` | | +| Name | Server | Description | +| ------ | -------------------------------- | ----------- | +| `prod` | `https://api.prod.speakeasy.com` | | #### Example @@ -594,15 +651,20 @@ import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ server: "prod", + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -616,7 +678,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -631,16 +692,21 @@ The default server can also be overridden globally by passing a URL to the `serv import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ - serverURL: "https://api.prod.speakeasyapi.dev", + serverURL: "https://api.prod.speakeasy.com", + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -654,7 +720,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -708,7 +773,7 @@ httpClient.addHook("requestError", (error, request) => { console.groupEnd(); }); -const sdk = new SpeakeasyCodeSamples({ httpClient }); +const sdk = new SpeakeasyCodeSamples({ httpClient: httpClient }); ``` diff --git a/RELEASES.md b/RELEASES.md index fff18c7..ab231ed 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -132,4 +132,14 @@ Based on: ### Generated - [typescript v2.4.0-beta] . ### Releases -- [NPM v2.4.0-beta] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.4.0-beta - . \ No newline at end of file +- [NPM v2.4.0-beta] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.4.0-beta - . + +## 2025-11-22 00:05:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.660.0 (2.760.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v2.4.0-beta.1] . +### Releases +- [NPM v2.4.0-beta.1] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.4.0-beta.1 - . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md index db7ea94..27731c3 100644 --- a/RUNTIMES.md +++ b/RUNTIMES.md @@ -2,9 +2,9 @@ This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features: -* [Web Fetch API][web-fetch] -* [Web Streams API][web-streams] and in particular `ReadableStream` -* [Async iterables][async-iter] using `Symbol.asyncIterator` +- [Web Fetch API][web-fetch] +- [Web Streams API][web-streams] and in particular `ReadableStream` +- [Async iterables][async-iter] using `Symbol.asyncIterator` [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API @@ -25,7 +25,7 @@ Runtime environments that are explicitly supported are: The following `tsconfig.json` options are recommended for projects using this SDK in order to get static type support for features like async iterables, -streams and `fetch`-related APIs ([`for await...of`][for-await-of], +streams and `fetch`-related APIs ([`for await...of`][for-await-of], [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and so on): @@ -38,11 +38,11 @@ so on): { "compilerOptions": { "target": "es2020", // or higher - "lib": ["es2020", "dom", "dom.iterable"], + "lib": ["es2020", "dom", "dom.iterable"] } } ``` While `target` can be set to older ECMAScript versions, it may result in extra, unnecessary compatibility code being generated if you are not targeting old -runtimes. \ No newline at end of file +runtimes. diff --git a/USAGE.md b/USAGE.md index a1c602d..d2afa4c 100644 --- a/USAGE.md +++ b/USAGE.md @@ -3,15 +3,20 @@ import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -25,7 +30,6 @@ async function run() { ], }); - // Handle the result console.log(result); } diff --git a/docs/models/components/httpmethod.md b/docs/models/components/httpmethod.md index f3337e3..76b5b84 100644 --- a/docs/models/components/httpmethod.md +++ b/docs/models/components/httpmethod.md @@ -5,7 +5,7 @@ ```typescript import { HttpMethod } from "@speakeasyapi/code-samples/models/components"; -let value: HttpMethod = "delete"; +let value: HttpMethod = "options"; ``` ## Values diff --git a/docs/models/components/usagesnippet.md b/docs/models/components/usagesnippet.md index e502527..4b8abc2 100644 --- a/docs/models/components/usagesnippet.md +++ b/docs/models/components/usagesnippet.md @@ -6,7 +6,7 @@ import { UsageSnippet } from "@speakeasyapi/code-samples/models/components"; let value: UsageSnippet = { - path: "/usr/bin", + path: "/private/tmp", method: "", operationId: "", language: "", diff --git a/docs/models/components/usagesnippets.md b/docs/models/components/usagesnippets.md index 760eb5b..cdb1bc2 100644 --- a/docs/models/components/usagesnippets.md +++ b/docs/models/components/usagesnippets.md @@ -6,15 +6,7 @@ import { UsageSnippets } from "@speakeasyapi/code-samples/models/components"; let value: UsageSnippets = { - snippets: [ - { - path: "/root", - method: "", - operationId: "", - language: "", - code: "", - }, - ], + snippets: [], }; ``` diff --git a/docs/models/operations/getcodesamplesrequest.md b/docs/models/operations/getcodesamplesrequest.md index 6d84585..e1cb9b2 100644 --- a/docs/models/operations/getcodesamplesrequest.md +++ b/docs/models/operations/getcodesamplesrequest.md @@ -6,7 +6,6 @@ import { GetCodeSamplesRequest } from "@speakeasyapi/code-samples/models/operations"; let value: GetCodeSamplesRequest = { - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", operationIds: [ "getPets", ], diff --git a/docs/models/operations/methodpaths.md b/docs/models/operations/methodpaths.md index 33b4ea0..cc12614 100644 --- a/docs/models/operations/methodpaths.md +++ b/docs/models/operations/methodpaths.md @@ -6,8 +6,8 @@ import { MethodPaths } from "@speakeasyapi/code-samples/models/operations"; let value: MethodPaths = { - method: "delete", - path: "/opt/sbin", + method: "put", + path: "/rescue", }; ``` diff --git a/docs/sdks/codesamples/README.md b/docs/sdks/codesamples/README.md index 18f470d..b91cf4a 100644 --- a/docs/sdks/codesamples/README.md +++ b/docs/sdks/codesamples/README.md @@ -13,19 +13,25 @@ Retrieve usage snippets from an OpenAPI document stored in the registry. Support ### Example Usage + ```typescript import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const result = await speakeasyCodeSamples.codeSamples.get({ - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -39,7 +45,6 @@ async function run() { ], }); - // Handle the result console.log(result); } @@ -57,15 +62,20 @@ import { codeSamplesGet } from "@speakeasyapi/code-samples/funcs/codeSamplesGet. // Use `SpeakeasyCodeSamplesCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", apiKey: "", - registryUrl: "https://spec.speakeasy.com/org/ws/my-source", }); async function run() { const res = await codeSamplesGet(speakeasyCodeSamples, { - registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", operationIds: [ - "getPets", + "g", + "e", + "t", + "P", + "e", + "t", + "s", ], methodPaths: [ { @@ -78,15 +88,12 @@ async function run() { "javascript", ], }); - - if (!res.ok) { - throw res.error; + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("codeSamplesGet failed:", res.error); } - - const { value: result } = res; - - // Handle the result - console.log(result); } run(); diff --git a/docs/sdks/speakeasycodesamples/README.md b/docs/sdks/speakeasycodesamples/README.md deleted file mode 100644 index b1d2c6a..0000000 --- a/docs/sdks/speakeasycodesamples/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpeakeasyCodeSamples SDK - -## Overview - -Speakeasy Code Samples API: REST APIs for retrieving SDK usage snippets from the Speakeasy Code Samples API. - - -The Speakeasy Platform Documentation - - -### Available Operations diff --git a/eslint.config.mjs b/eslint.config.mjs index 3483f71..67bccfe 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,6 +11,7 @@ export default [ { rules: { "no-constant-condition": "off", + "no-useless-escape": "off", // Handled by typescript compiler "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-explicit-any": "off", diff --git a/examples/.env.template b/examples/.env.template new file mode 100644 index 0000000..0c15794 --- /dev/null +++ b/examples/.env.template @@ -0,0 +1,3 @@ +# @speakeasyapi/code-samples SDK Environment Variables +# Copy this file to .env and fill in your actual values +# DO NOT commit the .env file to version control diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..ce809dd --- /dev/null +++ b/examples/README.md @@ -0,0 +1,31 @@ +# @speakeasyapi/code-samples Examples + +This directory contains example scripts demonstrating how to use the @speakeasyapi/code-samples SDK. + +## Prerequisites + +- Node.js (v18 or higher) +- npm + +## Setup + +1. Copy `.env.template` to `.env`: + ```bash + cp .env.template .env + ``` + +2. Edit `.env` and add your actual credentials + +## Running the Examples + +To run an example file from the examples directory: + +```bash +npm run build && npx tsx example.ts +``` + +## Creating new examples + +Duplicate an existing example file, they won't be overwritten by the generation process. + + diff --git a/examples/codeSamplesGet.example.ts b/examples/codeSamplesGet.example.ts new file mode 100644 index 0000000..fd97bbd --- /dev/null +++ b/examples/codeSamplesGet.example.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import dotenv from "dotenv"; +dotenv.config(); +/** + * Example usage of the @speakeasyapi/code-samples SDK + * + * To run this example from the examples directory: + * npm run build && npx tsx codeSamplesGet.example.ts + */ + +import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples"; + +const speakeasyCodeSamples = new SpeakeasyCodeSamples({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", + apiKey: "", +}); + +async function main() { + const result = await speakeasyCodeSamples.codeSamples.get({ + operationIds: [ + "g", + "e", + "t", + "P", + "e", + "t", + "s", + ], + methodPaths: [ + { + method: "get", + path: "/pets", + }, + ], + languages: [ + "python", + "javascript", + ], + }); + + console.log(result); +} + +main().catch(console.error); diff --git a/examples/package-lock.json b/examples/package-lock.json new file mode 100644 index 0000000..db10632 --- /dev/null +++ b/examples/package-lock.json @@ -0,0 +1,640 @@ +{ + "name": "@speakeasyapi/code-samples-examples", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@speakeasyapi/code-samples-examples", + "version": "1.0.0", + "dependencies": { + "@speakeasyapi/code-samples": "file:.." + }, + "devDependencies": { + "@types/node": "^20.0.0", + "dotenv": "^16.4.5", + "tsx": "^4.19.2" + } + }, + "..": { + "name": "@speakeasyapi/code-samples", + "version": "2.4.0-beta.1", + "dependencies": { + "@emotion/css": "^11.13.5", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", + "codehike": "^1.0.4", + "motion": "^12.4.7", + "zod": "^3.25.0 || ^4.0.0" + }, + "bin": { + "mcp": "bin/mcp-server.js" + }, + "devDependencies": { + "@eslint/js": "^9.19.0", + "@stricli/core": "^1.1.1", + "@tanstack/react-query": "^5.61.4", + "@types/express": "^4.17.21", + "@types/react": "^18.3.18", + "bun": "1.2.17", + "bun-types": "1.2.17", + "eslint": "^9.19.0", + "express": "^4.21.2", + "globals": "^15.14.0", + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" + }, + "peerDependencies": { + "@tanstack/react-query": "^5", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" + }, + "peerDependenciesMeta": { + "@tanstack/react-query": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@speakeasyapi/code-samples": { + "resolved": "..", + "link": true + }, + "node_modules/@types/node": { + "version": "20.19.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.25.tgz", + "integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/tsx": { + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 0000000..732d2c7 --- /dev/null +++ b/examples/package.json @@ -0,0 +1,18 @@ +{ + "name": "@speakeasyapi/code-samples-examples", + "version": "1.0.0", + "private": true, + "scripts": { + "build:parent": "cd .. && npm i && npm run build && cd -", + "build:examples": "npm i", + "build": "npm run build:parent && npm run build:examples" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "dotenv": "^16.4.5", + "tsx": "^4.19.2" + }, + "dependencies": { + "@speakeasyapi/code-samples": "file:.." + } +} \ No newline at end of file diff --git a/jsr.json b/jsr.json index efa0e4a..1b39fc4 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@speakeasyapi/code-samples", - "version": "2.4.0-beta", + "version": "2.4.0-beta.1", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 8578f1f..1ea415d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,47 +1,42 @@ { "name": "@speakeasyapi/code-samples", - "version": "2.4.0-beta", + "version": "2.4.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@speakeasyapi/code-samples", - "version": "2.4.0-beta", + "version": "2.4.0-beta.1", "dependencies": { "@emotion/css": "^11.13.5", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", "codehike": "^1.0.4", - "motion": "^12.4.7" + "motion": "^12.4.7", + "zod": "^3.25.0 || ^4.0.0" }, "bin": { "mcp": "bin/mcp-server.js" }, "devDependencies": { "@eslint/js": "^9.19.0", - "@modelcontextprotocol/sdk": "^1.5.0", "@stricli/core": "^1.1.1", "@tanstack/react-query": "^5.61.4", "@types/express": "^4.17.21", "@types/react": "^18.3.18", - "bun": "^1.2.2", - "bun-types": "^1.2.2", + "bun": "1.2.17", + "bun-types": "1.2.17", "eslint": "^9.19.0", "express": "^4.21.2", "globals": "^15.14.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "zod": "^3.23.4" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "peerDependencies": { - "@modelcontextprotocol/sdk": "^1.5.0", "@tanstack/react-query": "^5", "react": "^18 || ^19", - "react-dom": "^18 || ^19", - "zod": ">= 3" + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { - "@modelcontextprotocol/sdk": { - "optional": true - }, "@tanstack/react-query": { "optional": true }, @@ -302,9 +297,9 @@ "license": "MIT" }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", - "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -595,7 +590,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.6.0.tgz", "integrity": "sha512-585s8g+jzuGBomzgzDeP5l8gEyiSs+KhoAHbA2ZZ24Zgm83IZsyCLl/fmWhPHbfYsuLG8NE6SWGZA5ZBql8jSw==", - "dev": true, "license": "MIT", "dependencies": { "content-type": "^1.0.5", @@ -616,7 +610,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", - "dev": true, "license": "MIT", "dependencies": { "mime-types": "^3.0.0", @@ -630,7 +623,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.1.0.tgz", "integrity": "sha512-/hPxh61E+ll0Ujp24Ilm64cykicul1ypfwjVttduAiEdtnJFvLePSrIPk+HMImtNv5270wOGCb1Tns2rybMkoQ==", - "dev": true, "license": "MIT", "dependencies": { "bytes": "^3.1.2", @@ -651,7 +643,6 @@ "version": "6.14.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" @@ -667,7 +658,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", - "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" @@ -680,7 +670,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.6.0" @@ -690,7 +679,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/express/-/express-5.0.1.tgz", "integrity": "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ==", - "dev": true, "license": "MIT", "dependencies": { "accepts": "^2.0.0", @@ -734,7 +722,6 @@ "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -752,14 +739,12 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, "license": "MIT" }, "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.0.0.tgz", "integrity": "sha512-MX6Zo2adDViYh+GcxxB1dpO43eypOGUOL12rLCOTMQv/DfIbpSJUy4oQIIZhVZkH9e+bZWKMon0XHFEju16tkQ==", - "dev": true, "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -778,7 +763,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -788,7 +772,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -798,14 +781,12 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, "license": "MIT" }, "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -815,7 +796,6 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz", "integrity": "sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -828,7 +808,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -838,7 +817,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -851,7 +829,6 @@ "version": "1.53.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz", "integrity": "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -861,7 +838,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.0.tgz", "integrity": "sha512-XqoSHeCGjVClAmoGFG3lVFqQFRIrTVw2OH3axRqAcfaw+gHWIfnASS92AV+Rl/mk0MupgZTRHQOjxY6YVnzK5w==", - "dev": true, "license": "MIT", "dependencies": { "mime-db": "^1.53.0" @@ -874,7 +850,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -884,7 +859,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/send/-/send-1.1.0.tgz", "integrity": "sha512-v67WcEouB5GxbTWL/4NeToqcZiAWEq90N888fczVArY8A79J0L4FD7vj5hm3eUMua5EpoQ59wa/oovY6TLvRUA==", - "dev": true, "license": "MIT", "dependencies": { "debug": "^4.3.5", @@ -908,7 +882,6 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -918,7 +891,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -928,7 +900,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -941,7 +912,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.1.0.tgz", "integrity": "sha512-A3We5UfEjG8Z7VkDv6uItWw6HY2bBSBJT1KtVESn6EOoOr2jAxNhxWCLY3jDE2WcuHXByWju74ck3ZgLwL8xmA==", - "dev": true, "license": "MIT", "dependencies": { "encodeurl": "^2.0.0", @@ -957,7 +927,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.0.tgz", "integrity": "sha512-gd0sGezQYCbWSbkZr75mln4YBidWUN60+devscpLF5mtRDUpiaTvKpBNrdaCvel1NdR2k6vclXybU5fBd2i+nw==", - "dev": true, "license": "MIT", "dependencies": { "content-type": "^1.0.5", @@ -1007,9 +976,9 @@ } }, "node_modules/@oven/bun-darwin-aarch64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.2.3.tgz", - "integrity": "sha512-wEUBqSD7KDUx6xcOlNs/lDcbzJYH9CEPVZzAaJ+F3Zp8hORQYJ07byidQ0YgNMc1QhJq4xLaClMDLga6u2abIQ==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.2.17.tgz", + "integrity": "sha512-66Xjz3NZXUUWKZJPvWKuwEkaqMZpir1Gm4SbhbB2iiRSSTW8jqwdkSb9RhgTCDt5OnSPd3+Cq0WsP/T5ExJbhA==", "cpu": [ "arm64" ], @@ -1021,9 +990,9 @@ ] }, "node_modules/@oven/bun-darwin-x64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.2.3.tgz", - "integrity": "sha512-kBeKYLNAwQrcJ1HPcuDGo3PGEfDvzHbL5N5kiaui1+eluyCS2yJZvuy2ddg9b0vqQkgzNu7D1keiRLpdR2Wneg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.2.17.tgz", + "integrity": "sha512-OMJMHpcpBlWcVnWfSQ6x+8fF7HpkQLqBfoIvzxgUjIZZvj2d8K46XX4N/h62RglDEinRC9VDGxt24vwvlk5tTw==", "cpu": [ "x64" ], @@ -1035,9 +1004,9 @@ ] }, "node_modules/@oven/bun-darwin-x64-baseline": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.2.3.tgz", - "integrity": "sha512-oYqGnocQ7eY5wfthGivpXd0lzLYklXU4rEKXU4+oLaiFeFnY3lyszv85UHjywuB5bl7xybmSIE8tN8ie36WY1w==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.2.17.tgz", + "integrity": "sha512-VSIctl90tV8yg1LRMvPg/8LgUzl55Q7Jcxe+u6PfuvLQIJOTIPbNn7HtRpJg7MGc3+qyztB5KDd70xC7qI2yEg==", "cpu": [ "x64" ], @@ -1049,9 +1018,9 @@ ] }, "node_modules/@oven/bun-linux-aarch64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.2.3.tgz", - "integrity": "sha512-hbi7ykhLAtoBZl7mox5Qg6xVy9FcnPNibo/h6A1oElXBl4pRaVGNFDsuDmb80f9sFf4yZL0vwYyb47hL89MiGw==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.2.17.tgz", + "integrity": "sha512-KPoMqaibCXcSv+VZ3uMqKUNZqMxE6Hho1be6+laolYGOIJxJTMnZPfmKfIlQmnnW3vLlm3g2Rm8pPPC7doSHWg==", "cpu": [ "arm64" ], @@ -1063,9 +1032,9 @@ ] }, "node_modules/@oven/bun-linux-aarch64-musl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.2.3.tgz", - "integrity": "sha512-nSB6FU29OW+8zUP5jRrQEAXl9m6Jd8vp5Swplh3prc0L0niYdtan39wouCxDVFNJafC0DaeKQme4UMQJ65s9qw==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.2.17.tgz", + "integrity": "sha512-PH+hUV+I6DGD1VRHdAIAKEAOed+GSdvn6S1b3qqX27/VuHBU781V+hzt+6DBlcWBHYLw8PIg9sfIdNp485gQmw==", "cpu": [ "aarch64" ], @@ -1077,9 +1046,9 @@ ] }, "node_modules/@oven/bun-linux-x64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.2.3.tgz", - "integrity": "sha512-oxubd+zJW8+1H02bwzne8lj2EtvgoRU6w245hWMtwjo15IET/YGc01ndFRd42FX02bwo926N+7Jm7NFzS8GOHQ==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.2.17.tgz", + "integrity": "sha512-BfySnrTxp7D9hVUi9JEpviJl8ndsuESiRiQKTzgmdTLrMjUxP4SwrwMtYt6R9X20n9rREG6a47C0IyQMhbwG/g==", "cpu": [ "x64" ], @@ -1091,9 +1060,9 @@ ] }, "node_modules/@oven/bun-linux-x64-baseline": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.2.3.tgz", - "integrity": "sha512-PrkC18s81ImpHMdqgFXvyq9Oxed8mzlYb709DsuuoV9NL3nrzQzfqq8JStz/g3dYMc4obrljG/EKXGfMaJMJVA==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.2.17.tgz", + "integrity": "sha512-IrnFMUwYWxoKICQgK8ZlJ6rI/HU2gITFNEW0MIOPIcuT0s3j0/33631M9EzYDoL4NuLQPks6569JDvSHEVqdeA==", "cpu": [ "x64" ], @@ -1105,9 +1074,9 @@ ] }, "node_modules/@oven/bun-linux-x64-musl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.2.3.tgz", - "integrity": "sha512-481HyvBKKXrKH2VZsSBVsqsqxcnncqpsKz7qgTqnSEToCSyNqc3bGrI6pN6haI9nLawJpIh+oNXCg4JISUi6bg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.2.17.tgz", + "integrity": "sha512-fW9qn/WqO131/qSIkIPW8zN+thQnYUWa/k98EWubLG87htKSPh1v023E5ikKb7WlUv4Yb6UlE/z4NmMYKffmAg==", "cpu": [ "x64" ], @@ -1119,9 +1088,9 @@ ] }, "node_modules/@oven/bun-linux-x64-musl-baseline": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.2.3.tgz", - "integrity": "sha512-1VsFwYMOryIsnTGPG70N1HAXoa8Fa7s+XAtP2Y010tao0omgpM0S6Go0Uc7VJ8g+yHKyIw79leRMwUs35ysQZA==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.2.17.tgz", + "integrity": "sha512-YE5wQ/YA79BykMLhuwgdoF8Yjj5dRipD8dwmXs8n7gzR+/L9tL7Q69NQgskW2KkAalmWPoGAv3TV0IwbU+1dFw==", "cpu": [ "x64" ], @@ -1133,9 +1102,9 @@ ] }, "node_modules/@oven/bun-windows-x64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.2.3.tgz", - "integrity": "sha512-z3G7jft1hbiiX47rY666i3HFJZBqCLgddr7e0ccoE/kUk4U5IB08mqJZYW0vaaL8zy0wuEF2h5VkK0S/iryLWw==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.2.17.tgz", + "integrity": "sha512-GJUg1oA59DWH6eyV8uccpgfTEVxjmgfTWQCOl2ySMXR3IfRoFwS4aQfpjcVzNmEZrv8eYt+yMuw1K7aNcWTTIg==", "cpu": [ "x64" ], @@ -1147,9 +1116,9 @@ ] }, "node_modules/@oven/bun-windows-x64-baseline": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.2.3.tgz", - "integrity": "sha512-pvtDgWRclz/bxLEWUAppj854MklfTu01DfHAvKzV1UAHbBOlurC8+StpE7EhITAHC/jBK9U39eVYnZNvumVU9w==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.2.17.tgz", + "integrity": "sha512-aVkq4l1yZ9VKfBOtZ2HEj0OCU5kUe3Fx6LbAG6oY6OglWVYj051i3RGaE2OdR4L4F2jDyxzfGYRTM/qs8nU5qA==", "cpu": [ "x64" ], @@ -1388,27 +1357,22 @@ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "license": "MIT" }, - "node_modules/@types/ws": { - "version": "8.5.14", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz", - "integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.23.0.tgz", - "integrity": "sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.47.0.tgz", + "integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/utils": "8.23.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.0.1" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/type-utils": "8.47.0", + "@typescript-eslint/utils": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", + "graphemer": "^1.4.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1418,39 +1382,33 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "@typescript-eslint/parser": "^8.47.0", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 4" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", + "node_modules/@typescript-eslint/parser": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.47.0.tgz", + "integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", + "debug": "^4.3.4" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1460,18 +1418,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", + "node_modules/@typescript-eslint/project-service": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.47.0.tgz", + "integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "eslint-visitor-keys": "^4.2.0" + "@typescript-eslint/tsconfig-utils": "^8.47.0", + "@typescript-eslint/types": "^8.47.0", + "debug": "^4.3.4" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1479,46 +1439,35 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "funding": { - "url": "https://opencollective.com/eslint" + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.47.0.tgz", + "integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==", "dev": true, "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0" + }, "engines": { - "node": ">=18.12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "typescript": ">=4.8.4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.23.0.tgz", - "integrity": "sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.47.0.tgz", + "integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==", "dev": true, "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0" - }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1527,19 +1476,21 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", - "integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.47.0.tgz", + "integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0" + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1547,12 +1498,16 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", + "node_modules/@typescript-eslint/types": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.47.0.tgz", + "integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==", "dev": true, "license": "MIT", "engines": { @@ -1563,21 +1518,23 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.47.0.tgz", + "integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/project-service": "8.47.0", + "@typescript-eslint/tsconfig-utils": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1587,18 +1544,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", + "node_modules/@typescript-eslint/utils": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.47.0.tgz", + "integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "eslint-visitor-keys": "^4.2.0" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1606,39 +1565,47 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.47.0.tgz", + "integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.47.0", + "eslint-visitor-keys": "^4.2.1" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/utils/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "engines": { - "node": ">=18.12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "typescript": ">=4.8.4" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dev": true, "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -1721,7 +1688,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true, "license": "MIT" }, "node_modules/babel-plugin-macros": { @@ -1750,7 +1716,6 @@ "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "dev": true, "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1775,7 +1740,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -1785,14 +1749,12 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, "license": "MIT" }, "node_modules/body-parser/node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1805,9 +1767,9 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1828,9 +1790,9 @@ } }, "node_modules/bun": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bun/-/bun-1.2.3.tgz", - "integrity": "sha512-i8F+I3wxmt9omnLh3lOg0APQtqxZaMU0x6xuC+9YH4Eg/7fu8SM4YbdwyvV8Z6sy3OMtGFB0SYOjU2STuId4FQ==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/bun/-/bun-1.2.17.tgz", + "integrity": "sha512-lrUZTWS24eVy6v+Eph8VTwqFPcG7/XQ0rLBQEMNoQs2Vd7ctVdMGAzJKKGZRUQH+rgkD8rBeHGIVoWxX4vJLCA==", "cpu": [ "arm64", "x64", @@ -1846,38 +1808,36 @@ ], "bin": { "bun": "bin/bun.exe", - "bunx": "bin/bun.exe" + "bunx": "bin/bunx.exe" }, "optionalDependencies": { - "@oven/bun-darwin-aarch64": "1.2.3", - "@oven/bun-darwin-x64": "1.2.3", - "@oven/bun-darwin-x64-baseline": "1.2.3", - "@oven/bun-linux-aarch64": "1.2.3", - "@oven/bun-linux-aarch64-musl": "1.2.3", - "@oven/bun-linux-x64": "1.2.3", - "@oven/bun-linux-x64-baseline": "1.2.3", - "@oven/bun-linux-x64-musl": "1.2.3", - "@oven/bun-linux-x64-musl-baseline": "1.2.3", - "@oven/bun-windows-x64": "1.2.3", - "@oven/bun-windows-x64-baseline": "1.2.3" + "@oven/bun-darwin-aarch64": "1.2.17", + "@oven/bun-darwin-x64": "1.2.17", + "@oven/bun-darwin-x64-baseline": "1.2.17", + "@oven/bun-linux-aarch64": "1.2.17", + "@oven/bun-linux-aarch64-musl": "1.2.17", + "@oven/bun-linux-x64": "1.2.17", + "@oven/bun-linux-x64-baseline": "1.2.17", + "@oven/bun-linux-x64-musl": "1.2.17", + "@oven/bun-linux-x64-musl-baseline": "1.2.17", + "@oven/bun-windows-x64": "1.2.17", + "@oven/bun-windows-x64-baseline": "1.2.17" } }, "node_modules/bun-types": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.3.tgz", - "integrity": "sha512-P7AeyTseLKAvgaZqQrvp3RqFM3yN9PlcLuSTe7SoJOfZkER73mLdT2vEQi8U64S1YvM/ldcNiQjn0Sn7H9lGgg==", + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.17.tgz", + "integrity": "sha512-ElC7ItwT3SCQwYZDYoAH+q6KT4Fxjl8DtZ6qDulUFBmXA8YB4xo+l54J9ZJN+k2pphfn9vk7kfubeSd5QfTVJQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/node": "*", - "@types/ws": "~8.5.10" + "@types/node": "*" } }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -1887,7 +1847,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -1901,7 +1860,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2038,7 +1996,6 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" @@ -2051,7 +2008,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -2067,7 +2023,6 @@ "version": "0.7.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -2077,14 +2032,12 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true, "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, "license": "MIT", "dependencies": { "object-assign": "^4", @@ -2181,7 +2134,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -2200,7 +2152,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8", @@ -2233,7 +2184,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2248,14 +2198,12 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true, "license": "MIT" }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -2274,7 +2222,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2284,7 +2231,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2294,7 +2240,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -2307,7 +2252,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true, "license": "MIT" }, "node_modules/escape-string-regexp": { @@ -2544,7 +2488,6 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -2554,7 +2497,6 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.5.tgz", "integrity": "sha512-LT/5J605bx5SNyE+ITBDiM3FxffBiq9un7Vx0EwMDM3vg8sWKx/tO2zC+LMqZ+smAM0F2hblaDZUVZF0te2pSw==", - "dev": true, "license": "MIT", "dependencies": { "eventsource-parser": "^3.0.0" @@ -2567,7 +2509,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.0.tgz", "integrity": "sha512-T1C0XCUimhxVQzW4zFipdx0SficT651NnkR0ZSH3yQwh+mFMdLfgjABVi4YtMTtaL4s168593DaoaRLMqryavA==", - "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" @@ -2577,7 +2518,6 @@ "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "dev": true, "license": "MIT", "dependencies": { "accepts": "~1.3.8", @@ -2624,7 +2564,6 @@ "version": "7.5.0", "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 16" @@ -2640,7 +2579,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -2650,7 +2588,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, "license": "MIT" }, "node_modules/fast-deep-equal": { @@ -2705,9 +2642,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", - "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "license": "ISC", "dependencies": { @@ -2744,7 +2681,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "dev": true, "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -2763,7 +2699,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -2773,7 +2708,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, "license": "MIT" }, "node_modules/find-root": { @@ -2824,7 +2758,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -2861,7 +2794,6 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -2880,7 +2812,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -2905,7 +2836,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -2945,7 +2875,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2975,7 +2904,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3000,7 +2928,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, "license": "MIT", "dependencies": { "depd": "2.0.0", @@ -3017,7 +2944,6 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -3066,14 +2992,12 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, "license": "ISC" }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.10" @@ -3181,7 +3105,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "dev": true, "license": "MIT" }, "node_modules/isexe": { @@ -3342,7 +3265,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3448,7 +3370,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -3458,7 +3379,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3478,7 +3398,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -3944,7 +3863,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, "license": "MIT", "bin": { "mime": "cli.js" @@ -3957,7 +3875,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -3967,7 +3884,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -4050,7 +3966,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -4060,7 +3975,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4070,7 +3984,6 @@ "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4083,7 +3996,6 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dev": true, "license": "MIT", "dependencies": { "ee-first": "1.1.1" @@ -4096,7 +4008,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -4211,7 +4122,6 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -4247,7 +4157,6 @@ "version": "0.1.12", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "dev": true, "license": "MIT" }, "node_modules/path-type": { @@ -4282,7 +4191,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-4.1.0.tgz", "integrity": "sha512-ZBmhE1C9LcPoH9XZSdwiPtbPHZROwAnMy+kIFQVrnMCxY4Cudlz3gBOpzilgc0jOgRaiT3sIWfpMomW2ar2orQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=16.20.0" @@ -4302,7 +4210,6 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dev": true, "license": "MIT", "dependencies": { "forwarded": "0.2.0", @@ -4326,7 +4233,6 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" @@ -4363,7 +4269,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -4373,7 +4278,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", - "dev": true, "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -4389,7 +4293,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -4463,9 +4366,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { @@ -4477,7 +4380,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/router/-/router-2.1.0.tgz", "integrity": "sha512-/m/NSLxeYEgWNtyC+WtNHCF7jbGxOibVWKnn+1Psff4dJGOfoXP+MuC/f2CwSmyiHdOIzYnYFp4W6GxWfekaLA==", - "dev": true, "license": "MIT", "dependencies": { "is-promise": "^4.0.0", @@ -4492,7 +4394,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=16" @@ -4526,7 +4427,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -4547,7 +4447,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, "license": "MIT" }, "node_modules/scheduler": { @@ -4562,9 +4461,9 @@ } }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "license": "ISC", "bin": { @@ -4578,7 +4477,6 @@ "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dev": true, "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -4603,7 +4501,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -4613,14 +4510,12 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, "license": "MIT" }, "node_modules/send/node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -4630,7 +4525,6 @@ "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "dev": true, "license": "MIT", "dependencies": { "encodeurl": "~2.0.0", @@ -4646,7 +4540,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true, "license": "ISC" }, "node_modules/shebang-command": { @@ -4676,7 +4569,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -4696,7 +4588,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -4713,7 +4604,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -4732,7 +4622,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -4761,7 +4650,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -4842,12 +4730,24 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.6" } }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4871,7 +4771,6 @@ "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, "license": "MIT", "dependencies": { "media-typer": "0.3.0", @@ -4882,9 +4781,9 @@ } }, "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4896,70 +4795,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.23.0.tgz", - "integrity": "sha512-/LBRo3HrXr5LxmrdYSOCvoAMm7p2jNizNfbIpCgvG4HMsnoprRUOce/+8VJ9BDYWW68rqIENE/haVLWPeFZBVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "8.23.0", - "@typescript-eslint/parser": "8.23.0", - "@typescript-eslint/utils": "8.23.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.23.0.tgz", - "integrity": "sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/type-utils": "8.23.0", - "@typescript-eslint/utils": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.23.0.tgz", - "integrity": "sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.47.0.tgz", + "integrity": "sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", - "debug": "^4.3.4" + "@typescript-eslint/eslint-plugin": "8.47.0", + "@typescript-eslint/parser": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4970,110 +4815,7 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", - "integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.23.0", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/typescript-eslint/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/undici-types": { @@ -5142,7 +4884,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -5162,7 +4903,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4.0" @@ -5172,7 +4912,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8" @@ -5222,7 +4961,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, "license": "ISC" }, "node_modules/yocto-queue": { @@ -5239,23 +4977,21 @@ } }, "node_modules/zod": { - "version": "3.24.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", - "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", - "dev": true, + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zod-to-json-schema": { - "version": "3.24.3", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.3.tgz", - "integrity": "sha512-HIAfWdYIt1sssHfYZFCXp4rU1w2r8hVVXYIlmoa0r0gABLs5di3RCqPU5DDROogVz1pAdYBaz7HK5n9pSUNs3A==", - "dev": true, + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.0.tgz", + "integrity": "sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==", "license": "ISC", "peerDependencies": { - "zod": "^3.24.1" + "zod": "^3.25 || ^4" } }, "node_modules/zwitch": { diff --git a/package.json b/package.json index 16b98a2..672a83f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@speakeasyapi/code-samples", - "version": "2.4.0-beta", + "version": "2.4.0-beta.1", "author": "Speakeasy", "type": "module", "bin": { @@ -34,6 +34,11 @@ "types": "./esm/models/operations/index.d.ts", "default": "./esm/models/operations/index.js" }, + "./react-query": { + "source": "./src/react-query/index.ts", + "types": "./esm/react-query/index.d.ts", + "default": "./esm/react-query/index.js" + }, "./*.js": { "source": "./src/*.ts", "types": "./esm/*.d.ts", @@ -57,37 +62,34 @@ "prepublishOnly": "npm run build" }, "peerDependencies": { - "@modelcontextprotocol/sdk": "^1.5.0", "@tanstack/react-query": "^5", "react": "^18 || ^19", - "react-dom": "^18 || ^19", - "zod": ">= 3" + "react-dom": "^18 || ^19" }, "peerDependenciesMeta": { - "@modelcontextprotocol/sdk": {"optional":true}, "@tanstack/react-query": {"optional":true}, "react": {"optional":true}, "react-dom": {"optional":true} }, "devDependencies": { "@eslint/js": "^9.19.0", - "@modelcontextprotocol/sdk": "^1.5.0", "@stricli/core": "^1.1.1", "@tanstack/react-query": "^5.61.4", "@types/express": "^4.17.21", "@types/react": "^18.3.18", - "bun": "^1.2.2", - "bun-types": "^1.2.2", + "bun": "1.2.17", + "bun-types": "1.2.17", "eslint": "^9.19.0", "express": "^4.21.2", "globals": "^15.14.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "zod": "^3.23.4" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "dependencies": { "@emotion/css": "^11.13.5", + "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", "codehike": "^1.0.4", - "motion": "^12.4.7" + "motion": "^12.4.7", + "zod": "^3.25.0 || ^4.0.0" } } diff --git a/src/funcs/codeSamplesGet.ts b/src/funcs/codeSamplesGet.ts index c7b320b..b252628 100644 --- a/src/funcs/codeSamplesGet.ts +++ b/src/funcs/codeSamplesGet.ts @@ -11,7 +11,6 @@ import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import * as components from "../models/components/index.js"; -import { APIError } from "../models/errors/apierror.js"; import { ConnectionError, InvalidRequestError, @@ -20,7 +19,9 @@ import { UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { SpeakeasyCodeSamplesError } from "../models/errors/speakeasycodesampleserror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; @@ -39,13 +40,14 @@ export function codeSamplesGet( Result< components.UsageSnippets, | errors.ErrorT - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | SpeakeasyCodeSamplesError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError > > { return new APIPromise($do( @@ -64,13 +66,14 @@ async function $do( Result< components.UsageSnippets, | errors.ErrorT - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | SpeakeasyCodeSamplesError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >, APICall, ] @@ -104,9 +107,10 @@ async function $do( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { + options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getCodeSamples", - oAuth2Scopes: [], + oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -125,6 +129,7 @@ async function $do( headers: headers, query: query, body: body, + userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -150,18 +155,19 @@ async function $do( const [result] = await M.match< components.UsageSnippets, | errors.ErrorT - | APIError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError + | SpeakeasyCodeSamplesError + | ResponseValidationError + | ConnectionError | RequestAbortedError | RequestTimeoutError - | ConnectionError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError >( M.json("2XX", components.UsageSnippets$inboundSchema), M.jsonErr("4XX", errors.ErrorT$inboundSchema), M.fail("5XX"), - )(response, { extraFields: responseFields }); + )(response, req, { extraFields: responseFields }); if (!result.ok) { return [result, { status: "complete", request: req, response }]; } diff --git a/src/hooks/types.ts b/src/hooks/types.ts index f34898c..8bfe4fe 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -2,6 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { SDKOptions } from "../lib/config.js"; import { HTTPClient, RequestInput } from "../lib/http.js"; import { RetryConfig } from "../lib/retries.js"; import { SecurityState } from "../lib/security.js"; @@ -9,10 +10,11 @@ import { SecurityState } from "../lib/security.js"; export type HookContext = { baseURL: string | URL; operationID: string; - oAuth2Scopes?: string[]; + oAuth2Scopes: string[] | null; securitySource?: any | (() => Promise); retryConfig: RetryConfig; resolvedSecurity: SecurityState | null; + options: SDKOptions; }; export type Awaitable = T | Promise; diff --git a/src/index.ts b/src/index.ts index 5ddc765..dbcba16 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,4 +4,6 @@ export * from "./lib/config.js"; export * as files from "./lib/files.js"; +export { HTTPClient } from "./lib/http.js"; +export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; export * from "./sdk/sdk.js"; diff --git a/src/lib/base64.ts b/src/lib/base64.ts index c2d5b38..0aebd8b 100644 --- a/src/lib/base64.ts +++ b/src/lib/base64.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export function bytesToBase64(u8arr: Uint8Array): string { return btoa(String.fromCodePoint(...u8arr)); diff --git a/src/lib/config.ts b/src/lib/config.ts index 7b2773a..8ac0ef2 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -12,7 +12,7 @@ export const ServerProd = "prod"; * Contains the list of servers available to the SDK */ export const ServerList = { - [ServerProd]: "https://api.prod.speakeasyapi.dev", + [ServerProd]: "https://api.prod.speakeasy.com", } as const; export type SDKOptions = { @@ -32,6 +32,10 @@ export type SDKOptions = { * Allows overriding the default server URL used by the SDK */ serverURL?: string | undefined; + /** + * Allows overriding the default user agent used by the SDK + */ + userAgent?: string | undefined; /** * Allows overriding the default retry config used by the SDK */ @@ -57,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.4.0", - sdkVersion: "2.4.0-beta", - genVersion: "2.546.0", + sdkVersion: "2.4.0-beta.1", + genVersion: "2.760.2", userAgent: - "speakeasy-sdk/typescript 2.4.0-beta 2.546.0 0.4.0 @speakeasyapi/code-samples", + "speakeasy-sdk/typescript 2.4.0-beta.1 2.760.2 0.4.0 @speakeasyapi/code-samples", } as const; diff --git a/src/lib/files.ts b/src/lib/files.ts index 59d15f0..0344cd0 100644 --- a/src/lib/files.ts +++ b/src/lib/files.ts @@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer( return concatenatedChunks.buffer as ArrayBuffer; } + +/** + * Determines the MIME content type based on a file's extension. + * Returns null if the extension is not recognized. + */ +export function getContentTypeFromFileName(fileName: string): string | null { + if (!fileName) return null; + + const ext = fileName.toLowerCase().split(".").pop(); + if (!ext) return null; + + const mimeTypes: Record = { + json: "application/json", + xml: "application/xml", + html: "text/html", + htm: "text/html", + txt: "text/plain", + csv: "text/csv", + pdf: "application/pdf", + png: "image/png", + jpg: "image/jpeg", + jpeg: "image/jpeg", + gif: "image/gif", + svg: "image/svg+xml", + js: "application/javascript", + css: "text/css", + zip: "application/zip", + tar: "application/x-tar", + gz: "application/gzip", + mp4: "video/mp4", + mp3: "audio/mpeg", + wav: "audio/wav", + webp: "image/webp", + ico: "image/x-icon", + woff: "font/woff", + woff2: "font/woff2", + ttf: "font/ttf", + otf: "font/otf", + }; + + return mimeTypes[ext] || null; +} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts index 65858ac..77d4108 100644 --- a/src/lib/matchers.ts +++ b/src/lib/matchers.ts @@ -3,13 +3,13 @@ */ import { APIError } from "../models/errors/apierror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import { Result } from "../types/fp.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { ERR, OK, Result } from "../types/fp.js"; import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; import { isPlainObject } from "./is-plain-object.js"; -import { safeParse } from "./schemas.js"; export type Encoding = + | "jsonl" | "json" | "text" | "bytes" @@ -19,6 +19,7 @@ export type Encoding = | "fail"; const DEFAULT_CONTENT_TYPES: Record = { + jsonl: "application/jsonl", json: "application/json", text: "text/plain", bytes: "application/octet-stream", @@ -72,6 +73,21 @@ export function json( return { ...options, enc: "json", codes, schema }; } +export function jsonl( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions, +): ValueMatcher { + return { ...options, enc: "jsonl", codes, schema }; +} + +export function jsonlErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions, +): ErrorMatcher { + return { ...options, err: true, enc: "jsonl", codes, schema }; +} export function textErr( codes: StatusCodePredicate, schema: Schema, @@ -159,17 +175,19 @@ export type MatchedError = Matchers extends Matcher[] : never; export type MatchFunc = ( response: Response, + request: Request, options?: { resultKey?: string; extraFields?: Record }, ) => Promise<[result: Result, raw: unknown]>; export function match( ...matchers: Array> -): MatchFunc { +): MatchFunc { return async function matchFunc( response: Response, + request: Request, options?: { resultKey?: string; extraFields?: Record }, ): Promise< - [result: Result, raw: unknown] + [result: Result, raw: unknown] > { let raw: unknown; let matcher: Matcher | undefined; @@ -188,21 +206,25 @@ export function match( } if (!matcher) { - const responseBody = await response.text(); return [{ ok: false, - error: new APIError( - "Unexpected API response status or content-type", + error: new APIError("Unexpected Status or Content-Type", { response, - responseBody, - ), - }, responseBody]; + request, + body: await response.text().catch(() => ""), + }), + }, raw]; } const encoding = matcher.enc; + let body = ""; switch (encoding) { case "json": - raw = await response.json(); + body = await response.text(); + raw = JSON.parse(body); + break; + case "jsonl": + raw = response.body; break; case "bytes": raw = new Uint8Array(await response.arrayBuffer()); @@ -211,16 +233,19 @@ export function match( raw = response.body; break; case "text": - raw = await response.text(); + body = await response.text(); + raw = body; break; case "sse": raw = response.body; break; case "nil": - raw = await discardResponseBody(response); + body = await response.text(); + raw = undefined; break; case "fail": - raw = await response.text(); + body = await response.text(); + raw = body; break; default: encoding satisfies never; @@ -230,11 +255,7 @@ export function match( if (matcher.enc === "fail") { return [{ ok: false, - error: new APIError( - "API error occurred", - response, - typeof raw === "string" ? raw : "", - ), + error: new APIError("API error occurred", { request, response, body }), }, raw]; } @@ -246,6 +267,9 @@ export function match( ...options?.extraFields, ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), ...(isPlainObject(raw) ? raw : null), + request$: request, + response$: response, + body$: body, }; } else if (resultKey) { data = { @@ -264,18 +288,20 @@ export function match( } if ("err" in matcher) { - const result = safeParse( + const result = safeParseResponse( data, (v: unknown) => matcher.schema.parse(v), "Response validation failed", + { request, response, body }, ); return [result.ok ? { ok: false, error: result.value } : result, raw]; } else { return [ - safeParse( + safeParseResponse( data, (v: unknown) => matcher.schema.parse(v), "Response validation failed", + { request, response, body }, ), raw, ]; @@ -298,25 +324,22 @@ export function unpackHeaders(headers: Headers): Record { return out; } -/** - * Discards the response body to free up resources. - * - * To learn why this is need, see the undici docs: - * https://undici.nodejs.org/#/?id=garbage-collection - */ -export async function discardResponseBody(res: Response) { - const reader = res.body?.getReader(); - if (reader == null) { - return; - } - +function safeParseResponse( + rawValue: Inp, + fn: (value: Inp) => Out, + errorMessage: string, + httpMeta: { response: Response; request: Request; body: string }, +): Result { try { - let done = false; - while (!done) { - const res = await reader.read(); - done = res.done; - } - } finally { - reader.releaseLock(); + return OK(fn(rawValue)); + } catch (err) { + return ERR( + new ResponseValidationError(errorMessage, { + cause: err, + rawValue, + rawMessage: errorMessage, + ...httpMeta, + }), + ); } } diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index 0e340b7..47edb97 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -9,7 +9,7 @@ import { ZodObject, ZodRawShape, ZodTypeAny, -} from "zod"; +} from "zod/v3"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { ERR, OK, Result } from "../types/fp.js"; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index 2971fa8..bdb1f37 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -46,12 +46,14 @@ export type RequestOptions = { */ serverURL?: string | URL; /** + * @deprecated `fetchOptions` has been flattened into `RequestOptions`. + * * Sets various request options on the `fetch` call made by an SDK method. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} */ fetchOptions?: Omit; -}; +} & Omit; type RequestConfig = { method: string; @@ -62,6 +64,7 @@ type RequestConfig = { headers?: HeadersInit; security?: SecurityState | null; uaHeader?: string; + userAgent?: string | undefined; timeoutMs?: number; }; @@ -93,19 +96,21 @@ export class ClientSDK { } else { this.#hooks = new SDKHooks(); } - this._options = { ...options, hooks: this.#hooks }; - const url = serverURLFromOptions(options); if (url) { url.pathname = url.pathname.replace(/\/+$/, "") + "/"; } + const { baseURL, client } = this.#hooks.sdkInit({ baseURL: url, client: options.httpClient || new HTTPClient(), }); this._baseURL = baseURL; this.#httpClient = client; - this.#logger = options.debugLogger; + + this._options = { ...options, hooks: this.#hooks }; + + this.#logger = this._options.debugLogger; } public _createRequest( @@ -168,7 +173,9 @@ export class ClientSDK { cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; headers.set("cookie", cookie); - const userHeaders = new Headers(options?.fetchOptions?.headers); + const userHeaders = new Headers( + options?.headers ?? options?.fetchOptions?.headers, + ); for (const [k, v] of userHeaders) { headers.set(k, v); } @@ -176,29 +183,23 @@ export class ClientSDK { // Only set user agent header in non-browser-like environments since CORS // policy disallows setting it in browsers e.g. Chrome throws an error. if (!isBrowserLike) { - headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + headers.set( + conf.uaHeader ?? "user-agent", + conf.userAgent ?? SDK_METADATA.userAgent, + ); } - let fetchOptions = options?.fetchOptions; + const fetchOptions: Omit = { + ...options?.fetchOptions, + ...options, + }; if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - if (!fetchOptions) { - fetchOptions = { signal: timeoutSignal }; - } else { - fetchOptions.signal = timeoutSignal; - } + fetchOptions.signal = timeoutSignal; } if (conf.body instanceof ReadableStream) { - if (!fetchOptions) { - fetchOptions = { - // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 - duplex: "half", - }; - } else { - // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 - fetchOptions.duplex = "half"; - } + Object.assign(fetchOptions, { duplex: "half" }); } let input; @@ -303,7 +304,9 @@ export class ClientSDK { } } -const jsonLikeContentTypeRE = /^application\/(?:.{0,100}\+)?json/; +const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/; +const jsonlLikeContentTypeRE = + /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/; async function logRequest(logger: Logger | undefined, req: Request) { if (!logger) { return; @@ -369,9 +372,13 @@ async function logResponse( logger.group("Body:"); switch (true) { case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct): + || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): logger.log(await res.clone().json()); break; + case matchContentType(res, "application/jsonl") + || jsonlLikeContentTypeRE.test(ct): + logger.log(await res.clone().text()); + break; case matchContentType(res, "text/event-stream"): logger.log(`<${contentType}>`); break; diff --git a/src/lib/security.ts b/src/lib/security.ts index 206d58a..844dd9f 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -3,10 +3,11 @@ */ import * as components from "../models/components/index.js"; + type OAuth2PasswordFlow = { username: string; - password?: string | undefined; - clientID: string; + password: string; + clientID?: string | undefined; clientSecret?: string | undefined; tokenURL: string; }; @@ -82,9 +83,14 @@ type SecurityInputOAuth2 = { type SecurityInputOAuth2ClientCredentials = { type: "oauth2:client_credentials"; value: - | { clientID?: string | undefined; clientSecret?: string | undefined } + | { + clientID?: string | undefined; + clientSecret?: string | undefined; + } | null + | string | undefined; + fieldName?: string; }; type SecurityInputOAuth2PasswordCredentials = { @@ -93,13 +99,13 @@ type SecurityInputOAuth2PasswordCredentials = { | string | null | undefined; - fieldName: string; + fieldName?: string; }; type SecurityInputCustom = { type: "http:custom"; value: any | null | undefined; - fieldName: string; + fieldName?: string; }; export type SecurityInput = @@ -136,6 +142,9 @@ export function resolveSecurity( typeof o.value === "string" && !!o.value ); } else if (o.type === "oauth2:client_credentials") { + if (typeof o.value == "string") { + return !!o.value; + } return o.value.clientID != null || o.value.clientSecret != null; } else if (typeof o.value === "string") { return !!o.value; @@ -224,7 +233,9 @@ function applyBearer( value = `Bearer ${value}`; } - state.headers[spec.fieldName] = value; + if (spec.fieldName !== undefined) { + state.headers[spec.fieldName] = value; + } } export function resolveGlobalSecurity( diff --git a/src/lib/url.ts b/src/lib/url.ts index 6bc6356..f3a8de6 100644 --- a/src/lib/url.ts +++ b/src/lib/url.ts @@ -10,7 +10,7 @@ export function pathToFunc( pathPattern: string, options?: { charEncoding?: "percent" | "none" }, ): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; + const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; return function buildURLPath(params: Record = {}): string { return pathPattern.replace(paramRE, function (_, placeholder) { diff --git a/src/mcp-server/cli/start/command.ts b/src/mcp-server/cli/start/command.ts index 9d5bb81..2a57f0d 100644 --- a/src/mcp-server/cli/start/command.ts +++ b/src/mcp-server/cli/start/command.ts @@ -3,10 +3,9 @@ */ import { buildCommand } from "@stricli/core"; -import * as z from "zod"; +import * as z from "zod/v3"; import { ServerList } from "../../../lib/config.js"; import { consoleLoggerLevels } from "../../console-logger.js"; -import { mcpScopes } from "../../scopes.js"; export const startCommand = buildCommand({ loader: async () => { @@ -37,18 +36,6 @@ export const startCommand = buildCommand({ return z.string().parse(value); }, }, - ...(mcpScopes.length - ? { - scope: { - kind: "enum", - brief: - "Mount tools/resources that match given scope (repeatable flag)", - values: mcpScopes, - variadic: true, - optional: true, - }, - } - : {}), "api-key": { kind: "parsed", brief: "Sets the apiKey auth field for the API", diff --git a/src/mcp-server/cli/start/impl.ts b/src/mcp-server/cli/start/impl.ts index a98ea94..49ad6c8 100644 --- a/src/mcp-server/cli/start/impl.ts +++ b/src/mcp-server/cli/start/impl.ts @@ -11,14 +11,12 @@ import { ConsoleLoggerLevel, createConsoleLogger, } from "../../console-logger.js"; -import { MCPScope } from "../../scopes.js"; import { createMCPServer } from "../../server.js"; interface StartCommandFlags { readonly transport: "stdio" | "sse"; readonly port: number; readonly tool?: string[]; - readonly scope?: MCPScope[]; readonly "api-key"?: string | undefined; readonly "registry-url"?: SDKOptions["registryUrl"] | undefined; readonly "server-url"?: string; @@ -50,8 +48,7 @@ async function startStdio(flags: StartCommandFlags) { const server = createMCPServer({ logger, allowedTools: flags.tool, - scopes: flags.scope, - ...{ apiKey: flags["api-key"] }, + ...{ apiKey: flags["api-key"] ?? "" }, registryUrl: flags["registry-url"], serverURL: flags["server-url"], server: flags.server, @@ -72,8 +69,7 @@ async function startSSE(flags: StartCommandFlags) { const mcpServer = createMCPServer({ logger, allowedTools: flags.tool, - scopes: flags.scope, - ...{ apiKey: flags["api-key"] }, + ...{ apiKey: flags["api-key"] ?? "" }, registryUrl: flags["registry-url"], serverURL: flags["server-url"], server: flags.server, diff --git a/src/mcp-server/extensions.ts b/src/mcp-server/extensions.ts index 02d6d97..0955a57 100644 --- a/src/mcp-server/extensions.ts +++ b/src/mcp-server/extensions.ts @@ -2,7 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ZodRawShape } from "zod"; +import { ZodRawShape } from "zod/v3"; +import { PromptArgsRawShape, PromptDefinition } from "./prompts.js"; import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js"; import { ToolDefinition } from "./tools.js"; @@ -10,4 +11,7 @@ export type Register = { tool: (def: ToolDefinition) => void; resource: (def: ResourceDefinition) => void; resourceTemplate: (def: ResourceTemplateDefinition) => void; + prompt: ( + prompt: PromptDefinition, + ) => void; }; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index 0cad167..b50aa02 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "2.4.0-beta", + currentVersion: "2.4.0-beta.1", }, }); diff --git a/src/mcp-server/prompts.ts b/src/mcp-server/prompts.ts new file mode 100644 index 0000000..ef445e1 --- /dev/null +++ b/src/mcp-server/prompts.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; +import { GetPromptResult } from "@modelcontextprotocol/sdk/types.js"; +import { + objectOutputType, + ZodOptional, + ZodType, + ZodTypeAny, + ZodTypeDef, +} from "zod/v3"; +import { SpeakeasyCodeSamplesCore } from "../core.js"; +import { ConsoleLogger } from "./console-logger.js"; +import { MCPScope } from "./scopes.js"; + +// '@modelcontextprotocol/sdk' currently does not export this type +export type PromptArgsRawShape = { + [k: string]: + | ZodType + | ZodOptional>; +}; + +export type PromptDefinition< + Args extends undefined | PromptArgsRawShape = undefined, +> = Args extends PromptArgsRawShape ? { + name: string; + description?: string; + scopes?: MCPScope[]; + args: Args; + prompt: ( + client: SpeakeasyCodeSamplesCore, + args: objectOutputType, + extra: RequestHandlerExtra, + ) => GetPromptResult | Promise; + } + : { + name: string; + description?: string; + scopes?: MCPScope[]; + args?: undefined; + prompt: ( + client: SpeakeasyCodeSamplesCore, + extra: RequestHandlerExtra, + ) => GetPromptResult | Promise; + }; + +// Optional function to assist with formatting prompt results +export async function formatResult(value: string): Promise { + return { + messages: [ + { + role: "user", + content: { + type: "text", + text: value, + }, + }, + ], + }; +} + +export function createRegisterPrompt( + logger: ConsoleLogger, + server: McpServer, + sdk: SpeakeasyCodeSamplesCore, + allowedScopes: Set, +): ( + prompt: PromptDefinition, +) => void { + return ( + prompt: PromptDefinition, + ): void => { + const scopes = prompt.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { + return; + } + + if (prompt.args) { + if (prompt.description) { + server.prompt( + prompt.name, + prompt.description, + prompt.args, + async (args, ctx) => prompt.prompt(sdk, args, ctx), + ); + } else { + server.prompt( + prompt.name, + prompt.args, + async (args, ctx) => prompt.prompt(sdk, args, ctx), + ); + } + } else { + if (prompt.description) { + server.prompt( + prompt.name, + prompt.description, + async (ctx) => prompt.prompt(sdk, ctx), + ); + } else { + server.prompt(prompt.name, async (ctx) => prompt.prompt(sdk, ctx)); + } + } + + logger.debug("Registered prompt", { name: prompt.name }); + }; +} diff --git a/src/mcp-server/resources.ts b/src/mcp-server/resources.ts index c72f0fc..619143e 100644 --- a/src/mcp-server/resources.ts +++ b/src/mcp-server/resources.ts @@ -46,6 +46,7 @@ export type ResourceTemplateDefinition = { read: ReadResourceTemplateCallback; }; +// Optional function to assist with formatting resource results export async function formatResult( value: unknown, uri: URL, @@ -108,7 +109,14 @@ export function createRegisterResource( ): (resource: ResourceDefinition) => void { return (resource: ResourceDefinition): void => { const scopes = resource.scopes ?? []; - if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) { + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } @@ -136,7 +144,14 @@ export function createRegisterResourceTemplate( ): (resource: ResourceTemplateDefinition) => void { return (resource: ResourceTemplateDefinition): void => { const scopes = resource.scopes ?? []; - if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) { + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index 30edcc9..8ed209a 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -6,11 +6,12 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { SpeakeasyCodeSamplesCore } from "../core.js"; import { SDKOptions } from "../lib/config.js"; import type { ConsoleLogger } from "./console-logger.js"; +import { createRegisterPrompt } from "./prompts.js"; import { createRegisterResource, createRegisterResourceTemplate, } from "./resources.js"; -import { MCPScope, mcpScopes } from "./scopes.js"; +import { MCPScope } from "./scopes.js"; import { createRegisterTool } from "./tools.js"; import { tool$codeSamplesGet } from "./tools/codeSamplesGet.js"; @@ -25,7 +26,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "SpeakeasyCodeSamples", - version: "2.4.0-beta", + version: "2.4.0-beta.1", }); const client = new SpeakeasyCodeSamplesCore({ @@ -35,7 +36,7 @@ export function createMCPServer(deps: { server: deps.server, }); - const scopes = new Set(deps.scopes ?? mcpScopes); + const scopes = new Set(deps.scopes); const allowedTools = deps.allowedTools && new Set(deps.allowedTools); const tool = createRegisterTool( @@ -52,7 +53,8 @@ export function createMCPServer(deps: { client, scopes, ); - const register = { tool, resource, resourceTemplate }; + const prompt = createRegisterPrompt(deps.logger, server, client, scopes); + const register = { tool, resource, resourceTemplate, prompt }; void register; // suppress unused warnings tool(tool$codeSamplesGet); diff --git a/src/mcp-server/shared.ts b/src/mcp-server/shared.ts index 9dc6d2f..3e94144 100644 --- a/src/mcp-server/shared.ts +++ b/src/mcp-server/shared.ts @@ -2,9 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { bytesToBase64 } from "../lib/base64.js"; - type BinaryData = | Uint8Array | ArrayBuffer diff --git a/src/mcp-server/tools.ts b/src/mcp-server/tools.ts index a3c24c7..428e806 100644 --- a/src/mcp-server/tools.ts +++ b/src/mcp-server/tools.ts @@ -5,7 +5,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; -import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod"; +import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod/v3"; import { SpeakeasyCodeSamplesCore } from "../core.js"; import { ConsoleLogger } from "./console-logger.js"; import { MCPScope } from "./scopes.js"; @@ -34,6 +34,7 @@ export type ToolDefinition = ) => CallToolResult | Promise; }; +// Optional function to assist with formatting tool results export async function formatResult( value: unknown, init: { response?: Response | undefined }, @@ -101,8 +102,15 @@ export function createRegisterTool( return; } - const toolScopes = tool.scopes ?? []; - if (!toolScopes.every((s) => allowedScopes.has(s))) { + const scopes = tool.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { return; } diff --git a/src/mcp-server/tools/codeSamplesGet.ts b/src/mcp-server/tools/codeSamplesGet.ts index f39b3af..ccb7cd1 100644 --- a/src/mcp-server/tools/codeSamplesGet.ts +++ b/src/mcp-server/tools/codeSamplesGet.ts @@ -11,7 +11,7 @@ const args = { }; export const tool$codeSamplesGet: ToolDefinition = { - name: "code-samples_get", + name: "code-samples-get", description: `Retrieve usage snippets Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID.`, diff --git a/src/models/components/httpmethod.ts b/src/models/components/httpmethod.ts index ab8a125..e333ff9 100644 --- a/src/models/components/httpmethod.ts +++ b/src/models/components/httpmethod.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; export const HttpMethod = { @@ -20,18 +20,6 @@ export type HttpMethod = ClosedEnum; /** @internal */ export const HttpMethod$inboundSchema: z.ZodNativeEnum = z .nativeEnum(HttpMethod); - /** @internal */ export const HttpMethod$outboundSchema: z.ZodNativeEnum = HttpMethod$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace HttpMethod$ { - /** @deprecated use `HttpMethod$inboundSchema` instead. */ - export const inboundSchema = HttpMethod$inboundSchema; - /** @deprecated use `HttpMethod$outboundSchema` instead. */ - export const outboundSchema = HttpMethod$outboundSchema; -} diff --git a/src/models/components/security.ts b/src/models/components/security.ts index 58366fb..b61b523 100644 --- a/src/models/components/security.ts +++ b/src/models/components/security.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -24,7 +24,6 @@ export const Security$inboundSchema: z.ZodType< "APIKey": "apiKey", }); }); - /** @internal */ export type Security$Outbound = { APIKey: string; @@ -43,23 +42,9 @@ export const Security$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Security$ { - /** @deprecated use `Security$inboundSchema` instead. */ - export const inboundSchema = Security$inboundSchema; - /** @deprecated use `Security$outboundSchema` instead. */ - export const outboundSchema = Security$outboundSchema; - /** @deprecated use `Security$Outbound` instead. */ - export type Outbound = Security$Outbound; -} - export function securityToJSON(security: Security): string { return JSON.stringify(Security$outboundSchema.parse(security)); } - export function securityFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/usagesnippet.ts b/src/models/components/usagesnippet.ts index 16f1c0e..5885f61 100644 --- a/src/models/components/usagesnippet.ts +++ b/src/models/components/usagesnippet.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -42,7 +42,6 @@ export const UsageSnippet$inboundSchema: z.ZodType< language: z.string(), code: z.string(), }); - /** @internal */ export type UsageSnippet$Outbound = { path: string; @@ -65,23 +64,9 @@ export const UsageSnippet$outboundSchema: z.ZodType< code: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UsageSnippet$ { - /** @deprecated use `UsageSnippet$inboundSchema` instead. */ - export const inboundSchema = UsageSnippet$inboundSchema; - /** @deprecated use `UsageSnippet$outboundSchema` instead. */ - export const outboundSchema = UsageSnippet$outboundSchema; - /** @deprecated use `UsageSnippet$Outbound` instead. */ - export type Outbound = UsageSnippet$Outbound; -} - export function usageSnippetToJSON(usageSnippet: UsageSnippet): string { return JSON.stringify(UsageSnippet$outboundSchema.parse(usageSnippet)); } - export function usageSnippetFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/components/usagesnippets.ts b/src/models/components/usagesnippets.ts index 31edfff..e3de003 100644 --- a/src/models/components/usagesnippets.ts +++ b/src/models/components/usagesnippets.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; @@ -25,7 +25,6 @@ export const UsageSnippets$inboundSchema: z.ZodType< > = z.object({ snippets: z.array(UsageSnippet$inboundSchema), }); - /** @internal */ export type UsageSnippets$Outbound = { snippets: Array; @@ -40,23 +39,9 @@ export const UsageSnippets$outboundSchema: z.ZodType< snippets: z.array(UsageSnippet$outboundSchema), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UsageSnippets$ { - /** @deprecated use `UsageSnippets$inboundSchema` instead. */ - export const inboundSchema = UsageSnippets$inboundSchema; - /** @deprecated use `UsageSnippets$outboundSchema` instead. */ - export const outboundSchema = UsageSnippets$outboundSchema; - /** @deprecated use `UsageSnippets$Outbound` instead. */ - export type Outbound = UsageSnippets$Outbound; -} - export function usageSnippetsToJSON(usageSnippets: UsageSnippets): string { return JSON.stringify(UsageSnippets$outboundSchema.parse(usageSnippets)); } - export function usageSnippetsFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/errors/apierror.ts b/src/models/errors/apierror.ts index 3a04a1c..0c2d1f6 100644 --- a/src/models/errors/apierror.ts +++ b/src/models/errors/apierror.ts @@ -2,26 +2,39 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export class APIError extends Error { - public readonly statusCode: number; - public readonly contentType: string; +import { SpeakeasyCodeSamplesError } from "./speakeasycodesampleserror.js"; +/** The fallback error class if no more specific error class is matched */ +export class APIError extends SpeakeasyCodeSamplesError { constructor( message: string, - public readonly rawResponse: Response, - public readonly body: string = "", + httpMeta: { + response: Response; + request: Request; + body: string; + }, ) { - const statusCode = rawResponse.status; - const contentType = rawResponse.headers.get("content-type") || ""; - const bodyString = body.length > 0 ? `\n${body}` : ""; - - super( - `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, - ); - - this.statusCode = statusCode; - this.contentType = contentType; - + if (message) { + message += `: `; + } + message += `Status ${httpMeta.response.status}`; + const contentType = httpMeta.response.headers.get("content-type") || `""`; + if (contentType !== "application/json") { + message += ` Content-Type ${ + contentType.includes(" ") ? `"${contentType}"` : contentType + }`; + } + const body = httpMeta.body || `""`; + message += body.length > 100 ? "\n" : ". "; + let bodyDisplay = body; + if (body.length > 10000) { + const truncated = body.substring(0, 10000); + const remaining = body.length - 10000; + bodyDisplay = `${truncated}...and ${remaining} more chars`; + } + message += `Body: ${bodyDisplay}`; + message = message.trim(); + super(message, httpMeta); this.name = "APIError"; } } diff --git a/src/models/errors/error.ts b/src/models/errors/error.ts index df80066..cc01cd5 100644 --- a/src/models/errors/error.ts +++ b/src/models/errors/error.ts @@ -2,8 +2,9 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; +import { SpeakeasyCodeSamplesError } from "./speakeasycodesampleserror.js"; /** * The `Status` type defines a logical error model @@ -22,24 +23,18 @@ export type ErrorTData = { /** * The `Status` type defines a logical error model */ -export class ErrorT extends Error { - /** - * The HTTP status code - */ - statusCode: number; - +export class ErrorT extends SpeakeasyCodeSamplesError { /** The original data that was passed to this error instance. */ data$: ErrorTData; - constructor(err: ErrorTData) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message); + constructor( + err: ErrorTData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const message = err.message || `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); this.data$ = err; - this.statusCode = err.statusCode; - this.name = "ErrorT"; } } @@ -49,13 +44,20 @@ export const ErrorT$inboundSchema: z.ZodType = z .object({ message: z.string(), status_code: z.number().int(), + request$: z.instanceof(Request), + response$: z.instanceof(Response), + body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "status_code": "statusCode", }); - return new ErrorT(remapped); + return new ErrorT(remapped, { + request: v.request$, + response: v.response$, + body: v.body$, + }); }); /** @internal */ @@ -81,16 +83,3 @@ export const ErrorT$outboundSchema: z.ZodType< }); }), ); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ErrorT$ { - /** @deprecated use `ErrorT$inboundSchema` instead. */ - export const inboundSchema = ErrorT$inboundSchema; - /** @deprecated use `ErrorT$outboundSchema` instead. */ - export const outboundSchema = ErrorT$outboundSchema; - /** @deprecated use `ErrorT$Outbound` instead. */ - export type Outbound = ErrorT$Outbound; -} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index c530c01..e62985a 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -5,4 +5,6 @@ export * from "./apierror.js"; export * from "./error.js"; export * from "./httpclienterrors.js"; +export * from "./responsevalidationerror.js"; export * from "./sdkvalidationerror.js"; +export * from "./speakeasycodesampleserror.js"; diff --git a/src/models/errors/responsevalidationerror.ts b/src/models/errors/responsevalidationerror.ts new file mode 100644 index 0000000..e1e734e --- /dev/null +++ b/src/models/errors/responsevalidationerror.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { formatZodError } from "./sdkvalidationerror.js"; +import { SpeakeasyCodeSamplesError } from "./speakeasycodesampleserror.js"; + +export class ResponseValidationError extends SpeakeasyCodeSamplesError { + /** + * The raw value that failed validation. + */ + public readonly rawValue: unknown; + + /** + * The raw message that failed validation. + */ + public readonly rawMessage: unknown; + + constructor( + message: string, + extra: { + response: Response; + request: Request; + body: string; + cause: unknown; + rawValue: unknown; + rawMessage: unknown; + }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawValue = extra.rawValue; + this.rawMessage = extra.rawMessage; + } + + /** + * Return a pretty-formatted error message if the underlying validation error + * is a ZodError or some other recognized error type, otherwise return the + * default error message. + */ + public pretty(): string { + if (this.cause instanceof z.ZodError) { + return `${this.rawMessage}\n${formatZodError(this.cause)}`; + } else { + return this.toString(); + } + } +} diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts index 16929b9..6826e12 100644 --- a/src/models/errors/sdkvalidationerror.ts +++ b/src/models/errors/sdkvalidationerror.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export class SDKValidationError extends Error { /** @@ -15,6 +15,18 @@ export class SDKValidationError extends Error { */ public readonly rawMessage: unknown; + // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` + static override [Symbol.hasInstance]( + instance: unknown, + ): instance is SDKValidationError { + if (!(instance instanceof Error)) return false; + if (!("rawValue" in instance)) return false; + if (!("rawMessage" in instance)) return false; + if (!("pretty" in instance)) return false; + if (typeof instance.pretty !== "function") return false; + return true; + } + constructor(message: string, cause: unknown, rawValue: unknown) { super(`${message}: ${cause}`); this.name = "SDKValidationError"; diff --git a/src/models/errors/speakeasycodesampleserror.ts b/src/models/errors/speakeasycodesampleserror.ts new file mode 100644 index 0000000..4859417 --- /dev/null +++ b/src/models/errors/speakeasycodesampleserror.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** The base class for all HTTP error responses */ +export class SpeakeasyCodeSamplesError extends Error { + /** HTTP status code */ + public readonly statusCode: number; + /** HTTP body */ + public readonly body: string; + /** HTTP headers */ + public readonly headers: Headers; + /** HTTP content type */ + public readonly contentType: string; + /** Raw response */ + public readonly rawResponse: Response; + + constructor( + message: string, + httpMeta: { + response: Response; + request: Request; + body: string; + }, + ) { + super(message); + this.statusCode = httpMeta.response.status; + this.body = httpMeta.body; + this.headers = httpMeta.response.headers; + this.contentType = httpMeta.response.headers.get("content-type") || ""; + this.rawResponse = httpMeta.response; + + this.name = "SpeakeasyCodeSamplesError"; + } +} diff --git a/src/models/operations/getcodesamples.ts b/src/models/operations/getcodesamples.ts index 303c452..4bde3ed 100644 --- a/src/models/operations/getcodesamples.ts +++ b/src/models/operations/getcodesamples.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; @@ -52,7 +52,6 @@ export const GetCodeSamplesGlobals$inboundSchema: z.ZodType< "registry_url": "registryUrl", }); }); - /** @internal */ export type GetCodeSamplesGlobals$Outbound = { registry_url?: string | undefined; @@ -71,19 +70,6 @@ export const GetCodeSamplesGlobals$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetCodeSamplesGlobals$ { - /** @deprecated use `GetCodeSamplesGlobals$inboundSchema` instead. */ - export const inboundSchema = GetCodeSamplesGlobals$inboundSchema; - /** @deprecated use `GetCodeSamplesGlobals$outboundSchema` instead. */ - export const outboundSchema = GetCodeSamplesGlobals$outboundSchema; - /** @deprecated use `GetCodeSamplesGlobals$Outbound` instead. */ - export type Outbound = GetCodeSamplesGlobals$Outbound; -} - export function getCodeSamplesGlobalsToJSON( getCodeSamplesGlobals: GetCodeSamplesGlobals, ): string { @@ -91,7 +77,6 @@ export function getCodeSamplesGlobalsToJSON( GetCodeSamplesGlobals$outboundSchema.parse(getCodeSamplesGlobals), ); } - export function getCodeSamplesGlobalsFromJSON( jsonString: string, ): SafeParseResult { @@ -111,7 +96,6 @@ export const MethodPaths$inboundSchema: z.ZodType< method: components.HttpMethod$inboundSchema, path: z.string(), }); - /** @internal */ export type MethodPaths$Outbound = { method: string; @@ -128,23 +112,9 @@ export const MethodPaths$outboundSchema: z.ZodType< path: z.string(), }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace MethodPaths$ { - /** @deprecated use `MethodPaths$inboundSchema` instead. */ - export const inboundSchema = MethodPaths$inboundSchema; - /** @deprecated use `MethodPaths$outboundSchema` instead. */ - export const outboundSchema = MethodPaths$outboundSchema; - /** @deprecated use `MethodPaths$Outbound` instead. */ - export type Outbound = MethodPaths$Outbound; -} - export function methodPathsToJSON(methodPaths: MethodPaths): string { return JSON.stringify(MethodPaths$outboundSchema.parse(methodPaths)); } - export function methodPathsFromJSON( jsonString: string, ): SafeParseResult { @@ -172,7 +142,6 @@ export const GetCodeSamplesRequest$inboundSchema: z.ZodType< "method_paths": "methodPaths", }); }); - /** @internal */ export type GetCodeSamplesRequest$Outbound = { registry_url?: string | undefined; @@ -199,19 +168,6 @@ export const GetCodeSamplesRequest$outboundSchema: z.ZodType< }); }); -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetCodeSamplesRequest$ { - /** @deprecated use `GetCodeSamplesRequest$inboundSchema` instead. */ - export const inboundSchema = GetCodeSamplesRequest$inboundSchema; - /** @deprecated use `GetCodeSamplesRequest$outboundSchema` instead. */ - export const outboundSchema = GetCodeSamplesRequest$outboundSchema; - /** @deprecated use `GetCodeSamplesRequest$Outbound` instead. */ - export type Outbound = GetCodeSamplesRequest$Outbound; -} - export function getCodeSamplesRequestToJSON( getCodeSamplesRequest: GetCodeSamplesRequest, ): string { @@ -219,7 +175,6 @@ export function getCodeSamplesRequestToJSON( GetCodeSamplesRequest$outboundSchema.parse(getCodeSamplesRequest), ); } - export function getCodeSamplesRequestFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/react-query/_types.ts b/src/react-query/_types.ts index 0dcbf91..4146001 100644 --- a/src/react-query/_types.ts +++ b/src/react-query/_types.ts @@ -6,15 +6,88 @@ import { RequestOptions } from "../lib/sdks.js"; import { PageIterator } from "../types/operations.js"; import type { + DefaultError, InfiniteData, + InfiniteQueryPageParamsOptions, + OmitKeyof, QueryKey, - UseInfiniteQueryOptions, + QueryObserverOptions, + SkipToken, UseMutationOptions, UseQueryOptions, - UseSuspenseInfiniteQueryOptions, UseSuspenseQueryOptions, } from "@tanstack/react-query"; +// Reaction to breaking change in 5.80.0 https://github.com/TanStack/query/pull/9224#issuecomment-2934835936 +interface UseInfiniteQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends + OmitKeyof< + InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + "suspense" + > +{ + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} + +// Reaction to breaking change in 5.80.0 https://github.com/TanStack/query/pull/9224#issuecomment-2934835936 +interface InfiniteQueryObserverOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends + QueryObserverOptions< + TQueryFnData, + TError, + TData, + InfiniteData, + TQueryKey, + TPageParam + >, + InfiniteQueryPageParamsOptions +{ +} + +// Reaction to breaking change in 5.80.0 https://github.com/TanStack/query/pull/9224#issuecomment-2934835936 +interface UseSuspenseInfiniteQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends + OmitKeyof< + UseInfiniteQueryOptions, + "queryFn" | "enabled" | "throwOnError" | "placeholderData" + > +{ + queryFn?: Exclude< + UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >["queryFn"], + SkipToken + >; +} export type TupleToPrefixes = T extends [...infer Prefix, any] ? TupleToPrefixes | T : never; @@ -41,7 +114,6 @@ export type InfiniteQueryHookOptions< Data, Error, InfiniteData, - Data, QueryKey, Data["~next"] >, @@ -64,7 +136,6 @@ export type SuspenseInfiniteQueryHookOptions< Data, Error, InfiniteData, - Data, QueryKey, Data["~next"] >, diff --git a/src/types/blobs.ts b/src/types/blobs.ts index 4ce8460..cce2892 100644 --- a/src/types/blobs.ts +++ b/src/types/blobs.ts @@ -2,13 +2,14 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; -export const blobLikeSchema: z.ZodType = - z.custom(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, - }); +export const blobLikeSchema: z.ZodType = z.custom< + Blob +>(isBlobLike, { + message: "expected a Blob, File or Blob-like object", + fatal: true, +}); export function isBlobLike(val: unknown): val is Blob { if (val instanceof Blob) { diff --git a/src/types/constdatetime.ts b/src/types/constdatetime.ts index c0a4409..fe62144 100644 --- a/src/types/constdatetime.ts +++ b/src/types/constdatetime.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; +import * as z from "zod/v3"; export function constDateTime( val: string, @@ -11,5 +11,5 @@ export function constDateTime( return ( typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() ); - }, `Value must be equivelant to ${val}`); + }, `Value must be equivalent to ${val}`); } diff --git a/src/types/enums.ts b/src/types/enums.ts index 6fb6d91..aba0ffd 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -2,15 +2,44 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -declare const __brand: unique symbol; -export type Unrecognized = T & { [__brand]: "unrecognized" }; +import * as z from "zod/v3"; +import { Unrecognized, unrecognized } from "./unrecognized.js"; -export function catchUnrecognizedEnum(value: T): Unrecognized { - return value as Unrecognized; +export type ClosedEnum>> = + T[keyof T]; +export type OpenEnum>> = + | T[keyof T] + | Unrecognized; + +export function inboundSchema>( + enumObj: T, +): z.ZodType, z.ZodTypeDef, unknown> { + const options = Object.values(enumObj); + return z.union([ + ...options.map(x => z.literal(x)), + z.string().transform(x => unrecognized(x)), + ] as any); } -type Prettify = { [K in keyof T]: T[K] } & {}; -export type ClosedEnum = T[keyof T]; -export type OpenEnum = - | Prettify - | Unrecognized; +export function inboundSchemaInt>( + enumObj: T, +): z.ZodType, z.ZodTypeDef, unknown> { + // For numeric enums, Object.values returns both numbers and string keys + const options = Object.values(enumObj).filter(v => typeof v === "number"); + return z.union([ + ...options.map(x => z.literal(x)), + z.number().int().transform(x => unrecognized(x)), + ] as any); +} + +export function outboundSchema>( + _: T, +): z.ZodType> { + return z.string() as any; +} + +export function outboundSchemaInt>( + _: T, +): z.ZodType> { + return z.number().int() as any; +} diff --git a/src/types/index.ts b/src/types/index.ts index e124e81..abf0b7a 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,9 +3,9 @@ */ export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export { catchUnrecognizedEnum } from "./enums.js"; -export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; +export type { ClosedEnum, OpenEnum } from "./enums.js"; export type { Result } from "./fp.js"; export type { PageIterator, Paginator } from "./operations.js"; export { createPageIterator } from "./operations.js"; export { RFCDate } from "./rfcdate.js"; +export * from "./unrecognized.js"; diff --git a/src/types/unrecognized.ts b/src/types/unrecognized.ts new file mode 100644 index 0000000..08227f2 --- /dev/null +++ b/src/types/unrecognized.ts @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +declare const __brand: unique symbol; +export type Unrecognized = T & { [__brand]: "unrecognized" }; + +function unrecognized(value: T): Unrecognized { + globalCount++; + return value as Unrecognized; +} + +let globalCount = 0; +let refCount = 0; +export function startCountingUnrecognized() { + refCount++; + const start = globalCount; + return { + end: () => { + const count = globalCount - start; + if (--refCount === 0) globalCount = 0; + return count; + }, + }; +} + +export { unrecognized };