From a02c6bd9b2457445c0dc61c05c8eb399cfa57af1 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Mon, 22 Jun 2026 13:10:44 +0200 Subject: [PATCH] chore: Update Hey API OpenAPI TS to 0.99 --- package-lock.json | 74 +++++++++++++++++++++++++-------------------- package.json | 2 +- scripts/generate.js | 18 ++++++----- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 689f71c..5656eeb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "devDependencies": { "@eslint/js": "^10.0.1", - "@hey-api/openapi-ts": "^0.98.0", + "@hey-api/openapi-ts": "^0.99.0", "@types/node": "^26.0.0", "@types/ws": "^8.5.13", "@typescript-eslint/eslint-plugin": "^8.57.1", @@ -639,9 +639,9 @@ } }, "node_modules/@hey-api/codegen-core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.9.0.tgz", - "integrity": "sha512-OK9/R8WuujwgvnrDIPnEiIf6WnfUOi3GaEr6kIngqoI5FUQwYbeDKHE/frTVUl2A76ZQPCrMknHtPx6Gqtwf8Q==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.9.1.tgz", + "integrity": "sha512-s97jL1dgTMuiMHv2BZ1X4Tgd99Mf9GOvGdNqNcGwIMmnR+PgYNoraj4Zvp134MKsNCap/m7k0r0vKKnl56pj4w==", "dev": true, "license": "MIT", "dependencies": { @@ -658,15 +658,15 @@ } }, "node_modules/@hey-api/json-schema-ref-parser": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.4.3.tgz", - "integrity": "sha512-UzGSDzh3QUhrnwl4atnHc2YqDO6KemYVEOwl1Ynowm/tcr0XlpdHOpyWr5UaWIJfiXTXdYRIC9k2Yxm19pcPzQ==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.4.4.tgz", + "integrity": "sha512-otmd+zCxbYVBIp/mlMTnGkvlNYLkVKgs3VOIq0kSnenhB1+fRwLPQIeSwyWM6E51oXhUedkYjVsVpkVexeuJOA==", "dev": true, "license": "MIT", "dependencies": { "@jsdevtools/ono": "7.1.3", "@types/json-schema": "7.0.15", - "js-yaml": "4.1.1" + "js-yaml": "4.2.0" }, "engines": { "node": ">=22.18.0" @@ -676,15 +676,15 @@ } }, "node_modules/@hey-api/openapi-ts": { - "version": "0.98.2", - "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.98.2.tgz", - "integrity": "sha512-2nVJXH8tpFPGTBOhxyjEd1Jw0hsRqJqeTQW3kltAjVdSU4YWxeu97x5sgNOmsbsfeg6Dqz7Wfzs26walBOuswA==", + "version": "0.99.0", + "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.99.0.tgz", + "integrity": "sha512-SePU/5oEWWkvUBYmvzdYRctseoLuskyhs4ET0RvLIcmzc8yLQoA2R+KtBIQ8bPsoSUB0m4E5SmBnl6aGSA0szQ==", "dev": true, "license": "MIT", "dependencies": { - "@hey-api/codegen-core": "0.9.0", - "@hey-api/json-schema-ref-parser": "1.4.3", - "@hey-api/shared": "0.4.8", + "@hey-api/codegen-core": "0.9.1", + "@hey-api/json-schema-ref-parser": "1.4.4", + "@hey-api/shared": "0.5.0", "@hey-api/spec-types": "0.2.0", "@hey-api/types": "0.1.4", "@lukeed/ms": "2.0.2", @@ -707,20 +707,20 @@ } }, "node_modules/@hey-api/shared": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/@hey-api/shared/-/shared-0.4.8.tgz", - "integrity": "sha512-29Pg2FB0UW20pplYgcfiQn1hQYpbZ9D2gdDJc7nDK3xh3pvHOTGP0v3R2ueFpFnw9GN1SRhIdhiVuAYWMDimjA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@hey-api/shared/-/shared-0.5.0.tgz", + "integrity": "sha512-JN/j4Ebh4cJGYIQ5cwWuqe7GeSUyQoz7oC51WqyhKOcrejK6DKZMDkshc5d1eKTRuRL+rjozuRcoUaZZn2DGPw==", "dev": true, "license": "MIT", "dependencies": { - "@hey-api/codegen-core": "0.9.0", - "@hey-api/json-schema-ref-parser": "1.4.3", + "@hey-api/codegen-core": "0.9.1", + "@hey-api/json-schema-ref-parser": "1.4.4", "@hey-api/spec-types": "0.2.0", "@hey-api/types": "0.1.4", "ansi-colors": "4.1.3", "cross-spawn": "7.0.6", "open": "11.0.0", - "semver": "7.8.2" + "semver": "7.8.4" }, "engines": { "node": ">=22.18.0" @@ -2489,9 +2489,9 @@ } }, "node_modules/exsolve": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", - "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.0.tgz", + "integrity": "sha512-D+42+T12DdIlJM3uepa55qGiL3sYdLBOxIl2ifQCzCHz4c7eiolaHsi3BIqEr7JxBzxv2pYZQX9kw16ziMcEmw==", "dev": true, "license": "MIT" }, @@ -3041,10 +3041,20 @@ } }, "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -3516,9 +3526,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.13.tgz", - "integrity": "sha512-sPdqC6ByMVVGvF1ynvvMo0/o+oD1VX7DaHhijt1bFgjvBkHBib4t49GoNDhf2NDta4oeUNlaGbSt5K7qjZ955Q==", + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", "dev": true, "funding": [ { @@ -3961,9 +3971,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", - "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 0fb9f0f..50edf34 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", - "@hey-api/openapi-ts": "^0.98.0", + "@hey-api/openapi-ts": "^0.99.0", "@types/node": "^26.0.0", "@types/ws": "^8.5.13", "@typescript-eslint/eslint-plugin": "^8.57.1", diff --git a/scripts/generate.js b/scripts/generate.js index 1ab5aad..800675f 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -1,6 +1,11 @@ #!/usr/bin/env node import { createClient } from "@hey-api/openapi-ts"; +import { + transformers, + typescript as typescriptPlugin, + zod as zodPlugin, +} from "@hey-api/openapi-ts/plugins"; import * as fs from "fs/promises"; import { dirname } from "path"; import * as prettier from "prettier"; @@ -39,13 +44,12 @@ async function main() { postProcess: ["prettier"], }, plugins: [ - { + zodPlugin({ compatibilityVersion: 4, - name: "zod", - "~resolvers": createDeserializationResolvers(), - }, - { bigInt: false, name: "@hey-api/transformers" }, - "@hey-api/typescript", + $resolvers: createDeserializationResolvers(), + }), + transformers({ bigInt: false }), + typescriptPlugin(), ], }); @@ -205,7 +209,7 @@ function createDeserializationResolvers() { return undefined; } - ctx.chain.current = ctx.$(ctx.symbols.z).attr("number").call(); + ctx.chain.current = ctx.$(ctx.plugin.imports.z).attr("number").call(); return ctx.chain.current; },