diff --git a/.changeset/fifty-plums-battle.md b/.changeset/fifty-plums-battle.md new file mode 100644 index 000000000..04999ef23 --- /dev/null +++ b/.changeset/fifty-plums-battle.md @@ -0,0 +1,5 @@ +--- +'@hey-api/openapi-ts': patch +--- + +fix: properly handle dual publishing and type generation diff --git a/.changeset/giant-buckets-eat.md b/.changeset/giant-buckets-eat.md new file mode 100644 index 000000000..9aa705c24 --- /dev/null +++ b/.changeset/giant-buckets-eat.md @@ -0,0 +1,6 @@ +--- +'@hey-api/client-axios': patch +'@hey-api/client-fetch': patch +--- + +fix: properly handle dual publishing and type generation diff --git a/.editorconfig b/.editorconfig index 72f4cd61d..903a3b5f0 100755 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,13 @@ root = true [*] -end_of_line = lf charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space +end_of_line = lf indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true [*.hbs] -indent_style = tab +indent_size = 2 +indent_style = space diff --git a/eslint.config.js b/eslint.config.js index e36c19669..2e8115f33 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -53,9 +53,12 @@ export default tseslint.config( configPrettier, { ignores: [ + '**/.tsup/', '**/dist/', '**/node_modules/', 'temp/', + 'packages/openapi-ts/src/legacy/handlebars/compiled/**/*.js', + 'packages/openapi-ts/src/legacy/handlebars/templates/**/*.hbs', '**/test/e2e/generated/', '**/test/generated/', '**/.svelte-kit/', diff --git a/package.json b/package.json index ea01e1ae5..fbfa582af 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,9 @@ "node": "^18.0.0 || >=20.0.0" }, "devDependencies": { + "@arethetypeswrong/cli": "0.16.4", "@changesets/changelog-github": "0.5.0", "@changesets/cli": "2.27.7", - "@rollup/plugin-commonjs": "26.0.1", - "@rollup/plugin-terser": "0.4.4", - "@rollup/plugin-typescript": "11.1.6", "@types/node": "20.14.10", "@typescript-eslint/eslint-plugin": "7.15.0", "@vitest/coverage-v8": "1.6.0", @@ -52,9 +50,7 @@ "husky": "9.0.11", "lint-staged": "15.2.7", "prettier": "3.3.2", - "rimraf": "5.0.8", - "rollup": "4.18.0", - "rollup-plugin-dts": "6.1.1", + "tsup": "8.3.0", "typescript": "5.5.3", "typescript-eslint": "7.15.0", "vitest": "1.6.0" diff --git a/packages/client-axios/package.json b/packages/client-axios/package.json index 3d6202ed5..50ba3d1e2 100644 --- a/packages/client-axios/package.json +++ b/packages/client-axios/package.json @@ -1,7 +1,6 @@ { "name": "@hey-api/client-axios", "version": "0.2.4", - "type": "module", "description": "Type-safe Axios client for your @hey-api/openapi-ts types", "homepage": "https://heyapi.vercel.app/", "repository": { @@ -25,18 +24,19 @@ "typescript", "vue" ], - "types": "dist/node/index.d.ts", - "main": "dist/node/index.cjs", - "module": "dist/node/index.mjs", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { "import": { - "types": "./dist/node/index.d.ts", - "default": "./dist/node/index.mjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" }, "require": { - "types": "./dist/node/index.d.ts", - "default": "./dist/node/index.cjs" + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } }, "./package.json": "./package.json" @@ -48,14 +48,9 @@ "src" ], "scripts": { - "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", - "build-types-check": "tsc --project tsconfig.check.json", - "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", - "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node", - "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", - "build": "pnpm clean && pnpm build-bundle && pnpm build-types", - "clean": "rimraf dist coverage node_modules/.cache", - "dev": "rimraf dist && pnpm build-bundle --watch", + "build": "tsup && pnpm check-exports", + "check-exports": "attw --pack .", + "dev": "tsup --watch", "prepublishOnly": "pnpm build", "test:coverage": "vitest run --coverage", "test:update": "vitest watch --update", diff --git a/packages/client-axios/rollup.config.ts b/packages/client-axios/rollup.config.ts deleted file mode 100644 index 579f86706..000000000 --- a/packages/client-axios/rollup.config.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { readFileSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -import commonjs from '@rollup/plugin-commonjs'; -import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; -import type { RollupOptions } from 'rollup'; -import { defineConfig } from 'rollup'; - -const __dirname = fileURLToPath(new URL('.', import.meta.url)); - -const pkg = JSON.parse( - readFileSync(new URL('./package.json', import.meta.url)).toString(), -); - -export const externalDependencies = [ - ...Object.keys(pkg.dependencies ?? {}), - ...Object.keys(pkg.peerDependencies ?? {}), -]; - -function createConfig(isProduction: boolean) { - return [ - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.cjs'), - format: 'cjs', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.mjs'), - format: 'esm', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - ]; -} - -export default (commandLineArgs: any): RollupOptions[] => { - const isDev = commandLineArgs.watch; - const isProduction = !isDev; - return defineConfig(createConfig(isProduction)); -}; diff --git a/packages/client-axios/rollup.dts.config.ts b/packages/client-axios/rollup.dts.config.ts deleted file mode 100644 index ebb285d54..000000000 --- a/packages/client-axios/rollup.dts.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'rollup'; -import dts from 'rollup-plugin-dts'; - -import { externalDependencies } from './rollup.config'; - -export default defineConfig({ - external: externalDependencies, - input: { - index: './temp/node/index.d.ts', - }, - output: { - dir: './dist/node', - format: 'cjs', - }, - plugins: [dts({ respectExternal: true })], -}); diff --git a/packages/client-axios/src/index.ts b/packages/client-axios/src/index.ts index afe16e6a1..d0890ea39 100644 --- a/packages/client-axios/src/index.ts +++ b/packages/client-axios/src/index.ts @@ -84,3 +84,11 @@ export const createClient = (config: Config): Client => { setConfig, } as Client; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/client-axios/src/node/index.ts b/packages/client-axios/src/node/index.ts deleted file mode 100644 index f94d3c1d7..000000000 --- a/packages/client-axios/src/node/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export { createClient } from '../'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from '../types'; -export { - createConfig, - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from '../utils'; diff --git a/packages/client-axios/src/node/tsconfig.json b/packages/client-axios/src/node/tsconfig.json deleted file mode 100644 index 873575990..000000000 --- a/packages/client-axios/src/node/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "stripInternal": true - }, - "exclude": ["../**/__tests__"], - "extends": "../../tsconfig.base.json", - "include": ["../"] -} diff --git a/packages/client-axios/tsconfig.check.json b/packages/client-axios/tsconfig.check.json deleted file mode 100644 index 74f64f72a..000000000 --- a/packages/client-axios/tsconfig.check.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "exactOptionalPropertyTypes": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "target": "ES2020" - }, - "include": ["dist/**/*"] -} diff --git a/packages/client-axios/tsconfig.json b/packages/client-axios/tsconfig.json index 2d6d90ad8..faaf0992f 100644 --- a/packages/client-axios/tsconfig.json +++ b/packages/client-axios/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "declaration": false, "esModuleInterop": true - }, - "exclude": ["node_modules", "**/__mocks__"], - "include": ["./src/**/*.ts", "rollup.config.ts", "rollup.dts.config.ts"] + } } diff --git a/packages/client-axios/tsup.config.ts b/packages/client-axios/tsup.config.ts new file mode 100644 index 000000000..77dfaf864 --- /dev/null +++ b/packages/client-axios/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig((options) => ({ + clean: true, + dts: true, + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + minify: !options.watch, + shims: false, + sourcemap: true, + treeshake: true, +})); diff --git a/packages/client-core/package.json b/packages/client-core/package.json index a205af833..d4840e9b5 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -19,14 +19,6 @@ "types": "./dist/node/index.d.ts" }, "scripts": { - "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", - "build-types-check": "tsc --project tsconfig.check.json", - "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", - "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node", - "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", - "build": "pnpm clean && pnpm build-bundle && pnpm build-types", - "clean": "rimraf dist coverage node_modules/.cache", - "dev": "rimraf dist && pnpm build-bundle --watch", "prepublishOnly": "pnpm build", "test:coverage": "vitest run --coverage", "test:update": "vitest watch --update", diff --git a/packages/client-core/rollup.config.ts b/packages/client-core/rollup.config.ts deleted file mode 100644 index 579f86706..000000000 --- a/packages/client-core/rollup.config.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { readFileSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -import commonjs from '@rollup/plugin-commonjs'; -import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; -import type { RollupOptions } from 'rollup'; -import { defineConfig } from 'rollup'; - -const __dirname = fileURLToPath(new URL('.', import.meta.url)); - -const pkg = JSON.parse( - readFileSync(new URL('./package.json', import.meta.url)).toString(), -); - -export const externalDependencies = [ - ...Object.keys(pkg.dependencies ?? {}), - ...Object.keys(pkg.peerDependencies ?? {}), -]; - -function createConfig(isProduction: boolean) { - return [ - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.cjs'), - format: 'cjs', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.mjs'), - format: 'esm', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - ]; -} - -export default (commandLineArgs: any): RollupOptions[] => { - const isDev = commandLineArgs.watch; - const isProduction = !isDev; - return defineConfig(createConfig(isProduction)); -}; diff --git a/packages/client-core/rollup.dts.config.ts b/packages/client-core/rollup.dts.config.ts deleted file mode 100644 index ebb285d54..000000000 --- a/packages/client-core/rollup.dts.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'rollup'; -import dts from 'rollup-plugin-dts'; - -import { externalDependencies } from './rollup.config'; - -export default defineConfig({ - external: externalDependencies, - input: { - index: './temp/node/index.d.ts', - }, - output: { - dir: './dist/node', - format: 'cjs', - }, - plugins: [dts({ respectExternal: true })], -}); diff --git a/packages/client-core/tsconfig.check.json b/packages/client-core/tsconfig.check.json deleted file mode 100644 index 74f64f72a..000000000 --- a/packages/client-core/tsconfig.check.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "exactOptionalPropertyTypes": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "target": "ES2020" - }, - "include": ["dist/**/*"] -} diff --git a/packages/client-core/tsconfig.json b/packages/client-core/tsconfig.json index 2d6d90ad8..c2a684570 100644 --- a/packages/client-core/tsconfig.json +++ b/packages/client-core/tsconfig.json @@ -5,5 +5,5 @@ "esModuleInterop": true }, "exclude": ["node_modules", "**/__mocks__"], - "include": ["./src/**/*.ts", "rollup.config.ts", "rollup.dts.config.ts"] + "include": ["./src/**/*.ts"] } diff --git a/packages/client-fetch/package.json b/packages/client-fetch/package.json index fb90cde53..17634844c 100644 --- a/packages/client-fetch/package.json +++ b/packages/client-fetch/package.json @@ -1,7 +1,6 @@ { "name": "@hey-api/client-fetch", "version": "0.3.1", - "type": "module", "description": "Type-safe Fetch API client for your @hey-api/openapi-ts types", "homepage": "https://heyapi.vercel.app/", "repository": { @@ -25,18 +24,19 @@ "typescript", "vue" ], - "types": "dist/node/index.d.ts", - "main": "dist/node/index.cjs", - "module": "dist/node/index.mjs", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { "import": { - "types": "./dist/node/index.d.ts", - "default": "./dist/node/index.mjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" }, "require": { - "types": "./dist/node/index.d.ts", - "default": "./dist/node/index.cjs" + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } }, "./package.json": "./package.json" @@ -48,14 +48,9 @@ "src" ], "scripts": { - "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", - "build-types-check": "tsc --project tsconfig.check.json", - "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", - "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node", - "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", - "build": "pnpm clean && pnpm build-bundle && pnpm build-types", - "clean": "rimraf dist coverage node_modules/.cache", - "dev": "rimraf dist && pnpm build-bundle --watch", + "build": "tsup && pnpm check-exports", + "check-exports": "attw --pack .", + "dev": "tsup --watch", "prepublishOnly": "pnpm build", "test:coverage": "vitest run --coverage", "test:update": "vitest watch --update", diff --git a/packages/client-fetch/rollup.config.ts b/packages/client-fetch/rollup.config.ts deleted file mode 100644 index 579f86706..000000000 --- a/packages/client-fetch/rollup.config.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { readFileSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -import commonjs from '@rollup/plugin-commonjs'; -import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; -import type { RollupOptions } from 'rollup'; -import { defineConfig } from 'rollup'; - -const __dirname = fileURLToPath(new URL('.', import.meta.url)); - -const pkg = JSON.parse( - readFileSync(new URL('./package.json', import.meta.url)).toString(), -); - -export const externalDependencies = [ - ...Object.keys(pkg.dependencies ?? {}), - ...Object.keys(pkg.peerDependencies ?? {}), -]; - -function createConfig(isProduction: boolean) { - return [ - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.cjs'), - format: 'cjs', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.mjs'), - format: 'esm', - }, - plugins: [ - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - isProduction && terser(), - ], - }), - ]; -} - -export default (commandLineArgs: any): RollupOptions[] => { - const isDev = commandLineArgs.watch; - const isProduction = !isDev; - return defineConfig(createConfig(isProduction)); -}; diff --git a/packages/client-fetch/rollup.dts.config.ts b/packages/client-fetch/rollup.dts.config.ts deleted file mode 100644 index ebb285d54..000000000 --- a/packages/client-fetch/rollup.dts.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'rollup'; -import dts from 'rollup-plugin-dts'; - -import { externalDependencies } from './rollup.config'; - -export default defineConfig({ - external: externalDependencies, - input: { - index: './temp/node/index.d.ts', - }, - output: { - dir: './dist/node', - format: 'cjs', - }, - plugins: [dts({ respectExternal: true })], -}); diff --git a/packages/client-fetch/src/index.ts b/packages/client-fetch/src/index.ts index ab5cd4a1f..46a8d73ad 100644 --- a/packages/client-fetch/src/index.ts +++ b/packages/client-fetch/src/index.ts @@ -144,3 +144,11 @@ export const createClient = (config: Config = {}): Client => { trace: (options) => request({ ...options, method: 'TRACE' }), }; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/client-fetch/src/node/index.ts b/packages/client-fetch/src/node/index.ts deleted file mode 100644 index a2b79943b..000000000 --- a/packages/client-fetch/src/node/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export { createClient } from '../'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from '../types'; -export { - type BodySerializer, - createConfig, - formDataBodySerializer, - jsonBodySerializer, - type Middleware, - type QuerySerializer, - type QuerySerializerOptions, - urlSearchParamsBodySerializer, -} from '../utils'; diff --git a/packages/client-fetch/src/node/tsconfig.json b/packages/client-fetch/src/node/tsconfig.json deleted file mode 100644 index 873575990..000000000 --- a/packages/client-fetch/src/node/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "stripInternal": true - }, - "exclude": ["../**/__tests__"], - "extends": "../../tsconfig.base.json", - "include": ["../"] -} diff --git a/packages/client-fetch/tsconfig.check.json b/packages/client-fetch/tsconfig.check.json deleted file mode 100644 index 74f64f72a..000000000 --- a/packages/client-fetch/tsconfig.check.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "exactOptionalPropertyTypes": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "target": "ES2020" - }, - "include": ["dist/**/*"] -} diff --git a/packages/client-fetch/tsconfig.json b/packages/client-fetch/tsconfig.json index 2d6d90ad8..faaf0992f 100644 --- a/packages/client-fetch/tsconfig.json +++ b/packages/client-fetch/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "declaration": false, "esModuleInterop": true - }, - "exclude": ["node_modules", "**/__mocks__"], - "include": ["./src/**/*.ts", "rollup.config.ts", "rollup.dts.config.ts"] + } } diff --git a/packages/client-fetch/tsup.config.ts b/packages/client-fetch/tsup.config.ts new file mode 100644 index 000000000..77dfaf864 --- /dev/null +++ b/packages/client-fetch/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig((options) => ({ + clean: true, + dts: true, + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + minify: !options.watch, + shims: false, + sourcemap: true, + treeshake: true, +})); diff --git a/packages/openapi-ts/.gitignore b/packages/openapi-ts/.gitignore index 4bde635cb..3d31689e4 100644 --- a/packages/openapi-ts/.gitignore +++ b/packages/openapi-ts/.gitignore @@ -1,5 +1,6 @@ .DS_Store .idea +.tsup .tmp junit.xml node_modules diff --git a/packages/openapi-ts/bin/index.cjs b/packages/openapi-ts/bin/index.cjs index b4aa49be8..4df67d2cb 100755 --- a/packages/openapi-ts/bin/index.cjs +++ b/packages/openapi-ts/bin/index.cjs @@ -66,9 +66,7 @@ const processParams = (obj, booleanKeys) => { async function start() { let userConfig; try { - const { createClient } = require( - resolve(__dirname, '../dist/node/index.cjs'), - ); + const { createClient } = require(resolve(__dirname, '../dist/index.cjs')); userConfig = processParams(params, [ 'dryRun', 'exportCore', diff --git a/packages/openapi-ts/package.json b/packages/openapi-ts/package.json index 2385cb152..280205549 100644 --- a/packages/openapi-ts/package.json +++ b/packages/openapi-ts/package.json @@ -1,7 +1,6 @@ { "name": "@hey-api/openapi-ts", "version": "0.53.2", - "type": "module", "description": "Turn your OpenAPI specification into a beautiful TypeScript client", "homepage": "https://heyapi.vercel.app/", "repository": { @@ -29,8 +28,23 @@ "xhr", "yaml" ], - "main": "./dist/node/index.cjs", - "types": "./dist/node/index.d.ts", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "bin": { "openapi-ts": "bin/index.cjs" }, @@ -40,14 +54,10 @@ "LICENSE.md" ], "scripts": { - "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript", - "build-types-check": "tsc --project tsconfig.check.json", - "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", - "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node", - "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check", - "build": "pnpm clean && pnpm build-bundle && pnpm build-types", - "clean": "rimraf dist test/generated test/e2e/generated coverage node_modules/.cache", - "dev": "rimraf dist && pnpm build-bundle --watch", + "build": "tsup && pnpm check-exports", + "check-exports": "attw --pack .", + "dev": "tsup --watch", + "handlebars": "node src/legacy/handlebars/handlebars.cjs", "prepublishOnly": "pnpm build", "test:coverage": "vitest run --config vitest.config.unit.ts --coverage", "test:e2e": "vitest run --config vitest.config.e2e.ts", @@ -83,8 +93,6 @@ "@angular/router": "17.3.9", "@hey-api/client-axios": "workspace:*", "@hey-api/client-fetch": "workspace:*", - "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "15.2.3", "@tanstack/react-query": "5.56.2", "@tanstack/solid-query": "5.51.21", "@tanstack/svelte-query": "5.56.2", diff --git a/packages/openapi-ts/rollup.config.ts b/packages/openapi-ts/rollup.config.ts deleted file mode 100644 index 5989e110c..000000000 --- a/packages/openapi-ts/rollup.config.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { readFileSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -import commonjs from '@rollup/plugin-commonjs'; -import json from '@rollup/plugin-json'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; -import handlebars from 'handlebars'; -import type { Plugin, RollupOptions } from 'rollup'; -import { defineConfig } from 'rollup'; - -/** - * Custom plugin to parse handlebar imports and precompile - * the template on the fly. This reduces runtime by about - * half on large projects. - */ -export function handlebarsPlugin(): Plugin { - return { - load: (file: any) => { - if (path.extname(file) === '.hbs') { - const template = readFileSync(file, 'utf8').toString().trim(); - const templateSpec = handlebars.precompile(template, { - knownHelpers: { - camelCase: true, - equals: true, - ifdef: true, - notEquals: true, - transformServiceName: true, - }, - knownHelpersOnly: true, - noEscape: true, - preventIndent: true, - strict: true, - }); - return `export default ${templateSpec};`; - } - return null; - }, - name: 'handlebars', - resolveId: (file: any, importer: any) => { - if (path.extname(file) === '.hbs') { - return path.resolve(path.dirname(importer), file); - } - return null; - }, - }; -} - -const __dirname = fileURLToPath(new URL('.', import.meta.url)); - -const pkg = JSON.parse( - readFileSync(new URL('./package.json', import.meta.url)).toString(), -); - -// ESM only dependencies are not treated as external so that we can fully support CommonJS and ESM -const esmDependencies = ['camelcase']; - -export const externalDependencies = [ - ...Object.keys(pkg.dependencies ?? {}), - ...Object.keys(pkg.peerDependencies ?? {}), -].filter((dependency) => !esmDependencies.includes(dependency)); - -function createConfig(isProduction: boolean) { - return defineConfig({ - external: externalDependencies, - input: path.resolve(__dirname, 'src/node/index.ts'), - output: { - file: path.resolve(__dirname, 'dist/node/index.cjs'), - format: 'cjs', - }, - plugins: [ - nodeResolve({ preferBuiltins: true }), - typescript({ - declaration: false, - tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'), - }), - commonjs({ - sourceMap: false, - }), - json(), - handlebarsPlugin(), - isProduction && terser(), - ], - }); -} - -export default (commandLineArgs: any): RollupOptions[] => { - const isDev = commandLineArgs.watch; - const isProduction = !isDev; - return defineConfig([createConfig(isProduction)]); -}; diff --git a/packages/openapi-ts/rollup.dts.config.ts b/packages/openapi-ts/rollup.dts.config.ts deleted file mode 100644 index ebb285d54..000000000 --- a/packages/openapi-ts/rollup.dts.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'rollup'; -import dts from 'rollup-plugin-dts'; - -import { externalDependencies } from './rollup.config'; - -export default defineConfig({ - external: externalDependencies, - input: { - index: './temp/node/index.d.ts', - }, - output: { - dir: './dist/node', - format: 'cjs', - }, - plugins: [dts({ respectExternal: true })], -}); diff --git a/packages/openapi-ts/src/generate/client.ts b/packages/openapi-ts/src/generate/client.ts index 720d8b4f5..a818ad7f7 100644 --- a/packages/openapi-ts/src/generate/client.ts +++ b/packages/openapi-ts/src/generate/client.ts @@ -1,11 +1,31 @@ -import { copyFileSync, readFileSync, writeFileSync } from 'node:fs'; -import { createRequire } from 'node:module'; +import { copyFileSync } from 'node:fs'; import path from 'node:path'; import { getConfig, isStandaloneClient } from '../utils/config'; import { ensureDirSync } from './utils'; -const require = createRequire(import.meta.url); +const isESM = () => { + try { + return typeof import.meta.url === 'string'; + } catch (error) { + return false; + } +}; + +const getRequire = async (): Promise => { + try { + if (isESM()) { + const module: any = await import('node:module'); + const createRequire: (path: string | URL) => NodeRequire = + module.createRequire; + return createRequire(import.meta.url); + } + + return module.require; + } catch (error) { + return module.require; + } +}; export const clientModulePath = () => { const config = getConfig(); @@ -16,7 +36,7 @@ export const clientOptionsTypeName = () => 'Options'; /** * (optional) Creates a `client.ts` file containing the same exports as a - * standalone client package. Creates a `core` directory containing the modules + * standalone client package. Creates a `client` directory containing the modules * from standalone client. These files are generated only when `client.bundle` * is set to true. */ @@ -31,9 +51,10 @@ export const generateClient = async ( } // create directory for client modules - const dirPath = path.resolve(outputPath, 'core'); + const dirPath = path.resolve(outputPath, 'client'); ensureDirSync(dirPath); + const require = await getRequire(); const clientModulePath = path.normalize(require.resolve(moduleName)); const clientModulePathComponents = clientModulePath.split(path.sep); const clientSrcPath = [ @@ -52,12 +73,4 @@ export const generateClient = async ( path.resolve(dirPath, file), ); }); - - // copy index file with cherry-picked exports - const nodeIndexFile = readFileSync( - path.resolve(clientSrcPath, 'node', 'index.ts'), - 'utf-8', - ); - const indexFile = nodeIndexFile.replaceAll('../', './core/'); - writeFileSync(path.resolve(outputPath, 'client.ts'), indexFile, 'utf-8'); }; diff --git a/packages/openapi-ts/src/generate/output.ts b/packages/openapi-ts/src/generate/output.ts index ea08d814d..aa34b8534 100644 --- a/packages/openapi-ts/src/generate/output.ts +++ b/packages/openapi-ts/src/generate/output.ts @@ -88,6 +88,10 @@ export const generateOutput = async ( await generatePlugins({ client, files }); Object.entries(files).forEach(([name, file]) => { + if (config.dryRun) { + return; + } + if (name === 'index') { file.write(); } else { diff --git a/packages/openapi-ts/src/index.ts b/packages/openapi-ts/src/index.ts index 23ee28dd1..85a8c7334 100644 --- a/packages/openapi-ts/src/index.ts +++ b/packages/openapi-ts/src/index.ts @@ -18,7 +18,7 @@ import { operationParameterFilterFn, operationParameterNameFn, } from './utils/parse'; -import { Performance } from './utils/performance'; +import { Performance, PerformanceReport } from './utils/performance'; import { postProcessClient } from './utils/postprocess'; type OutputProcessor = { @@ -112,7 +112,7 @@ const getClient = (userConfig: ClientConfig): Config['client'] => { }; if (typeof userConfig.client === 'string') { client.name = userConfig.client; - } else { + } else if (userConfig.client) { client = { ...client, ...userConfig.client, @@ -269,7 +269,7 @@ const initConfigs = async (userConfig: UserConfig): Promise => { const client = getClient(userConfig); - if (!CLIENTS.includes(client.name)) { + if (client.name && !CLIENTS.includes(client.name)) { throw new Error('🚫 invalid client - select a valid client value'); } @@ -286,7 +286,7 @@ const initConfigs = async (userConfig: UserConfig): Promise => { output.path = path.resolve(process.cwd(), output.path); - return setConfig({ + const config = setConfig({ base, client, configFile, @@ -305,6 +305,12 @@ const initConfigs = async (userConfig: UserConfig): Promise => { types, useOptions, }); + + if (debug) { + console.warn('config:', config); + } + + return config; }); }; @@ -319,17 +325,23 @@ export async function createClient( ): Promise> { Performance.start('createClient'); + Performance.start('config'); const configs = await initConfigs(userConfig); + Performance.end('config'); + Performance.start('handlebars'); const templates = registerHandlebarTemplates(); + Performance.end('handlebars'); const pCreateClient = (config: Config) => async () => { + Performance.start('openapi'); const openApi = typeof config.input === 'string' ? await getOpenApiSpec(config.input) : (config.input as unknown as Awaited< ReturnType >); + Performance.end('openapi'); if (config.experimental_parser) { Performance.start('experimental_parser'); @@ -355,13 +367,19 @@ export async function createClient( const client = postProcessClient(parsed); Performance.end('parser'); + logClientMessage(); + + Performance.start('generator'); + await generateOutput(openApi, client, templates); + Performance.end('generator'); + + Performance.start('postprocess'); if (!config.dryRun) { - logClientMessage(); - await generateOutput(openApi, client, templates); processOutput(); - } - console.log('✨ Done! Your client is located in:', config.output.path); + console.log('✨ Done! Your client is located in:', config.output.path); + } + Performance.end('postprocess'); return client; } @@ -379,6 +397,22 @@ export async function createClient( Performance.end('createClient'); + if (userConfig.debug) { + const perfReport = new PerformanceReport({ + totalMark: 'createClient', + }); + perfReport.report({ + marks: [ + 'config', + 'openapi', + 'handlebars', + 'parser', + 'generator', + 'postprocess', + ], + }); + } + return clients; } @@ -391,3 +425,5 @@ export default { createClient, defineConfig, }; + +export type { UserConfig } from './types/config'; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/client.js b/packages/openapi-ts/src/legacy/handlebars/compiled/client.js new file mode 100644 index 000000000..edf1d2dc0 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/client.js @@ -0,0 +1,457 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return "import { NgModule} from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\n\nimport { AngularHttpRequest } from './core/AngularHttpRequest';\nimport { BaseHttpRequest } from './core/BaseHttpRequest';\nimport type { OpenAPIConfig } from './core/OpenAPI';\nimport { OpenAPI } from './core/OpenAPI';\nimport { Interceptors } from './core/OpenAPI';\n"; + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.strict, + alias2 = container.lambda; + + return ( + "import type { BaseHttpRequest } from './core/BaseHttpRequest';\nimport type { OpenAPIConfig } from './core/OpenAPI';\nimport { Interceptors } from './core/OpenAPI';\nimport { " + + ((stack1 = alias2( + alias1(depth0, 'httpRequest', { + start: { line: 14, column: 12 }, + end: { line: 14, column: 23 }, + }), + depth0, + )) != null + ? stack1 + : '') + + " } from './core/" + + ((stack1 = alias2( + alias1(depth0, 'httpRequest', { + start: { line: 14, column: 45 }, + end: { line: 14, column: 56 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "';\n" + ); + }, + 5: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return (stack1 = lookupProperty(helpers, 'each').call( + depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty(depth0, 'services'), + { + name: 'each', + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 18, column: 0 }, end: { line: 20, column: 9 } }, + }, + )) != null + ? stack1 + : ''; + }, + 6: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + 'import { ' + + ((stack1 = lookupProperty(helpers, 'transformServiceName').call( + depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty(depth0, 'name'), + { + name: 'transformServiceName', + hash: {}, + data: data, + loc: { + start: { line: 19, column: 9 }, + end: { line: 19, column: 40 }, + }, + }, + )) != null + ? stack1 + : '') + + " } from './services.gen';\n" + ); + }, + 8: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.strict, + alias2 = container.lambda, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + "@NgModule({\n imports: [HttpClientModule],\n providers: [\n {\n provide: OpenAPI,\n useValue: {\n BASE: OpenAPI?.BASE ?? '" + + ((stack1 = alias2( + alias1(depth0, 'server', { + start: { line: 30, column: 31 }, + end: { line: 30, column: 37 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n VERSION: OpenAPI?.VERSION ?? '" + + ((stack1 = alias2( + alias1(depth0, 'version', { + start: { line: 31, column: 37 }, + end: { line: 31, column: 44 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n WITH_CREDENTIALS: OpenAPI?.WITH_CREDENTIALS ?? false,\n CREDENTIALS: OpenAPI?.CREDENTIALS ?? 'include',\n TOKEN: OpenAPI?.TOKEN,\n USERNAME: OpenAPI?.USERNAME,\n PASSWORD: OpenAPI?.PASSWORD,\n HEADERS: OpenAPI?.HEADERS,\n ENCODE_PATH: OpenAPI?.ENCODE_PATH,\n interceptors: {\n response: OpenAPI?.interceptors?.response ?? new Interceptors(),\n },\n } as OpenAPIConfig,\n },\n {\n provide: BaseHttpRequest,\n useClass: AngularHttpRequest,\n },\n" + + ((stack1 = lookupProperty(helpers, 'each').call( + depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty(depth0, 'services'), + { + name: 'each', + hash: {}, + fn: container.program(9, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 48, column: 2 }, + end: { line: 50, column: 11 }, + }, + }, + )) != null + ? stack1 + : '') + + ' ]\n})\nexport class ' + + ((stack1 = alias2( + alias1( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'name', + { start: { line: 53, column: 16 }, end: { line: 53, column: 34 } }, + ), + depth0, + )) != null + ? stack1 + : '') + + ' {}\n' + ); + }, + 9: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ' ' + + ((stack1 = lookupProperty(helpers, 'transformServiceName').call( + depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty(depth0, 'name'), + { + name: 'transformServiceName', + hash: {}, + data: data, + loc: { + start: { line: 49, column: 2 }, + end: { line: 49, column: 33 }, + }, + }, + )) != null + ? stack1 + : '') + + ',\n' + ); + }, + 11: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.strict, + alias2 = container.lambda, + alias3 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + 'type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;\n\nexport class ' + + ((stack1 = alias2( + alias1( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'name', + { start: { line: 57, column: 16 }, end: { line: 57, column: 34 } }, + ), + depth0, + )) != null + ? stack1 + : '') + + ' {\n\n' + + ((stack1 = lookupProperty(helpers, 'each').call( + alias3, + lookupProperty(depth0, 'services'), + { + name: 'each', + hash: {}, + fn: container.program(12, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 59, column: 1 }, + end: { line: 61, column: 10 }, + }, + }, + )) != null + ? stack1 + : '') + + '\n public readonly request: BaseHttpRequest;\n\n constructor(config?: Partial, HttpRequest: HttpRequestConstructor = ' + + ((stack1 = alias2( + alias1(depth0, 'httpRequest', { + start: { line: 65, column: 87 }, + end: { line: 65, column: 98 }, + }), + depth0, + )) != null + ? stack1 + : '') + + ") {\n this.request = new HttpRequest({\n BASE: config?.BASE ?? '" + + ((stack1 = alias2( + alias1(depth0, 'server', { + start: { line: 67, column: 29 }, + end: { line: 67, column: 35 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n VERSION: config?.VERSION ?? '" + + ((stack1 = alias2( + alias1(depth0, 'version', { + start: { line: 68, column: 35 }, + end: { line: 68, column: 42 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,\n CREDENTIALS: config?.CREDENTIALS ?? 'include',\n TOKEN: config?.TOKEN,\n USERNAME: config?.USERNAME,\n PASSWORD: config?.PASSWORD,\n HEADERS: config?.HEADERS,\n ENCODE_PATH: config?.ENCODE_PATH,\n interceptors: {\n request: config?.interceptors?.request ?? new Interceptors(),\n response: config?.interceptors?.response ?? new Interceptors(),\n },\n });\n\n" + + ((stack1 = lookupProperty(helpers, 'each').call( + alias3, + lookupProperty(depth0, 'services'), + { + name: 'each', + hash: {}, + fn: container.program(14, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 82, column: 2 }, + end: { line: 84, column: 11 }, + }, + }, + )) != null + ? stack1 + : '') + + ' }\n}\n' + ); + }, + 12: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ' public readonly ' + + ((stack1 = lookupProperty(helpers, 'camelCase').call( + alias1, + lookupProperty(depth0, 'name'), + { + name: 'camelCase', + hash: {}, + data: data, + loc: { + start: { line: 60, column: 17 }, + end: { line: 60, column: 37 }, + }, + }, + )) != null + ? stack1 + : '') + + ': ' + + ((stack1 = lookupProperty(helpers, 'transformServiceName').call( + alias1, + lookupProperty(depth0, 'name'), + { + name: 'transformServiceName', + hash: {}, + data: data, + loc: { + start: { line: 60, column: 39 }, + end: { line: 60, column: 70 }, + }, + }, + )) != null + ? stack1 + : '') + + ';\n' + ); + }, + 14: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ' this.' + + ((stack1 = lookupProperty(helpers, 'camelCase').call( + alias1, + lookupProperty(depth0, 'name'), + { + name: 'camelCase', + hash: {}, + data: data, + loc: { + start: { line: 83, column: 7 }, + end: { line: 83, column: 27 }, + }, + }, + )) != null + ? stack1 + : '') + + ' = new ' + + ((stack1 = lookupProperty(helpers, 'transformServiceName').call( + alias1, + lookupProperty(depth0, 'name'), + { + name: 'transformServiceName', + hash: {}, + data: data, + loc: { + start: { line: 83, column: 34 }, + end: { line: 83, column: 65 }, + }, + }, + )) != null + ? stack1 + : '') + + '(this.request);\n' + ); + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 15, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + '\n' + + ((stack1 = lookupProperty(helpers, 'if').call( + alias1, + lookupProperty(depth0, 'services'), + { + name: 'if', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 17, column: 0 }, end: { line: 21, column: 7 } }, + }, + )) != null + ? stack1 + : '') + + '\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(11, data, 0), + data: data, + loc: { + start: { line: 23, column: 0 }, + end: { line: 87, column: 11 }, + }, + }, + )) != null + ? stack1 + : '') + ); + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiError.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiError.js new file mode 100644 index 000000000..4cb06ccc6 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiError.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "import type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\n\nexport class ApiError extends Error {\n public readonly url: string;\n public readonly status: number;\n public readonly statusText: string;\n public readonly body: unknown;\n public readonly request: ApiRequestOptions;\n\n constructor(request: ApiRequestOptions, response: ApiResult, message: string) {\n super(message);\n\n this.name = 'ApiError';\n this.url = response.url;\n this.status = response.status;\n this.statusText = response.statusText;\n this.body = response.body;\n this.request = request;\n }\n}"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiRequestOptions.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiRequestOptions.js new file mode 100644 index 000000000..b63eb8a02 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiRequestOptions.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export type ApiRequestOptions = {\n readonly body?: any;\n readonly cookies?: Record;\n readonly errors?: Record;\n readonly formData?: Record | any[] | Blob | File;\n readonly headers?: Record;\n readonly mediaType?: string;\n readonly method:\n | 'DELETE'\n | 'GET'\n | 'HEAD'\n | 'OPTIONS'\n | 'PATCH'\n | 'POST'\n | 'PUT';\n readonly path?: Record;\n readonly query?: Record;\n readonly responseHeader?: string;\n readonly responseTransformer?: (data: unknown) => Promise;\n readonly url: string;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiResult.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiResult.js new file mode 100644 index 000000000..6d87d8336 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/ApiResult.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export type ApiResult = {\n readonly body: TData;\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly url: string;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/BaseHttpRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/BaseHttpRequest.js new file mode 100644 index 000000000..2d4bf78e2 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/BaseHttpRequest.js @@ -0,0 +1,109 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return "import type { HttpClient } from '@angular/common/http';\nimport type { Observable } from 'rxjs';\n\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { OpenAPIConfig } from './OpenAPI';\n"; + }, + 3: function (container, depth0, helpers, partials, data) { + return "import type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { CancelablePromise } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n"; + }, + 5: function (container, depth0, helpers, partials, data) { + return ' constructor(\n public readonly config: OpenAPIConfig,\n public readonly http: HttpClient,\n ) {}\n'; + }, + 7: function (container, depth0, helpers, partials, data) { + return ' constructor(public readonly config: OpenAPIConfig) {}\n'; + }, + 9: function (container, depth0, helpers, partials, data) { + return ' public abstract request(options: ApiRequestOptions): Observable;\n'; + }, + 11: function (container, depth0, helpers, partials, data) { + return ' public abstract request(options: ApiRequestOptions): CancelablePromise;\n'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 11, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + '\nexport abstract class BaseHttpRequest {\n\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.program(7, data, 0), + data: data, + loc: { + start: { line: 15, column: 1 }, + end: { line: 22, column: 12 }, + }, + }, + )) != null + ? stack1 + : '') + + '\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(9, data, 0), + inverse: container.program(11, data, 0), + data: data, + loc: { + start: { line: 24, column: 1 }, + end: { line: 28, column: 12 }, + }, + }, + )) != null + ? stack1 + : '') + + '}' + ); + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/CancelablePromise.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/CancelablePromise.js new file mode 100644 index 000000000..b2154cde4 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/CancelablePromise.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export class CancelError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'CancelError';\n }\n\n public get isCancelled(): boolean {\n return true;\n }\n}\n\nexport interface OnCancel {\n readonly isResolved: boolean;\n readonly isRejected: boolean;\n readonly isCancelled: boolean;\n\n (cancelHandler: () => void): void;\n}\n\nexport class CancelablePromise implements Promise {\n private _isResolved: boolean;\n private _isRejected: boolean;\n private _isCancelled: boolean;\n readonly cancelHandlers: (() => void)[];\n readonly promise: Promise;\n private _resolve?: (value: T | PromiseLike) => void;\n private _reject?: (reason?: unknown) => void;\n\n constructor(\n executor: (\n resolve: (value: T | PromiseLike) => void,\n reject: (reason?: unknown) => void,\n onCancel: OnCancel\n ) => void\n ) {\n this._isResolved = false;\n this._isRejected = false;\n this._isCancelled = false;\n this.cancelHandlers = [];\n this.promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n\n const onResolve = (value: T | PromiseLike): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isResolved = true;\n if (this._resolve) this._resolve(value);\n };\n\n const onReject = (reason?: unknown): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isRejected = true;\n if (this._reject) this._reject(reason);\n };\n\n const onCancel = (cancelHandler: () => void): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this.cancelHandlers.push(cancelHandler);\n };\n\n Object.defineProperty(onCancel, 'isResolved', {\n get: (): boolean => this._isResolved,\n });\n\n Object.defineProperty(onCancel, 'isRejected', {\n get: (): boolean => this._isRejected,\n });\n\n Object.defineProperty(onCancel, 'isCancelled', {\n get: (): boolean => this._isCancelled,\n });\n\n return executor(onResolve, onReject, onCancel as OnCancel);\n });\n }\n\n get [Symbol.toStringTag]() {\n return \"Cancellable Promise\";\n }\n\n public then(\n onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null\n ): Promise {\n return this.promise.then(onFulfilled, onRejected);\n }\n\n public catch(\n onRejected?: ((reason: unknown) => TResult | PromiseLike) | null\n ): Promise {\n return this.promise.catch(onRejected);\n }\n\n public finally(onFinally?: (() => void) | null): Promise {\n return this.promise.finally(onFinally);\n }\n\n public cancel(): void {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isCancelled = true;\n if (this.cancelHandlers.length) {\n try {\n for (const cancelHandler of this.cancelHandlers) {\n cancelHandler();\n }\n } catch (error) {\n console.warn('Cancellation threw an error', error);\n return;\n }\n }\n this.cancelHandlers.length = 0;\n if (this._reject) this._reject(new CancelError('Request aborted'));\n }\n\n public get isCancelled(): boolean {\n return this._isCancelled;\n }\n}"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/HttpRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/HttpRequest.js new file mode 100644 index 000000000..de89e82e7 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/HttpRequest.js @@ -0,0 +1,147 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return "import { Inject, Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Observable } from 'rxjs';\n\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport { BaseHttpRequest } from './BaseHttpRequest';\nimport type { OpenAPIConfig } from './OpenAPI';\nimport { OpenAPI } from './OpenAPI';\nimport { request as __request } from './request';\n"; + }, + 3: function (container, depth0, helpers, partials, data) { + return "import type { ApiRequestOptions } from './ApiRequestOptions';\nimport { BaseHttpRequest } from './BaseHttpRequest';\nimport type { CancelablePromise } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\nimport { request as __request } from './request';\n"; + }, + 5: function (container, depth0, helpers, partials, data) { + return '@Injectable()\n'; + }, + 7: function (container, depth0, helpers, partials, data) { + return ' constructor(\n @Inject(OpenAPI)\n config: OpenAPIConfig,\n http: HttpClient,\n ) {\n super(config, http);\n }\n'; + }, + 9: function (container, depth0, helpers, partials, data) { + return ' constructor(config: OpenAPIConfig) {\n super(config);\n }\n'; + }, + 11: function (container, depth0, helpers, partials, data) { + return ' /**\n * Request method\n * @param options The request options from the service\n * @returns Observable\n * @throws ApiError\n */\n public override request(options: ApiRequestOptions): Observable {\n return __request(this.config, this.http, options);\n }\n'; + }, + 13: function (container, depth0, helpers, partials, data) { + return ' /**\n * Request method\n * @param options The request options from the service\n * @returns CancelablePromise\n * @throws ApiError\n */\n public override request(options: ApiRequestOptions): CancelablePromise {\n return __request(this.config, options);\n }\n'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 17, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + '\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 19, column: 0 }, + end: { line: 21, column: 11 }, + }, + }, + )) != null + ? stack1 + : '') + + 'export class ' + + ((stack1 = container.lambda( + container.strict(depth0, 'httpRequest', { + start: { line: 22, column: 15 }, + end: { line: 22, column: 26 }, + }), + depth0, + )) != null + ? stack1 + : '') + + ' extends BaseHttpRequest {\n\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(7, data, 0), + inverse: container.program(9, data, 0), + data: data, + loc: { + start: { line: 24, column: 1 }, + end: { line: 36, column: 12 }, + }, + }, + )) != null + ? stack1 + : '') + + '\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(11, data, 0), + inverse: container.program(13, data, 0), + data: data, + loc: { + start: { line: 38, column: 1 }, + end: { line: 58, column: 12 }, + }, + }, + )) != null + ? stack1 + : '') + + '}' + ); + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/OpenAPI.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/OpenAPI.js new file mode 100644 index 000000000..6fef4a7c3 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/OpenAPI.js @@ -0,0 +1,275 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return "import type { HttpResponse } from '@angular/common/http';\n"; + }, + 3: function (container, depth0, helpers, partials, data) { + return "import type { AxiosRequestConfig, AxiosResponse } from 'axios';\n"; + }, + 5: function (container, depth0, helpers, partials, data) { + return "import type { RequestInit, Response } from 'node-fetch';\n"; + }, + 7: function (container, depth0, helpers, partials, data) { + return ' response: Interceptors>;\n'; + }, + 9: function (container, depth0, helpers, partials, data) { + return ' request: Interceptors;\n response: Interceptors;\n'; + }, + 11: function (container, depth0, helpers, partials, data) { + return ' request: Interceptors;\n response: Interceptors;\n'; + }, + 13: function (container, depth0, helpers, partials, data) { + return ' request: Interceptors;\n response: Interceptors;\n'; + }, + 15: function (container, depth0, helpers, partials, data) { + return ' request: new Interceptors(),\n'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = container.strict, + alias3 = container.lambda, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 3, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/axios', + { + name: 'equals', + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 4, column: 0 }, end: { line: 6, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/node', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 7, column: 0 }, end: { line: 9, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + "import type { ApiRequestOptions } from './ApiRequestOptions';\n\ntype Headers = Record;\ntype Middleware = (value: T) => T | Promise;\ntype Resolver = (options: ApiRequestOptions) => Promise;\n\nexport class Interceptors {\n _fns: Middleware[];\n\n constructor() {\n this._fns = [];\n }\n\n eject(fn: Middleware): void {\n const index = this._fns.indexOf(fn);\n if (index !== -1) {\n this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];\n }\n }\n\n use(fn: Middleware): void {\n this._fns = [...this._fns, fn];\n }\n}\n\nexport type OpenAPIConfig = {\n BASE: string;\n CREDENTIALS: 'include' | 'omit' | 'same-origin';\n ENCODE_PATH?: ((path: string) => string) | undefined;\n HEADERS?: Headers | Resolver | undefined;\n PASSWORD?: string | Resolver | undefined;\n TOKEN?: string | Resolver | undefined;\n USERNAME?: string | Resolver | undefined;\n VERSION: string;\n WITH_CREDENTIALS: boolean;\n interceptors: {\n" + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(7, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 46, column: 2 }, + end: { line: 48, column: 13 }, + }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/axios', + { + name: 'equals', + hash: {}, + fn: container.program(9, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 49, column: 2 }, + end: { line: 52, column: 13 }, + }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/fetch', + { + name: 'equals', + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 53, column: 2 }, + end: { line: 56, column: 13 }, + }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/node', + { + name: 'equals', + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 57, column: 2 }, + end: { line: 60, column: 13 }, + }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/xhr', + { + name: 'equals', + hash: {}, + fn: container.program(13, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 61, column: 2 }, + end: { line: 64, column: 13 }, + }, + }, + )) != null + ? stack1 + : '') + + " };\n};\n\nexport const OpenAPI: OpenAPIConfig = {\n BASE: '" + + ((stack1 = alias3( + alias2(depth0, 'server', { + start: { line: 69, column: 11 }, + end: { line: 69, column: 17 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n CREDENTIALS: 'include',\n ENCODE_PATH: undefined,\n HEADERS: undefined,\n PASSWORD: undefined,\n TOKEN: undefined,\n USERNAME: undefined,\n VERSION: '" + + ((stack1 = alias3( + alias2(depth0, 'version', { + start: { line: 76, column: 14 }, + end: { line: 76, column: 21 }, + }), + depth0, + )) != null + ? stack1 + : '') + + "',\n WITH_CREDENTIALS: false,\n interceptors: {\n" + + ((stack1 = lookupProperty(helpers, 'notEquals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'notEquals', + hash: {}, + fn: container.program(15, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 79, column: 2 }, + end: { line: 81, column: 16 }, + }, + }, + )) != null + ? stack1 + : '') + + ' response: new Interceptors(),\n },\n};' + ); + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getHeaders.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getHeaders.js new file mode 100644 index 000000000..107171f6b --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getHeaders.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => {\n return forkJoin({\n // @ts-ignore\n token: resolve(options, config.TOKEN),\n // @ts-ignore\n username: resolve(options, config.USERNAME),\n // @ts-ignore\n password: resolve(options, config.PASSWORD),\n // @ts-ignore\n additionalHeaders: resolve(options, config.HEADERS),\n }).pipe(\n map(({ token, username, password, additionalHeaders }) => {\n const headers = Object.entries({\n Accept: 'application/json',\n ...additionalHeaders,\n ...options.headers,\n })\n .filter(([, value]) => value !== undefined && value !== null)\n .reduce((headers, [key, value]) => ({\n ...headers,\n [key]: String(value),\n }), {} as Record);\n\n if (isStringWithValue(token)) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n\n if (isStringWithValue(username) && isStringWithValue(password)) {\n const credentials = base64(`${username}:${password}`);\n headers['Authorization'] = `Basic ${credentials}`;\n }\n\n if (options.body !== undefined) {\n if (options.mediaType) {\n headers['Content-Type'] = options.mediaType;\n } else if (isBlob(options.body)) {\n headers['Content-Type'] = options.body.type || 'application/octet-stream';\n } else if (isString(options.body)) {\n headers['Content-Type'] = 'text/plain';\n } else if (!isFormData(options.body)) {\n headers['Content-Type'] = 'application/json';\n }\n }\n\n return new HttpHeaders(headers);\n }),\n );\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getRequestBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getRequestBody.js new file mode 100644 index 000000000..180b22abe --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getRequestBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getRequestBody = (options: ApiRequestOptions): unknown => {\n if (options.body) {\n if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {\n return JSON.stringify(options.body);\n } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {\n return options.body;\n } else {\n return JSON.stringify(options.body);\n }\n }\n return undefined;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseBody.js new file mode 100644 index 000000000..42fe81e07 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseBody = (response: HttpResponse): T | undefined => {\n if (response.status !== 204 && response.body !== null) {\n return response.body;\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseHeader.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseHeader.js new file mode 100644 index 000000000..6fdbaff37 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/getResponseHeader.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => {\n if (responseHeader) {\n const value = response.headers.get(responseHeader);\n if (isString(value)) {\n return value;\n }\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/request.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/request.js new file mode 100644 index 000000000..f9fe239aa --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/request.js @@ -0,0 +1,230 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + "import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport type { HttpResponse, HttpErrorResponse } from '@angular/common/http';\nimport { forkJoin, of, throwError } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport type { Observable } from 'rxjs';\n\nimport { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport type { OpenAPIConfig } from './OpenAPI';\n\n" + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isString'), + depth0, + { + name: 'functions/isString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isStringWithValue'), + depth0, + { + name: 'functions/isStringWithValue', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isBlob'), + depth0, + { + name: 'functions/isBlob', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isFormData'), + depth0, + { + name: 'functions/isFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/base64'), + depth0, + { + name: 'functions/base64', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getQueryString'), + depth0, + { + name: 'functions/getQueryString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getUrl'), + depth0, + { + name: 'functions/getUrl', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getFormData'), + depth0, + { + name: 'functions/getFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/resolve'), + depth0, + { + name: 'functions/resolve', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'angular/getHeaders'), + depth0, + { + name: 'angular/getHeaders', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'angular/getRequestBody'), + depth0, + { + name: 'angular/getRequestBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'angular/sendRequest'), + depth0, + { + name: 'angular/sendRequest', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'angular/getResponseHeader'), + depth0, + { + name: 'angular/getResponseHeader', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'angular/getResponseBody'), + depth0, + { + name: 'angular/getResponseBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/catchErrorCodes'), + depth0, + { + name: 'functions/catchErrorCodes', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param http The Angular HTTP client\n * @param options The request options from the service\n * @returns Observable\n * @throws ApiError\n */\nexport const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => {\n const url = getUrl(config, options);\n const formData = getFormData(options);\n const body = getRequestBody(options);\n\n return getHeaders(config, options).pipe(\n switchMap(headers => {\n return sendRequest(config, options, http, url, body, formData, headers);\n }),\n switchMap(async response => {\n for (const fn of config.interceptors.response._fns) {\n response = await fn(response);\n }\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n let transformedBody = responseBody;\n if (options.responseTransformer && response.ok) {\n transformedBody = await options.responseTransformer(responseBody)\n }\n\n return {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader ?? transformedBody,\n } as ApiResult;\n }),\n catchError((error: HttpErrorResponse) => {\n if (!error.status) {\n return throwError(() => error);\n }\n return of({\n url,\n ok: error.ok,\n status: error.status,\n statusText: error.statusText,\n body: error.error ?? error.statusText,\n } as ApiResult);\n }),\n map(result => {\n catchErrorCodes(options, result);\n return result.body as T;\n }),\n catchError((error: ApiError) => {\n return throwError(() => error);\n }),\n );\n};' + ); + }, + usePartial: true, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/sendRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/sendRequest.js new file mode 100644 index 000000000..509435921 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/angular/sendRequest.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const sendRequest = (\n config: OpenAPIConfig,\n options: ApiRequestOptions,\n http: HttpClient,\n url: string,\n body: unknown,\n formData: FormData | undefined,\n headers: HttpHeaders\n): Observable> => {\n return http.request(options.method, url, {\n headers,\n body: body ?? formData,\n withCredentials: config.WITH_CREDENTIALS,\n observe: 'response',\n });\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getHeaders.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getHeaders.js new file mode 100644 index 000000000..b6bbde16d --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getHeaders.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise> => {\n const [token, username, password, additionalHeaders] = await Promise.all([\n // @ts-ignore\n resolve(options, config.TOKEN),\n // @ts-ignore\n resolve(options, config.USERNAME),\n // @ts-ignore\n resolve(options, config.PASSWORD),\n // @ts-ignore\n resolve(options, config.HEADERS),\n ]);\n\n const headers = Object.entries({\n Accept: 'application/json',\n ...additionalHeaders,\n ...options.headers,\n })\n .filter(([, value]) => value !== undefined && value !== null)\n .reduce((headers, [key, value]) => ({\n ...headers,\n [key]: String(value),\n }), {} as Record);\n\n if (isStringWithValue(token)) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n\n if (isStringWithValue(username) && isStringWithValue(password)) {\n const credentials = base64(`${username}:${password}`);\n headers['Authorization'] = `Basic ${credentials}`;\n }\n\n if (options.body !== undefined) {\n if (options.mediaType) {\n headers['Content-Type'] = options.mediaType;\n } else if (isBlob(options.body)) {\n headers['Content-Type'] = options.body.type || 'application/octet-stream';\n } else if (isString(options.body)) {\n headers['Content-Type'] = 'text/plain';\n } else if (!isFormData(options.body)) {\n headers['Content-Type'] = 'application/json';\n }\n } else if (options.formData !== undefined) {\n if (options.mediaType) {\n headers['Content-Type'] = options.mediaType;\n }\n }\n\n return headers;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getRequestBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getRequestBody.js new file mode 100644 index 000000000..063582829 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getRequestBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getRequestBody = (options: ApiRequestOptions): unknown => {\n if (options.body) {\n return options.body;\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseBody.js new file mode 100644 index 000000000..800f8ddbe --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseBody = (response: AxiosResponse): unknown => {\n if (response.status !== 204) {\n return response.data;\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseHeader.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseHeader.js new file mode 100644 index 000000000..3d79fee5e --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/getResponseHeader.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => {\n if (responseHeader) {\n const content = response.headers[responseHeader];\n if (isString(content)) {\n return content;\n }\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/request.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/request.js new file mode 100644 index 000000000..4ce4ee749 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/request.js @@ -0,0 +1,332 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return 'ApiResult'; + }, + 3: function (container, depth0, helpers, partials, data) { + return 'T'; + }, + 5: function (container, depth0, helpers, partials, data) { + return 'result.body'; + }, + 7: function (container, depth0, helpers, partials, data) { + return 'result'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + "import axios from 'axios';\nimport type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';\n\nimport { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport { CancelablePromise } from './CancelablePromise';\nimport type { OnCancel } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n\n" + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isString'), + depth0, + { + name: 'functions/isString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isStringWithValue'), + depth0, + { + name: 'functions/isStringWithValue', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isBlob'), + depth0, + { + name: 'functions/isBlob', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isFormData'), + depth0, + { + name: 'functions/isFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isSuccess'), + depth0, + { + name: 'functions/isSuccess', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/base64'), + depth0, + { + name: 'functions/base64', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getQueryString'), + depth0, + { + name: 'functions/getQueryString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getUrl'), + depth0, + { + name: 'functions/getUrl', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getFormData'), + depth0, + { + name: 'functions/getFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/resolve'), + depth0, + { + name: 'functions/resolve', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'axios/getHeaders'), + depth0, + { + name: 'axios/getHeaders', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'axios/getRequestBody'), + depth0, + { + name: 'axios/getRequestBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'axios/sendRequest'), + depth0, + { + name: 'axios/sendRequest', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'axios/getResponseHeader'), + depth0, + { + name: 'axios/getResponseHeader', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'axios/getResponseBody'), + depth0, + { + name: 'axios/getResponseBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/catchErrorCodes'), + depth0, + { + name: 'functions/catchErrorCodes', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param options The request options from the service\n * @param axiosClient The axios client instance to use\n * @returns CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { + start: { line: 64, column: 30 }, + end: { line: 64, column: 116 }, + }, + }, + )) != null + ? stack1 + : '') + + '>\n * @throws ApiError\n */\nexport const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { + start: { line: 67, column: 136 }, + end: { line: 67, column: 222 }, + }, + }, + )) != null + ? stack1 + : '') + + '> => {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(config, options);\n const formData = getFormData(options);\n const body = getRequestBody(options);\n const headers = await getHeaders(config, options);\n\n if (!onCancel.isCancelled) {\n let response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient);\n\n for (const fn of config.interceptors.response._fns) {\n response = await fn(response);\n }\n\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n let transformedBody = responseBody;\n if (options.responseTransformer && isSuccess(response.status)) {\n transformedBody = await options.responseTransformer(responseBody)\n }\n\n const result: ApiResult = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: responseHeader ?? transformedBody,\n };\n\n catchErrorCodes(options, result);\n\n resolve(' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'body', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.program(7, data, 0), + data: data, + loc: { + start: { line: 100, column: 12 }, + end: { line: 100, column: 98 }, + }, + }, + )) != null + ? stack1 + : '') + + ');\n }\n } catch (error) {\n reject(error);\n }\n });\n};' + ); + }, + usePartial: true, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/sendRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/sendRequest.js new file mode 100644 index 000000000..448fd04f1 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/axios/sendRequest.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const sendRequest = async (\n config: OpenAPIConfig,\n options: ApiRequestOptions,\n url: string,\n body: unknown,\n formData: FormData | undefined,\n headers: Record,\n onCancel: OnCancel,\n axiosClient: AxiosInstance\n): Promise> => {\n const controller = new AbortController();\n\n let requestConfig: AxiosRequestConfig = {\n data: body ?? formData,\n headers,\n method: options.method,\n signal: controller.signal,\n url,\n withCredentials: config.WITH_CREDENTIALS,\n };\n\n onCancel(() => controller.abort());\n\n for (const fn of config.interceptors.request._fns) {\n requestConfig = await fn(requestConfig);\n }\n\n try {\n return await axiosClient.request(requestConfig);\n } catch (error) {\n const axiosError = error as AxiosError;\n if (axiosError.response) {\n return axiosError.response;\n }\n throw error;\n }\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getHeaders.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getHeaders.js new file mode 100644 index 000000000..ba30baa44 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getHeaders.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {\n const [token, username, password, additionalHeaders] = await Promise.all([\n // @ts-ignore\n resolve(options, config.TOKEN),\n // @ts-ignore\n resolve(options, config.USERNAME),\n // @ts-ignore\n resolve(options, config.PASSWORD),\n // @ts-ignore\n resolve(options, config.HEADERS),\n ]);\n\n const headers = Object.entries({\n Accept: 'application/json',\n ...additionalHeaders,\n ...options.headers,\n })\n .filter(([, value]) => value !== undefined && value !== null)\n .reduce((headers, [key, value]) => ({\n ...headers,\n [key]: String(value),\n }), {} as Record);\n\n if (isStringWithValue(token)) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n\n if (isStringWithValue(username) && isStringWithValue(password)) {\n const credentials = base64(`${username}:${password}`);\n headers['Authorization'] = `Basic ${credentials}`;\n }\n\n if (options.body !== undefined) {\n if (options.mediaType) {\n headers['Content-Type'] = options.mediaType;\n } else if (isBlob(options.body)) {\n headers['Content-Type'] = options.body.type || 'application/octet-stream';\n } else if (isString(options.body)) {\n headers['Content-Type'] = 'text/plain';\n } else if (!isFormData(options.body)) {\n headers['Content-Type'] = 'application/json';\n }\n }\n\n return new Headers(headers);\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getRequestBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getRequestBody.js new file mode 100644 index 000000000..1378625cb --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getRequestBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getRequestBody = (options: ApiRequestOptions): unknown => {\n if (options.body !== undefined) {\n if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {\n return JSON.stringify(options.body);\n } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {\n return options.body;\n } else {\n return JSON.stringify(options.body);\n }\n }\n return undefined;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseBody.js new file mode 100644 index 000000000..7b90b1b61 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getResponseBody = async (response: Response): Promise => {\n if (response.status !== 204) {\n try {\n const contentType = response.headers.get('Content-Type');\n if (contentType) {\n const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];\n if (contentType.includes('application/json') || contentType.includes('+json')) {\n return await response.json();\n } else if (binaryTypes.some(type => contentType.includes(type))) {\n return await response.blob();\n } else if (contentType.includes('multipart/form-data')) {\n return await response.formData();\n } else if (contentType.includes('text/')) {\n return await response.text();\n }\n }\n } catch (error) {\n console.error(error);\n }\n }\n return undefined;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseHeader.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseHeader.js new file mode 100644 index 000000000..46f79e225 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/getResponseHeader.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {\n if (responseHeader) {\n const content = response.headers.get(responseHeader);\n if (isString(content)) {\n return content;\n }\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/request.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/request.js new file mode 100644 index 000000000..9b798af0a --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/request.js @@ -0,0 +1,342 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return "import fetch, { FormData, Headers } from 'node-fetch';\nimport type { RequestInit, Response } from 'node-fetch';\n\n"; + }, + 3: function (container, depth0, helpers, partials, data) { + return 'ApiResult'; + }, + 5: function (container, depth0, helpers, partials, data) { + return 'T'; + }, + 7: function (container, depth0, helpers, partials, data) { + return 'result.body'; + }, + 9: function (container, depth0, helpers, partials, data) { + return 'result'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/node', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 5, column: 11 } }, + }, + )) != null + ? stack1 + : '') + + "import { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport { CancelablePromise } from './CancelablePromise';\nimport type { OnCancel } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n\n" + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isString'), + depth0, + { + name: 'functions/isString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isStringWithValue'), + depth0, + { + name: 'functions/isStringWithValue', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isBlob'), + depth0, + { + name: 'functions/isBlob', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isFormData'), + depth0, + { + name: 'functions/isFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/base64'), + depth0, + { + name: 'functions/base64', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getQueryString'), + depth0, + { + name: 'functions/getQueryString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getUrl'), + depth0, + { + name: 'functions/getUrl', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getFormData'), + depth0, + { + name: 'functions/getFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/resolve'), + depth0, + { + name: 'functions/resolve', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/getHeaders'), + depth0, + { + name: 'fetch/getHeaders', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/getRequestBody'), + depth0, + { + name: 'fetch/getRequestBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/sendRequest'), + depth0, + { + name: 'fetch/sendRequest', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/getResponseHeader'), + depth0, + { + name: 'fetch/getResponseHeader', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/getResponseBody'), + depth0, + { + name: 'fetch/getResponseBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/catchErrorCodes'), + depth0, + { + name: 'functions/catchErrorCodes', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param options The request options from the service\n * @returns CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(3, data, 0), + inverse: container.program(5, data, 0), + data: data, + loc: { + start: { line: 62, column: 30 }, + end: { line: 62, column: 116 }, + }, + }, + )) != null + ? stack1 + : '') + + '>\n * @throws ApiError\n */\nexport const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(3, data, 0), + inverse: container.program(5, data, 0), + data: data, + loc: { + start: { line: 65, column: 100 }, + end: { line: 65, column: 186 }, + }, + }, + )) != null + ? stack1 + : '') + + '> => {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(config, options);\n const formData = getFormData(options);\n const body = getRequestBody(options);\n const headers = await getHeaders(config, options);\n\n if (!onCancel.isCancelled) {\n let response = await sendRequest(config, options, url, body, formData, headers, onCancel);\n\n for (const fn of config.interceptors.response._fns) {\n response = await fn(response);\n }\n\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n let transformedBody = responseBody;\n if (options.responseTransformer && response.ok) {\n transformedBody = await options.responseTransformer(responseBody)\n }\n\n const result: ApiResult = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader ?? transformedBody,\n };\n\n catchErrorCodes(options, result);\n\n resolve(' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'body', + { + name: 'equals', + hash: {}, + fn: container.program(7, data, 0), + inverse: container.program(9, data, 0), + data: data, + loc: { + start: { line: 98, column: 12 }, + end: { line: 98, column: 98 }, + }, + }, + )) != null + ? stack1 + : '') + + ');\n }\n } catch (error) {\n reject(error);\n }\n });\n};' + ); + }, + usePartial: true, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/sendRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/sendRequest.js new file mode 100644 index 000000000..0b0087c7b --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/fetch/sendRequest.js @@ -0,0 +1,47 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return ' if (config.WITH_CREDENTIALS) {\n request.credentials = config.CREDENTIALS;\n }\n'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + 'export const sendRequest = async (\n config: OpenAPIConfig,\n options: ApiRequestOptions,\n url: string,\n body: any,\n formData: FormData | undefined,\n headers: Headers,\n onCancel: OnCancel\n): Promise => {\n const controller = new AbortController();\n\n let request: RequestInit = {\n headers,\n body: body ?? formData,\n method: options.method,\n signal: controller.signal,\n };\n\n' + + ((stack1 = lookupProperty(helpers, 'equals').call( + depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/fetch', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + loc: { + start: { line: 19, column: 1 }, + end: { line: 23, column: 12 }, + }, + }, + )) != null + ? stack1 + : '') + + '\n for (const fn of config.interceptors.request._fns) {\n request = await fn(request);\n }\n\n onCancel(() => controller.abort());\n\n return await fetch(url, request);\n};' + ); + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/base64.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/base64.js new file mode 100644 index 000000000..b8fa64c80 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/base64.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const base64 = (str: string): string => {\n try {\n return btoa(str);\n } catch (err) {\n // @ts-ignore\n return Buffer.from(str).toString('base64');\n }\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/catchErrorCodes.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/catchErrorCodes.js new file mode 100644 index 000000000..91272e89e --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/catchErrorCodes.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {\n const errors: Record = {\n 400: 'Bad Request',\n 401: 'Unauthorized',\n 402: 'Payment Required',\n 403: 'Forbidden',\n 404: 'Not Found',\n 405: 'Method Not Allowed',\n 406: 'Not Acceptable',\n 407: 'Proxy Authentication Required',\n 408: 'Request Timeout',\n 409: 'Conflict',\n 410: 'Gone',\n 411: 'Length Required',\n 412: 'Precondition Failed',\n 413: 'Payload Too Large',\n 414: 'URI Too Long',\n 415: 'Unsupported Media Type',\n 416: 'Range Not Satisfiable',\n 417: 'Expectation Failed',\n 418: 'Im a teapot',\n 421: 'Misdirected Request',\n 422: 'Unprocessable Content',\n 423: 'Locked',\n 424: 'Failed Dependency',\n 425: 'Too Early',\n 426: 'Upgrade Required',\n 428: 'Precondition Required',\n 429: 'Too Many Requests',\n 431: 'Request Header Fields Too Large',\n 451: 'Unavailable For Legal Reasons',\n 500: 'Internal Server Error',\n 501: 'Not Implemented',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n 505: 'HTTP Version Not Supported',\n 506: 'Variant Also Negotiates',\n 507: 'Insufficient Storage',\n 508: 'Loop Detected',\n 510: 'Not Extended',\n 511: 'Network Authentication Required',\n ...options.errors,\n }\n\n const error = errors[result.status];\n if (error) {\n throw new ApiError(options, result, error);\n }\n\n if (!result.ok) {\n const errorStatus = result.status ?? 'unknown';\n const errorStatusText = result.statusText ?? 'unknown';\n const errorBody = (() => {\n try {\n return JSON.stringify(result.body, null, 2);\n } catch (e) {\n return undefined;\n }\n })();\n\n throw new ApiError(options, result,\n `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`\n );\n }\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getFormData.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getFormData.js new file mode 100644 index 000000000..aadad3cc5 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getFormData.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getFormData = (options: ApiRequestOptions): FormData | undefined => {\n if (options.formData) {\n const formData = new FormData();\n\n const process = (key: string, value: unknown) => {\n if (isString(value) || isBlob(value)) {\n formData.append(key, value);\n } else {\n formData.append(key, JSON.stringify(value));\n }\n };\n\n Object.entries(options.formData)\n .filter(([, value]) => value !== undefined && value !== null)\n .forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.forEach(v => process(key, v));\n } else {\n process(key, value);\n }\n });\n\n return formData;\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getQueryString.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getQueryString.js new file mode 100644 index 000000000..f9c6ca47b --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getQueryString.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getQueryString = (params: Record): string => {\n const qs: string[] = [];\n\n const append = (key: string, value: unknown) => {\n qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n };\n\n const encodePair = (key: string, value: unknown) => {\n if (value === undefined || value === null) {\n return;\n }\n\n if (value instanceof Date) {\n append(key, value.toISOString());\n } else if (Array.isArray(value)) {\n value.forEach(v => encodePair(key, v));\n } else if (typeof value === 'object') {\n Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));\n } else {\n append(key, value);\n }\n };\n\n Object.entries(params).forEach(([key, value]) => encodePair(key, value));\n\n return qs.length ? `?${qs.join('&')}` : '';\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getUrl.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getUrl.js new file mode 100644 index 000000000..6229a3a36 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/getUrl.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {\n const encoder = config.ENCODE_PATH || encodeURI;\n\n const path = options.url\n .replace('{api-version}', config.VERSION)\n .replace(/{(.*?)}/g, (substring: string, group: string) => {\n if (options.path?.hasOwnProperty(group)) {\n return encoder(String(options.path[group]));\n }\n return substring;\n });\n\n const url = config.BASE + path;\n return options.query ? url + getQueryString(options.query) : url;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isBlob.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isBlob.js new file mode 100644 index 000000000..a2e49389a --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isBlob.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const isBlob = (value: any): value is Blob => {\n return value instanceof Blob;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isFormData.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isFormData.js new file mode 100644 index 000000000..9d0880a49 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isFormData.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const isFormData = (value: unknown): value is FormData => {\n return value instanceof FormData;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isString.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isString.js new file mode 100644 index 000000000..54f1fd264 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isString.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const isString = (value: unknown): value is string => {\n return typeof value === 'string';\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isStringWithValue.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isStringWithValue.js new file mode 100644 index 000000000..693b6f883 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isStringWithValue.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const isStringWithValue = (value: unknown): value is string => {\n return isString(value) && value !== '';\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isSuccess.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isSuccess.js new file mode 100644 index 000000000..b51b66827 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/isSuccess.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const isSuccess = (status: number): boolean => {\n return status >= 200 && status < 300;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/resolve.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/resolve.js new file mode 100644 index 000000000..79457a4a7 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/functions/resolve.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "type Resolver = (options: ApiRequestOptions) => Promise;\n\nexport const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => {\n if (typeof resolver === 'function') {\n return (resolver as Resolver)(options);\n }\n return resolver;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/request.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/request.js new file mode 100644 index 000000000..f536aca4a --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/request.js @@ -0,0 +1,225 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return (stack1 = container.invokePartial( + lookupProperty(partials, 'angular/request'), + depth0, + { + name: 'angular/request', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : ''; + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return (stack1 = container.invokePartial( + lookupProperty(partials, 'axios/request'), + depth0, + { + name: 'axios/request', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : ''; + }, + 5: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return (stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/request'), + depth0, + { + name: 'fetch/request', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : ''; + }, + 7: function (container, depth0, helpers, partials, data) { + var stack1, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return (stack1 = container.invokePartial( + lookupProperty(partials, 'xhr/request'), + depth0, + { + name: 'xhr/request', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : ''; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/angular', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 87 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/axios', + { + name: 'equals', + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 2, column: 0 }, end: { line: 2, column: 83 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/fetch', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 3, column: 0 }, end: { line: 3, column: 83 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/node', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 4, column: 0 }, end: { line: 4, column: 82 } }, + }, + )) != null + ? stack1 + : '') + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'client', + ), + 'name', + ), + 'legacy/xhr', + { + name: 'equals', + hash: {}, + fn: container.program(7, data, 0), + inverse: container.noop, + data: data, + loc: { start: { line: 5, column: 0 }, end: { line: 5, column: 79 } }, + }, + )) != null + ? stack1 + : '') + ); + }, + usePartial: true, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getHeaders.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getHeaders.js new file mode 100644 index 000000000..ba30baa44 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getHeaders.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {\n const [token, username, password, additionalHeaders] = await Promise.all([\n // @ts-ignore\n resolve(options, config.TOKEN),\n // @ts-ignore\n resolve(options, config.USERNAME),\n // @ts-ignore\n resolve(options, config.PASSWORD),\n // @ts-ignore\n resolve(options, config.HEADERS),\n ]);\n\n const headers = Object.entries({\n Accept: 'application/json',\n ...additionalHeaders,\n ...options.headers,\n })\n .filter(([, value]) => value !== undefined && value !== null)\n .reduce((headers, [key, value]) => ({\n ...headers,\n [key]: String(value),\n }), {} as Record);\n\n if (isStringWithValue(token)) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n\n if (isStringWithValue(username) && isStringWithValue(password)) {\n const credentials = base64(`${username}:${password}`);\n headers['Authorization'] = `Basic ${credentials}`;\n }\n\n if (options.body !== undefined) {\n if (options.mediaType) {\n headers['Content-Type'] = options.mediaType;\n } else if (isBlob(options.body)) {\n headers['Content-Type'] = options.body.type || 'application/octet-stream';\n } else if (isString(options.body)) {\n headers['Content-Type'] = 'text/plain';\n } else if (!isFormData(options.body)) {\n headers['Content-Type'] = 'application/json';\n }\n }\n\n return new Headers(headers);\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getRequestBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getRequestBody.js new file mode 100644 index 000000000..1378625cb --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getRequestBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getRequestBody = (options: ApiRequestOptions): unknown => {\n if (options.body !== undefined) {\n if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {\n return JSON.stringify(options.body);\n } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {\n return options.body;\n } else {\n return JSON.stringify(options.body);\n }\n }\n return undefined;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseBody.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseBody.js new file mode 100644 index 000000000..8229393a7 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseBody.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const getResponseBody = (xhr: XMLHttpRequest): unknown => {\n if (xhr.status !== 204) {\n try {\n const contentType = xhr.getResponseHeader('Content-Type');\n if (contentType) {\n if (contentType.includes('application/json') || contentType.includes('+json')) {\n return JSON.parse(xhr.responseText);\n } else {\n return xhr.responseText;\n }\n }\n } catch (error) {\n console.error(error);\n }\n }\n return undefined;\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseHeader.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseHeader.js new file mode 100644 index 000000000..560ee1ef8 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/getResponseHeader.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return 'export const getResponseHeader = (xhr: XMLHttpRequest, responseHeader?: string): string | undefined => {\n if (responseHeader) {\n const content = xhr.getResponseHeader(responseHeader);\n if (isString(content)) {\n return content;\n }\n }\n return undefined;\n};'; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/request.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/request.js new file mode 100644 index 000000000..3bd1b801f --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/request.js @@ -0,0 +1,332 @@ +export default { + 1: function (container, depth0, helpers, partials, data) { + return 'ApiResult'; + }, + 3: function (container, depth0, helpers, partials, data) { + return 'T'; + }, + 5: function (container, depth0, helpers, partials, data) { + return 'result.body'; + }, + 7: function (container, depth0, helpers, partials, data) { + return 'result'; + }, + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + lookupProperty = + container.lookupProperty || + function (parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined; + }; + + return ( + "import { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport { CancelablePromise } from './CancelablePromise';\nimport type { OnCancel } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n\n" + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isString'), + depth0, + { + name: 'functions/isString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isStringWithValue'), + depth0, + { + name: 'functions/isStringWithValue', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isBlob'), + depth0, + { + name: 'functions/isBlob', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isFormData'), + depth0, + { + name: 'functions/isFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/isSuccess'), + depth0, + { + name: 'functions/isSuccess', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/base64'), + depth0, + { + name: 'functions/base64', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getQueryString'), + depth0, + { + name: 'functions/getQueryString', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getUrl'), + depth0, + { + name: 'functions/getUrl', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/getFormData'), + depth0, + { + name: 'functions/getFormData', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/resolve'), + depth0, + { + name: 'functions/resolve', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'fetch/getHeaders'), + depth0, + { + name: 'fetch/getHeaders', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'xhr/getRequestBody'), + depth0, + { + name: 'xhr/getRequestBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'xhr/sendRequest'), + depth0, + { + name: 'xhr/sendRequest', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'xhr/getResponseHeader'), + depth0, + { + name: 'xhr/getResponseHeader', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'xhr/getResponseBody'), + depth0, + { + name: 'xhr/getResponseBody', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n' + + ((stack1 = container.invokePartial( + lookupProperty(partials, 'functions/catchErrorCodes'), + depth0, + { + name: 'functions/catchErrorCodes', + data: data, + helpers: helpers, + partials: partials, + decorators: container.decorators, + }, + )) != null + ? stack1 + : '') + + '\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param options The request options from the service\n * @returns CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { + start: { line: 60, column: 30 }, + end: { line: 60, column: 116 }, + }, + }, + )) != null + ? stack1 + : '') + + '>\n * @throws ApiError\n */\nexport const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise<' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'response', + { + name: 'equals', + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(3, data, 0), + data: data, + loc: { + start: { line: 63, column: 100 }, + end: { line: 63, column: 186 }, + }, + }, + )) != null + ? stack1 + : '') + + '> => {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(config, options);\n const formData = getFormData(options);\n const body = getRequestBody(options);\n const headers = await getHeaders(config, options);\n\n if (!onCancel.isCancelled) {\n let response = await sendRequest(config, options, url, body, formData, headers, onCancel);\n\n for (const fn of config.interceptors.response._fns) {\n response = await fn(response);\n }\n\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n let transformedBody = responseBody;\n if (options.responseTransformer && isSuccess(response.status)) {\n transformedBody = await options.responseTransformer(responseBody)\n }\n\n const result: ApiResult = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: responseHeader ?? transformedBody,\n };\n\n catchErrorCodes(options, result);\n\n resolve(' + + ((stack1 = lookupProperty(helpers, 'equals').call( + alias1, + lookupProperty( + lookupProperty( + lookupProperty(lookupProperty(data, 'root'), '$config'), + 'services', + ), + 'response', + ), + 'body', + { + name: 'equals', + hash: {}, + fn: container.program(5, data, 0), + inverse: container.program(7, data, 0), + data: data, + loc: { + start: { line: 96, column: 12 }, + end: { line: 96, column: 98 }, + }, + }, + )) != null + ? stack1 + : '') + + ');\n }\n } catch (error) {\n reject(error);\n }\n });\n};' + ); + }, + usePartial: true, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/sendRequest.js b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/sendRequest.js new file mode 100644 index 000000000..41c79a585 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/compiled/core/xhr/sendRequest.js @@ -0,0 +1,7 @@ +export default { + compiler: [8, '>= 4.3.0'], + main: function (container, depth0, helpers, partials, data) { + return "export const sendRequest = async (\n config: OpenAPIConfig,\n options: ApiRequestOptions,\n url: string,\n body: any,\n formData: FormData | undefined,\n headers: Headers,\n onCancel: OnCancel\n): Promise => {\n let xhr = new XMLHttpRequest();\n xhr.open(options.method, url, true);\n xhr.withCredentials = config.WITH_CREDENTIALS;\n\n headers.forEach((value, key) => {\n xhr.setRequestHeader(key, value);\n });\n\n return new Promise(async (resolve, reject) => {\n xhr.onload = () => resolve(xhr);\n xhr.onabort = () => reject(new Error('Request aborted'));\n xhr.onerror = () => reject(new Error('Network error'));\n\n for (const fn of config.interceptors.request._fns) {\n xhr = await fn(xhr);\n }\n\n xhr.send(body ?? formData);\n\n onCancel(() => xhr.abort());\n });\n};"; + }, + useData: true, +}; diff --git a/packages/openapi-ts/src/legacy/handlebars/handlebars.cjs b/packages/openapi-ts/src/legacy/handlebars/handlebars.cjs new file mode 100644 index 000000000..99e456f01 --- /dev/null +++ b/packages/openapi-ts/src/legacy/handlebars/handlebars.cjs @@ -0,0 +1,79 @@ +const Handlebars = require('handlebars'); +const { + readFileSync, + readdirSync, + statSync, + existsSync, + mkdirSync, + writeFileSync, + rmdirSync, +} = require('node:fs'); +const path = require('node:path'); + +const getFilesRecursively = (folderPath) => { + let fileList = []; + + const files = readdirSync(folderPath); + + files.forEach((file) => { + const fullPath = path.join(folderPath, file); + + if (statSync(fullPath).isDirectory()) { + fileList = fileList.concat(getFilesRecursively(fullPath)); + } else { + fileList.push(fullPath); + } + }); + + return fileList; +}; + +const templatePaths = getFilesRecursively( + path.resolve('src', 'legacy', 'handlebars', 'templates'), +); + +const compiledDirPath = path.resolve('src', 'legacy', 'handlebars', 'compiled'); + +if (existsSync(compiledDirPath)) { + rmdirSync(compiledDirPath, { + recursive: true, + }); +} + +templatePaths.forEach((templatePath) => { + const template = readFileSync(templatePath, 'utf8').toString().trim(); + + const compiled = Handlebars.precompile(template, { + knownHelpers: { + camelCase: true, + equals: true, + ifdef: true, + notEquals: true, + transformServiceName: true, + }, + knownHelpersOnly: true, + noEscape: true, + preventIndent: true, + strict: true, + }); + + const parts = templatePath.split(path.sep); + const fileName = parts[parts.length - 1]; + const fileNameParts = fileName.split('.'); + const fileNameBase = fileNameParts + .slice(0, fileNameParts.length - 1) + .join('.'); + const compiledPath = path.resolve( + compiledDirPath, + ...parts.slice(parts.lastIndexOf('templates') + 1, parts.length - 1), + `${fileNameBase}.js`, + ); + + const compiledDir = path.dirname(compiledPath); + + if (!existsSync(compiledDir)) { + mkdirSync(compiledDir, { recursive: true }); + } + + writeFileSync(compiledPath, `export default ${compiled};`); +}); diff --git a/packages/openapi-ts/src/templates/client.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/client.hbs similarity index 100% rename from packages/openapi-ts/src/templates/client.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/client.hbs diff --git a/packages/openapi-ts/src/templates/core/ApiError.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/ApiError.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/ApiError.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/ApiError.hbs diff --git a/packages/openapi-ts/src/templates/core/ApiRequestOptions.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/ApiRequestOptions.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/ApiRequestOptions.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/ApiRequestOptions.hbs diff --git a/packages/openapi-ts/src/templates/core/ApiResult.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/ApiResult.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/ApiResult.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/ApiResult.hbs diff --git a/packages/openapi-ts/src/templates/core/BaseHttpRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/BaseHttpRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/BaseHttpRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/BaseHttpRequest.hbs diff --git a/packages/openapi-ts/src/templates/core/CancelablePromise.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/CancelablePromise.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/CancelablePromise.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/CancelablePromise.hbs diff --git a/packages/openapi-ts/src/templates/core/HttpRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/HttpRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/HttpRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/HttpRequest.hbs diff --git a/packages/openapi-ts/src/templates/core/OpenAPI.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/OpenAPI.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/OpenAPI.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/OpenAPI.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/getHeaders.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getHeaders.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/getHeaders.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getHeaders.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/getRequestBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getRequestBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/getRequestBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getRequestBody.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/getResponseBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getResponseBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/getResponseBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getResponseBody.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/getResponseHeader.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getResponseHeader.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/getResponseHeader.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/getResponseHeader.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/request.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/request.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/request.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/request.hbs diff --git a/packages/openapi-ts/src/templates/core/angular/sendRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/angular/sendRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/angular/sendRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/angular/sendRequest.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/getHeaders.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getHeaders.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/getHeaders.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getHeaders.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/getRequestBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getRequestBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/getRequestBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getRequestBody.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/getResponseBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getResponseBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/getResponseBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getResponseBody.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/getResponseHeader.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getResponseHeader.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/getResponseHeader.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/getResponseHeader.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/request.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/request.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/request.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/request.hbs diff --git a/packages/openapi-ts/src/templates/core/axios/sendRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/axios/sendRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/axios/sendRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/axios/sendRequest.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/getHeaders.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getHeaders.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/getHeaders.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getHeaders.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/getRequestBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getRequestBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/getRequestBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getRequestBody.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/getResponseBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getResponseBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/getResponseBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getResponseBody.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/getResponseHeader.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getResponseHeader.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/getResponseHeader.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/getResponseHeader.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/request.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/request.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/request.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/request.hbs diff --git a/packages/openapi-ts/src/templates/core/fetch/sendRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/sendRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/fetch/sendRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/fetch/sendRequest.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/base64.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/base64.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/base64.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/base64.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/catchErrorCodes.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/catchErrorCodes.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/catchErrorCodes.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/catchErrorCodes.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/getFormData.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getFormData.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/getFormData.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getFormData.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/getQueryString.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getQueryString.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/getQueryString.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getQueryString.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/getUrl.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getUrl.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/getUrl.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/getUrl.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/isBlob.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isBlob.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/isBlob.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isBlob.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/isFormData.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isFormData.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/isFormData.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isFormData.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/isString.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isString.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/isString.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isString.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/isStringWithValue.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isStringWithValue.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/isStringWithValue.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isStringWithValue.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/isSuccess.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isSuccess.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/isSuccess.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/isSuccess.hbs diff --git a/packages/openapi-ts/src/templates/core/functions/resolve.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/functions/resolve.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/functions/resolve.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/functions/resolve.hbs diff --git a/packages/openapi-ts/src/templates/core/request.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/request.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/request.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/request.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/getHeaders.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getHeaders.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/getHeaders.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getHeaders.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/getRequestBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getRequestBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/getRequestBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getRequestBody.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/getResponseBody.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getResponseBody.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/getResponseBody.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getResponseBody.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/getResponseHeader.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getResponseHeader.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/getResponseHeader.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/getResponseHeader.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/request.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/request.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/request.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/request.hbs diff --git a/packages/openapi-ts/src/templates/core/xhr/sendRequest.hbs b/packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/sendRequest.hbs similarity index 100% rename from packages/openapi-ts/src/templates/core/xhr/sendRequest.hbs rename to packages/openapi-ts/src/legacy/handlebars/templates/core/xhr/sendRequest.hbs diff --git a/packages/openapi-ts/src/node/index.ts b/packages/openapi-ts/src/node/index.ts deleted file mode 100644 index dba118ff7..000000000 --- a/packages/openapi-ts/src/node/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { createClient, defineConfig } from '../'; -export type { Plugins } from '../plugins'; -export type { Operation } from '../types/client'; -export type { UserConfig } from '../types/config'; diff --git a/packages/openapi-ts/src/node/tsconfig.json b/packages/openapi-ts/src/node/tsconfig.json deleted file mode 100644 index 38e89fc09..000000000 --- a/packages/openapi-ts/src/node/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ESNext", "DOM"], - "stripInternal": true - }, - "exclude": ["../**/__tests__"], - "extends": "../../tsconfig.base.json", - "include": ["../", "../client/interfaces"] -} diff --git a/packages/openapi-ts/src/types/config.ts b/packages/openapi-ts/src/types/config.ts index e58230d33..07c1fc0e4 100644 --- a/packages/openapi-ts/src/types/config.ts +++ b/packages/openapi-ts/src/types/config.ts @@ -26,6 +26,7 @@ export interface ClientConfig { */ client?: | Client + | false | { /** * Bundle the client module? Set this to true if you're using a standalone diff --git a/packages/openapi-ts/src/types/hbs.d.ts b/packages/openapi-ts/src/types/hbs.d.ts deleted file mode 100644 index 44f69c1d9..000000000 --- a/packages/openapi-ts/src/types/hbs.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * We precompile the handlebar templates during the build process, - * however in the source code we want to reference these templates - * by importing the hbs files directly. Of course this is not allowed - * by Typescript, so we need to provide some declaration for these - * types. - * @see: build.js for more information - */ -declare module '*.hbs' { - const template: { - compiler: [number, string]; - main: () => void; - useData: true; - }; - export default template; -} diff --git a/packages/openapi-ts/src/utils/handlebars.ts b/packages/openapi-ts/src/utils/handlebars.ts index 2398a6eaa..1c435e46a 100644 --- a/packages/openapi-ts/src/utils/handlebars.ts +++ b/packages/openapi-ts/src/utils/handlebars.ts @@ -1,49 +1,93 @@ import Handlebars from 'handlebars/runtime'; -import templateClient from '../templates/client.hbs'; -import angularGetHeaders from '../templates/core/angular/getHeaders.hbs'; -import angularGetRequestBody from '../templates/core/angular/getRequestBody.hbs'; -import angularGetResponseBody from '../templates/core/angular/getResponseBody.hbs'; -import angularGetResponseHeader from '../templates/core/angular/getResponseHeader.hbs'; -import angularRequest from '../templates/core/angular/request.hbs'; -import angularSendRequest from '../templates/core/angular/sendRequest.hbs'; -import templateCoreApiError from '../templates/core/ApiError.hbs'; -import templateCoreApiRequestOptions from '../templates/core/ApiRequestOptions.hbs'; -import templateCoreApiResult from '../templates/core/ApiResult.hbs'; -import axiosGetHeaders from '../templates/core/axios/getHeaders.hbs'; -import axiosGetRequestBody from '../templates/core/axios/getRequestBody.hbs'; -import axiosGetResponseBody from '../templates/core/axios/getResponseBody.hbs'; -import axiosGetResponseHeader from '../templates/core/axios/getResponseHeader.hbs'; -import axiosRequest from '../templates/core/axios/request.hbs'; -import axiosSendRequest from '../templates/core/axios/sendRequest.hbs'; -import templateCoreBaseHttpRequest from '../templates/core/BaseHttpRequest.hbs'; -import templateCancelablePromise from '../templates/core/CancelablePromise.hbs'; -import fetchGetHeaders from '../templates/core/fetch/getHeaders.hbs'; -import fetchGetRequestBody from '../templates/core/fetch/getRequestBody.hbs'; -import fetchGetResponseBody from '../templates/core/fetch/getResponseBody.hbs'; -import fetchGetResponseHeader from '../templates/core/fetch/getResponseHeader.hbs'; -import fetchRequest from '../templates/core/fetch/request.hbs'; -import fetchSendRequest from '../templates/core/fetch/sendRequest.hbs'; -import functionBase64 from '../templates/core/functions/base64.hbs'; -import functionCatchErrorCodes from '../templates/core/functions/catchErrorCodes.hbs'; -import functionGetFormData from '../templates/core/functions/getFormData.hbs'; -import functionGetQueryString from '../templates/core/functions/getQueryString.hbs'; -import functionGetUrl from '../templates/core/functions/getUrl.hbs'; -import functionIsBlob from '../templates/core/functions/isBlob.hbs'; -import functionIsFormData from '../templates/core/functions/isFormData.hbs'; -import functionIsString from '../templates/core/functions/isString.hbs'; -import functionIsStringWithValue from '../templates/core/functions/isStringWithValue.hbs'; -import functionIsSuccess from '../templates/core/functions/isSuccess.hbs'; -import functionResolve from '../templates/core/functions/resolve.hbs'; -import templateCoreHttpRequest from '../templates/core/HttpRequest.hbs'; -import templateCoreSettings from '../templates/core/OpenAPI.hbs'; -import templateCoreRequest from '../templates/core/request.hbs'; -import xhrGetHeaders from '../templates/core/xhr/getHeaders.hbs'; -import xhrGetRequestBody from '../templates/core/xhr/getRequestBody.hbs'; -import xhrGetResponseBody from '../templates/core/xhr/getResponseBody.hbs'; -import xhrGetResponseHeader from '../templates/core/xhr/getResponseHeader.hbs'; -import xhrRequest from '../templates/core/xhr/request.hbs'; -import xhrSendRequest from '../templates/core/xhr/sendRequest.hbs'; +// @ts-ignore +import templateClient from '../legacy/handlebars/compiled/client.js'; +// @ts-ignore +import angularGetHeaders from '../legacy/handlebars/compiled/core/angular/getHeaders.js'; +// @ts-ignore +import angularGetRequestBody from '../legacy/handlebars/compiled/core/angular/getRequestBody.js'; +// @ts-ignore +import angularGetResponseBody from '../legacy/handlebars/compiled/core/angular/getResponseBody.js'; +// @ts-ignore +import angularGetResponseHeader from '../legacy/handlebars/compiled/core/angular/getResponseHeader.js'; +// @ts-ignore +import angularRequest from '../legacy/handlebars/compiled/core/angular/request.js'; +// @ts-ignore +import angularSendRequest from '../legacy/handlebars/compiled/core/angular/sendRequest.js'; +// @ts-ignore +import templateCoreApiError from '../legacy/handlebars/compiled/core/ApiError.js'; +// @ts-ignore +import templateCoreApiRequestOptions from '../legacy/handlebars/compiled/core/ApiRequestOptions.js'; +// @ts-ignore +import templateCoreApiResult from '../legacy/handlebars/compiled/core/ApiResult.js'; +// @ts-ignore +import axiosGetHeaders from '../legacy/handlebars/compiled/core/axios/getHeaders.js'; +// @ts-ignore +import axiosGetRequestBody from '../legacy/handlebars/compiled/core/axios/getRequestBody.js'; +// @ts-ignore +import axiosGetResponseBody from '../legacy/handlebars/compiled/core/axios/getResponseBody.js'; +// @ts-ignore +import axiosGetResponseHeader from '../legacy/handlebars/compiled/core/axios/getResponseHeader.js'; +// @ts-ignore +import axiosRequest from '../legacy/handlebars/compiled/core/axios/request.js'; +// @ts-ignore +import axiosSendRequest from '../legacy/handlebars/compiled/core/axios/sendRequest.js'; +// @ts-ignore +import templateCoreBaseHttpRequest from '../legacy/handlebars/compiled/core/BaseHttpRequest.js'; +// @ts-ignore +import templateCancelablePromise from '../legacy/handlebars/compiled/core/CancelablePromise.js'; +// @ts-ignore +import fetchGetHeaders from '../legacy/handlebars/compiled/core/fetch/getHeaders.js'; +// @ts-ignore +import fetchGetRequestBody from '../legacy/handlebars/compiled/core/fetch/getRequestBody.js'; +// @ts-ignore +import fetchGetResponseBody from '../legacy/handlebars/compiled/core/fetch/getResponseBody.js'; +// @ts-ignore +import fetchGetResponseHeader from '../legacy/handlebars/compiled/core/fetch/getResponseHeader.js'; +// @ts-ignore +import fetchRequest from '../legacy/handlebars/compiled/core/fetch/request.js'; +// @ts-ignore +import fetchSendRequest from '../legacy/handlebars/compiled/core/fetch/sendRequest.js'; +// @ts-ignore +import functionBase64 from '../legacy/handlebars/compiled/core/functions/base64.js'; +// @ts-ignore +import functionCatchErrorCodes from '../legacy/handlebars/compiled/core/functions/catchErrorCodes.js'; +// @ts-ignore +import functionGetFormData from '../legacy/handlebars/compiled/core/functions/getFormData.js'; +// @ts-ignore +import functionGetQueryString from '../legacy/handlebars/compiled/core/functions/getQueryString.js'; +// @ts-ignore +import functionGetUrl from '../legacy/handlebars/compiled/core/functions/getUrl.js'; +// @ts-ignore +import functionIsBlob from '../legacy/handlebars/compiled/core/functions/isBlob.js'; +// @ts-ignore +import functionIsFormData from '../legacy/handlebars/compiled/core/functions/isFormData.js'; +// @ts-ignore +import functionIsString from '../legacy/handlebars/compiled/core/functions/isString.js'; +// @ts-ignore +import functionIsStringWithValue from '../legacy/handlebars/compiled/core/functions/isStringWithValue.js'; +// @ts-ignore +import functionIsSuccess from '../legacy/handlebars/compiled/core/functions/isSuccess.js'; +// @ts-ignore +import functionResolve from '../legacy/handlebars/compiled/core/functions/resolve.js'; +// @ts-ignore +import templateCoreHttpRequest from '../legacy/handlebars/compiled/core/HttpRequest.js'; +// @ts-ignore +import templateCoreSettings from '../legacy/handlebars/compiled/core/OpenAPI.js'; +// @ts-ignore +import templateCoreRequest from '../legacy/handlebars/compiled/core/request.js'; +// @ts-ignore +import xhrGetHeaders from '../legacy/handlebars/compiled/core/xhr/getHeaders.js'; +// @ts-ignore +import xhrGetRequestBody from '../legacy/handlebars/compiled/core/xhr/getRequestBody.js'; +// @ts-ignore +import xhrGetResponseBody from '../legacy/handlebars/compiled/core/xhr/getResponseBody.js'; +// @ts-ignore +import xhrGetResponseHeader from '../legacy/handlebars/compiled/core/xhr/getResponseHeader.js'; +// @ts-ignore +import xhrRequest from '../legacy/handlebars/compiled/core/xhr/request.js'; +// @ts-ignore +import xhrSendRequest from '../legacy/handlebars/compiled/core/xhr/sendRequest.js'; import { camelCase } from './camelCase'; import { transformServiceName } from './transform'; @@ -128,7 +172,7 @@ export const registerHandlebarTemplates = (): Templates => { }, }; - // Generic functions used in 'request' file @see src/templates/core/request.hbs for more info + // Generic functions used in 'request' file @see src/legacy/handlebars/templates/core/request.hbs for more info Handlebars.registerPartial( 'functions/base64', Handlebars.template(functionBase64), diff --git a/packages/openapi-ts/src/utils/performance.ts b/packages/openapi-ts/src/utils/performance.ts index 087c41127..ae0dd8582 100644 --- a/packages/openapi-ts/src/utils/performance.ts +++ b/packages/openapi-ts/src/utils/performance.ts @@ -5,18 +5,42 @@ const idLength = (id: string) => `${id}-length`; const idStart = (id: string) => `${id}-start`; export const Performance = { - clear: () => { + clear: (): void => { performance.clearMarks(); performance.clearMeasures(); }, - end: (id: string) => { - performance.mark(idEnd(id)); - }, - getEntriesByName: (id: string) => performance.getEntriesByName(idLength(id)), - measure: (id: string) => { - performance.measure(idLength(id), idStart(id), idEnd(id)); - }, - start: (id: string) => { - performance.mark(idStart(id)); - }, + end: (id: string): PerformanceMark => performance.mark(idEnd(id)), + getEntriesByName: (id: string): PerformanceEntryList => + performance.getEntriesByName(idLength(id)), + measure: (id: string): PerformanceMeasure => + performance.measure(idLength(id), idStart(id), idEnd(id)), + start: (id: string): PerformanceMark => performance.mark(idStart(id)), }; + +export class PerformanceReport { + totalMeasure: PerformanceMeasure; + + constructor({ totalMark }: { totalMark: string }) { + this.totalMeasure = Performance.measure(totalMark); + } + + public report({ marks }: { marks: ReadonlyArray }) { + const totalDuration = Math.ceil(this.totalMeasure.duration * 100) / 100; + const totalName = this.totalMeasure.name; + console.warn( + `${totalName.substring(0, totalName.length - idLength('').length)}: ${totalDuration.toFixed(2)}ms`, + ); + + marks.forEach((mark) => { + const markMeasure = Performance.measure(mark); + const markDuration = Math.ceil(markMeasure.duration * 100) / 100; + const percentage = + Math.ceil( + (markMeasure.duration / this.totalMeasure.duration) * 100 * 100, + ) / 100; + console.warn( + `${mark}: ${markDuration.toFixed(2)}ms (${percentage.toFixed(2)}%)`, + ); + }); + } +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client.ts.snap deleted file mode 100644 index 7d794d27a..000000000 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -export { createClient } from './core/'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from './core/types'; -export { - createConfig, - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from './core/utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/index.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/index.ts.snap similarity index 93% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/index.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/index.ts.snap index afe16e6a1..d0890ea39 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/index.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/index.ts.snap @@ -84,3 +84,11 @@ export const createClient = (config: Config): Client => { setConfig, } as Client; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/types.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/types.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/types.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/types.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/utils.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/utils.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/core/utils.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/client/utils.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client.ts.snap deleted file mode 100644 index 7d794d27a..000000000 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -export { createClient } from './core/'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from './core/types'; -export { - createConfig, - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from './core/utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/index.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/index.ts.snap similarity index 93% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/index.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/index.ts.snap index afe16e6a1..d0890ea39 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/index.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/index.ts.snap @@ -84,3 +84,11 @@ export const createClient = (config: Config): Client => { setConfig, } as Client; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/types.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/types.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/types.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/types.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/utils.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/utils.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/core/utils.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle_transform/client/utils.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client.ts.snap deleted file mode 100644 index 31f504580..000000000 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -export { createClient } from './core/'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from './core/types'; -export { - type BodySerializer, - createConfig, - formDataBodySerializer, - jsonBodySerializer, - type Middleware, - type QuerySerializer, - type QuerySerializerOptions, - urlSearchParamsBodySerializer, -} from './core/utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/index.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/index.ts.snap similarity index 95% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/index.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/index.ts.snap index ab5cd4a1f..46a8d73ad 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/index.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/index.ts.snap @@ -144,3 +144,11 @@ export const createClient = (config: Config = {}): Client => { trace: (options) => request({ ...options, method: 'TRACE' }), }; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/types.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/types.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/types.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/types.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/utils.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/utils.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/utils.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/client/utils.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client.ts.snap deleted file mode 100644 index 31f504580..000000000 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -export { createClient } from './core/'; -export type { - Client, - Config, - Options, - RequestOptions, - RequestOptionsBase, - RequestResult, -} from './core/types'; -export { - type BodySerializer, - createConfig, - formDataBodySerializer, - jsonBodySerializer, - type Middleware, - type QuerySerializer, - type QuerySerializerOptions, - urlSearchParamsBodySerializer, -} from './core/utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/index.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/index.ts.snap similarity index 95% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/index.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/index.ts.snap index ab5cd4a1f..46a8d73ad 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/core/index.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/index.ts.snap @@ -144,3 +144,11 @@ export const createClient = (config: Config = {}): Client => { trace: (options) => request({ ...options, method: 'TRACE' }), }; }; + +export type { Config, Options } from './types'; +export { + createConfig, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from './utils'; diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/types.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/types.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/types.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/types.ts.snap diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/utils.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/utils.ts.snap similarity index 100% rename from packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/core/utils.ts.snap rename to packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle_transform/client/utils.ts.snap diff --git a/packages/openapi-ts/test/bin.spec.ts b/packages/openapi-ts/test/bin.spec.ts index 01d317077..94d415a3f 100755 --- a/packages/openapi-ts/test/bin.spec.ts +++ b/packages/openapi-ts/test/bin.spec.ts @@ -14,7 +14,7 @@ describe('bin', () => { '--dry-run', 'true', ]); - expect(result.stdout.toString()).toContain('Done!'); + expect(result.stdout.toString()).toContain('Creating Fetch client'); expect(result.stderr.toString()).toContain('Duplicate operationId'); }); @@ -119,7 +119,7 @@ describe('bin', () => { '--dry-run', 'true', ]); - expect(result.stdout.toString()).toContain('Done!'); + expect(result.stdout.toString()).toContain('Creating Fetch client'); expect(result.stderr.toString()).toContain('Duplicate operationId'); }); @@ -139,7 +139,7 @@ describe('bin', () => { '--dry-run', 'true', ]); - expect(result.stdout.toString()).toContain('Done!'); + expect(result.stdout.toString()).toContain('Creating Fetch client'); expect(result.stderr.toString()).toContain('Duplicate operationId'); }); @@ -187,6 +187,8 @@ describe('bin', () => { './test/spec/v3.json', '--output', './test/generated/bin', + '--client', + 'invalid/client', '--dry-run', 'true', ]); diff --git a/packages/openapi-ts/test/e2e/scripts/generateClient.ts b/packages/openapi-ts/test/e2e/scripts/generateClient.ts index 11d37940d..df78a483f 100644 --- a/packages/openapi-ts/test/e2e/scripts/generateClient.ts +++ b/packages/openapi-ts/test/e2e/scripts/generateClient.ts @@ -4,7 +4,7 @@ import type { Config } from '../../../src/types/config' export const generateClient = async ( dir: string, version: string, - client: Config['client'], + client: Config['client']['name'], useOptions: boolean = false, name?: string ) => { diff --git a/packages/openapi-ts/test/index.spec.ts b/packages/openapi-ts/test/index.spec.ts index cc2e77bdb..996338245 100644 --- a/packages/openapi-ts/test/index.spec.ts +++ b/packages/openapi-ts/test/index.spec.ts @@ -38,6 +38,7 @@ describe('OpenAPI v2', () => { }, ])('$description', async ({ name, config }) => { const output = toOutputPath(name); + // @ts-ignore await createClient({ ...config, input: V2_SPEC_PATH, @@ -429,6 +430,7 @@ describe('OpenAPI v3', () => { '$description', async ({ name, config }) => { const output = toOutputPath(name); + // @ts-ignore await createClient({ ...config, input: V3_SPEC_PATH, @@ -446,6 +448,7 @@ describe('OpenAPI v3', () => { async ({ name, config }) => { const output = toOutputPath(name + '_transform'); + // @ts-ignore await createClient({ ...config, input: V3_TRANSFORMS_SPEC_PATH, diff --git a/packages/openapi-ts/test/sample.cjs b/packages/openapi-ts/test/sample.cjs index 5be6f2b4c..8c8397214 100644 --- a/packages/openapi-ts/test/sample.cjs +++ b/packages/openapi-ts/test/sample.cjs @@ -1,7 +1,7 @@ const path = require('node:path'); const main = async () => { - /** @type {import('../src/node').UserConfig} */ + /** @type {import('../src').UserConfig} */ const config = { client: { // bundle: true, @@ -38,7 +38,7 @@ const main = async () => { // name: '^Parameters', }, types: { - dates: 'types+transform', + // dates: 'types+transform', // enums: 'javascript', // export: false, // include: @@ -50,7 +50,7 @@ const main = async () => { }; const { createClient } = await import( - path.resolve(process.cwd(), 'dist/node/index.cjs') + path.resolve(process.cwd(), 'dist', 'index.cjs') ); await createClient(config); }; diff --git a/packages/openapi-ts/tsconfig.check.json b/packages/openapi-ts/tsconfig.check.json deleted file mode 100644 index b1498316f..000000000 --- a/packages/openapi-ts/tsconfig.check.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "exactOptionalPropertyTypes": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "target": "ES2020" - }, - "include": ["dist/**/*", "types/**/*"] -} diff --git a/packages/openapi-ts/tsconfig.json b/packages/openapi-ts/tsconfig.json index e16902e20..1824d6eec 100644 --- a/packages/openapi-ts/tsconfig.json +++ b/packages/openapi-ts/tsconfig.json @@ -5,7 +5,5 @@ "esModuleInterop": true, "resolveJsonModule": true }, - "exclude": ["node_modules", "**/__mocks__"], - "files": ["./src/types/hbs.d.ts"], - "include": ["./src/**/*.ts", "rollup.config.ts", "rollup.dts.config.ts"] + "exclude": ["test/custom/request.ts", "test/e2e/**", "test/generated/**"] } diff --git a/packages/openapi-ts/tsup.config.ts b/packages/openapi-ts/tsup.config.ts new file mode 100644 index 000000000..77dfaf864 --- /dev/null +++ b/packages/openapi-ts/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig((options) => ({ + clean: true, + dts: true, + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + minify: !options.watch, + shims: false, + sourcemap: true, + treeshake: true, +})); diff --git a/packages/openapi-ts/vitest.config.e2e.ts b/packages/openapi-ts/vitest.config.e2e.ts index ae277b99b..19429c285 100644 --- a/packages/openapi-ts/vitest.config.e2e.ts +++ b/packages/openapi-ts/vitest.config.e2e.ts @@ -2,10 +2,8 @@ import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vitest/config'; -import { handlebarsPlugin } from './rollup.config'; - export default defineConfig({ - plugins: [handlebarsPlugin()], + plugins: [], test: { // Dont run tests in parallel. This is to ensure the test server can start up. // And that the port was not previously taken. diff --git a/packages/openapi-ts/vitest.config.unit.ts b/packages/openapi-ts/vitest.config.unit.ts index 2b1683955..0da11e718 100644 --- a/packages/openapi-ts/vitest.config.unit.ts +++ b/packages/openapi-ts/vitest.config.unit.ts @@ -2,10 +2,8 @@ import { fileURLToPath } from 'node:url'; import { configDefaults, defineConfig } from 'vitest/config'; -import { handlebarsPlugin } from './rollup.config'; - export default defineConfig({ - plugins: [handlebarsPlugin()], + plugins: [], test: { coverage: { exclude: ['bin', 'dist', 'src/**/*.d.ts'], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a226610bd..68d2e5565 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,21 +8,15 @@ importers: .: devDependencies: + '@arethetypeswrong/cli': + specifier: 0.16.4 + version: 0.16.4 '@changesets/changelog-github': specifier: 0.5.0 version: 0.5.0(encoding@0.1.13) '@changesets/cli': specifier: 2.27.7 version: 2.27.7 - '@rollup/plugin-commonjs': - specifier: 26.0.1 - version: 26.0.1(rollup@4.18.0) - '@rollup/plugin-terser': - specifier: 0.4.4 - version: 0.4.4(rollup@4.18.0) - '@rollup/plugin-typescript': - specifier: 11.1.6 - version: 11.1.6(rollup@4.18.0)(tslib@2.6.3)(typescript@5.5.3) '@types/node': specifier: 20.14.10 version: 20.14.10 @@ -62,15 +56,9 @@ importers: prettier: specifier: 3.3.2 version: 3.3.2 - rimraf: - specifier: 5.0.8 - version: 5.0.8 - rollup: - specifier: 4.18.0 - version: 4.18.0 - rollup-plugin-dts: - specifier: 6.1.1 - version: 6.1.1(rollup@4.18.0)(typescript@5.5.3) + tsup: + specifier: 8.3.0 + version: 8.3.0(@microsoft/api-extractor@7.47.9(@types/node@20.14.10))(jiti@1.21.6)(postcss@8.4.45)(typescript@5.5.3)(yaml@2.4.5) typescript: specifier: 5.5.3 version: 5.5.3 @@ -526,12 +514,6 @@ importers: '@hey-api/client-fetch': specifier: workspace:* version: link:../client-fetch - '@rollup/plugin-json': - specifier: 6.1.0 - version: 6.1.0(rollup@4.22.0) - '@rollup/plugin-node-resolve': - specifier: 15.2.3 - version: 15.2.3(rollup@4.22.0) '@tanstack/react-query': specifier: 5.56.2 version: 5.56.2(react@18.3.1) @@ -662,6 +644,9 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@andrewbranch/untar.js@1.0.3': + resolution: {integrity: sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==} + '@angular-devkit/architect@0.1703.7': resolution: {integrity: sha512-SwXbdsZqEE3JtvujCLChAii+FA20d1931VDjDYffrGWdQEViTBAr4NKtDr/kOv8KkgiL3fhGibPnRNUHTeAMtg==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} @@ -814,6 +799,15 @@ packages: resolution: {integrity: sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog==} engines: {node: '>= 16'} + '@arethetypeswrong/cli@0.16.4': + resolution: {integrity: sha512-qMmdVlJon5FtA+ahn0c1oAVNxiq4xW5lqFiTZ21XHIeVwAVIQ+uRz4UEivqRMsjVV1grzRgJSKqaOrq1MvlVyQ==} + engines: {node: '>=18'} + hasBin: true + + '@arethetypeswrong/core@0.16.4': + resolution: {integrity: sha512-RI3HXgSuKTfcBf1hSEg1P9/cOvmI0flsMm6/QL3L3wju4AlHDqd55JFPfXs4pzgEAgy5L9pul4/HPPz99x2GvA==} + engines: {node: '>=18'} + '@babel/code-frame@7.24.7': resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} @@ -1564,6 +1558,10 @@ packages: '@changesets/write@0.3.1': resolution: {integrity: sha512-SyGtMXzH3qFqlHKcvFY2eX+6b0NGiFcNav8AFsYwy5l8hejOeoeTDemu5Yjmke2V5jpzY+pBvM0vCCQ3gdZpfw==} + '@colors/colors@1.5.0': + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + engines: {node: '>=0.1.90'} + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -1613,6 +1611,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.19.12': resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} engines: {node: '>=12'} @@ -1631,6 +1635,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.19.12': resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} engines: {node: '>=12'} @@ -1649,6 +1659,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.19.12': resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} engines: {node: '>=12'} @@ -1667,6 +1683,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.19.12': resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} engines: {node: '>=12'} @@ -1685,6 +1707,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.19.12': resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} engines: {node: '>=12'} @@ -1703,6 +1731,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.19.12': resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} engines: {node: '>=12'} @@ -1721,6 +1755,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.19.12': resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} engines: {node: '>=12'} @@ -1739,6 +1779,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.19.12': resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} engines: {node: '>=12'} @@ -1757,6 +1803,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.19.12': resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} engines: {node: '>=12'} @@ -1775,6 +1827,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.19.12': resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} engines: {node: '>=12'} @@ -1793,6 +1851,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.19.12': resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} engines: {node: '>=12'} @@ -1811,6 +1875,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.19.12': resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} engines: {node: '>=12'} @@ -1829,6 +1899,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.19.12': resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} engines: {node: '>=12'} @@ -1847,6 +1923,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.19.12': resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} engines: {node: '>=12'} @@ -1865,6 +1947,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.19.12': resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} engines: {node: '>=12'} @@ -1883,6 +1971,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.19.12': resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} engines: {node: '>=12'} @@ -1901,6 +1995,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.19.12': resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} engines: {node: '>=12'} @@ -1919,6 +2019,18 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.19.12': resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} engines: {node: '>=12'} @@ -1937,6 +2049,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.19.12': resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} engines: {node: '>=12'} @@ -1955,6 +2073,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.19.12': resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} engines: {node: '>=12'} @@ -1973,6 +2097,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.19.12': resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} engines: {node: '>=12'} @@ -1991,6 +2121,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.19.12': resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} engines: {node: '>=12'} @@ -2009,6 +2145,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2133,6 +2275,19 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + '@microsoft/api-extractor-model@7.29.8': + resolution: {integrity: sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==} + + '@microsoft/api-extractor@7.47.9': + resolution: {integrity: sha512-TTq30M1rikVsO5wZVToQT/dGyJY7UXJmjiRtkHPLb74Prx3Etw8+bX7Bv7iLuby6ysb7fuu1NFWqma+csym8Jw==} + hasBin: true + + '@microsoft/tsdoc-config@0.17.0': + resolution: {integrity: sha512-v/EYRXnCAIHxOHW+Plb6OWuUoMotxTN0GLatnpOb1xq0KuTNw/WI3pamJx/UbsoJP5k9MCw1QxvvhPcF9pH3Zg==} + + '@microsoft/tsdoc@0.15.0': + resolution: {integrity: sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==} + '@neoconfetti/svelte@2.0.0': resolution: {integrity: sha512-n/Uu7/XmHc8w0uBci0QWBjgbRzLhfWsH8yPJ5pMaseIvzSwabXvB30nb3JjzEYNBp9uGt4eCeY7LUmxAjnJV8A==} @@ -2801,55 +2956,6 @@ packages: '@types/react-dom': optional: true - '@rollup/plugin-commonjs@26.0.1': - resolution: {integrity: sha512-UnsKoZK6/aGIH6AdkptXhNvhaqftcjq3zZdT+LY5Ftms6JR06nADcDsYp5hTU9E2lbJUEOhdlY5J4DNTneM+jQ==} - engines: {node: '>=16.0.0 || 14 >= 14.17'} - peerDependencies: - rollup: ^2.68.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-json@6.1.0': - resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-node-resolve@15.2.3': - resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-terser@0.4.4': - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - - '@rollup/plugin-typescript@11.1.6': - resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.14.0||^3.0.0||^4.0.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - '@rollup/pluginutils@5.1.0': resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} @@ -3022,6 +3128,28 @@ packages: '@rushstack/eslint-patch@1.10.4': resolution: {integrity: sha512-WJgX9nzTqknM393q1QJDJmoW28kUfEnybeTfVNcNAPnIx210RXm2DiXiHzfNPJNIUUb1tJnz/l4QGtJ30PgWmA==} + '@rushstack/node-core-library@5.9.0': + resolution: {integrity: sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + '@rushstack/rig-package@0.5.3': + resolution: {integrity: sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==} + + '@rushstack/terminal@0.14.2': + resolution: {integrity: sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + '@rushstack/ts-command-line@4.22.8': + resolution: {integrity: sha512-XbFjOoV7qZHJnSuFUHv0pKaFA4ixyCuki+xMjsMfDwfvQjs5MYG0IK5COal3tRnG7KCDe2l/G+9LrzYE/RJhgg==} + '@schematics/angular@17.3.7': resolution: {integrity: sha512-HaJroKaberriP4wFefTTSVFrtU9GMvnG3I6ELbOteOyKMH7o2V91FXGJDJ5KnIiLRlBmC30G3r+9Ybc/rtAYkw==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} @@ -3059,6 +3187,10 @@ packages: '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + '@stackblitz/sdk@1.11.0': resolution: {integrity: sha512-DFQGANNkEZRzFk1/rDP6TcFdM82ycHE+zfl9C/M/jXlH68jiqHWHFMQURLELoD8koxvu/eW5uhg94NSAZlYrUQ==} @@ -3166,6 +3298,9 @@ packages: resolution: {integrity: sha512-92F7/SFyufn4DXsha9+QfKnN03JGqtMFMXgSHbZOo8JG59WkTni7UzAouNQDf7AuP9OAMxVOPQcqG3sB7w+kkg==} engines: {node: ^16.14.0 || >=18.0.0} + '@types/argparse@1.0.38': + resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -3268,9 +3403,6 @@ packages: '@types/react@18.3.3': resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} - '@types/resolve@1.20.2': - resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -3804,6 +3936,14 @@ packages: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} + ajv-draft-04@1.0.0: + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -3812,6 +3952,14 @@ packages: ajv: optional: true + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + ajv-keywords@3.5.2: resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} peerDependencies: @@ -3828,6 +3976,9 @@ packages: ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + ajv@8.13.0: + resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} + ajv@8.16.0: resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} @@ -3846,6 +3997,10 @@ packages: resolution: {integrity: sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==} engines: {node: '>=14.16'} + ansi-escapes@7.0.0: + resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + engines: {node: '>=18'} + ansi-html-community@0.0.8: resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} engines: {'0': node >= 0.8.0} @@ -4067,14 +4222,16 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} + bundle-require@5.0.0: + resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.18' + bytes@3.0.0: resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} engines: {node: '>= 0.8'} @@ -4145,6 +4302,10 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} @@ -4179,6 +4340,9 @@ packages: citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + cjs-module-lexer@1.4.1: + resolution: {integrity: sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==} + classnames@2.3.2: resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} @@ -4194,10 +4358,19 @@ packages: resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + cli-highlight@2.1.11: + resolution: {integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==} + engines: {node: '>=8.0.0', npm: '>=5.0.0'} + hasBin: true + cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cli-table3@0.6.5: + resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} + engines: {node: 10.* || >= 12.*} + cli-truncate@4.0.0: resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} engines: {node: '>=18'} @@ -4206,6 +4379,9 @@ packages: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} + cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -4259,9 +4435,6 @@ packages: common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - compressible@2.0.18: resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} engines: {node: '>= 0.6'} @@ -4591,6 +4764,9 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + emojis-list@3.0.0: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} @@ -4625,6 +4801,10 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} @@ -4672,6 +4852,11 @@ packages: engines: {node: '>=12'} hasBin: true + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -4918,10 +5103,21 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + fdir@6.3.0: + resolution: {integrity: sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} + fflate@0.8.2: + resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -5182,6 +5378,9 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + highlight.js@10.7.3: + resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -5300,6 +5499,10 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import-lazy@4.0.0: + resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} + engines: {node: '>=8'} + import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} @@ -5354,10 +5557,6 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} - is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - is-core-module@2.14.0: resolution: {integrity: sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==} engines: {node: '>= 0.4'} @@ -5404,9 +5603,6 @@ packages: is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} - is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -5426,9 +5622,6 @@ packages: is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} - is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} - is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} @@ -5513,6 +5706,13 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jju@1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + + joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + js-beautify@1.15.1: resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==} engines: {node: '>=14'} @@ -5668,6 +5868,10 @@ packages: resolution: {integrity: sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==} engines: {node: '>=18.0.0'} + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -5709,6 +5913,9 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} @@ -5737,6 +5944,9 @@ packages: resolution: {integrity: sha512-bfJaPTuEiTYBu+ulDaeQ0F+uLmlfFkMgXj4cbwfuMSjgObGMzb55FMMbDvbRU0fAHZ4sLGkz2mKwcMg8Dvm8Ww==} engines: {node: '>=18'} + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -5782,6 +5992,17 @@ packages: mark.js@8.11.1: resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + marked-terminal@7.1.0: + resolution: {integrity: sha512-+pvwa14KZL74MVXjYdPR3nSInhGhNvPce/3mqLVZT2oUvt654sL1XImFuLZ1pkA866IYZ3ikDTOFUIC7XzpZZg==} + engines: {node: '>=16.0.0'} + peerDependencies: + marked: '>=1 <14' + + marked@9.1.6: + resolution: {integrity: sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==} + engines: {node: '>= 16'} + hasBin: true + mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} @@ -5849,6 +6070,9 @@ packages: minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + minimatch@3.0.8: + resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -5989,6 +6213,10 @@ packages: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} + node-emoji@2.1.3: + resolution: {integrity: sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==} + engines: {node: '>=18'} + node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} @@ -6232,9 +6460,18 @@ packages: parse5-html-rewriting-stream@7.0.0: resolution: {integrity: sha512-mazCyGWkmCRWDI15Zp+UiCqMp/0dgEmkZRvhlsqqKYr4SsVm/TvnSpD9fCvqCA2zoWJcfRym846ejWBBHRiYEg==} + parse5-htmlparser2-tree-adapter@6.0.1: + resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} + parse5-sax-parser@7.0.0: resolution: {integrity: sha512-5A+v2SNsq8T6/mG3ahcz8ZtQ0OUFTatxPbeidoMB7tkJSGDY3tdfl4MHovtLQHkEn5CGxijNWRQHhRQ6IRpXKg==} + parse5@5.1.1: + resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} + + parse5@6.0.1: + resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} + parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} @@ -6309,6 +6546,10 @@ packages: resolution: {integrity: sha512-xUXwsxNjwTQ8K3GnT4pCJm+xq3RUPQbmkYJTP5aFIfNIvbcc/4MUxgBaaRSZJ6yGJZiGSyYlM6MzwTsRk8SYCg==} engines: {node: '>=12'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} @@ -6391,6 +6632,24 @@ packages: ts-node: optional: true + postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} + peerDependencies: + jiti: '>=1.21.0' + postcss: '>=8.0.9' + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + jiti: + optional: true + postcss: + optional: true + tsx: + optional: true + yaml: + optional: true + postcss-loader@8.1.1: resolution: {integrity: sha512-0IeqyAsG6tYiDRCYKQJLAmgQr47DX6N7sFSWvQxt6AcupX8DIdmykuk/o/tx0Lze3ErGHJEp5OSRxrelC6+NdQ==} engines: {node: '>= 18.12.0'} @@ -6772,18 +7031,6 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - rimraf@5.0.8: - resolution: {integrity: sha512-XSh0V2/yNhDEi8HwdIefD8MLgs4LQXPag/nEJWs3YUc3Upn+UHa1GyIkEg9xSSNt7HnkO5FjTvmcRzgf+8UZuw==} - engines: {node: '>=18'} - hasBin: true - - rollup-plugin-dts@6.1.1: - resolution: {integrity: sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==} - engines: {node: '>=16'} - peerDependencies: - rollup: ^3.29.4 || ^4 - typescript: ^4.5 || ^5.0 - rollup@4.18.0: resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -6892,6 +7139,11 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + semver@7.6.0: resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} engines: {node: '>=10'} @@ -6988,6 +7240,10 @@ packages: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -7008,9 +7264,6 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - smob@1.5.0: - resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==} - sockjs@0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} @@ -7050,6 +7303,10 @@ packages: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} + source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} @@ -7177,6 +7434,10 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} + supports-hyperlinks@3.1.0: + resolution: {integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==} + engines: {node: '>=14.18'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -7343,6 +7604,10 @@ packages: tinybench@2.8.0: resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + tinyglobby@0.2.6: + resolution: {integrity: sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==} + engines: {node: '>=12.0.0'} + tinypool@0.8.4: resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} @@ -7386,6 +7651,9 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + tr46@5.0.0: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} @@ -7426,10 +7694,29 @@ packages: tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: + tsup@8.3.0: + resolution: {integrity: sha512-ALscEeyS03IomcuNdFdc0YWGVIkwH1Ws7nfTbAPuoILvEV2hpGQAY72LIOjglGo4ShWpZfpBqP/jpQVCzqYQag==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + + tsutils@3.21.0: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' tuf-js@2.2.1: @@ -7478,11 +7765,21 @@ packages: typescript: optional: true + typescript@5.4.2: + resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} + engines: {node: '>=14.17'} + hasBin: true + typescript@5.5.3: resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} engines: {node: '>=14.17'} hasBin: true + typescript@5.6.1-rc: + resolution: {integrity: sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==} + engines: {node: '>=14.17'} + hasBin: true + ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} @@ -7505,6 +7802,10 @@ packages: resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} engines: {node: '>=4'} + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + unicode-match-property-ecmascript@2.0.0: resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} engines: {node: '>=4'} @@ -7843,6 +8144,9 @@ packages: webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -7926,6 +8230,9 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + which-pm@2.2.0: resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} engines: {node: '>=8.15'} @@ -8028,10 +8335,18 @@ packages: engines: {node: '>= 14'} hasBin: true + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -8170,6 +8485,8 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@andrewbranch/untar.js@1.0.3': {} + '@angular-devkit/architect@0.1703.7(chokidar@3.6.0)': dependencies: '@angular-devkit/core': 17.3.7(chokidar@3.6.0) @@ -8181,7 +8498,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.1703.7(chokidar@3.6.0) - '@angular-devkit/build-webpack': 0.1703.7(chokidar@3.6.0)(webpack-dev-server@4.15.1(webpack@5.90.3))(webpack@5.90.3(esbuild@0.20.1)) + '@angular-devkit/build-webpack': 0.1703.7(chokidar@3.6.0)(webpack-dev-server@4.15.1(webpack@5.90.3(esbuild@0.23.1)))(webpack@5.90.3(esbuild@0.20.1)) '@angular-devkit/core': 17.3.7(chokidar@3.6.0) '@angular/compiler-cli': 17.3.9(@angular/compiler@17.3.9(@angular/core@17.3.9(rxjs@7.8.1)(zone.js@0.14.7)))(typescript@5.5.3) '@babel/core': 7.24.0 @@ -8241,7 +8558,7 @@ snapshots: watchpack: 2.4.0 webpack: 5.90.3(esbuild@0.20.1) webpack-dev-middleware: 6.1.2(webpack@5.90.3(esbuild@0.20.1)) - webpack-dev-server: 4.15.1(webpack@5.90.3) + webpack-dev-server: 4.15.1(webpack@5.90.3(esbuild@0.23.1)) webpack-merge: 5.10.0 webpack-subresource-integrity: 5.1.0(webpack@5.90.3(esbuild@0.20.1)) optionalDependencies: @@ -8266,12 +8583,12 @@ snapshots: - utf-8-validate - webpack-cli - '@angular-devkit/build-webpack@0.1703.7(chokidar@3.6.0)(webpack-dev-server@4.15.1(webpack@5.90.3))(webpack@5.90.3(esbuild@0.20.1))': + '@angular-devkit/build-webpack@0.1703.7(chokidar@3.6.0)(webpack-dev-server@4.15.1(webpack@5.90.3(esbuild@0.23.1)))(webpack@5.90.3(esbuild@0.20.1))': dependencies: '@angular-devkit/architect': 0.1703.7(chokidar@3.6.0) rxjs: 7.8.1 webpack: 5.90.3(esbuild@0.20.1) - webpack-dev-server: 4.15.1(webpack@5.90.3) + webpack-dev-server: 4.15.1(webpack@5.90.3(esbuild@0.23.1)) transitivePeerDependencies: - chokidar @@ -8399,6 +8716,26 @@ snapshots: '@types/json-schema': 7.0.15 js-yaml: 4.1.0 + '@arethetypeswrong/cli@0.16.4': + dependencies: + '@arethetypeswrong/core': 0.16.4 + chalk: 4.1.2 + cli-table3: 0.6.5 + commander: 10.0.1 + marked: 9.1.6 + marked-terminal: 7.1.0(marked@9.1.6) + semver: 7.6.2 + + '@arethetypeswrong/core@0.16.4': + dependencies: + '@andrewbranch/untar.js': 1.0.3 + cjs-module-lexer: 1.4.1 + fflate: 0.8.2 + lru-cache: 10.4.3 + semver: 7.6.2 + typescript: 5.6.1-rc + validate-npm-package-name: 5.0.1 + '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 @@ -9564,6 +9901,9 @@ snapshots: human-id: 1.0.2 prettier: 2.8.8 + '@colors/colors@1.5.0': + optional: true + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -9606,6 +9946,9 @@ snapshots: '@esbuild/aix-ppc64@0.21.5': optional: true + '@esbuild/aix-ppc64@0.23.1': + optional: true + '@esbuild/android-arm64@0.19.12': optional: true @@ -9615,6 +9958,9 @@ snapshots: '@esbuild/android-arm64@0.21.5': optional: true + '@esbuild/android-arm64@0.23.1': + optional: true + '@esbuild/android-arm@0.19.12': optional: true @@ -9624,6 +9970,9 @@ snapshots: '@esbuild/android-arm@0.21.5': optional: true + '@esbuild/android-arm@0.23.1': + optional: true + '@esbuild/android-x64@0.19.12': optional: true @@ -9633,6 +9982,9 @@ snapshots: '@esbuild/android-x64@0.21.5': optional: true + '@esbuild/android-x64@0.23.1': + optional: true + '@esbuild/darwin-arm64@0.19.12': optional: true @@ -9642,6 +9994,9 @@ snapshots: '@esbuild/darwin-arm64@0.21.5': optional: true + '@esbuild/darwin-arm64@0.23.1': + optional: true + '@esbuild/darwin-x64@0.19.12': optional: true @@ -9651,6 +10006,9 @@ snapshots: '@esbuild/darwin-x64@0.21.5': optional: true + '@esbuild/darwin-x64@0.23.1': + optional: true + '@esbuild/freebsd-arm64@0.19.12': optional: true @@ -9660,6 +10018,9 @@ snapshots: '@esbuild/freebsd-arm64@0.21.5': optional: true + '@esbuild/freebsd-arm64@0.23.1': + optional: true + '@esbuild/freebsd-x64@0.19.12': optional: true @@ -9669,6 +10030,9 @@ snapshots: '@esbuild/freebsd-x64@0.21.5': optional: true + '@esbuild/freebsd-x64@0.23.1': + optional: true + '@esbuild/linux-arm64@0.19.12': optional: true @@ -9678,6 +10042,9 @@ snapshots: '@esbuild/linux-arm64@0.21.5': optional: true + '@esbuild/linux-arm64@0.23.1': + optional: true + '@esbuild/linux-arm@0.19.12': optional: true @@ -9687,6 +10054,9 @@ snapshots: '@esbuild/linux-arm@0.21.5': optional: true + '@esbuild/linux-arm@0.23.1': + optional: true + '@esbuild/linux-ia32@0.19.12': optional: true @@ -9696,6 +10066,9 @@ snapshots: '@esbuild/linux-ia32@0.21.5': optional: true + '@esbuild/linux-ia32@0.23.1': + optional: true + '@esbuild/linux-loong64@0.19.12': optional: true @@ -9705,6 +10078,9 @@ snapshots: '@esbuild/linux-loong64@0.21.5': optional: true + '@esbuild/linux-loong64@0.23.1': + optional: true + '@esbuild/linux-mips64el@0.19.12': optional: true @@ -9714,6 +10090,9 @@ snapshots: '@esbuild/linux-mips64el@0.21.5': optional: true + '@esbuild/linux-mips64el@0.23.1': + optional: true + '@esbuild/linux-ppc64@0.19.12': optional: true @@ -9723,6 +10102,9 @@ snapshots: '@esbuild/linux-ppc64@0.21.5': optional: true + '@esbuild/linux-ppc64@0.23.1': + optional: true + '@esbuild/linux-riscv64@0.19.12': optional: true @@ -9732,6 +10114,9 @@ snapshots: '@esbuild/linux-riscv64@0.21.5': optional: true + '@esbuild/linux-riscv64@0.23.1': + optional: true + '@esbuild/linux-s390x@0.19.12': optional: true @@ -9741,6 +10126,9 @@ snapshots: '@esbuild/linux-s390x@0.21.5': optional: true + '@esbuild/linux-s390x@0.23.1': + optional: true + '@esbuild/linux-x64@0.19.12': optional: true @@ -9750,6 +10138,9 @@ snapshots: '@esbuild/linux-x64@0.21.5': optional: true + '@esbuild/linux-x64@0.23.1': + optional: true + '@esbuild/netbsd-x64@0.19.12': optional: true @@ -9759,6 +10150,12 @@ snapshots: '@esbuild/netbsd-x64@0.21.5': optional: true + '@esbuild/netbsd-x64@0.23.1': + optional: true + + '@esbuild/openbsd-arm64@0.23.1': + optional: true + '@esbuild/openbsd-x64@0.19.12': optional: true @@ -9768,6 +10165,9 @@ snapshots: '@esbuild/openbsd-x64@0.21.5': optional: true + '@esbuild/openbsd-x64@0.23.1': + optional: true + '@esbuild/sunos-x64@0.19.12': optional: true @@ -9777,6 +10177,9 @@ snapshots: '@esbuild/sunos-x64@0.21.5': optional: true + '@esbuild/sunos-x64@0.23.1': + optional: true + '@esbuild/win32-arm64@0.19.12': optional: true @@ -9786,6 +10189,9 @@ snapshots: '@esbuild/win32-arm64@0.21.5': optional: true + '@esbuild/win32-arm64@0.23.1': + optional: true + '@esbuild/win32-ia32@0.19.12': optional: true @@ -9795,6 +10201,9 @@ snapshots: '@esbuild/win32-ia32@0.21.5': optional: true + '@esbuild/win32-ia32@0.23.1': + optional: true + '@esbuild/win32-x64@0.19.12': optional: true @@ -9804,6 +10213,9 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true + '@esbuild/win32-x64@0.23.1': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@9.0.0)': dependencies: eslint: 9.0.0 @@ -9953,6 +10365,45 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 + '@microsoft/api-extractor-model@7.29.8(@types/node@20.14.10)': + dependencies: + '@microsoft/tsdoc': 0.15.0 + '@microsoft/tsdoc-config': 0.17.0 + '@rushstack/node-core-library': 5.9.0(@types/node@20.14.10) + transitivePeerDependencies: + - '@types/node' + optional: true + + '@microsoft/api-extractor@7.47.9(@types/node@20.14.10)': + dependencies: + '@microsoft/api-extractor-model': 7.29.8(@types/node@20.14.10) + '@microsoft/tsdoc': 0.15.0 + '@microsoft/tsdoc-config': 0.17.0 + '@rushstack/node-core-library': 5.9.0(@types/node@20.14.10) + '@rushstack/rig-package': 0.5.3 + '@rushstack/terminal': 0.14.2(@types/node@20.14.10) + '@rushstack/ts-command-line': 4.22.8(@types/node@20.14.10) + lodash: 4.17.21 + minimatch: 3.0.8 + resolve: 1.22.8 + semver: 7.5.4 + source-map: 0.6.1 + typescript: 5.4.2 + transitivePeerDependencies: + - '@types/node' + optional: true + + '@microsoft/tsdoc-config@0.17.0': + dependencies: + '@microsoft/tsdoc': 0.15.0 + ajv: 8.12.0 + jju: 1.4.0 + resolve: 1.22.8 + optional: true + + '@microsoft/tsdoc@0.15.0': + optional: true + '@neoconfetti/svelte@2.0.0': {} '@ngtools/webpack@17.3.7(@angular/compiler-cli@17.3.9(@angular/compiler@17.3.9(@angular/core@17.3.9(rxjs@7.8.1)(zone.js@0.14.7)))(typescript@5.5.3))(typescript@5.5.3)(webpack@5.90.3(esbuild@0.20.1))': @@ -10707,59 +11158,6 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@rollup/plugin-commonjs@26.0.1(rollup@4.18.0)': - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 10.4.3 - is-reference: 1.2.1 - magic-string: 0.30.10 - optionalDependencies: - rollup: 4.18.0 - - '@rollup/plugin-json@6.1.0(rollup@4.22.0)': - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.0) - optionalDependencies: - rollup: 4.22.0 - - '@rollup/plugin-node-resolve@15.2.3(rollup@4.22.0)': - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.0) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-builtin-module: 3.2.1 - is-module: 1.0.0 - resolve: 1.22.8 - optionalDependencies: - rollup: 4.22.0 - - '@rollup/plugin-terser@0.4.4(rollup@4.18.0)': - dependencies: - serialize-javascript: 6.0.2 - smob: 1.5.0 - terser: 5.31.1 - optionalDependencies: - rollup: 4.18.0 - - '@rollup/plugin-typescript@11.1.6(rollup@4.18.0)(tslib@2.6.3)(typescript@5.5.3)': - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) - resolve: 1.22.8 - typescript: 5.5.3 - optionalDependencies: - rollup: 4.18.0 - tslib: 2.6.3 - - '@rollup/pluginutils@5.1.0(rollup@4.18.0)': - dependencies: - '@types/estree': 1.0.5 - estree-walker: 2.0.2 - picomatch: 2.3.1 - optionalDependencies: - rollup: 4.18.0 - '@rollup/pluginutils@5.1.0(rollup@4.22.0)': dependencies: '@types/estree': 1.0.5 @@ -10866,6 +11264,44 @@ snapshots: '@rushstack/eslint-patch@1.10.4': {} + '@rushstack/node-core-library@5.9.0(@types/node@20.14.10)': + dependencies: + ajv: 8.13.0 + ajv-draft-04: 1.0.0(ajv@8.13.0) + ajv-formats: 3.0.1(ajv@8.13.0) + fs-extra: 7.0.1 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.8 + semver: 7.5.4 + optionalDependencies: + '@types/node': 20.14.10 + optional: true + + '@rushstack/rig-package@0.5.3': + dependencies: + resolve: 1.22.8 + strip-json-comments: 3.1.1 + optional: true + + '@rushstack/terminal@0.14.2(@types/node@20.14.10)': + dependencies: + '@rushstack/node-core-library': 5.9.0(@types/node@20.14.10) + supports-color: 8.1.1 + optionalDependencies: + '@types/node': 20.14.10 + optional: true + + '@rushstack/ts-command-line@4.22.8(@types/node@20.14.10)': + dependencies: + '@rushstack/terminal': 0.14.2(@types/node@20.14.10) + '@types/argparse': 1.0.38 + argparse: 1.0.10 + string-argv: 0.3.2 + transitivePeerDependencies: + - '@types/node' + optional: true + '@schematics/angular@17.3.7(chokidar@3.6.0)': dependencies: '@angular-devkit/core': 17.3.7(chokidar@3.6.0) @@ -10916,6 +11352,8 @@ snapshots: '@sinclair/typebox@0.27.8': {} + '@sindresorhus/is@4.6.0': {} + '@stackblitz/sdk@1.11.0': {} '@sveltejs/adapter-auto@3.0.0(@sveltejs/kit@2.5.28(@sveltejs/vite-plugin-svelte@3.0.0(svelte@4.2.19)(vite@5.4.6(@types/node@20.14.10)(less@4.2.0)(sass@1.71.1)(terser@5.31.1)))(svelte@4.2.19)(vite@5.4.6(@types/node@20.14.10)(less@4.2.0)(sass@1.71.1)(terser@5.31.1)))': @@ -11028,6 +11466,9 @@ snapshots: '@tufjs/canonical-json': 2.0.0 minimatch: 9.0.5 + '@types/argparse@1.0.38': + optional: true + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.24.7 @@ -11159,8 +11600,6 @@ snapshots: '@types/prop-types': 15.7.12 csstype: 3.1.3 - '@types/resolve@1.20.2': {} - '@types/retry@0.12.0': {} '@types/semver@7.5.8': {} @@ -11918,6 +12357,11 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 + ajv-draft-04@1.0.0(ajv@8.13.0): + optionalDependencies: + ajv: 8.13.0 + optional: true + ajv-formats@2.1.1(ajv@8.12.0): optionalDependencies: ajv: 8.12.0 @@ -11926,6 +12370,11 @@ snapshots: optionalDependencies: ajv: 8.16.0 + ajv-formats@3.0.1(ajv@8.13.0): + optionalDependencies: + ajv: 8.13.0 + optional: true + ajv-keywords@3.5.2(ajv@6.12.6): dependencies: ajv: 6.12.6 @@ -11949,6 +12398,14 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 + ajv@8.13.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + optional: true + ajv@8.16.0: dependencies: fast-deep-equal: 3.1.3 @@ -11982,6 +12439,10 @@ snapshots: ansi-escapes@6.2.1: {} + ansi-escapes@7.0.0: + dependencies: + environment: 1.1.0 + ansi-html-community@0.0.8: {} ansi-regex@5.0.1: {} @@ -12231,12 +12692,15 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - builtin-modules@3.3.0: {} - bundle-name@4.1.0: dependencies: run-applescript: 7.0.0 + bundle-require@5.0.0(esbuild@0.23.1): + dependencies: + esbuild: 0.23.1 + load-tsconfig: 0.2.5 + bytes@3.0.0: {} bytes@3.1.2: {} @@ -12326,6 +12790,8 @@ snapshots: chalk@5.3.0: {} + char-regex@1.0.2: {} + chardet@0.7.0: {} check-error@1.0.3: @@ -12363,6 +12829,8 @@ snapshots: dependencies: consola: 3.2.3 + cjs-module-lexer@1.4.1: {} + classnames@2.3.2: {} clean-stack@2.2.0: {} @@ -12375,8 +12843,23 @@ snapshots: dependencies: restore-cursor: 4.0.0 + cli-highlight@2.1.11: + dependencies: + chalk: 4.1.2 + highlight.js: 10.7.3 + mz: 2.7.0 + parse5: 5.1.1 + parse5-htmlparser2-tree-adapter: 6.0.1 + yargs: 16.2.0 + cli-spinners@2.9.2: {} + cli-table3@0.6.5: + dependencies: + string-width: 4.2.3 + optionalDependencies: + '@colors/colors': 1.5.0 + cli-truncate@4.0.0: dependencies: slice-ansi: 5.0.0 @@ -12384,6 +12867,12 @@ snapshots: cli-width@4.1.0: {} + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -12434,8 +12923,6 @@ snapshots: common-path-prefix@3.0.0: {} - commondir@1.0.1: {} - compressible@2.0.18: dependencies: mime-db: 1.52.0 @@ -12725,6 +13212,8 @@ snapshots: emoji-regex@9.2.2: {} + emojilib@2.4.0: {} + emojis-list@3.0.0: {} encodeurl@1.0.2: {} @@ -12754,6 +13243,8 @@ snapshots: env-paths@2.2.1: {} + environment@1.1.0: {} + err-code@2.0.3: {} errno@0.1.8: @@ -12858,6 +13349,33 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 + esbuild@0.23.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + escalade@3.1.2: {} escape-html@1.0.3: {} @@ -13234,11 +13752,17 @@ snapshots: dependencies: pend: 1.2.0 + fdir@6.3.0(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 + fflate@0.8.2: {} + figures@3.2.0: dependencies: escape-string-regexp: 1.0.5 @@ -13505,6 +14029,8 @@ snapshots: he@1.2.0: {} + highlight.js@10.7.3: {} + hookable@5.5.3: {} hosted-git-info@7.0.2: @@ -13628,6 +14154,9 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + import-lazy@4.0.0: + optional: true + import-meta-resolve@4.1.0: {} imurmurhash@0.1.4: {} @@ -13684,10 +14213,6 @@ snapshots: dependencies: binary-extensions: 2.3.0 - is-builtin-module@3.2.1: - dependencies: - builtin-modules: 3.3.0 - is-core-module@2.14.0: dependencies: hasown: 2.0.2 @@ -13718,8 +14243,6 @@ snapshots: is-lambda@1.0.1: {} - is-module@1.0.0: {} - is-number@7.0.0: {} is-path-inside@3.0.3: {} @@ -13732,10 +14255,6 @@ snapshots: is-potential-custom-element-name@1.0.1: {} - is-reference@1.2.1: - dependencies: - '@types/estree': 1.0.5 - is-reference@3.0.2: dependencies: '@types/estree': 1.0.5 @@ -13817,6 +14336,11 @@ snapshots: jiti@1.21.6: {} + jju@1.4.0: + optional: true + + joycon@3.1.1: {} + js-beautify@1.15.1: dependencies: config-chain: 1.1.13 @@ -13988,6 +14512,8 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 9.0.0 + load-tsconfig@0.2.5: {} + load-yaml-file@0.2.0: dependencies: graceful-fs: 4.2.11 @@ -14028,6 +14554,8 @@ snapshots: lodash.merge@4.6.2: {} + lodash.sortby@4.7.0: {} + lodash.startcase@4.4.0: {} lodash@4.17.21: {} @@ -14059,6 +14587,8 @@ snapshots: lru-cache@10.4.0: {} + lru-cache@10.4.3: {} + lru-cache@4.1.5: dependencies: pseudomap: 1.0.2 @@ -14123,6 +14653,18 @@ snapshots: mark.js@8.11.1: {} + marked-terminal@7.1.0(marked@9.1.6): + dependencies: + ansi-escapes: 7.0.0 + chalk: 5.3.0 + cli-highlight: 2.1.11 + cli-table3: 0.6.5 + marked: 9.1.6 + node-emoji: 2.1.3 + supports-hyperlinks: 3.1.0 + + marked@9.1.6: {} + mdn-data@2.0.30: {} media-typer@0.3.0: {} @@ -14168,6 +14710,11 @@ snapshots: minimalistic-assert@1.0.1: {} + minimatch@3.0.8: + dependencies: + brace-expansion: 1.1.11 + optional: true + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -14295,6 +14842,13 @@ snapshots: node-domexception@1.0.0: {} + node-emoji@2.1.3: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + node-fetch-native@1.6.4: {} node-fetch@2.7.0(encoding@0.1.13): @@ -14595,10 +15149,18 @@ snapshots: parse5: 7.1.2 parse5-sax-parser: 7.0.0 + parse5-htmlparser2-tree-adapter@6.0.1: + dependencies: + parse5: 6.0.1 + parse5-sax-parser@7.0.0: dependencies: parse5: 7.1.2 + parse5@5.1.1: {} + + parse5@6.0.1: {} + parse5@7.1.2: dependencies: entities: 4.5.0 @@ -14650,6 +15212,8 @@ snapshots: picomatch@4.0.1: {} + picomatch@4.0.2: {} + pidtree@0.6.0: {} pify@2.3.0: {} @@ -14726,6 +15290,14 @@ snapshots: postcss: 8.4.39 ts-node: 10.9.2(@types/node@20.14.5)(typescript@5.5.3) + postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.45)(yaml@2.4.5): + dependencies: + lilconfig: 3.1.2 + optionalDependencies: + jiti: 1.21.6 + postcss: 8.4.45 + yaml: 2.4.5 + postcss-loader@8.1.1(postcss@8.4.35)(typescript@5.5.3)(webpack@5.90.3(esbuild@0.20.1)): dependencies: cosmiconfig: 9.0.0(typescript@5.5.3) @@ -15107,18 +15679,6 @@ snapshots: dependencies: glob: 7.2.3 - rimraf@5.0.8: - dependencies: - glob: 10.4.3 - - rollup-plugin-dts@6.1.1(rollup@4.18.0)(typescript@5.5.3): - dependencies: - magic-string: 0.30.10 - rollup: 4.18.0 - typescript: 5.5.3 - optionalDependencies: - '@babel/code-frame': 7.24.7 - rollup@4.18.0: dependencies: '@types/estree': 1.0.5 @@ -15247,6 +15807,11 @@ snapshots: semver@6.3.1: {} + semver@7.5.4: + dependencies: + lru-cache: 6.0.0 + optional: true + semver@7.6.0: dependencies: lru-cache: 6.0.0 @@ -15370,6 +15935,10 @@ snapshots: mrmime: 2.0.0 totalist: 3.0.1 + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + slash@3.0.0: {} slash@4.0.0: {} @@ -15386,8 +15955,6 @@ snapshots: smart-buffer@4.2.0: {} - smob@1.5.0: {} - sockjs@0.3.24: dependencies: faye-websocket: 0.11.4 @@ -15437,6 +16004,10 @@ snapshots: source-map@0.7.4: {} + source-map@0.8.0-beta.0: + dependencies: + whatwg-url: 7.1.0 + spawndamnit@2.0.0: dependencies: cross-spawn: 5.1.0 @@ -15581,6 +16152,11 @@ snapshots: dependencies: has-flag: 4.0.0 + supports-hyperlinks@3.1.0: + dependencies: + has-flag: 4.0.0 + supports-color: 7.2.0 + supports-preserve-symlinks-flag@1.0.0: {} svelte-check@3.6.0(@babel/core@7.24.7)(less@4.2.0)(postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(postcss@8.4.39)(sass@1.71.1)(svelte@4.2.19): @@ -15774,7 +16350,7 @@ snapshots: term-size@2.2.1: {} - terser-webpack-plugin@5.3.10(esbuild@0.20.1)(webpack@5.90.3): + terser-webpack-plugin@5.3.10(esbuild@0.20.1)(webpack@5.90.3(esbuild@0.23.1)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 @@ -15798,6 +16374,7 @@ snapshots: acorn: 8.12.0 commander: 2.20.3 source-map-support: 0.5.21 + optional: true test-exclude@6.0.0: dependencies: @@ -15830,6 +16407,11 @@ snapshots: tinybench@2.8.0: {} + tinyglobby@0.2.6: + dependencies: + fdir: 6.3.0(picomatch@4.0.2) + picomatch: 4.0.2 + tinypool@0.8.4: {} tinypool@1.0.0: {} @@ -15861,6 +16443,10 @@ snapshots: tr46@0.0.3: {} + tr46@1.0.1: + dependencies: + punycode: 2.3.1 + tr46@5.0.0: dependencies: punycode: 2.3.1 @@ -15916,6 +16502,34 @@ snapshots: tslib@2.6.3: {} + tsup@8.3.0(@microsoft/api-extractor@7.47.9(@types/node@20.14.10))(jiti@1.21.6)(postcss@8.4.45)(typescript@5.5.3)(yaml@2.4.5): + dependencies: + bundle-require: 5.0.0(esbuild@0.23.1) + cac: 6.7.14 + chokidar: 3.6.0 + consola: 3.2.3 + debug: 4.3.5 + esbuild: 0.23.1 + execa: 5.1.1 + joycon: 3.1.1 + picocolors: 1.0.1 + postcss-load-config: 6.0.1(jiti@1.21.6)(postcss@8.4.45)(yaml@2.4.5) + resolve-from: 5.0.0 + rollup: 4.22.0 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tinyglobby: 0.2.6 + tree-kill: 1.2.2 + optionalDependencies: + '@microsoft/api-extractor': 7.47.9(@types/node@20.14.10) + postcss: 8.4.45 + typescript: 5.5.3 + transitivePeerDependencies: + - jiti + - supports-color + - tsx + - yaml + tsutils@3.21.0(typescript@5.5.3): dependencies: tslib: 1.14.1 @@ -15968,8 +16582,13 @@ snapshots: - eslint - supports-color + typescript@5.4.2: + optional: true + typescript@5.5.3: {} + typescript@5.6.1-rc: {} + ufo@1.5.3: {} uglify-js@3.18.0: @@ -15986,6 +16605,8 @@ snapshots: unicode-canonical-property-names-ecmascript@2.0.0: {} + unicode-emoji-modifier-base@1.0.0: {} + unicode-match-property-ecmascript@2.0.0: dependencies: unicode-canonical-property-names-ecmascript: 2.0.0 @@ -16440,9 +17061,11 @@ snapshots: webidl-conversions@3.0.1: {} + webidl-conversions@4.0.2: {} + webidl-conversions@7.0.0: {} - webpack-dev-middleware@5.3.4(webpack@5.90.3): + webpack-dev-middleware@5.3.4(webpack@5.90.3(esbuild@0.23.1)): dependencies: colorette: 2.0.20 memfs: 3.5.3 @@ -16461,7 +17084,7 @@ snapshots: optionalDependencies: webpack: 5.90.3(esbuild@0.20.1) - webpack-dev-server@4.15.1(webpack@5.90.3): + webpack-dev-server@4.15.1(webpack@5.90.3(esbuild@0.23.1)): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -16491,7 +17114,7 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 5.3.4(webpack@5.90.3) + webpack-dev-middleware: 5.3.4(webpack@5.90.3(esbuild@0.23.1)) ws: 8.17.1 optionalDependencies: webpack: 5.90.3(esbuild@0.20.1) @@ -16537,7 +17160,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(esbuild@0.20.1)(webpack@5.90.3) + terser-webpack-plugin: 5.3.10(esbuild@0.20.1)(webpack@5.90.3(esbuild@0.23.1)) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -16569,6 +17192,12 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 + whatwg-url@7.1.0: + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + which-pm@2.2.0: dependencies: load-yaml-file: 0.2.0 @@ -16648,8 +17277,20 @@ snapshots: yaml@2.4.5: {} + yargs-parser@20.2.9: {} + yargs-parser@21.1.1: {} + yargs@16.2.0: + dependencies: + cliui: 7.0.4 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + yargs@17.7.2: dependencies: cliui: 8.0.1