@hey-api/openapi-ts 0.87.3 → 0.87.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"src-CF9c-t93.js","names":["meta: ProjectRenderMeta","path","isexe","sync","fs","path","checkStat","isexe","sync","fs","path","isexe","sync","path","path","which","path","resolveCommand","path","fs","readShebang","path","isWin","parse","cp","formatters: Record<Formatters, OutputProcessor>","path","linters: Record<Linters, OutputProcessor>","module","result: Pick<\n Partial<Input>,\n | 'api_key'\n | 'branch'\n | 'commit_sha'\n | 'organization'\n | 'project'\n | 'registry'\n | 'tags'\n | 'version'\n > &\n Pick<Input, 'path'>","path","queryParams: Array<string>","lines: Array<string>","createClient","watches: ReadonlyArray<WatchValues>","context: Context | undefined","data","lines: Array<string>","event: LoggerEvent | undefined","event: LoggerEvent","result: StoredEventResult","configs: Configs | undefined","result","pCreateClient"],"sources":["../src/config/engine.ts","../src/generate/output.ts","../src/openApi/shared/utils/patch.ts","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","../../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js","../../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js","../../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js","../src/processOutput.ts","../src/createClient.ts","../src/utils/cli.ts","../src/utils/logger.ts","../src/generate.ts","../src/utils/exports.ts","../src/index.ts"],"sourcesContent":["import { ConfigError } from '~/error';\n\nexport const checkNodeVersion = () => {\n if (typeof Bun !== 'undefined') {\n const [major] = Bun.version.split('.').map(Number);\n if (major! < 1) {\n throw new ConfigError(\n `Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`,\n );\n }\n } else if (typeof process !== 'undefined' && process.versions?.node) {\n const [major] = process.versions.node.split('.').map(Number);\n if (major! < 20) {\n throw new ConfigError(\n `Unsupported Node version ${process.versions.node}. Please use Node 20 or newer.`,\n );\n }\n }\n};\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { ProjectRenderMeta } from '@hey-api/codegen-core';\n\nimport type { Context } from '~/ir/context';\nimport { getClientPlugin } from '~/plugins/@hey-api/client-core/utils';\n\nimport { generateClientBundle } from './client';\n\nexport const generateOutput = async ({ context }: { context: Context }) => {\n const outputPath = path.resolve(context.config.output.path);\n\n if (context.config.output.clean) {\n if (fs.existsSync(outputPath)) {\n fs.rmSync(outputPath, { force: true, recursive: true });\n }\n }\n\n const meta: ProjectRenderMeta = {\n importFileExtension: context.config.output.importFileExtension,\n };\n\n const client = getClientPlugin(context.config);\n if (\n 'bundle' in client.config &&\n client.config.bundle &&\n !context.config.dryRun\n ) {\n // not proud of this one\n // @ts-expect-error\n context.config._FRAGILE_CLIENT_BUNDLE_RENAMED = generateClientBundle({\n meta,\n outputPath,\n // @ts-expect-error\n plugin: client,\n project: context.gen,\n });\n }\n\n for (const plugin of context.registerPlugins()) {\n await plugin.run();\n }\n\n for (const file of context.gen.render(meta)) {\n const filePath = path.resolve(outputPath, file.path);\n const dir = path.dirname(filePath);\n if (!context.config.dryRun) {\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(filePath, file.content, { encoding: 'utf8' });\n }\n }\n};\n","import type { OpenApi } from '~/openApi/types';\n\nimport type { Patch } from '../../../types/parser';\n\nexport const patchOpenApiSpec = ({\n patchOptions,\n spec: _spec,\n}: {\n patchOptions: Patch | undefined;\n spec: unknown;\n}) => {\n if (!patchOptions) {\n return;\n }\n\n const spec = _spec as OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X;\n\n if ('swagger' in spec) {\n if (patchOptions.version && spec.swagger) {\n spec.swagger = (\n typeof patchOptions.version === 'string'\n ? patchOptions.version\n : patchOptions.version(spec.swagger)\n ) as typeof spec.swagger;\n }\n\n if (patchOptions.meta && spec.info) {\n patchOptions.meta(spec.info);\n }\n\n if (patchOptions.schemas && spec.definitions) {\n for (const key in patchOptions.schemas) {\n const schema = spec.definitions[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.schemas[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.operations && spec.paths) {\n for (const key in patchOptions.operations) {\n const [method, path] = key.split(' ');\n if (!method || !path) continue;\n\n const pathItem = spec.paths[path as keyof typeof spec.paths];\n if (!pathItem) continue;\n\n const operation =\n pathItem[method.toLocaleLowerCase() as keyof typeof pathItem] ||\n pathItem[method.toLocaleUpperCase() as keyof typeof pathItem];\n if (!operation || typeof operation !== 'object') continue;\n\n const patchFn = patchOptions.operations[key]!;\n patchFn(operation as any);\n }\n }\n return;\n }\n\n if (patchOptions.version && spec.openapi) {\n spec.openapi = (\n typeof patchOptions.version === 'string'\n ? patchOptions.version\n : patchOptions.version(spec.openapi)\n ) as typeof spec.openapi;\n }\n\n if (patchOptions.meta && spec.info) {\n patchOptions.meta(spec.info);\n }\n\n if (spec.components) {\n if (patchOptions.schemas && spec.components.schemas) {\n for (const key in patchOptions.schemas) {\n const schema = spec.components.schemas[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.schemas[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.parameters && spec.components.parameters) {\n for (const key in patchOptions.parameters) {\n const schema = spec.components.parameters[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.parameters[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.requestBodies && spec.components.requestBodies) {\n for (const key in patchOptions.requestBodies) {\n const schema = spec.components.requestBodies[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.requestBodies[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.responses && spec.components.responses) {\n for (const key in patchOptions.responses) {\n const schema = spec.components.responses[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.responses[key]!;\n patchFn(schema);\n }\n }\n }\n\n if (patchOptions.operations && spec.paths) {\n for (const key in patchOptions.operations) {\n const [method, path] = key.split(' ');\n if (!method || !path) continue;\n\n const pathItem = spec.paths[path as keyof typeof spec.paths];\n if (!pathItem) continue;\n\n const operation =\n pathItem[method.toLocaleLowerCase() as keyof typeof pathItem] ||\n pathItem[method.toLocaleUpperCase() as keyof typeof pathItem];\n if (!operation || typeof operation !== 'object') continue;\n\n const patchFn = patchOptions.operations[key]!;\n patchFn(operation as any);\n }\n }\n};\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input\n // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(?=(\\\\+?)?)\\1\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(?=(\\\\+?)?)\\1$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed);\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","import { sync } from 'cross-spawn';\n\nimport type { Config } from '~/types/config';\nimport type { Formatters, Linters } from '~/types/output';\n\ntype OutputProcessor = {\n args: (path: string) => ReadonlyArray<string>;\n command: string;\n name: string;\n};\n\n/**\n * Map of supported formatters\n */\nconst formatters: Record<Formatters, OutputProcessor> = {\n biome: {\n args: (path) => ['format', '--write', path],\n command: 'biome',\n name: 'Biome (Format)',\n },\n prettier: {\n args: (path) => [\n '--ignore-unknown',\n path,\n '--write',\n '--ignore-path',\n './.prettierignore',\n ],\n command: 'prettier',\n name: 'Prettier',\n },\n};\n\n/**\n * Map of supported linters\n */\nconst linters: Record<Linters, OutputProcessor> = {\n biome: {\n args: (path) => ['lint', '--apply', path],\n command: 'biome',\n name: 'Biome (Lint)',\n },\n eslint: {\n args: (path) => [path, '--fix'],\n command: 'eslint',\n name: 'ESLint',\n },\n oxlint: {\n args: (path) => ['--fix', path],\n command: 'oxlint',\n name: 'oxlint',\n },\n};\n\nexport const processOutput = ({ config }: { config: Config }) => {\n if (config.output.lint) {\n const module = linters[config.output.lint];\n console.log(`✨ Running ${module.name}`);\n sync(module.command, module.args(config.output.path));\n }\n\n if (config.output.format) {\n const module = formatters[config.output.format];\n console.log(`✨ Running ${module.name}`);\n sync(module.command, module.args(config.output.path));\n }\n};\n","import path from 'node:path';\n\nimport { $RefParser } from '@hey-api/json-schema-ref-parser';\nimport colors from 'ansi-colors';\n\nimport { generateOutput } from '~/generate/output';\nimport { getSpec } from '~/getSpec';\nimport type { Context } from '~/ir/context';\nimport { parseOpenApiSpec } from '~/openApi';\nimport { buildGraph } from '~/openApi/shared/utils/graph';\nimport { patchOpenApiSpec } from '~/openApi/shared/utils/patch';\nimport { processOutput } from '~/processOutput';\nimport type { Config } from '~/types/config';\nimport type { Input } from '~/types/input';\nimport type { WatchValues } from '~/types/types';\nimport type { Logger } from '~/utils/logger';\n\nexport const compileInputPath = (input: Omit<Input, 'watch'>) => {\n const result: Pick<\n Partial<Input>,\n | 'api_key'\n | 'branch'\n | 'commit_sha'\n | 'organization'\n | 'project'\n | 'registry'\n | 'tags'\n | 'version'\n > &\n Pick<Input, 'path'> = {\n ...input,\n path: '',\n };\n\n if (\n input.path &&\n (typeof input.path !== 'string' || input.registry !== 'hey-api')\n ) {\n result.path = input.path;\n return result;\n }\n\n const [basePath, baseQuery] = input.path.split('?');\n const queryParts = (baseQuery || '').split('&');\n const queryPath = queryParts.map((part) => part.split('='));\n\n let path = basePath || '';\n if (path.endsWith('/')) {\n path = path.slice(0, path.length - 1);\n }\n\n const [, pathUrl] = path.split('://');\n const [baseUrl, organization, project] = (pathUrl || '').split('/');\n result.organization = organization || input.organization;\n result.project = project || input.project;\n\n const queryParams: Array<string> = [];\n\n const kApiKey = 'api_key';\n result.api_key =\n queryPath.find(([key]) => key === kApiKey)?.[1] ||\n input.api_key ||\n process.env.HEY_API_TOKEN;\n if (result.api_key) {\n queryParams.push(`${kApiKey}=${result.api_key}`);\n }\n\n const kBranch = 'branch';\n result.branch =\n queryPath.find(([key]) => key === kBranch)?.[1] || input.branch;\n if (result.branch) {\n queryParams.push(`${kBranch}=${result.branch}`);\n }\n\n const kCommitSha = 'commit_sha';\n result.commit_sha =\n queryPath.find(([key]) => key === kCommitSha)?.[1] || input.commit_sha;\n if (result.commit_sha) {\n queryParams.push(`${kCommitSha}=${result.commit_sha}`);\n }\n\n const kTags = 'tags';\n result.tags =\n queryPath.find(([key]) => key === kTags)?.[1]?.split(',') || input.tags;\n if (result.tags?.length) {\n queryParams.push(`${kTags}=${result.tags.join(',')}`);\n }\n\n const kVersion = 'version';\n result.version =\n queryPath.find(([key]) => key === kVersion)?.[1] || input.version;\n if (result.version) {\n queryParams.push(`${kVersion}=${result.version}`);\n }\n\n if (!result.organization) {\n throw new Error(\n 'missing organization - from which Hey API Platform organization do you want to generate your output?',\n );\n }\n\n if (!result.project) {\n throw new Error(\n 'missing project - from which Hey API Platform project do you want to generate your output?',\n );\n }\n\n const query = queryParams.join('&');\n const platformUrl = baseUrl || 'get.heyapi.dev';\n const isLocalhost = platformUrl.startsWith('localhost');\n const platformUrlWithProtocol = [\n isLocalhost ? 'http' : 'https',\n platformUrl,\n ].join('://');\n const compiledPath = isLocalhost\n ? [\n platformUrlWithProtocol,\n 'v1',\n 'get',\n result.organization,\n result.project,\n ].join('/')\n : [platformUrlWithProtocol, result.organization, result.project].join('/');\n result.path = query ? `${compiledPath}?${query}` : compiledPath;\n\n return result;\n};\n\nconst logInputPaths = (\n inputPaths: ReadonlyArray<ReturnType<typeof compileInputPath>>,\n jobIndex: number,\n) => {\n const lines: Array<string> = [];\n\n const jobPrefix = colors.gray(`[Job ${jobIndex + 1}] `);\n const count = inputPaths.length;\n const baseString = colors.cyan(\n `Generating from ${count} ${count === 1 ? 'input' : 'inputs'}:`,\n );\n lines.push(`${jobPrefix}⏳ ${baseString}`);\n\n inputPaths.forEach((inputPath, index) => {\n const itemPrefixStr = ` [${index + 1}] `;\n const itemPrefix = colors.cyan(itemPrefixStr);\n const detailIndent = ' '.repeat(itemPrefixStr.length);\n\n if (typeof inputPath.path !== 'string') {\n lines.push(`${jobPrefix}${itemPrefix}raw OpenAPI specification`);\n return;\n }\n\n switch (inputPath.registry) {\n case 'hey-api': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n if (inputPath.branch) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('branch:')} ${colors.green(\n inputPath.branch,\n )}`,\n );\n }\n if (inputPath.commit_sha) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('commit:')} ${colors.green(\n inputPath.commit_sha,\n )}`,\n );\n }\n if (inputPath.tags?.length) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('tags:')} ${colors.green(\n inputPath.tags.join(', '),\n )}`,\n );\n }\n if (inputPath.version) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('version:')} ${colors.green(\n inputPath.version,\n )}`,\n );\n }\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('Hey API')}`,\n );\n break;\n }\n case 'readme': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n if (!baseInput) {\n lines.push(`${jobPrefix}${itemPrefix}${inputPath.path}`);\n } else {\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n }\n // @ts-expect-error\n if (inputPath.uuid) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('uuid:')} ${colors.green(\n // @ts-expect-error\n inputPath.uuid,\n )}`,\n );\n }\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('ReadMe')}`,\n );\n break;\n }\n case 'scalar': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('Scalar')}`,\n );\n break;\n }\n default:\n lines.push(`${jobPrefix}${itemPrefix}${inputPath.path}`);\n break;\n }\n });\n\n for (const line of lines) {\n console.log(line);\n }\n};\n\nexport const createClient = async ({\n config,\n dependencies,\n jobIndex,\n logger,\n watches: _watches,\n}: {\n config: Config;\n dependencies: Record<string, string>;\n jobIndex: number;\n logger: Logger;\n /**\n * Always undefined on the first run, defined on subsequent runs.\n */\n watches?: ReadonlyArray<WatchValues>;\n}): Promise<Context | undefined> => {\n const watches: ReadonlyArray<WatchValues> =\n _watches ||\n Array.from({ length: config.input.length }, () => ({\n headers: new Headers(),\n }));\n\n const inputPaths = config.input.map((input) => compileInputPath(input));\n\n // on first run, print the message as soon as possible\n if (config.logs.level !== 'silent' && !_watches) {\n logInputPaths(inputPaths, jobIndex);\n }\n\n const getSpecData = async (input: Input, index: number) => {\n const eventSpec = logger.timeEvent('spec');\n const { arrayBuffer, error, resolvedInput, response } = await getSpec({\n fetchOptions: input.fetch,\n inputPath: inputPaths[index]!.path,\n timeout: input.watch.timeout,\n watch: watches[index]!,\n });\n eventSpec.timeEnd();\n\n // throw on first run if there's an error to preserve user experience\n // if in watch mode, subsequent errors won't throw to gracefully handle\n // cases where server might be reloading\n if (error && !_watches) {\n throw new Error(\n `Request failed with status ${response.status}: ${response.statusText}`,\n );\n }\n\n return { arrayBuffer, resolvedInput };\n };\n const specData = (\n await Promise.all(\n config.input.map((input, index) => getSpecData(input, index)),\n )\n ).filter((data) => data.arrayBuffer || data.resolvedInput);\n\n let context: Context | undefined;\n\n if (specData.length) {\n const refParser = new $RefParser();\n const data =\n specData.length > 1\n ? await refParser.bundleMany({\n arrayBuffer: specData.map((data) => data.arrayBuffer!),\n pathOrUrlOrSchemas: [],\n resolvedInputs: specData.map((data) => data.resolvedInput!),\n })\n : await refParser.bundle({\n arrayBuffer: specData[0]!.arrayBuffer,\n pathOrUrlOrSchema: undefined,\n resolvedInput: specData[0]!.resolvedInput,\n });\n\n // on subsequent runs in watch mode, print the message only if we know we're\n // generating the output\n if (config.logs.level !== 'silent' && _watches) {\n console.clear();\n logInputPaths(inputPaths, jobIndex);\n }\n\n const eventInputPatch = logger.timeEvent('input.patch');\n patchOpenApiSpec({ patchOptions: config.parser.patch, spec: data });\n eventInputPatch.timeEnd();\n\n const eventParser = logger.timeEvent('parser');\n context = parseOpenApiSpec({ config, dependencies, logger, spec: data });\n context.graph = buildGraph(context.ir, logger).graph;\n eventParser.timeEnd();\n\n const eventGenerator = logger.timeEvent('generator');\n await generateOutput({ context });\n eventGenerator.timeEnd();\n\n const eventPostprocess = logger.timeEvent('postprocess');\n if (!config.dryRun) {\n processOutput({ config });\n\n if (config.logs.level !== 'silent') {\n const outputPath = process.env.INIT_CWD\n ? `./${path.relative(process.env.INIT_CWD, config.output.path)}`\n : config.output.path;\n const jobPrefix = colors.gray(`[Job ${jobIndex + 1}] `);\n console.log(\n `${jobPrefix}${colors.green('✅ Done!')} Your output is in ${colors.cyanBright(outputPath)}`,\n );\n }\n }\n eventPostprocess.timeEnd();\n }\n\n const watchedInput = config.input.find(\n (input, index) =>\n input.watch.enabled && typeof inputPaths[index]!.path === 'string',\n );\n\n if (watchedInput) {\n setTimeout(() => {\n createClient({\n config,\n dependencies,\n jobIndex,\n logger,\n watches,\n });\n }, watchedInput.watch.interval);\n }\n\n return context;\n};\n","import colors from 'ansi-colors';\n\nimport { loadPackageJson } from '~/generate/tsConfig';\n\nconst textAscii = `\n888 | e 888~-_ 888\n888___| e88~~8e Y88b / d8b 888 \\\\ 888\n888 | d888 88b Y888/ /Y88b 888 | 888\n888 | 8888__888 Y8/ / Y88b 888 / 888\n888 | Y888 , Y /____Y88b 888_-~ 888\n888 | \"88___/ / / Y88b 888 888\n _/\n`;\n\nconst asciiToLines = (\n ascii: string,\n options?: {\n padding?: number;\n },\n) => {\n const lines: Array<string> = [];\n const padding = Array.from<string>({ length: options?.padding ?? 0 }).fill(\n '',\n );\n lines.push(...padding);\n let maxLineLength = 0;\n let line = '';\n for (const char of ascii) {\n if (char === '\\n') {\n if (line) {\n lines.push(line);\n maxLineLength = Math.max(maxLineLength, line.length);\n line = '';\n }\n } else {\n line += char;\n }\n }\n lines.push(...padding);\n return { lines, maxLineLength };\n};\n\nexport function printCliIntro() {\n const packageJson = loadPackageJson();\n const text = asciiToLines(textAscii, { padding: 1 });\n for (const line of text.lines) {\n console.log(colors.cyan(line));\n }\n console.log(colors.gray(`${packageJson.name} v${packageJson.version}`));\n console.log('');\n}\n","import colors from 'ansi-colors';\n\ninterface LoggerEvent {\n end?: PerformanceMark;\n events: Array<LoggerEvent>;\n id: string; // unique internal key\n name: string;\n start: PerformanceMark;\n}\n\ninterface Severity {\n color: colors.StyleFunction;\n type: 'duration' | 'percentage';\n}\n\ninterface StoredEventResult {\n position: ReadonlyArray<number>;\n}\n\nlet loggerCounter = 0;\nconst nameToId = (name: string) => `${name}-${loggerCounter++}`;\nconst idEnd = (id: string) => `${id}-end`;\nconst idLength = (id: string) => `${id}-length`;\nconst idStart = (id: string) => `${id}-start`;\n\nconst getSeverity = (\n duration: number,\n percentage: number,\n): Severity | undefined => {\n if (duration > 200) {\n return {\n color: colors.red,\n type: 'duration',\n };\n }\n if (percentage > 30) {\n return {\n color: colors.red,\n type: 'percentage',\n };\n }\n if (duration > 50) {\n return {\n color: colors.yellow,\n type: 'duration',\n };\n }\n if (percentage > 10) {\n return {\n color: colors.yellow,\n type: 'percentage',\n };\n }\n return;\n};\n\nexport class Logger {\n private events: Array<LoggerEvent> = [];\n\n private end(result: StoredEventResult): void {\n let event: LoggerEvent | undefined;\n let events = this.events;\n for (const index of result.position) {\n event = events[index];\n if (event?.events) {\n events = event.events;\n }\n }\n if (event && !event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n }\n\n /**\n * Recursively end all unended events in the event tree.\n * This ensures all events have end marks before measuring.\n */\n private endAllEvents(events: Array<LoggerEvent>): void {\n for (const event of events) {\n if (!event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n if (event.events.length > 0) {\n this.endAllEvents(event.events);\n }\n }\n }\n\n report(print: boolean = true): PerformanceMeasure | undefined {\n const firstEvent = this.events[0];\n if (!firstEvent) return;\n\n // Ensure all events are ended before reporting\n this.endAllEvents(this.events);\n\n const lastEvent = this.events[this.events.length - 1]!;\n const name = 'root';\n const id = nameToId(name);\n\n try {\n const measure = performance.measure(\n idLength(id),\n idStart(firstEvent.id),\n idEnd(lastEvent.id),\n );\n if (print) {\n this.reportEvent({\n end: lastEvent.end,\n events: this.events,\n id,\n indent: 0,\n measure,\n name,\n start: firstEvent!.start,\n });\n }\n return measure;\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip reporting\n // to avoid crashing the application\n return;\n }\n }\n\n private reportEvent({\n indent,\n ...parent\n }: LoggerEvent & {\n indent: number;\n measure: PerformanceMeasure;\n }): void {\n const color = !indent ? colors.cyan : colors.gray;\n const lastIndex = parent.events.length - 1;\n\n parent.events.forEach((event, index) => {\n try {\n const measure = performance.measure(\n idLength(event.id),\n idStart(event.id),\n idEnd(event.id),\n );\n const duration = Math.ceil(measure.duration * 100) / 100;\n const percentage =\n Math.ceil((measure.duration / parent.measure.duration) * 100 * 100) /\n 100;\n const severity = indent ? getSeverity(duration, percentage) : undefined;\n\n let durationLabel = `${duration.toFixed(2).padStart(8)}ms`;\n if (severity?.type === 'duration') {\n durationLabel = severity.color(durationLabel);\n }\n\n const branch = index === lastIndex ? '└─ ' : '├─ ';\n const prefix = !indent ? '' : '│ '.repeat(indent - 1) + branch;\n const maxLength = 38 - prefix.length;\n\n const percentageBranch = !indent ? '' : '↳ ';\n const percentagePrefix = indent\n ? ' '.repeat(indent - 1) + percentageBranch\n : '';\n let percentageLabel = `${percentagePrefix}${percentage.toFixed(2)}%`;\n if (severity?.type === 'percentage') {\n percentageLabel = severity.color(percentageLabel);\n }\n const jobPrefix = colors.gray('[root] ');\n console.log(\n `${jobPrefix}${colors.gray(prefix)}${color(\n `${event.name.padEnd(maxLength)} ${durationLabel} (${percentageLabel})`,\n )}`,\n );\n this.reportEvent({ ...event, indent: indent + 1, measure });\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip this event\n // to avoid crashing the application\n }\n });\n }\n\n private start(id: string): PerformanceMark {\n return performance.mark(idStart(id));\n }\n\n private storeEvent({\n result,\n ...event\n }: Pick<LoggerEvent, 'events' | 'id' | 'name' | 'start'> & {\n result: StoredEventResult;\n }): void {\n const lastEventIndex = event.events.length - 1;\n const lastEvent = event.events[lastEventIndex];\n if (lastEvent && !lastEvent.end) {\n result.position = [...result.position, lastEventIndex];\n this.storeEvent({ ...event, events: lastEvent.events, result });\n return;\n }\n const length = event.events.push({ ...event, events: [] });\n result.position = [...result.position, length - 1];\n }\n\n timeEvent(name: string) {\n const id = nameToId(name);\n const start = this.start(id);\n const event: LoggerEvent = {\n events: this.events,\n id,\n name,\n start,\n };\n const result: StoredEventResult = {\n position: [],\n };\n this.storeEvent({ ...event, result });\n return {\n mark: start,\n timeEnd: () => this.end(result),\n };\n }\n}\n","import { checkNodeVersion } from '~/config/engine';\nimport type { Configs } from '~/config/init';\nimport { initConfigs } from '~/config/init';\nimport { getLogs } from '~/config/logs';\nimport { createClient as pCreateClient } from '~/createClient';\nimport {\n ConfigValidationError,\n JobError,\n logCrashReport,\n openGitHubIssueWithCrashReport,\n printCrashReport,\n shouldReportCrash,\n} from '~/error';\nimport type { Context } from '~/ir/context';\nimport type { UserConfig } from '~/types/config';\nimport type { LazyOrAsync, MaybeArray } from '~/types/utils';\nimport { printCliIntro } from '~/utils/cli';\nimport { Logger } from '~/utils/logger';\n\n/**\n * Generate a client from the provided configuration.\n *\n * @param userConfig User provided {@link UserConfig} configuration(s).\n */\nexport const createClient = async (\n userConfig?: LazyOrAsync<MaybeArray<UserConfig>>,\n logger = new Logger(),\n): Promise<ReadonlyArray<Context>> => {\n const resolvedConfig =\n typeof userConfig === 'function' ? await userConfig() : userConfig;\n const userConfigs = resolvedConfig\n ? resolvedConfig instanceof Array\n ? resolvedConfig\n : [resolvedConfig]\n : [];\n\n let rawLogs = userConfigs.find(\n (config) => getLogs(config).level !== 'silent',\n )?.logs;\n if (typeof rawLogs === 'string') {\n rawLogs = getLogs({ logs: rawLogs });\n }\n\n let configs: Configs | undefined;\n\n try {\n checkNodeVersion();\n\n const eventCreateClient = logger.timeEvent('createClient');\n\n const eventConfig = logger.timeEvent('config');\n configs = await initConfigs({ logger, userConfigs });\n const printIntro = configs.results.some(\n (result) => result.config.logs.level !== 'silent',\n );\n if (printIntro) {\n printCliIntro();\n }\n eventConfig.timeEnd();\n\n const allConfigErrors = configs.results.flatMap((result) =>\n result.errors.map((error) => ({ error, jobIndex: result.jobIndex })),\n );\n if (allConfigErrors.length) {\n throw new ConfigValidationError(allConfigErrors);\n }\n\n const clients = await Promise.all(\n configs.results.map(async (result) => {\n try {\n return await pCreateClient({\n config: result.config,\n dependencies: configs!.dependencies,\n jobIndex: result.jobIndex,\n logger,\n });\n } catch (error) {\n throw new JobError('', {\n error,\n jobIndex: result.jobIndex,\n });\n }\n }),\n );\n const result = clients.filter((client) =>\n Boolean(client),\n ) as ReadonlyArray<Context>;\n\n eventCreateClient.timeEnd();\n\n const printLogs = configs.results.some(\n (result) => result.config.logs.level === 'debug',\n );\n logger.report(printLogs);\n\n return result;\n } catch (error) {\n const results = configs?.results ?? [];\n\n const logs =\n results.find((result) => result.config.logs.level !== 'silent')?.config\n .logs ??\n results[0]?.config.logs ??\n rawLogs;\n const dryRun =\n results.some((result) => result.config.dryRun) ??\n userConfigs.some((config) => config.dryRun) ??\n false;\n const logPath =\n logs?.file && !dryRun\n ? logCrashReport(error, logs.path ?? '')\n : undefined;\n if (!logs || logs.level !== 'silent') {\n printCrashReport({ error, logPath });\n const isInteractive =\n results.some((result) => result.config.interactive) ??\n userConfigs.some((config) => config.interactive) ??\n false;\n if (await shouldReportCrash({ error, isInteractive })) {\n await openGitHubIssueWithCrashReport(error);\n }\n }\n\n throw error;\n }\n};\n","import { stringCase } from './stringCase';\n\n// publicly exposed utils\nexport const utils = {\n stringCase,\n};\n","// OVERRIDES\n// hard-coded here because build process doesn't pick up overrides from separate files\nimport '@hey-api/codegen-core';\n\ndeclare module '@hey-api/codegen-core' {\n interface ProjectRenderMeta {\n /**\n * If specified, this will be the file extension used when importing\n * other modules. By default, we don't add a file extension and let the\n * runtime resolve it.\n *\n * @default null\n */\n importFileExtension?: (string & {}) | null;\n }\n\n interface SymbolMeta {\n category?:\n | 'client'\n | 'external'\n | 'hook'\n | 'schema'\n | 'sdk'\n | 'transform'\n | 'type'\n | 'utility'\n | (string & {});\n /**\n * Path to the resource this symbol represents.\n */\n path?: ReadonlyArray<string | number>;\n /**\n * Name of the plugin that registered this symbol.\n */\n pluginName?: string;\n resource?:\n | 'client'\n | 'definition'\n | 'operation'\n | 'webhook'\n | (string & {});\n resourceId?: string;\n role?:\n | 'data'\n | 'error'\n | 'errors'\n | 'options'\n | 'response'\n | 'responses'\n | (string & {});\n /**\n * Tags associated with this symbol.\n */\n tags?: ReadonlyArray<string>;\n tool?:\n | 'angular'\n | 'arktype'\n | 'fastify'\n | 'json-schema'\n | 'sdk'\n | 'typescript'\n | 'valibot'\n | 'zod'\n | (string & {});\n variant?: 'container' | (string & {});\n }\n}\n// END OVERRIDES\n\nimport colors from 'ansi-colors';\n// @ts-expect-error\nimport colorSupport from 'color-support';\n\nimport type { UserConfig } from '~/types/config';\nimport type { LazyOrAsync, MaybeArray } from '~/types/utils';\n\ncolors.enabled = colorSupport().hasBasic;\n\nexport { createClient } from '~/generate';\n\n/**\n * Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s)\n */\nexport const defineConfig = async <T extends MaybeArray<UserConfig>>(\n config: LazyOrAsync<T>,\n): Promise<T> => (typeof config === 'function' ? await config() : config);\n\nexport { defaultPaginationKeywords } from '~/config/parser';\nexport { defaultPlugins } from '~/config/plugins';\nexport type { IR } from '~/ir/types';\nexport type {\n OpenApi,\n OpenApiMetaObject,\n OpenApiOperationObject,\n OpenApiParameterObject,\n OpenApiRequestBodyObject,\n OpenApiResponseObject,\n OpenApiSchemaObject,\n} from '~/openApi/types';\nexport type { DefinePlugin, Plugin } from '~/plugins';\nexport type { AngularClient } from '~/plugins/@hey-api/client-angular';\nexport type { AxiosClient } from '~/plugins/@hey-api/client-axios';\nexport {\n clientDefaultConfig,\n clientDefaultMeta,\n} from '~/plugins/@hey-api/client-core/config';\nexport { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin';\nexport type { Client } from '~/plugins/@hey-api/client-core/types';\nexport type { FetchClient } from '~/plugins/@hey-api/client-fetch';\nexport type { NextClient } from '~/plugins/@hey-api/client-next';\nexport type { NuxtClient } from '~/plugins/@hey-api/client-nuxt';\nexport type { OfetchClient } from '~/plugins/@hey-api/client-ofetch';\nexport type { ExpressionTransformer } from '~/plugins/@hey-api/transformers/expressions';\nexport type { TypeTransformer } from '~/plugins/@hey-api/transformers/types';\nexport { definePluginConfig } from '~/plugins/shared/utils/config';\nexport * from '~/ts-dsl';\nexport { compiler, tsc } from '~/tsc';\nexport type { UserConfig } from '~/types/config';\nexport { utils } from '~/utils/exports';\nexport { Logger } from '~/utils/logger';\n"],"x_google_ignoreList":[3,4,5,6,7,8,9,10,11,12,13,14,15],"mappings":"kZAEA,MAAa,MAAyB,CACpC,GAAI,OAAO,IAAQ,IAAa,CAC9B,GAAM,CAAC,GAAS,IAAI,QAAQ,MAAM,IAAI,CAAC,IAAI,OAAO,CAClD,GAAI,EAAS,EACX,MAAM,IAAI,EACR,2BAA2B,IAAI,QAAQ,kCACxC,SAEM,OAAO,QAAY,KAAe,QAAQ,UAAU,KAAM,CAC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,MAAQ,CAAC,EACX,EAAe,EAAO,EAAK,MAAQ,GAAG,CACtC,IAAA,GAYN,MAXI,CAAC,GAAQ,EAAK,QAAU,YAC1B,EAAiB,CAAE,QAAO,UAAS,CAAC,CAKhC,MAAM,EAAkB,CAAE,QAAO,cAHnC,EAAQ,KAAM,GAAW,EAAO,OAAO,YAAY,EACnD,EAAY,KAAM,GAAW,EAAO,YAAY,EAChD,GACkD,CAAC,EACnD,MAAM,EAA+B,EAAM,EAIzC,ICxHG,GAAQ,CACnB,aACD,CCuED,EAAO,QAAU,GAAc,CAAC,SAOhC,MAAa,GAAe,KAC1B,IACgB,OAAO,GAAW,WAAa,MAAM,GAAQ,CAAG"}
1
+ {"version":3,"file":"src-D4L_i8zt.js","names":["meta: ProjectRenderMeta","path","isexe","sync","fs","path","checkStat","isexe","sync","fs","path","isexe","sync","path","path","which","path","resolveCommand","path","fs","readShebang","path","isWin","parse","cp","formatters: Record<Formatters, OutputProcessor>","path","linters: Record<Linters, OutputProcessor>","module","result: Pick<\n Partial<Input>,\n | 'api_key'\n | 'branch'\n | 'commit_sha'\n | 'organization'\n | 'project'\n | 'registry'\n | 'tags'\n | 'version'\n > &\n Pick<Input, 'path'>","path","queryParams: Array<string>","lines: Array<string>","createClient","watches: ReadonlyArray<WatchValues>","context: Context | undefined","data","lines: Array<string>","event: LoggerEvent | undefined","event: LoggerEvent","result: StoredEventResult","configs: Configs | undefined","result","pCreateClient"],"sources":["../src/config/engine.ts","../src/generate/output.ts","../src/openApi/shared/utils/patch.ts","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","../../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js","../../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js","../../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js","../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js","../src/processOutput.ts","../src/createClient.ts","../src/utils/cli.ts","../src/utils/logger.ts","../src/generate.ts","../src/utils/exports.ts","../src/index.ts"],"sourcesContent":["import { ConfigError } from '~/error';\n\nexport const checkNodeVersion = () => {\n if (typeof Bun !== 'undefined') {\n const [major] = Bun.version.split('.').map(Number);\n if (major! < 1) {\n throw new ConfigError(\n `Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`,\n );\n }\n } else if (typeof process !== 'undefined' && process.versions?.node) {\n const [major] = process.versions.node.split('.').map(Number);\n if (major! < 20) {\n throw new ConfigError(\n `Unsupported Node version ${process.versions.node}. Please use Node 20 or newer.`,\n );\n }\n }\n};\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { ProjectRenderMeta } from '@hey-api/codegen-core';\n\nimport type { Context } from '~/ir/context';\nimport { getClientPlugin } from '~/plugins/@hey-api/client-core/utils';\n\nimport { generateClientBundle } from './client';\n\nexport const generateOutput = async ({ context }: { context: Context }) => {\n const outputPath = path.resolve(context.config.output.path);\n\n if (context.config.output.clean) {\n if (fs.existsSync(outputPath)) {\n fs.rmSync(outputPath, { force: true, recursive: true });\n }\n }\n\n const meta: ProjectRenderMeta = {\n importFileExtension: context.config.output.importFileExtension,\n };\n\n const client = getClientPlugin(context.config);\n if (\n 'bundle' in client.config &&\n client.config.bundle &&\n !context.config.dryRun\n ) {\n // not proud of this one\n // @ts-expect-error\n context.config._FRAGILE_CLIENT_BUNDLE_RENAMED = generateClientBundle({\n meta,\n outputPath,\n // @ts-expect-error\n plugin: client,\n project: context.gen,\n });\n }\n\n for (const plugin of context.registerPlugins()) {\n await plugin.run();\n }\n\n for (const file of context.gen.render(meta)) {\n const filePath = path.resolve(outputPath, file.path);\n const dir = path.dirname(filePath);\n if (!context.config.dryRun) {\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(filePath, file.content, { encoding: 'utf8' });\n }\n }\n};\n","import type { OpenApi } from '~/openApi/types';\n\nimport type { Patch } from '../../../types/parser';\n\nexport const patchOpenApiSpec = ({\n patchOptions,\n spec: _spec,\n}: {\n patchOptions: Patch | undefined;\n spec: unknown;\n}) => {\n if (!patchOptions) {\n return;\n }\n\n const spec = _spec as OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X;\n\n if ('swagger' in spec) {\n if (patchOptions.version && spec.swagger) {\n spec.swagger = (\n typeof patchOptions.version === 'string'\n ? patchOptions.version\n : patchOptions.version(spec.swagger)\n ) as typeof spec.swagger;\n }\n\n if (patchOptions.meta && spec.info) {\n patchOptions.meta(spec.info);\n }\n\n if (patchOptions.schemas && spec.definitions) {\n for (const key in patchOptions.schemas) {\n const schema = spec.definitions[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.schemas[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.operations && spec.paths) {\n for (const key in patchOptions.operations) {\n const [method, path] = key.split(' ');\n if (!method || !path) continue;\n\n const pathItem = spec.paths[path as keyof typeof spec.paths];\n if (!pathItem) continue;\n\n const operation =\n pathItem[method.toLocaleLowerCase() as keyof typeof pathItem] ||\n pathItem[method.toLocaleUpperCase() as keyof typeof pathItem];\n if (!operation || typeof operation !== 'object') continue;\n\n const patchFn = patchOptions.operations[key]!;\n patchFn(operation as any);\n }\n }\n return;\n }\n\n if (patchOptions.version && spec.openapi) {\n spec.openapi = (\n typeof patchOptions.version === 'string'\n ? patchOptions.version\n : patchOptions.version(spec.openapi)\n ) as typeof spec.openapi;\n }\n\n if (patchOptions.meta && spec.info) {\n patchOptions.meta(spec.info);\n }\n\n if (spec.components) {\n if (patchOptions.schemas && spec.components.schemas) {\n for (const key in patchOptions.schemas) {\n const schema = spec.components.schemas[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.schemas[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.parameters && spec.components.parameters) {\n for (const key in patchOptions.parameters) {\n const schema = spec.components.parameters[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.parameters[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.requestBodies && spec.components.requestBodies) {\n for (const key in patchOptions.requestBodies) {\n const schema = spec.components.requestBodies[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.requestBodies[key]!;\n patchFn(schema);\n }\n }\n\n if (patchOptions.responses && spec.components.responses) {\n for (const key in patchOptions.responses) {\n const schema = spec.components.responses[key];\n if (!schema || typeof schema !== 'object') continue;\n\n const patchFn = patchOptions.responses[key]!;\n patchFn(schema);\n }\n }\n }\n\n if (patchOptions.operations && spec.paths) {\n for (const key in patchOptions.operations) {\n const [method, path] = key.split(' ');\n if (!method || !path) continue;\n\n const pathItem = spec.paths[path as keyof typeof spec.paths];\n if (!pathItem) continue;\n\n const operation =\n pathItem[method.toLocaleLowerCase() as keyof typeof pathItem] ||\n pathItem[method.toLocaleUpperCase() as keyof typeof pathItem];\n if (!operation || typeof operation !== 'object') continue;\n\n const patchFn = patchOptions.operations[key]!;\n patchFn(operation as any);\n }\n }\n};\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input\n // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(?=(\\\\+?)?)\\1\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(?=(\\\\+?)?)\\1$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed);\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","import { sync } from 'cross-spawn';\n\nimport type { Config } from '~/types/config';\nimport type { Formatters, Linters } from '~/types/output';\n\ntype OutputProcessor = {\n args: (path: string) => ReadonlyArray<string>;\n command: string;\n name: string;\n};\n\n/**\n * Map of supported formatters\n */\nconst formatters: Record<Formatters, OutputProcessor> = {\n biome: {\n args: (path) => ['format', '--write', path],\n command: 'biome',\n name: 'Biome (Format)',\n },\n prettier: {\n args: (path) => [\n '--ignore-unknown',\n path,\n '--write',\n '--ignore-path',\n './.prettierignore',\n ],\n command: 'prettier',\n name: 'Prettier',\n },\n};\n\n/**\n * Map of supported linters\n */\nconst linters: Record<Linters, OutputProcessor> = {\n biome: {\n args: (path) => ['lint', '--apply', path],\n command: 'biome',\n name: 'Biome (Lint)',\n },\n eslint: {\n args: (path) => [path, '--fix'],\n command: 'eslint',\n name: 'ESLint',\n },\n oxlint: {\n args: (path) => ['--fix', path],\n command: 'oxlint',\n name: 'oxlint',\n },\n};\n\nexport const processOutput = ({ config }: { config: Config }) => {\n if (config.output.lint) {\n const module = linters[config.output.lint];\n console.log(`✨ Running ${module.name}`);\n sync(module.command, module.args(config.output.path));\n }\n\n if (config.output.format) {\n const module = formatters[config.output.format];\n console.log(`✨ Running ${module.name}`);\n sync(module.command, module.args(config.output.path));\n }\n};\n","import path from 'node:path';\n\nimport { $RefParser } from '@hey-api/json-schema-ref-parser';\nimport colors from 'ansi-colors';\n\nimport { generateOutput } from '~/generate/output';\nimport { getSpec } from '~/getSpec';\nimport type { Context } from '~/ir/context';\nimport { parseOpenApiSpec } from '~/openApi';\nimport { buildGraph } from '~/openApi/shared/utils/graph';\nimport { patchOpenApiSpec } from '~/openApi/shared/utils/patch';\nimport { processOutput } from '~/processOutput';\nimport type { Config } from '~/types/config';\nimport type { Input } from '~/types/input';\nimport type { WatchValues } from '~/types/types';\nimport type { Logger } from '~/utils/logger';\n\nexport const compileInputPath = (input: Omit<Input, 'watch'>) => {\n const result: Pick<\n Partial<Input>,\n | 'api_key'\n | 'branch'\n | 'commit_sha'\n | 'organization'\n | 'project'\n | 'registry'\n | 'tags'\n | 'version'\n > &\n Pick<Input, 'path'> = {\n ...input,\n path: '',\n };\n\n if (\n input.path &&\n (typeof input.path !== 'string' || input.registry !== 'hey-api')\n ) {\n result.path = input.path;\n return result;\n }\n\n const [basePath, baseQuery] = input.path.split('?');\n const queryParts = (baseQuery || '').split('&');\n const queryPath = queryParts.map((part) => part.split('='));\n\n let path = basePath || '';\n if (path.endsWith('/')) {\n path = path.slice(0, path.length - 1);\n }\n\n const [, pathUrl] = path.split('://');\n const [baseUrl, organization, project] = (pathUrl || '').split('/');\n result.organization = organization || input.organization;\n result.project = project || input.project;\n\n const queryParams: Array<string> = [];\n\n const kApiKey = 'api_key';\n result.api_key =\n queryPath.find(([key]) => key === kApiKey)?.[1] ||\n input.api_key ||\n process.env.HEY_API_TOKEN;\n if (result.api_key) {\n queryParams.push(`${kApiKey}=${result.api_key}`);\n }\n\n const kBranch = 'branch';\n result.branch =\n queryPath.find(([key]) => key === kBranch)?.[1] || input.branch;\n if (result.branch) {\n queryParams.push(`${kBranch}=${result.branch}`);\n }\n\n const kCommitSha = 'commit_sha';\n result.commit_sha =\n queryPath.find(([key]) => key === kCommitSha)?.[1] || input.commit_sha;\n if (result.commit_sha) {\n queryParams.push(`${kCommitSha}=${result.commit_sha}`);\n }\n\n const kTags = 'tags';\n result.tags =\n queryPath.find(([key]) => key === kTags)?.[1]?.split(',') || input.tags;\n if (result.tags?.length) {\n queryParams.push(`${kTags}=${result.tags.join(',')}`);\n }\n\n const kVersion = 'version';\n result.version =\n queryPath.find(([key]) => key === kVersion)?.[1] || input.version;\n if (result.version) {\n queryParams.push(`${kVersion}=${result.version}`);\n }\n\n if (!result.organization) {\n throw new Error(\n 'missing organization - from which Hey API Platform organization do you want to generate your output?',\n );\n }\n\n if (!result.project) {\n throw new Error(\n 'missing project - from which Hey API Platform project do you want to generate your output?',\n );\n }\n\n const query = queryParams.join('&');\n const platformUrl = baseUrl || 'get.heyapi.dev';\n const isLocalhost = platformUrl.startsWith('localhost');\n const platformUrlWithProtocol = [\n isLocalhost ? 'http' : 'https',\n platformUrl,\n ].join('://');\n const compiledPath = isLocalhost\n ? [\n platformUrlWithProtocol,\n 'v1',\n 'get',\n result.organization,\n result.project,\n ].join('/')\n : [platformUrlWithProtocol, result.organization, result.project].join('/');\n result.path = query ? `${compiledPath}?${query}` : compiledPath;\n\n return result;\n};\n\nconst logInputPaths = (\n inputPaths: ReadonlyArray<ReturnType<typeof compileInputPath>>,\n jobIndex: number,\n) => {\n const lines: Array<string> = [];\n\n const jobPrefix = colors.gray(`[Job ${jobIndex + 1}] `);\n const count = inputPaths.length;\n const baseString = colors.cyan(\n `Generating from ${count} ${count === 1 ? 'input' : 'inputs'}:`,\n );\n lines.push(`${jobPrefix}⏳ ${baseString}`);\n\n inputPaths.forEach((inputPath, index) => {\n const itemPrefixStr = ` [${index + 1}] `;\n const itemPrefix = colors.cyan(itemPrefixStr);\n const detailIndent = ' '.repeat(itemPrefixStr.length);\n\n if (typeof inputPath.path !== 'string') {\n lines.push(`${jobPrefix}${itemPrefix}raw OpenAPI specification`);\n return;\n }\n\n switch (inputPath.registry) {\n case 'hey-api': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n if (inputPath.branch) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('branch:')} ${colors.green(\n inputPath.branch,\n )}`,\n );\n }\n if (inputPath.commit_sha) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('commit:')} ${colors.green(\n inputPath.commit_sha,\n )}`,\n );\n }\n if (inputPath.tags?.length) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('tags:')} ${colors.green(\n inputPath.tags.join(', '),\n )}`,\n );\n }\n if (inputPath.version) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('version:')} ${colors.green(\n inputPath.version,\n )}`,\n );\n }\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('Hey API')}`,\n );\n break;\n }\n case 'readme': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n if (!baseInput) {\n lines.push(`${jobPrefix}${itemPrefix}${inputPath.path}`);\n } else {\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n }\n // @ts-expect-error\n if (inputPath.uuid) {\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('uuid:')} ${colors.green(\n // @ts-expect-error\n inputPath.uuid,\n )}`,\n );\n }\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('ReadMe')}`,\n );\n break;\n }\n case 'scalar': {\n const baseInput = [inputPath.organization, inputPath.project]\n .filter(Boolean)\n .join('/');\n lines.push(`${jobPrefix}${itemPrefix}${baseInput}`);\n lines.push(\n `${jobPrefix}${detailIndent}${colors.gray('registry:')} ${colors.green('Scalar')}`,\n );\n break;\n }\n default:\n lines.push(`${jobPrefix}${itemPrefix}${inputPath.path}`);\n break;\n }\n });\n\n for (const line of lines) {\n console.log(line);\n }\n};\n\nexport const createClient = async ({\n config,\n dependencies,\n jobIndex,\n logger,\n watches: _watches,\n}: {\n config: Config;\n dependencies: Record<string, string>;\n jobIndex: number;\n logger: Logger;\n /**\n * Always undefined on the first run, defined on subsequent runs.\n */\n watches?: ReadonlyArray<WatchValues>;\n}): Promise<Context | undefined> => {\n const watches: ReadonlyArray<WatchValues> =\n _watches ||\n Array.from({ length: config.input.length }, () => ({\n headers: new Headers(),\n }));\n\n const inputPaths = config.input.map((input) => compileInputPath(input));\n\n // on first run, print the message as soon as possible\n if (config.logs.level !== 'silent' && !_watches) {\n logInputPaths(inputPaths, jobIndex);\n }\n\n const getSpecData = async (input: Input, index: number) => {\n const eventSpec = logger.timeEvent('spec');\n const { arrayBuffer, error, resolvedInput, response } = await getSpec({\n fetchOptions: input.fetch,\n inputPath: inputPaths[index]!.path,\n timeout: input.watch.timeout,\n watch: watches[index]!,\n });\n eventSpec.timeEnd();\n\n // throw on first run if there's an error to preserve user experience\n // if in watch mode, subsequent errors won't throw to gracefully handle\n // cases where server might be reloading\n if (error && !_watches) {\n throw new Error(\n `Request failed with status ${response.status}: ${response.statusText}`,\n );\n }\n\n return { arrayBuffer, resolvedInput };\n };\n const specData = (\n await Promise.all(\n config.input.map((input, index) => getSpecData(input, index)),\n )\n ).filter((data) => data.arrayBuffer || data.resolvedInput);\n\n let context: Context | undefined;\n\n if (specData.length) {\n const refParser = new $RefParser();\n const data =\n specData.length > 1\n ? await refParser.bundleMany({\n arrayBuffer: specData.map((data) => data.arrayBuffer!),\n pathOrUrlOrSchemas: [],\n resolvedInputs: specData.map((data) => data.resolvedInput!),\n })\n : await refParser.bundle({\n arrayBuffer: specData[0]!.arrayBuffer,\n pathOrUrlOrSchema: undefined,\n resolvedInput: specData[0]!.resolvedInput,\n });\n\n // on subsequent runs in watch mode, print the message only if we know we're\n // generating the output\n if (config.logs.level !== 'silent' && _watches) {\n console.clear();\n logInputPaths(inputPaths, jobIndex);\n }\n\n const eventInputPatch = logger.timeEvent('input.patch');\n patchOpenApiSpec({ patchOptions: config.parser.patch, spec: data });\n eventInputPatch.timeEnd();\n\n const eventParser = logger.timeEvent('parser');\n context = parseOpenApiSpec({ config, dependencies, logger, spec: data });\n context.graph = buildGraph(context.ir, logger).graph;\n eventParser.timeEnd();\n\n const eventGenerator = logger.timeEvent('generator');\n await generateOutput({ context });\n eventGenerator.timeEnd();\n\n const eventPostprocess = logger.timeEvent('postprocess');\n if (!config.dryRun) {\n processOutput({ config });\n\n if (config.logs.level !== 'silent') {\n const outputPath = process.env.INIT_CWD\n ? `./${path.relative(process.env.INIT_CWD, config.output.path)}`\n : config.output.path;\n const jobPrefix = colors.gray(`[Job ${jobIndex + 1}] `);\n console.log(\n `${jobPrefix}${colors.green('✅ Done!')} Your output is in ${colors.cyanBright(outputPath)}`,\n );\n }\n }\n eventPostprocess.timeEnd();\n }\n\n const watchedInput = config.input.find(\n (input, index) =>\n input.watch.enabled && typeof inputPaths[index]!.path === 'string',\n );\n\n if (watchedInput) {\n setTimeout(() => {\n createClient({\n config,\n dependencies,\n jobIndex,\n logger,\n watches,\n });\n }, watchedInput.watch.interval);\n }\n\n return context;\n};\n","import colors from 'ansi-colors';\n\nimport { loadPackageJson } from '~/generate/tsConfig';\n\nconst textAscii = `\n888 | e 888~-_ 888\n888___| e88~~8e Y88b / d8b 888 \\\\ 888\n888 | d888 88b Y888/ /Y88b 888 | 888\n888 | 8888__888 Y8/ / Y88b 888 / 888\n888 | Y888 , Y /____Y88b 888_-~ 888\n888 | \"88___/ / / Y88b 888 888\n _/\n`;\n\nconst asciiToLines = (\n ascii: string,\n options?: {\n padding?: number;\n },\n) => {\n const lines: Array<string> = [];\n const padding = Array.from<string>({ length: options?.padding ?? 0 }).fill(\n '',\n );\n lines.push(...padding);\n let maxLineLength = 0;\n let line = '';\n for (const char of ascii) {\n if (char === '\\n') {\n if (line) {\n lines.push(line);\n maxLineLength = Math.max(maxLineLength, line.length);\n line = '';\n }\n } else {\n line += char;\n }\n }\n lines.push(...padding);\n return { lines, maxLineLength };\n};\n\nexport function printCliIntro() {\n const packageJson = loadPackageJson();\n const text = asciiToLines(textAscii, { padding: 1 });\n for (const line of text.lines) {\n console.log(colors.cyan(line));\n }\n console.log(colors.gray(`${packageJson.name} v${packageJson.version}`));\n console.log('');\n}\n","import colors from 'ansi-colors';\n\ninterface LoggerEvent {\n end?: PerformanceMark;\n events: Array<LoggerEvent>;\n id: string; // unique internal key\n name: string;\n start: PerformanceMark;\n}\n\ninterface Severity {\n color: colors.StyleFunction;\n type: 'duration' | 'percentage';\n}\n\ninterface StoredEventResult {\n position: ReadonlyArray<number>;\n}\n\nlet loggerCounter = 0;\nconst nameToId = (name: string) => `${name}-${loggerCounter++}`;\nconst idEnd = (id: string) => `${id}-end`;\nconst idLength = (id: string) => `${id}-length`;\nconst idStart = (id: string) => `${id}-start`;\n\nconst getSeverity = (\n duration: number,\n percentage: number,\n): Severity | undefined => {\n if (duration > 200) {\n return {\n color: colors.red,\n type: 'duration',\n };\n }\n if (percentage > 30) {\n return {\n color: colors.red,\n type: 'percentage',\n };\n }\n if (duration > 50) {\n return {\n color: colors.yellow,\n type: 'duration',\n };\n }\n if (percentage > 10) {\n return {\n color: colors.yellow,\n type: 'percentage',\n };\n }\n return;\n};\n\nexport class Logger {\n private events: Array<LoggerEvent> = [];\n\n private end(result: StoredEventResult): void {\n let event: LoggerEvent | undefined;\n let events = this.events;\n for (const index of result.position) {\n event = events[index];\n if (event?.events) {\n events = event.events;\n }\n }\n if (event && !event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n }\n\n /**\n * Recursively end all unended events in the event tree.\n * This ensures all events have end marks before measuring.\n */\n private endAllEvents(events: Array<LoggerEvent>): void {\n for (const event of events) {\n if (!event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n if (event.events.length > 0) {\n this.endAllEvents(event.events);\n }\n }\n }\n\n report(print: boolean = true): PerformanceMeasure | undefined {\n const firstEvent = this.events[0];\n if (!firstEvent) return;\n\n // Ensure all events are ended before reporting\n this.endAllEvents(this.events);\n\n const lastEvent = this.events[this.events.length - 1]!;\n const name = 'root';\n const id = nameToId(name);\n\n try {\n const measure = performance.measure(\n idLength(id),\n idStart(firstEvent.id),\n idEnd(lastEvent.id),\n );\n if (print) {\n this.reportEvent({\n end: lastEvent.end,\n events: this.events,\n id,\n indent: 0,\n measure,\n name,\n start: firstEvent!.start,\n });\n }\n return measure;\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip reporting\n // to avoid crashing the application\n return;\n }\n }\n\n private reportEvent({\n indent,\n ...parent\n }: LoggerEvent & {\n indent: number;\n measure: PerformanceMeasure;\n }): void {\n const color = !indent ? colors.cyan : colors.gray;\n const lastIndex = parent.events.length - 1;\n\n parent.events.forEach((event, index) => {\n try {\n const measure = performance.measure(\n idLength(event.id),\n idStart(event.id),\n idEnd(event.id),\n );\n const duration = Math.ceil(measure.duration * 100) / 100;\n const percentage =\n Math.ceil((measure.duration / parent.measure.duration) * 100 * 100) /\n 100;\n const severity = indent ? getSeverity(duration, percentage) : undefined;\n\n let durationLabel = `${duration.toFixed(2).padStart(8)}ms`;\n if (severity?.type === 'duration') {\n durationLabel = severity.color(durationLabel);\n }\n\n const branch = index === lastIndex ? '└─ ' : '├─ ';\n const prefix = !indent ? '' : '│ '.repeat(indent - 1) + branch;\n const maxLength = 38 - prefix.length;\n\n const percentageBranch = !indent ? '' : '↳ ';\n const percentagePrefix = indent\n ? ' '.repeat(indent - 1) + percentageBranch\n : '';\n let percentageLabel = `${percentagePrefix}${percentage.toFixed(2)}%`;\n if (severity?.type === 'percentage') {\n percentageLabel = severity.color(percentageLabel);\n }\n const jobPrefix = colors.gray('[root] ');\n console.log(\n `${jobPrefix}${colors.gray(prefix)}${color(\n `${event.name.padEnd(maxLength)} ${durationLabel} (${percentageLabel})`,\n )}`,\n );\n this.reportEvent({ ...event, indent: indent + 1, measure });\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip this event\n // to avoid crashing the application\n }\n });\n }\n\n private start(id: string): PerformanceMark {\n return performance.mark(idStart(id));\n }\n\n private storeEvent({\n result,\n ...event\n }: Pick<LoggerEvent, 'events' | 'id' | 'name' | 'start'> & {\n result: StoredEventResult;\n }): void {\n const lastEventIndex = event.events.length - 1;\n const lastEvent = event.events[lastEventIndex];\n if (lastEvent && !lastEvent.end) {\n result.position = [...result.position, lastEventIndex];\n this.storeEvent({ ...event, events: lastEvent.events, result });\n return;\n }\n const length = event.events.push({ ...event, events: [] });\n result.position = [...result.position, length - 1];\n }\n\n timeEvent(name: string) {\n const id = nameToId(name);\n const start = this.start(id);\n const event: LoggerEvent = {\n events: this.events,\n id,\n name,\n start,\n };\n const result: StoredEventResult = {\n position: [],\n };\n this.storeEvent({ ...event, result });\n return {\n mark: start,\n timeEnd: () => this.end(result),\n };\n }\n}\n","import { checkNodeVersion } from '~/config/engine';\nimport type { Configs } from '~/config/init';\nimport { initConfigs } from '~/config/init';\nimport { getLogs } from '~/config/logs';\nimport { createClient as pCreateClient } from '~/createClient';\nimport {\n ConfigValidationError,\n JobError,\n logCrashReport,\n openGitHubIssueWithCrashReport,\n printCrashReport,\n shouldReportCrash,\n} from '~/error';\nimport type { Context } from '~/ir/context';\nimport type { UserConfig } from '~/types/config';\nimport type { LazyOrAsync, MaybeArray } from '~/types/utils';\nimport { printCliIntro } from '~/utils/cli';\nimport { Logger } from '~/utils/logger';\n\n/**\n * Generate a client from the provided configuration.\n *\n * @param userConfig User provided {@link UserConfig} configuration(s).\n */\nexport const createClient = async (\n userConfig?: LazyOrAsync<MaybeArray<UserConfig>>,\n logger = new Logger(),\n): Promise<ReadonlyArray<Context>> => {\n const resolvedConfig =\n typeof userConfig === 'function' ? await userConfig() : userConfig;\n const userConfigs = resolvedConfig\n ? resolvedConfig instanceof Array\n ? resolvedConfig\n : [resolvedConfig]\n : [];\n\n let rawLogs = userConfigs.find(\n (config) => getLogs(config).level !== 'silent',\n )?.logs;\n if (typeof rawLogs === 'string') {\n rawLogs = getLogs({ logs: rawLogs });\n }\n\n let configs: Configs | undefined;\n\n try {\n checkNodeVersion();\n\n const eventCreateClient = logger.timeEvent('createClient');\n\n const eventConfig = logger.timeEvent('config');\n configs = await initConfigs({ logger, userConfigs });\n const printIntro = configs.results.some(\n (result) => result.config.logs.level !== 'silent',\n );\n if (printIntro) {\n printCliIntro();\n }\n eventConfig.timeEnd();\n\n const allConfigErrors = configs.results.flatMap((result) =>\n result.errors.map((error) => ({ error, jobIndex: result.jobIndex })),\n );\n if (allConfigErrors.length) {\n throw new ConfigValidationError(allConfigErrors);\n }\n\n const clients = await Promise.all(\n configs.results.map(async (result) => {\n try {\n return await pCreateClient({\n config: result.config,\n dependencies: configs!.dependencies,\n jobIndex: result.jobIndex,\n logger,\n });\n } catch (error) {\n throw new JobError('', {\n error,\n jobIndex: result.jobIndex,\n });\n }\n }),\n );\n const result = clients.filter((client) =>\n Boolean(client),\n ) as ReadonlyArray<Context>;\n\n eventCreateClient.timeEnd();\n\n const printLogs = configs.results.some(\n (result) => result.config.logs.level === 'debug',\n );\n logger.report(printLogs);\n\n return result;\n } catch (error) {\n const results = configs?.results ?? [];\n\n const logs =\n results.find((result) => result.config.logs.level !== 'silent')?.config\n .logs ??\n results[0]?.config.logs ??\n rawLogs;\n const dryRun =\n results.some((result) => result.config.dryRun) ??\n userConfigs.some((config) => config.dryRun) ??\n false;\n const logPath =\n logs?.file && !dryRun\n ? logCrashReport(error, logs.path ?? '')\n : undefined;\n if (!logs || logs.level !== 'silent') {\n printCrashReport({ error, logPath });\n const isInteractive =\n results.some((result) => result.config.interactive) ??\n userConfigs.some((config) => config.interactive) ??\n false;\n if (await shouldReportCrash({ error, isInteractive })) {\n await openGitHubIssueWithCrashReport(error);\n }\n }\n\n throw error;\n }\n};\n","import { stringCase } from './stringCase';\n\n// publicly exposed utils\nexport const utils = {\n stringCase,\n};\n","// OVERRIDES\n// hard-coded here because build process doesn't pick up overrides from separate files\nimport '@hey-api/codegen-core';\n\ndeclare module '@hey-api/codegen-core' {\n interface ProjectRenderMeta {\n /**\n * If specified, this will be the file extension used when importing\n * other modules. By default, we don't add a file extension and let the\n * runtime resolve it.\n *\n * @default null\n */\n importFileExtension?: (string & {}) | null;\n }\n\n interface SymbolMeta {\n category?:\n | 'client'\n | 'external'\n | 'hook'\n | 'schema'\n | 'sdk'\n | 'transform'\n | 'type'\n | 'utility'\n | (string & {});\n /**\n * Path to the resource this symbol represents.\n */\n path?: ReadonlyArray<string | number>;\n /**\n * Name of the plugin that registered this symbol.\n */\n pluginName?: string;\n resource?:\n | 'client'\n | 'definition'\n | 'operation'\n | 'webhook'\n | (string & {});\n resourceId?: string;\n role?:\n | 'data'\n | 'error'\n | 'errors'\n | 'options'\n | 'response'\n | 'responses'\n | (string & {});\n /**\n * Tags associated with this symbol.\n */\n tags?: ReadonlyArray<string>;\n tool?:\n | 'angular'\n | 'arktype'\n | 'fastify'\n | 'json-schema'\n | 'sdk'\n | 'typescript'\n | 'valibot'\n | 'zod'\n | (string & {});\n variant?: 'container' | (string & {});\n }\n}\n// END OVERRIDES\n\nimport colors from 'ansi-colors';\n// @ts-expect-error\nimport colorSupport from 'color-support';\n\nimport type { UserConfig } from '~/types/config';\nimport type { LazyOrAsync, MaybeArray } from '~/types/utils';\n\ncolors.enabled = colorSupport().hasBasic;\n\nexport { createClient } from '~/generate';\n\n/**\n * Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s)\n */\nexport const defineConfig = async <T extends MaybeArray<UserConfig>>(\n config: LazyOrAsync<T>,\n): Promise<T> => (typeof config === 'function' ? await config() : config);\n\nexport { defaultPaginationKeywords } from '~/config/parser';\nexport { defaultPlugins } from '~/config/plugins';\nexport type { IR } from '~/ir/types';\nexport type {\n OpenApi,\n OpenApiMetaObject,\n OpenApiOperationObject,\n OpenApiParameterObject,\n OpenApiRequestBodyObject,\n OpenApiResponseObject,\n OpenApiSchemaObject,\n} from '~/openApi/types';\nexport type { DefinePlugin, Plugin } from '~/plugins';\nexport type { AngularClient } from '~/plugins/@hey-api/client-angular';\nexport type { AxiosClient } from '~/plugins/@hey-api/client-axios';\nexport {\n clientDefaultConfig,\n clientDefaultMeta,\n} from '~/plugins/@hey-api/client-core/config';\nexport { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin';\nexport type { Client } from '~/plugins/@hey-api/client-core/types';\nexport type { FetchClient } from '~/plugins/@hey-api/client-fetch';\nexport type { NextClient } from '~/plugins/@hey-api/client-next';\nexport type { NuxtClient } from '~/plugins/@hey-api/client-nuxt';\nexport type { OfetchClient } from '~/plugins/@hey-api/client-ofetch';\nexport type { ExpressionTransformer } from '~/plugins/@hey-api/transformers/expressions';\nexport type { TypeTransformer } from '~/plugins/@hey-api/transformers/types';\nexport { definePluginConfig } from '~/plugins/shared/utils/config';\nexport * from '~/ts-dsl';\nexport { compiler, tsc } from '~/tsc';\nexport type { UserConfig } from '~/types/config';\nexport { utils } from '~/utils/exports';\nexport { Logger } from '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C1C,CAGD,OAFA,EAAO,OAAO,EAAU,CAEjB,QACA,EAAO,CACd,IAAM,EAAU,GAAS,SAAW,EAAE,CAEhC,EACJ,EAAQ,KAAM,GAAW,EAAO,OAAO,KAAK,QAAU,SAAS,EAAE,OAC9D,MACH,EAAQ,IAAI,OAAO,MACnB,EACI,EACJ,EAAQ,KAAM,GAAW,EAAO,OAAO,OAAO,EAC9C,EAAY,KAAM,GAAW,EAAO,OAAO,EAC3C,GACI,EACJ,GAAM,MAAQ,CAAC,EACX,EAAe,EAAO,EAAK,MAAQ,GAAG,CACtC,IAAA,GAYN,MAXI,CAAC,GAAQ,EAAK,QAAU,YAC1B,EAAiB,CAAE,QAAO,UAAS,CAAC,CAKhC,MAAM,EAAkB,CAAE,QAAO,cAHnC,EAAQ,KAAM,GAAW,EAAO,OAAO,YAAY,EACnD,EAAY,KAAM,GAAW,EAAO,YAAY,EAChD,GACkD,CAAC,EACnD,MAAM,EAA+B,EAAM,EAIzC,ICxHG,GAAQ,CACnB,aACD,CCuED,EAAO,QAAU,GAAc,CAAC,SAOhC,MAAa,GAAe,KAC1B,IACgB,OAAO,GAAW,WAAa,MAAM,GAAQ,CAAG"}
@@ -1,4 +1,4 @@
1
- const e=require(`./openApi-hVsWZkpA.cjs`);let t=require(`@hey-api/codegen-core`);t=e.st(t);let n=require(`ansi-colors`);n=e.st(n);let r=require(`color-support`);r=e.st(r);let i=require(`node:fs`);i=e.st(i);let a=require(`node:path`);a=e.st(a);let o=require(`@hey-api/json-schema-ref-parser`);o=e.st(o);const s=()=>{if(typeof Bun<`u`){let[t]=Bun.version.split(`.`).map(Number);if(t<1)throw new e.Q(`Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`)}else if(typeof process<`u`&&process.versions?.node){let[t]=process.versions.node.split(`.`).map(Number);if(t<20)throw new e.Q(`Unsupported Node version ${process.versions.node}. Please use Node 20 or newer.`)}},c=async({context:t})=>{let n=a.default.resolve(t.config.output.path);t.config.output.clean&&i.default.existsSync(n)&&i.default.rmSync(n,{force:!0,recursive:!0});let r={importFileExtension:t.config.output.importFileExtension},o=e.q(t.config);`bundle`in o.config&&o.config.bundle&&!t.config.dryRun&&(t.config._FRAGILE_CLIENT_BUNDLE_RENAMED=e.H({meta:r,outputPath:n,plugin:o,project:t.gen}));for(let e of t.registerPlugins())await e.run();for(let e of t.gen.render(r)){let r=a.default.resolve(n,e.path),o=a.default.dirname(r);t.config.dryRun||(i.default.mkdirSync(o,{recursive:!0}),i.default.writeFileSync(r,e.content,{encoding:`utf8`}))}},l=({patchOptions:e,spec:t})=>{if(!e)return;let n=t;if(`swagger`in n){if(e.version&&n.swagger&&(n.swagger=typeof e.version==`string`?e.version:e.version(n.swagger)),e.meta&&n.info&&e.meta(n.info),e.schemas&&n.definitions)for(let t in e.schemas){let r=n.definitions[t];if(!r||typeof r!=`object`)continue;let i=e.schemas[t];i(r)}if(e.operations&&n.paths)for(let t in e.operations){let[r,i]=t.split(` `);if(!r||!i)continue;let a=n.paths[i];if(!a)continue;let o=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!o||typeof o!=`object`)continue;let s=e.operations[t];s(o)}return}if(e.version&&n.openapi&&(n.openapi=typeof e.version==`string`?e.version:e.version(n.openapi)),e.meta&&n.info&&e.meta(n.info),n.components){if(e.schemas&&n.components.schemas)for(let t in e.schemas){let r=n.components.schemas[t];if(!r||typeof r!=`object`)continue;let i=e.schemas[t];i(r)}if(e.parameters&&n.components.parameters)for(let t in e.parameters){let r=n.components.parameters[t];if(!r||typeof r!=`object`)continue;let i=e.parameters[t];i(r)}if(e.requestBodies&&n.components.requestBodies)for(let t in e.requestBodies){let r=n.components.requestBodies[t];if(!r||typeof r!=`object`)continue;let i=e.requestBodies[t];i(r)}if(e.responses&&n.components.responses)for(let t in e.responses){let r=n.components.responses[t];if(!r||typeof r!=`object`)continue;let i=e.responses[t];i(r)}}if(e.operations&&n.paths)for(let t in e.operations){let[r,i]=t.split(` `);if(!r||!i)continue;let a=n.paths[i];if(!a)continue;let o=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!o||typeof o!=`object`)continue;let s=e.operations[t];s(o)}};var u=e.ot(((e,t)=>{t.exports=a,a.sync=o;var n=require(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}})),d=e.ot(((e,t)=>{t.exports=r,r.sync=i;var n=require(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),f=e.ot(((e,t)=>{require(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?u():d();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),p=e.ot(((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=require(`path`),i=n?`;`:`:`,a=f(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}})),m=e.ot(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),h=e.ot(((e,t)=>{let n=require(`path`),r=p(),i=m();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o})),g=e.ot(((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),_=e.ot(((e,t)=>{t.exports=/^#!(.*)/})),v=e.ot(((e,t)=>{let n=_();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),y=e.ot(((e,t)=>{let n=require(`fs`),r=v();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i})),b=e.ot(((e,t)=>{let n=require(`path`),r=h(),i=g(),a=y(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d})),x=e.ot(((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),S=e.ot(((e,t)=>{let n=require(`child_process`),r=b(),i=x();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})),C=e.st(S(),1);const w={biome:{args:e=>[`format`,`--write`,e],command:`biome`,name:`Biome (Format)`},prettier:{args:e=>[`--ignore-unknown`,e,`--write`,`--ignore-path`,`./.prettierignore`],command:`prettier`,name:`Prettier`}},T={biome:{args:e=>[`lint`,`--apply`,e],command:`biome`,name:`Biome (Lint)`},eslint:{args:e=>[e,`--fix`],command:`eslint`,name:`ESLint`},oxlint:{args:e=>[`--fix`,e],command:`oxlint`,name:`oxlint`}},E=({config:e})=>{if(e.output.lint){let t=T[e.output.lint];console.log(`✨ Running ${t.name}`),(0,C.sync)(t.command,t.args(e.output.path))}if(e.output.format){let t=w[e.output.format];console.log(`✨ Running ${t.name}`),(0,C.sync)(t.command,t.args(e.output.path))}},D=e=>{let t={...e,path:``};if(e.path&&(typeof e.path!=`string`||e.registry!==`hey-api`))return t.path=e.path,t;let[n,r]=e.path.split(`?`),i=(r||``).split(`&`).map(e=>e.split(`=`)),a=n||``;a.endsWith(`/`)&&(a=a.slice(0,a.length-1));let[,o]=a.split(`://`),[s,c,l]=(o||``).split(`/`);t.organization=c||e.organization,t.project=l||e.project;let u=[],d=`api_key`;t.api_key=i.find(([e])=>e===d)?.[1]||e.api_key||process.env.HEY_API_TOKEN,t.api_key&&u.push(`${d}=${t.api_key}`);let f=`branch`;t.branch=i.find(([e])=>e===f)?.[1]||e.branch,t.branch&&u.push(`${f}=${t.branch}`);let p=`commit_sha`;t.commit_sha=i.find(([e])=>e===p)?.[1]||e.commit_sha,t.commit_sha&&u.push(`${p}=${t.commit_sha}`);let m=`tags`;t.tags=i.find(([e])=>e===m)?.[1]?.split(`,`)||e.tags,t.tags?.length&&u.push(`${m}=${t.tags.join(`,`)}`);let h=`version`;if(t.version=i.find(([e])=>e===h)?.[1]||e.version,t.version&&u.push(`${h}=${t.version}`),!t.organization)throw Error(`missing organization - from which Hey API Platform organization do you want to generate your output?`);if(!t.project)throw Error(`missing project - from which Hey API Platform project do you want to generate your output?`);let g=u.join(`&`),_=s||`get.heyapi.dev`,v=_.startsWith(`localhost`),y=[v?`http`:`https`,_].join(`://`),b=v?[y,`v1`,`get`,t.organization,t.project].join(`/`):[y,t.organization,t.project].join(`/`);return t.path=g?`${b}?${g}`:b,t},O=(e,t)=>{let r=[],i=n.default.gray(`[Job ${t+1}] `),a=e.length,o=n.default.cyan(`Generating from ${a} ${a===1?`input`:`inputs`}:`);r.push(`${i}⏳ ${o}`),e.forEach((e,t)=>{let a=` [${t+1}] `,o=n.default.cyan(a),s=` `.repeat(a.length);if(typeof e.path!=`string`){r.push(`${i}${o}raw OpenAPI specification`);return}switch(e.registry){case`hey-api`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);r.push(`${i}${o}${t}`),e.branch&&r.push(`${i}${s}${n.default.gray(`branch:`)} ${n.default.green(e.branch)}`),e.commit_sha&&r.push(`${i}${s}${n.default.gray(`commit:`)} ${n.default.green(e.commit_sha)}`),e.tags?.length&&r.push(`${i}${s}${n.default.gray(`tags:`)} ${n.default.green(e.tags.join(`, `))}`),e.version&&r.push(`${i}${s}${n.default.gray(`version:`)} ${n.default.green(e.version)}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`Hey API`)}`);break}case`readme`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);t?r.push(`${i}${o}${t}`):r.push(`${i}${o}${e.path}`),e.uuid&&r.push(`${i}${s}${n.default.gray(`uuid:`)} ${n.default.green(e.uuid)}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`ReadMe`)}`);break}case`scalar`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);r.push(`${i}${o}${t}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`Scalar`)}`);break}default:r.push(`${i}${o}${e.path}`);break}});for(let e of r)console.log(e)},k=async({config:t,dependencies:r,jobIndex:i,logger:s,watches:u})=>{let d=u||Array.from({length:t.input.length},()=>({headers:new Headers})),f=t.input.map(e=>D(e));t.logs.level!==`silent`&&!u&&O(f,i);let p=async(t,n)=>{let r=s.timeEvent(`spec`),{arrayBuffer:i,error:a,resolvedInput:o,response:c}=await e.r({fetchOptions:t.fetch,inputPath:f[n].path,timeout:t.watch.timeout,watch:d[n]});if(r.timeEnd(),a&&!u)throw Error(`Request failed with status ${c.status}: ${c.statusText}`);return{arrayBuffer:i,resolvedInput:o}},m=(await Promise.all(t.input.map((e,t)=>p(e,t)))).filter(e=>e.arrayBuffer||e.resolvedInput),h;if(m.length){let d=new o.$RefParser,p=m.length>1?await d.bundleMany({arrayBuffer:m.map(e=>e.arrayBuffer),pathOrUrlOrSchemas:[],resolvedInputs:m.map(e=>e.resolvedInput)}):await d.bundle({arrayBuffer:m[0].arrayBuffer,pathOrUrlOrSchema:void 0,resolvedInput:m[0].resolvedInput});t.logs.level!==`silent`&&u&&(console.clear(),O(f,i));let g=s.timeEvent(`input.patch`);l({patchOptions:t.parser.patch,spec:p}),g.timeEnd();let _=s.timeEvent(`parser`);h=e.t({config:t,dependencies:r,logger:s,spec:p}),h.graph=e.n(h.ir,s).graph,_.timeEnd();let v=s.timeEvent(`generator`);await c({context:h}),v.timeEnd();let y=s.timeEvent(`postprocess`);if(!t.dryRun&&(E({config:t}),t.logs.level!==`silent`)){let e=process.env.INIT_CWD?`./${a.default.relative(process.env.INIT_CWD,t.output.path)}`:t.output.path,r=n.default.gray(`[Job ${i+1}] `);console.log(`${r}${n.default.green(`✅ Done!`)} Your output is in ${n.default.cyanBright(e)}`)}y.timeEnd()}let g=t.input.find((e,t)=>e.watch.enabled&&typeof f[t].path==`string`);return g&&setTimeout(()=>{k({config:t,dependencies:r,jobIndex:i,logger:s,watches:d})},g.watch.interval),h},A=`
1
+ const e=require(`./openApi-BKUOqJVi.cjs`);let t=require(`@hey-api/codegen-core`);t=e.st(t);let n=require(`ansi-colors`);n=e.st(n);let r=require(`color-support`);r=e.st(r);let i=require(`node:fs`);i=e.st(i);let a=require(`node:path`);a=e.st(a);let o=require(`@hey-api/json-schema-ref-parser`);o=e.st(o);const s=()=>{if(typeof Bun<`u`){let[t]=Bun.version.split(`.`).map(Number);if(t<1)throw new e.Q(`Unsupported Bun version ${Bun.version}. Please use Bun 1.0.0 or newer.`)}else if(typeof process<`u`&&process.versions?.node){let[t]=process.versions.node.split(`.`).map(Number);if(t<20)throw new e.Q(`Unsupported Node version ${process.versions.node}. Please use Node 20 or newer.`)}},c=async({context:t})=>{let n=a.default.resolve(t.config.output.path);t.config.output.clean&&i.default.existsSync(n)&&i.default.rmSync(n,{force:!0,recursive:!0});let r={importFileExtension:t.config.output.importFileExtension},o=e.q(t.config);`bundle`in o.config&&o.config.bundle&&!t.config.dryRun&&(t.config._FRAGILE_CLIENT_BUNDLE_RENAMED=e.H({meta:r,outputPath:n,plugin:o,project:t.gen}));for(let e of t.registerPlugins())await e.run();for(let e of t.gen.render(r)){let r=a.default.resolve(n,e.path),o=a.default.dirname(r);t.config.dryRun||(i.default.mkdirSync(o,{recursive:!0}),i.default.writeFileSync(r,e.content,{encoding:`utf8`}))}},l=({patchOptions:e,spec:t})=>{if(!e)return;let n=t;if(`swagger`in n){if(e.version&&n.swagger&&(n.swagger=typeof e.version==`string`?e.version:e.version(n.swagger)),e.meta&&n.info&&e.meta(n.info),e.schemas&&n.definitions)for(let t in e.schemas){let r=n.definitions[t];if(!r||typeof r!=`object`)continue;let i=e.schemas[t];i(r)}if(e.operations&&n.paths)for(let t in e.operations){let[r,i]=t.split(` `);if(!r||!i)continue;let a=n.paths[i];if(!a)continue;let o=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!o||typeof o!=`object`)continue;let s=e.operations[t];s(o)}return}if(e.version&&n.openapi&&(n.openapi=typeof e.version==`string`?e.version:e.version(n.openapi)),e.meta&&n.info&&e.meta(n.info),n.components){if(e.schemas&&n.components.schemas)for(let t in e.schemas){let r=n.components.schemas[t];if(!r||typeof r!=`object`)continue;let i=e.schemas[t];i(r)}if(e.parameters&&n.components.parameters)for(let t in e.parameters){let r=n.components.parameters[t];if(!r||typeof r!=`object`)continue;let i=e.parameters[t];i(r)}if(e.requestBodies&&n.components.requestBodies)for(let t in e.requestBodies){let r=n.components.requestBodies[t];if(!r||typeof r!=`object`)continue;let i=e.requestBodies[t];i(r)}if(e.responses&&n.components.responses)for(let t in e.responses){let r=n.components.responses[t];if(!r||typeof r!=`object`)continue;let i=e.responses[t];i(r)}}if(e.operations&&n.paths)for(let t in e.operations){let[r,i]=t.split(` `);if(!r||!i)continue;let a=n.paths[i];if(!a)continue;let o=a[r.toLocaleLowerCase()]||a[r.toLocaleUpperCase()];if(!o||typeof o!=`object`)continue;let s=e.operations[t];s(o)}};var u=e.ot(((e,t)=>{t.exports=a,a.sync=o;var n=require(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}})),d=e.ot(((e,t)=>{t.exports=r,r.sync=i;var n=require(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),f=e.ot(((e,t)=>{require(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?u():d();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),p=e.ot(((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=require(`path`),i=n?`;`:`:`,a=f(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}})),m=e.ot(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),h=e.ot(((e,t)=>{let n=require(`path`),r=p(),i=m();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o})),g=e.ot(((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),_=e.ot(((e,t)=>{t.exports=/^#!(.*)/})),v=e.ot(((e,t)=>{let n=_();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),y=e.ot(((e,t)=>{let n=require(`fs`),r=v();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i})),b=e.ot(((e,t)=>{let n=require(`path`),r=h(),i=g(),a=y(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d})),x=e.ot(((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),S=e.ot(((e,t)=>{let n=require(`child_process`),r=b(),i=x();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})),C=e.st(S(),1);const w={biome:{args:e=>[`format`,`--write`,e],command:`biome`,name:`Biome (Format)`},prettier:{args:e=>[`--ignore-unknown`,e,`--write`,`--ignore-path`,`./.prettierignore`],command:`prettier`,name:`Prettier`}},T={biome:{args:e=>[`lint`,`--apply`,e],command:`biome`,name:`Biome (Lint)`},eslint:{args:e=>[e,`--fix`],command:`eslint`,name:`ESLint`},oxlint:{args:e=>[`--fix`,e],command:`oxlint`,name:`oxlint`}},E=({config:e})=>{if(e.output.lint){let t=T[e.output.lint];console.log(`✨ Running ${t.name}`),(0,C.sync)(t.command,t.args(e.output.path))}if(e.output.format){let t=w[e.output.format];console.log(`✨ Running ${t.name}`),(0,C.sync)(t.command,t.args(e.output.path))}},D=e=>{let t={...e,path:``};if(e.path&&(typeof e.path!=`string`||e.registry!==`hey-api`))return t.path=e.path,t;let[n,r]=e.path.split(`?`),i=(r||``).split(`&`).map(e=>e.split(`=`)),a=n||``;a.endsWith(`/`)&&(a=a.slice(0,a.length-1));let[,o]=a.split(`://`),[s,c,l]=(o||``).split(`/`);t.organization=c||e.organization,t.project=l||e.project;let u=[],d=`api_key`;t.api_key=i.find(([e])=>e===d)?.[1]||e.api_key||process.env.HEY_API_TOKEN,t.api_key&&u.push(`${d}=${t.api_key}`);let f=`branch`;t.branch=i.find(([e])=>e===f)?.[1]||e.branch,t.branch&&u.push(`${f}=${t.branch}`);let p=`commit_sha`;t.commit_sha=i.find(([e])=>e===p)?.[1]||e.commit_sha,t.commit_sha&&u.push(`${p}=${t.commit_sha}`);let m=`tags`;t.tags=i.find(([e])=>e===m)?.[1]?.split(`,`)||e.tags,t.tags?.length&&u.push(`${m}=${t.tags.join(`,`)}`);let h=`version`;if(t.version=i.find(([e])=>e===h)?.[1]||e.version,t.version&&u.push(`${h}=${t.version}`),!t.organization)throw Error(`missing organization - from which Hey API Platform organization do you want to generate your output?`);if(!t.project)throw Error(`missing project - from which Hey API Platform project do you want to generate your output?`);let g=u.join(`&`),_=s||`get.heyapi.dev`,v=_.startsWith(`localhost`),y=[v?`http`:`https`,_].join(`://`),b=v?[y,`v1`,`get`,t.organization,t.project].join(`/`):[y,t.organization,t.project].join(`/`);return t.path=g?`${b}?${g}`:b,t},O=(e,t)=>{let r=[],i=n.default.gray(`[Job ${t+1}] `),a=e.length,o=n.default.cyan(`Generating from ${a} ${a===1?`input`:`inputs`}:`);r.push(`${i}⏳ ${o}`),e.forEach((e,t)=>{let a=` [${t+1}] `,o=n.default.cyan(a),s=` `.repeat(a.length);if(typeof e.path!=`string`){r.push(`${i}${o}raw OpenAPI specification`);return}switch(e.registry){case`hey-api`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);r.push(`${i}${o}${t}`),e.branch&&r.push(`${i}${s}${n.default.gray(`branch:`)} ${n.default.green(e.branch)}`),e.commit_sha&&r.push(`${i}${s}${n.default.gray(`commit:`)} ${n.default.green(e.commit_sha)}`),e.tags?.length&&r.push(`${i}${s}${n.default.gray(`tags:`)} ${n.default.green(e.tags.join(`, `))}`),e.version&&r.push(`${i}${s}${n.default.gray(`version:`)} ${n.default.green(e.version)}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`Hey API`)}`);break}case`readme`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);t?r.push(`${i}${o}${t}`):r.push(`${i}${o}${e.path}`),e.uuid&&r.push(`${i}${s}${n.default.gray(`uuid:`)} ${n.default.green(e.uuid)}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`ReadMe`)}`);break}case`scalar`:{let t=[e.organization,e.project].filter(Boolean).join(`/`);r.push(`${i}${o}${t}`),r.push(`${i}${s}${n.default.gray(`registry:`)} ${n.default.green(`Scalar`)}`);break}default:r.push(`${i}${o}${e.path}`);break}});for(let e of r)console.log(e)},k=async({config:t,dependencies:r,jobIndex:i,logger:s,watches:u})=>{let d=u||Array.from({length:t.input.length},()=>({headers:new Headers})),f=t.input.map(e=>D(e));t.logs.level!==`silent`&&!u&&O(f,i);let p=async(t,n)=>{let r=s.timeEvent(`spec`),{arrayBuffer:i,error:a,resolvedInput:o,response:c}=await e.r({fetchOptions:t.fetch,inputPath:f[n].path,timeout:t.watch.timeout,watch:d[n]});if(r.timeEnd(),a&&!u)throw Error(`Request failed with status ${c.status}: ${c.statusText}`);return{arrayBuffer:i,resolvedInput:o}},m=(await Promise.all(t.input.map((e,t)=>p(e,t)))).filter(e=>e.arrayBuffer||e.resolvedInput),h;if(m.length){let d=new o.$RefParser,p=m.length>1?await d.bundleMany({arrayBuffer:m.map(e=>e.arrayBuffer),pathOrUrlOrSchemas:[],resolvedInputs:m.map(e=>e.resolvedInput)}):await d.bundle({arrayBuffer:m[0].arrayBuffer,pathOrUrlOrSchema:void 0,resolvedInput:m[0].resolvedInput});t.logs.level!==`silent`&&u&&(console.clear(),O(f,i));let g=s.timeEvent(`input.patch`);l({patchOptions:t.parser.patch,spec:p}),g.timeEnd();let _=s.timeEvent(`parser`);h=e.t({config:t,dependencies:r,logger:s,spec:p}),h.graph=e.n(h.ir,s).graph,_.timeEnd();let v=s.timeEvent(`generator`);await c({context:h}),v.timeEnd();let y=s.timeEvent(`postprocess`);if(!t.dryRun&&(E({config:t}),t.logs.level!==`silent`)){let e=process.env.INIT_CWD?`./${a.default.relative(process.env.INIT_CWD,t.output.path)}`:t.output.path,r=n.default.gray(`[Job ${i+1}] `);console.log(`${r}${n.default.green(`✅ Done!`)} Your output is in ${n.default.cyanBright(e)}`)}y.timeEnd()}let g=t.input.find((e,t)=>e.watch.enabled&&typeof f[t].path==`string`);return g&&setTimeout(()=>{k({config:t,dependencies:r,jobIndex:i,logger:s,watches:d})},g.watch.interval),h},A=`
2
2
  888 | e 888~-_ 888
3
3
  888___| e88~~8e Y88b / d8b 888 \\ 888
4
4
  888 | d888 88b Y888/ /Y88b 888 | 888
@@ -16,4 +16,4 @@ const e=require(`./openApi-hVsWZkpA.cjs`);let t=require(`@hey-api/codegen-core`)
16
16
  888 | "88___/ / / Y88b 888 888
17
17
  _/
18
18
  `,{padding:1});for(let e of r.lines)console.log(n.default.cyan(e));console.log(n.default.gray(`${t.name} v${t.version}`)),console.log(``)}let N=0;const P=e=>`${e}-${N++}`,F=e=>`${e}-end`,I=e=>`${e}-length`,L=e=>`${e}-start`,R=(e,t)=>{if(e>200)return{color:n.default.red,type:`duration`};if(t>30)return{color:n.default.red,type:`percentage`};if(e>50)return{color:n.default.yellow,type:`duration`};if(t>10)return{color:n.default.yellow,type:`percentage`}};var z=class{events=[];end(e){let t,n=this.events;for(let r of e.position)t=n[r],t?.events&&(n=t.events);t&&!t.end&&(t.end=performance.mark(F(t.id)))}endAllEvents(e){for(let t of e)t.end||=performance.mark(F(t.id)),t.events.length>0&&this.endAllEvents(t.events)}report(e=!0){let t=this.events[0];if(!t)return;this.endAllEvents(this.events);let n=this.events[this.events.length-1],r=`root`,i=P(r);try{let a=performance.measure(I(i),L(t.id),F(n.id));return e&&this.reportEvent({end:n.end,events:this.events,id:i,indent:0,measure:a,name:r,start:t.start}),a}catch{return}}reportEvent({indent:e,...t}){let r=e?n.default.gray:n.default.cyan,i=t.events.length-1;t.events.forEach((a,o)=>{try{let s=performance.measure(I(a.id),L(a.id),F(a.id)),c=Math.ceil(s.duration*100)/100,l=Math.ceil(s.duration/t.measure.duration*100*100)/100,u=e?R(c,l):void 0,d=`${c.toFixed(2).padStart(8)}ms`;u?.type===`duration`&&(d=u.color(d));let f=o===i?`└─ `:`├─ `,p=e?`│ `.repeat(e-1)+f:``,m=38-p.length,h=e?`↳ `:``,g=`${e?` `.repeat(e-1)+h:``}${l.toFixed(2)}%`;u?.type===`percentage`&&(g=u.color(g));let _=n.default.gray(`[root] `);console.log(`${_}${n.default.gray(p)}${r(`${a.name.padEnd(m)} ${d} (${g})`)}`),this.reportEvent({...a,indent:e+1,measure:s})}catch{}})}start(e){return performance.mark(L(e))}storeEvent({result:e,...t}){let n=t.events.length-1,r=t.events[n];if(r&&!r.end){e.position=[...e.position,n],this.storeEvent({...t,events:r.events,result:e});return}let i=t.events.push({...t,events:[]});e.position=[...e.position,i-1]}timeEvent(e){let t=P(e),n=this.start(t),r={events:this.events,id:t,name:e,start:n},i={position:[]};return this.storeEvent({...r,result:i}),{mark:n,timeEnd:()=>this.end(i)}}};const B=async(t,n=new z)=>{let r=typeof t==`function`?await t():t,i=r?r instanceof Array?r:[r]:[],a=i.find(t=>e.Z(t).level!==`silent`)?.logs;typeof a==`string`&&(a=e.Z({logs:a}));let o;try{s();let t=n.timeEvent(`createClient`),r=n.timeEvent(`config`);o=await e.i({logger:n,userConfigs:i}),o.results.some(e=>e.config.logs.level!==`silent`)&&M(),r.timeEnd();let a=o.results.flatMap(e=>e.errors.map(t=>({error:t,jobIndex:e.jobIndex})));if(a.length)throw new e.$(a);let c=(await Promise.all(o.results.map(async t=>{try{return await k({config:t.config,dependencies:o.dependencies,jobIndex:t.jobIndex,logger:n})}catch(n){throw new e.et(``,{error:n,jobIndex:t.jobIndex})}}))).filter(e=>!!e);t.timeEnd();let l=o.results.some(e=>e.config.logs.level===`debug`);return n.report(l),c}catch(t){let n=o?.results??[],r=n.find(e=>e.config.logs.level!==`silent`)?.config.logs??n[0]?.config.logs??a,s=n.some(e=>e.config.dryRun)??i.some(e=>e.dryRun)??!1,c=r?.file&&!s?e.tt(t,r.path??``):void 0;throw(!r||r.level!==`silent`)&&(e.rt({error:t,logPath:c}),await e.it({error:t,isInteractive:n.some(e=>e.config.interactive)??i.some(e=>e.interactive)??!1})&&await e.nt(t)),t}},V={stringCase:e.J};n.default.enabled=(0,r.default)().hasBasic;const H=async e=>typeof e==`function`?await e():e;Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return H}});
19
- //# sourceMappingURL=src-CVDS5cbw.cjs.map
19
+ //# sourceMappingURL=src-DmdEIcct.cjs.map