keq 2.9.0 → 2.10.0
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.
- package/CHANGELOG.md +7 -0
- package/dist/esm/src/constant.d.ts +2 -0
- package/dist/esm/src/constant.js +2 -0
- package/dist/esm/src/core.d.ts +30 -0
- package/dist/esm/src/core.js +162 -53
- package/dist/esm/src/exception/abort.exception.d.ts +3 -0
- package/dist/esm/src/exception/abort.exception.js +6 -0
- package/dist/esm/src/index.d.ts +1 -0
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/is/is-abort-signal.d.ts +1 -0
- package/dist/esm/src/is/is-abort-signal.js +8 -0
- package/dist/esm/src/middlewares/fetch-arguments-middleware.js +5 -1
- package/dist/esm/src/middlewares/retry-middleware.js +20 -3
- package/dist/esm/src/middlewares/timeout-middleware.js +3 -1
- package/dist/esm/src/types/keq-context.d.ts +10 -1
- package/dist/esm/src/types/keq-context.js +1 -1
- package/dist/umd/src/constant.d.ts +2 -0
- package/dist/umd/src/constant.js +3 -1
- package/dist/umd/src/core.d.ts +30 -0
- package/dist/umd/src/core.js +162 -53
- package/dist/umd/src/exception/abort.exception.d.ts +3 -0
- package/dist/umd/src/exception/abort.exception.js +20 -0
- package/dist/umd/src/index.d.ts +1 -0
- package/dist/umd/src/index.js +4 -2
- package/dist/umd/src/is/is-abort-signal.d.ts +1 -0
- package/dist/umd/src/is/is-abort-signal.js +22 -0
- package/dist/umd/src/middlewares/fetch-arguments-middleware.js +4 -0
- package/dist/umd/src/middlewares/retry-middleware.js +21 -4
- package/dist/umd/src/middlewares/timeout-middleware.js +4 -2
- package/dist/umd/src/types/keq-context.d.ts +10 -1
- package/package.json +10 -13
- package/.claude/settings.local.json +0 -26
- package/packages/cache/.turbo/turbo-build.log +0 -29
- package/packages/cache/dist/index.d.mts +0 -354
- package/packages/cache/dist/index.d.mts.map +0 -1
- package/packages/cache/dist/index.d.ts +0 -353
- package/packages/cache/dist/index.d.ts.map +0 -1
- package/packages/cache/dist/index.js +0 -1271
- package/packages/cache/dist/index.js.map +0 -1
- package/packages/cache/dist/index.mjs +0 -1237
- package/packages/cache/dist/index.mjs.map +0 -1
- package/packages/cli/.turbo/turbo-build.log +0 -91
- package/packages/cli/dist/cli.cjs +0 -1364
- package/packages/cli/dist/cli.cjs.map +0 -1
- package/packages/cli/dist/cli.d.cts +0 -1
- package/packages/cli/dist/cli.d.mts +0 -1
- package/packages/cli/dist/cli.mjs +0 -1359
- package/packages/cli/dist/cli.mjs.map +0 -1
- package/packages/cli/dist/compiler-0Kli6UCr.cjs +0 -738
- package/packages/cli/dist/compiler-0Kli6UCr.cjs.map +0 -1
- package/packages/cli/dist/compiler-C3AE8j54.mjs +0 -715
- package/packages/cli/dist/compiler-C3AE8j54.mjs.map +0 -1
- package/packages/cli/dist/index.cjs +0 -20
- package/packages/cli/dist/index.cjs.map +0 -1
- package/packages/cli/dist/index.d.cts +0 -17
- package/packages/cli/dist/index.d.cts.map +0 -1
- package/packages/cli/dist/index.d.mts +0 -17
- package/packages/cli/dist/index.d.mts.map +0 -1
- package/packages/cli/dist/index.mjs +0 -10
- package/packages/cli/dist/index.mjs.map +0 -1
- package/packages/cli/dist/init-BNhD2oCI.mjs +0 -168
- package/packages/cli/dist/init-BNhD2oCI.mjs.map +0 -1
- package/packages/cli/dist/init-DqxLcRSQ.cjs +0 -170
- package/packages/cli/dist/init-DqxLcRSQ.cjs.map +0 -1
- package/packages/cli/dist/logger-D7PyVZo3.cjs +0 -46
- package/packages/cli/dist/logger-D7PyVZo3.cjs.map +0 -1
- package/packages/cli/dist/logger-QLBHySQ3.mjs +0 -12
- package/packages/cli/dist/logger-QLBHySQ3.mjs.map +0 -1
- package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs +0 -16
- package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs.map +0 -1
- package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs +0 -11
- package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs.map +0 -1
- package/packages/cli/dist/mock-command-Bp1LxSls.mjs +0 -350
- package/packages/cli/dist/mock-command-Bp1LxSls.mjs.map +0 -1
- package/packages/cli/dist/mock-command-WZcfy5Iq.cjs +0 -353
- package/packages/cli/dist/mock-command-WZcfy5Iq.cjs.map +0 -1
- package/packages/cli/dist/plugins-CgMhaNZq.cjs +0 -3558
- package/packages/cli/dist/plugins-CgMhaNZq.cjs.map +0 -1
- package/packages/cli/dist/plugins-DCvJ8iHR.mjs +0 -3280
- package/packages/cli/dist/plugins-DCvJ8iHR.mjs.map +0 -1
- package/packages/cli/dist/plugins.cjs +0 -36
- package/packages/cli/dist/plugins.d.cts +0 -2
- package/packages/cli/dist/plugins.d.mts +0 -2
- package/packages/cli/dist/plugins.mjs +0 -2
- package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts +0 -780
- package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts.map +0 -1
- package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts +0 -780
- package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts.map +0 -1
- package/packages/cli/dist/translators.cjs +0 -14
- package/packages/cli/dist/translators.cjs.map +0 -1
- package/packages/cli/dist/translators.d.cts +0 -14
- package/packages/cli/dist/translators.d.cts.map +0 -1
- package/packages/cli/dist/translators.d.mts +0 -14
- package/packages/cli/dist/translators.d.mts.map +0 -1
- package/packages/cli/dist/translators.mjs +0 -12
- package/packages/cli/dist/translators.mjs.map +0 -1
- package/packages/cli/node_modules/.bin/eslint +0 -21
- package/packages/cli/node_modules/.bin/jiti +0 -21
- package/packages/cli/node_modules/.bin/js-yaml +0 -21
- package/packages/cli/node_modules/.bin/jsf +0 -21
- package/packages/cli/node_modules/.bin/jsonpath +0 -21
- package/packages/cli/node_modules/.bin/jsonpath-plus +0 -21
- package/packages/cli/node_modules/.bin/semver +0 -21
- package/packages/cli/node_modules/.bin/tsc +0 -21
- package/packages/cli/node_modules/.bin/tsserver +0 -21
- package/packages/exception/.turbo/turbo-build.log +0 -29
- package/packages/exception/dist/index.d.mts +0 -21
- package/packages/exception/dist/index.d.mts.map +0 -1
- package/packages/exception/dist/index.d.ts +0 -21
- package/packages/exception/dist/index.d.ts.map +0 -1
- package/packages/exception/dist/index.js +0 -104
- package/packages/exception/dist/index.js.map +0 -1
- package/packages/exception/dist/index.mjs +0 -99
- package/packages/exception/dist/index.mjs.map +0 -1
- package/packages/headers/.turbo/turbo-build.log +0 -29
- package/packages/headers/dist/index.d.mts +0 -46
- package/packages/headers/dist/index.d.mts.map +0 -1
- package/packages/headers/dist/index.d.ts +0 -46
- package/packages/headers/dist/index.d.ts.map +0 -1
- package/packages/headers/dist/index.js +0 -81
- package/packages/headers/dist/index.js.map +0 -1
- package/packages/headers/dist/index.mjs +0 -75
- package/packages/headers/dist/index.mjs.map +0 -1
- package/packages/keq/.turbo/turbo-build.log +0 -29
- package/packages/keq/dist/index.d.mts +0 -962
- package/packages/keq/dist/index.d.mts.map +0 -1
- package/packages/keq/dist/index.d.ts +0 -962
- package/packages/keq/dist/index.d.ts.map +0 -1
- package/packages/keq/dist/index.js +0 -1876
- package/packages/keq/dist/index.js.map +0 -1
- package/packages/keq/dist/index.mjs +0 -1814
- package/packages/keq/dist/index.mjs.map +0 -1
- package/packages/nestjs/.turbo/turbo-build.log +0 -29
- package/packages/nestjs/dist/index.d.mts +0 -52
- package/packages/nestjs/dist/index.d.mts.map +0 -1
- package/packages/nestjs/dist/index.d.ts +0 -52
- package/packages/nestjs/dist/index.d.ts.map +0 -1
- package/packages/nestjs/dist/index.js +0 -166
- package/packages/nestjs/dist/index.js.map +0 -1
- package/packages/nestjs/dist/index.mjs +0 -136
- package/packages/nestjs/dist/index.mjs.map +0 -1
- package/packages/test/.turbo/turbo-build.log +0 -6
- package/packages/url/.turbo/turbo-build.log +0 -29
- package/packages/url/dist/index.d.mts +0 -9
- package/packages/url/dist/index.d.mts.map +0 -1
- package/packages/url/dist/index.d.ts +0 -9
- package/packages/url/dist/index.d.ts.map +0 -1
- package/packages/url/dist/index.js +0 -43
- package/packages/url/dist/index.js.map +0 -1
- package/packages/url/dist/index.mjs +0 -40
- package/packages/url/dist/index.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-C3AE8j54.mjs","names":["path","fs","main","main","path","main"],"sources":["../src/constants/file-naming-style.ts","../src/utils/matcher.ts","../src/compiler/tasks/setup/utils/find-nearest-package-json.ts","../src/compiler/tasks/setup/utils/get-project-module-system.ts","../src/types/address.ts","../src/utils/is-valid-url.ts","../src/types/runtime-config.ts","../src/compiler/tasks/setup/utils/parse-runtime-config.ts","../src/compiler/tasks/setup/index.ts","../src/compiler/tasks/download/validate-spec.ts","../src/compiler/tasks/download/index.ts","../src/compiler/tasks/persist/index.ts","../src/compiler/tasks/compile/index.ts","../src/compiler/intercepter/print-information.ts","../src/compiler/intercepter/perfect-error-message.ts","../src/compiler/compiler.ts"],"sourcesContent":["/**\n * File naming style options\n */\nexport enum FileNamingStyle {\n /** Camel case style (e.g., myFileName) */\n camelCase = 'camelCase',\n /** Capital case style (e.g., My File Name) */\n capitalCase = 'capitalCase',\n /** Constant case style (e.g., MY_FILE_NAME) */\n constantCase = 'constantCase',\n /** Dot case style (e.g., my.file.name) */\n dotCase = 'dotCase',\n /** Header case style (e.g., My-File-Name) */\n headerCase = 'headerCase',\n /** No case style (e.g., my file name) */\n noCase = 'noCase',\n /** Param case style (e.g., my-file-name) */\n paramCase = 'paramCase',\n /** Pascal case style (e.g., MyFileName) */\n pascalCase = 'pascalCase',\n /** Path case style (e.g., my/file/name) */\n pathCase = 'pathCase',\n /** Sentence case style (e.g., My file name) */\n sentenceCase = 'sentenceCase',\n /** Snake case style (e.g., my_file_name) */\n snakeCase = 'snakeCase',\n /** Kebab case style (e.g., my-file-name) */\n kebabCase = 'kebabCase',\n}\n","import * as R from 'ramda'\nimport fs from 'fs-extra'\nimport picomatch from 'picomatch'\nimport { OperationDefinition, ModuleDefinition } from '~/models/index.js'\n\n\nconst ALL_HTTP_METHODS = ['get', 'post', 'put', 'delete', 'patch', 'head', 'options']\n\nexport interface FilterRule {\n persist: boolean\n deny: boolean\n moduleName: string\n operationMethod: string\n operationPathname: string\n /** Lines (comment or blank) that appear before this rule in the file */\n leadingComments?: string[]\n /** Inline comment at end of the rule line, e.g. `# some note` */\n inlineComment?: string\n}\n\ninterface FilterMeta {\n preambleComments?: string[]\n trailingComments?: string[]\n}\n\nfunction deduplicateRules(rules: FilterRule[]): FilterRule[] {\n const sorted = R.sortBy(R.prop('deny'), rules)\n return R.uniqWith(\n (a, b) => a.moduleName === b.moduleName && a.operationMethod === b.operationMethod && a.operationPathname === b.operationPathname,\n sorted,\n )\n}\n\nfunction sortRulesForOutput(rules: FilterRule[]): FilterRule[] {\n return [...rules].sort((a, b) => {\n if (a.moduleName === '*' && b.moduleName !== '*') return -1\n if (a.moduleName !== '*' && b.moduleName === '*') return 1\n if (a.moduleName !== b.moduleName) return a.moduleName.localeCompare(b.moduleName)\n if (a.operationMethod === '*' && b.operationMethod !== '*') return -1\n if (a.operationMethod !== '*' && b.operationMethod === '*') return 1\n if (a.operationMethod !== b.operationMethod) return a.operationMethod.localeCompare(b.operationMethod)\n return a.operationPathname.localeCompare(b.operationPathname)\n })\n}\n\nfunction renderBlock(section: 'deny' | 'allow', rules: FilterRule[]): string {\n if (rules.length === 0) return ''\n const maxMethodLen = Math.max(...rules.map((r) => r.operationMethod.toUpperCase().length))\n const lines: string[] = []\n for (const r of rules) {\n if (r.leadingComments && r.leadingComments.length > 0) {\n lines.push(...r.leadingComments)\n }\n const ruleLine = `${r.operationMethod.toUpperCase().padEnd(maxMethodLen + 2)}${r.moduleName}:${r.operationPathname}`\n lines.push(r.inlineComment ? `${ruleLine} ${r.inlineComment}` : ruleLine)\n }\n return `[${section}]\\n${lines.join('\\n')}`\n}\n\n\ninterface CompiledRule {\n rule: FilterRule\n matchModuleName: (s: string) => boolean\n matchMethod: (s: string) => boolean\n matchPathname: (s: string) => boolean\n}\n\nfunction compileRule(rule: FilterRule): CompiledRule {\n return {\n rule,\n matchModuleName: picomatch(rule.moduleName),\n matchMethod: picomatch(rule.operationMethod),\n matchPathname: picomatch(rule.operationPathname),\n }\n}\n\n\n/**\n * Matches API operations and modules against `.keqfilter` rules to determine\n * which should be denied (excluded) or allowed during code generation.\n * Supports glob patterns (via picomatch) for module names, HTTP methods, and pathnames.\n */\nexport class Matcher {\n private compiled: CompiledRule[]\n private preambleComments: string[]\n private trailingComments: string[]\n\n constructor(rules: FilterRule[], meta: FilterMeta = {}) {\n this.compiled = rules.map(compileRule)\n this.preambleComments = meta.preambleComments ?? []\n this.trailingComments = meta.trailingComments ?? []\n }\n\n private get rules(): FilterRule[] {\n return this.compiled.map((c) => c.rule)\n }\n\n /**\n * Parse `.keqfilter` file content into a Matcher instance.\n *\n * File format:\n * ```\n * [deny]\n * GET petStore:/pets\n * * userService:/**\n *\n * [allow]\n * GET petStore:/pets/details\n * ```\n *\n * Line format: `METHOD module:/pathname`\n * - method: HTTP method or `*`, case-insensitive\n * - module:/pathname: module name + `:` + path pattern (glob supported)\n */\n static parse(content: string): Matcher {\n const normalized = content\n .replace(/\\r\\n/g, '\\n')\n .replace(/\\r/g, '\\n')\n\n const rules: FilterRule[] = []\n let currentDeny: boolean | null = null\n let firstSectionSeen = false\n let preambleComments: string[] = []\n const pendingComments: string[] = []\n\n for (const rawLine of normalized.split('\\n')) {\n const line = rawLine.replace(/#.*$/, '').trim()\n\n if (!line) {\n // blank line or comment-only line — buffer it\n pendingComments.push(rawLine)\n continue\n }\n\n if (line === '[deny]') {\n if (!firstSectionSeen) {\n preambleComments = [...pendingComments]\n pendingComments.length = 0\n firstSectionSeen = true\n } else {\n while (pendingComments.length > 0 && pendingComments[0].trim() === '') {\n pendingComments.shift()\n }\n }\n currentDeny = true\n continue\n }\n if (line === '[allow]') {\n if (!firstSectionSeen) {\n preambleComments = [...pendingComments]\n pendingComments.length = 0\n firstSectionSeen = true\n } else {\n while (pendingComments.length > 0 && pendingComments[0].trim() === '') {\n pendingComments.shift()\n }\n }\n currentDeny = false\n continue\n }\n if (currentDeny === null) continue\n\n const matched = line.match(/^([^\\s]+)\\s+([^:\\s]+):(.*)$/)\n if (!matched) throw new Error(`Invalid filter rule: \"${line}\"`)\n\n const [, operationMethod, moduleName, operationPathname] = matched\n\n // extract inline comment from the original raw line (whitespace + # + text at end)\n const inlineCommentMatch = rawLine.match(/\\s+(#.*)$/)\n const inlineComment = inlineCommentMatch ? inlineCommentMatch[1] : undefined\n\n rules.push({\n persist: true,\n deny: currentDeny,\n moduleName,\n operationMethod: operationMethod.toLowerCase(),\n operationPathname,\n leadingComments: pendingComments.length > 0 ? [...pendingComments] : undefined,\n inlineComment,\n })\n pendingComments.length = 0\n }\n\n const trailingComments = [...pendingComments]\n // strip trailing empty strings that are artifacts of the file's trailing newline\n while (trailingComments.length > 0 && trailingComments[trailingComments.length - 1].trim() === '') {\n trailingComments.pop()\n }\n // strip trailing empty strings from preamble for the same reason\n while (preambleComments.length > 0 && preambleComments[preambleComments.length - 1].trim() === '') {\n preambleComments.pop()\n }\n return new Matcher(deduplicateRules(rules), { preambleComments, trailingComments })\n }\n\n static async read(filepath: string): Promise<Matcher> {\n const content = await fs.readFile(filepath, 'utf-8')\n return Matcher.parse(content)\n }\n\n async write(filepath: string): Promise<void> {\n const persistRules: FilterRule[] = R.compose(\n R.reverse,\n R.uniqWith<FilterRule>(\n (a, b) => a.moduleName === b.moduleName && a.operationMethod === b.operationMethod && a.operationPathname === b.operationPathname,\n ),\n R.filter((rule: FilterRule) => rule.persist),\n )(this.rules) as FilterRule[]\n\n const denyRules = sortRulesForOutput(persistRules.filter((r) => r.deny))\n const allowRules = sortRulesForOutput(persistRules.filter((r) => !r.deny))\n\n const blocks = [\n renderBlock('deny', denyRules),\n renderBlock('allow', allowRules),\n ].filter(Boolean)\n\n if (blocks.length === 0) return\n\n const blockContent = blocks.join('\\n\\n')\n\n // prepend preamble comments (file-level comments before the first section)\n const mainContent = this.preambleComments.length > 0\n ? `${this.preambleComments.join('\\n')}\\n${blockContent}`\n : blockContent\n\n // append trailing comments (after the last rule)\n const output = this.trailingComments.length > 0\n ? `${mainContent}\\n\\n${this.trailingComments.join('\\n')}`\n : mainContent\n\n await fs.writeFile(filepath, output, 'utf-8')\n }\n\n append(rule: FilterRule): void {\n this.compiled.unshift(compileRule(rule))\n }\n\n isOperationDenied(operationDefinition: OperationDefinition): boolean {\n const moduleName = operationDefinition.module.name\n const operationMethod = operationDefinition.method.toLowerCase()\n const operationPathname = operationDefinition.pathname\n\n for (const { rule, matchModuleName, matchMethod, matchPathname } of this.compiled) {\n if (!matchModuleName(moduleName)) continue\n if (!matchMethod(operationMethod)) continue\n if (!matchPathname(operationPathname)) continue\n\n return rule.deny\n }\n\n return false\n }\n\n isModuleDenied(moduleDefinition: ModuleDefinition): boolean {\n const moduleName = moduleDefinition.name\n\n for (const { rule, matchModuleName, matchMethod, matchPathname } of this.compiled) {\n if (!matchModuleName(moduleName)) continue\n\n if (!rule.deny) return false\n\n if (!ALL_HTTP_METHODS.every((m) => matchMethod(m))) continue\n if (!matchPathname('/a/b/c/d')) continue\n\n return true\n }\n\n return false\n }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nexport interface PackageJsonInfo {\n json: any\n path: string\n}\n\n\nexport function findNearestPackageJson(startDir = process.cwd()): PackageJsonInfo | null {\n let dir = startDir\n // 向上遍历直到磁盘根目录\n while (true) {\n const pkgPath = path.join(dir, 'package.json')\n if (fs.existsSync(pkgPath)) {\n const json = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))\n return { json, path: pkgPath }\n }\n const parent = path.dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n return null\n}\n","import { PackageJsonInfo } from './find-nearest-package-json.js'\n\ntype ModuleSystem = 'esm' | 'cjs'\n\nexport function getProjectModuleSystem(pkgInfo: PackageJsonInfo): ModuleSystem {\n if (!pkgInfo?.json) return 'cjs'\n const { json } = pkgInfo\n\n if (json.type === 'module') return 'esm'\n return 'cjs'\n}\n","import { Static, Type } from '@sinclair/typebox'\n\n\nexport const Address = Type.Object({\n url: Type.String(),\n headers: Type.Optional(Type.Record(Type.String(), Type.String(), { default: {} })),\n encoding: Type.Optional(\n Type.Union([\n Type.Literal('utf8'),\n Type.Literal('ascii'),\n ], { default: 'utf8' }),\n ),\n})\n\nexport type Address = Static<typeof Address>\n","/**\n * 通用 URL 验证正则表达式,支持任意协议\n *\n * 格式: protocol://[user:password@][host][:port][/path][?query][#fragment]\n *\n * 支持的协议示例:\n * - http://, https://\n * - file:// (支持 file:///path 和 file://host/path 两种格式)\n * - ftp://, sftp://\n * - ws://, wss://\n * - 以及任何其他自定义协议\n */\nconst URL_REGEX = /^[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/(?:[^\\s@]+@)?[^\\s/:?#]*(?::\\d+)?(?:\\/[^\\s?#]*)?(?:\\?[^\\s#]*)?(?:#[^\\s]*)?$/\n\n/**\n * 验证是否为有效的 URL\n *\n * @param url - 待验证的 URL 字符串\n * @returns 如果是有效的 URL 返回 true,否则返回 false\n *\n * @example\n * ```typescript\n * isValidURL('http://example.com') // true\n * isValidURL('https://example.com:8080/path?query=1#fragment') // true\n * isValidURL('file:///path/to/file.json') // true\n * isValidURL('not a url') // false\n * ```\n */\nexport function isValidURL(url: string): boolean {\n return URL_REGEX.test(url)\n}\n","import * as R from 'ramda'\nimport { StaticDecode, StaticEncode, Type } from '@sinclair/typebox'\nimport { FileNamingStyle } from '../constants/file-naming-style.js'\nimport { Plugin } from './plugin.js'\nimport { Address } from './address.js'\nimport { isValidURL } from '../utils/is-valid-url.js'\nimport { Translator } from './index.js'\n\n\nconst Modules = Type.Transform(\n Type.Record(\n Type.String(),\n Type.Union([Type.String(), Address]),\n ),\n)\n .Decode((value): Record<string, Address> => {\n const keys = Object.keys(value)\n\n for (const key of keys) {\n if (!/^[A-Za-z_][A-Za-z0-9_$]*$/.test(key)) {\n throw new Error(`Module name \"${key}\" is not valid. It must start with a letter or underscore, and can only contain letters, numbers, and underscores.`)\n }\n }\n\n const keysGroupByLowerCase = R.groupBy(R.toLower, keys)\n\n for (const groupKey in keysGroupByLowerCase) {\n const keys = keysGroupByLowerCase[groupKey] || []\n if (keys.length > 1) {\n throw new Error(`Module names ${keys.map((name) => `\"${name}\"`).join(', ')} are case-insensitively duplicated.`)\n }\n }\n\n for (const key in value) {\n const url = typeof value[key] === 'string' ? value[key] : value[key].url\n\n if (isValidURL(url)) continue\n\n throw new Error(`The ${JSON.stringify(url)} of module \"${key}\" is not a valid URL.`)\n }\n\n return R.map(\n (item: string | Address): Address => (typeof item !== 'string' ? item : { url: item, headers: {}, encoding: 'utf8' }),\n value,\n )\n })\n .Encode((value) => value)\n\n\nexport const RawConfig = Type.Object({\n /**\n * Output directory for generated files\n */\n outdir: Type.String({ default: `${process.cwd()}/api` }),\n\n /**\n * Rendering options that directly control code generation output\n */\n rendering: Type.Object({\n /**\n * Whether to generate ES Module code\n *\n * If not specified, the module system will be inferred from the nearest package.json \"type\" field\n * or defaults to \"cjs\" if no package.json is found.\n */\n esm: Type.Optional(Type.Boolean({ default: false })),\n\n /**\n * File naming style for generated files\n */\n fileNamingStyle: Type.Enum(FileNamingStyle, { default: FileNamingStyle.snakeCase }),\n\n /**\n * Controls how `additionalProperties: true` (or undefined) is rendered in generated TypeScript types.\n *\n * - `'unknown'` (default): renders as `unknown`, which is stricter and type-safe\n * - `'any'`: renders as `any`, which is more permissive\n */\n additionalPropertiesType: Type.Optional(\n Type.Union([Type.Literal('unknown'), Type.Literal('any')], { default: 'unknown' }),\n ),\n\n /**\n * Whether to generate entrypoint (index) files that re-export all generated modules.\n *\n * Disable this to avoid merge conflicts in multi-branch collaborative development,\n * as auto-generated index files change frequently.\n */\n entrypoint: Type.Optional(Type.Boolean({ default: false })),\n }, { default: {} }),\n\n /**\n * OpenAPI/Swagger document sources\n *\n * A map of module names to their document URLs or Address objects.\n * The module name must be a valid JavaScript identifier.\n */\n modules: Modules,\n\n /**\n * Enable debug mode to output detailed logs during compilation\n */\n debug: Type.Optional(Type.Boolean({ default: false })),\n\n /**\n * Whether to tolerate wrong openapi/swagger structure\n */\n tolerant: Type.Optional(Type.Boolean({ default: false })),\n\n /**\n * Translators to transform generated code\n *\n * Used to customize the code generation process for different frameworks or patterns.\n * Can be a single translator or an array of translators.\n */\n translators: Type.Optional(\n Type.Transform(\n Type.Union([\n Type.Unsafe<Translator>(Type.Any()),\n Type.Array(Type.Unsafe<Translator>(Type.Any())),\n ], { default: [] }),\n )\n .Decode((value): Translator[] => {\n if (value === undefined) return []\n if (Array.isArray(value)) return value\n return [value]\n })\n .Encode((value) => value),\n ),\n\n /**\n * Plugins to extend code generation functionality\n *\n * An array of plugin instances that can hook into various stages of the compilation process,\n * such as code transformation, formatting, linting, or custom file generation.\n */\n plugins: Type.Optional(Type.Array(Type.Unsafe<Plugin>(Type.Any()), { default: [] })),\n})\n\nexport type RawConfig = StaticEncode<typeof RawConfig>\nexport type RuntimeConfig = StaticDecode<typeof RawConfig>\n","import { Value } from '@sinclair/typebox/value'\nimport { RawConfig, RuntimeConfig, Plugin, Translator } from '~/types/index.js'\n\n\nexport function parseRuntimeConfig(data: unknown): RuntimeConfig {\n try {\n const record = typeof data === 'object' && data !== null\n ? data as Record<string, unknown>\n : undefined\n\n const originalPlugins = record && 'plugins' in record ? record.plugins : undefined\n const originalTranslators = record && 'translators' in record ? record.translators : undefined\n\n const sanitized = record ? { ...record } : data\n if (record) {\n delete (sanitized as Record<string, unknown>).plugins\n delete (sanitized as Record<string, unknown>).translators\n }\n\n const parsed = Value.Parse(RawConfig, sanitized)\n\n if (originalPlugins !== undefined) {\n parsed.plugins = originalPlugins as Plugin[]\n }\n\n if (originalTranslators !== undefined) {\n parsed.translators = originalTranslators as Translator[]\n }\n\n return parsed\n } catch (error) {\n if (error instanceof Error) {\n error.message = `Invalid Config: ${error.message}`\n }\n throw error\n }\n}\n","import fs from 'fs-extra'\nimport path from 'path'\nimport { CosmiconfigResult } from 'cosmiconfig'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { ListrTask } from 'listr2'\nimport { Matcher, FilterRule } from '~/utils/matcher.js'\nimport { findNearestPackageJson, getProjectModuleSystem } from './utils/index.js'\nimport type { BaseTaskOptions } from '../types/base-task-options.js'\nimport type { Compiler } from '../../compiler.js'\nimport { CompilerContext } from '../../types/index.js'\nimport { parseRuntimeConfig } from './utils/parse-runtime-config.js'\nimport { MicroFunctionTranslator } from '~/translators/micro-function.translator.js'\n\n\nexport interface SetupTaskOptions {\n config?: string\n debug?: boolean\n tolerant?: boolean\n\n filter?: false | {\n rules: FilterRule[]\n }\n}\n\nconst explore = cosmiconfig('keq')\n\n\nfunction main(compiler: Compiler, options: SetupTaskOptions): ListrTask<CompilerContext> {\n return {\n task: async (context, task) => {\n const result: CosmiconfigResult = options?.config\n ? await explore.load(options.config)\n : await explore.search()\n\n if (!result || ('isEmpty' in result && result.isEmpty)) {\n throw new Error('Cannot find config file.')\n }\n\n const rc = parseRuntimeConfig(result.config)\n\n if (options?.debug) {\n await fs.ensureDir('.keq')\n rc.debug = true\n }\n\n rc.tolerant = Boolean(rc.tolerant || options?.tolerant)\n\n if (!rc.translators || !rc.translators.length) {\n rc.translators = [new MicroFunctionTranslator()]\n }\n\n const packageJsonInfo = findNearestPackageJson()\n if (packageJsonInfo) {\n const moduleSystem = getProjectModuleSystem(packageJsonInfo)\n rc.rendering.esm = moduleSystem === 'esm'\n }\n\n context.rc = rc\n\n\n // Setup Matcher\n\n let matcher: Matcher = new Matcher([])\n // filter === false means skip .keqfilter file loading entirely (e.g. --all flag)\n if (options.filter !== false && result.filepath) {\n const filterFilepath = path.resolve(path.dirname(result.filepath), '.keqfilter')\n if (await fs.exists(filterFilepath)) {\n matcher = await Matcher.read(filterFilepath)\n }\n }\n\n const filterRules = options.filter === false ? [] : options.filter?.rules || []\n for (const rule of filterRules) {\n matcher.append({\n persist: !!rule.persist,\n deny: rule.deny,\n moduleName: rule.moduleName,\n operationMethod: rule.operationMethod,\n operationPathname: rule.operationPathname,\n })\n }\n\n context.matcher = matcher\n\n await compiler.hooks.setup.promise(task)\n },\n }\n}\n\nexport function createSetupTask(compiler: Compiler, options: SetupTaskOptions & BaseTaskOptions): ListrTask<CompilerContext> {\n return {\n title: 'Setup',\n enabled: options?.enabled,\n skip: options?.skip,\n task: (context, task) => task.newListr(\n [\n main(compiler, options),\n {\n task: (context, task) => compiler.hooks.afterSetup\n .promise(task),\n },\n ],\n {\n concurrent: false,\n },\n ),\n }\n}\n","import { validate } from '@scalar/openapi-parser'\nimport { ModuleDefinition } from '~/models/index.js'\nimport { Exception } from '~/exception.js'\n\ninterface ValidateSpecOptions {\n moduleDefinition: ModuleDefinition\n tolerant: boolean\n}\n\ninterface ValidateSpecResult {\n valid: boolean\n warning?: string\n}\n\nexport async function validateSpec(\n spec: object,\n options: ValidateSpecOptions,\n): Promise<ValidateSpecResult> {\n const { valid, errors } = await validate(spec)\n if (valid) return { valid: true }\n\n const errorLines = errors?.map((e) => {\n const path = (e as { path?: string }).path\n if (path) {\n const readablePath = path.replace(/~1/g, '/').replace(/~0/g, '~')\n return ` - ${e.message}\\n at: ${readablePath}`\n }\n return ` - ${e.message}`\n }).join('\\n')\n\n let message = `${options.moduleDefinition.name} module openapi/swagger file does not conform to the openapi specifications or have grammatical errors, which may cause unexpected errors: \\n${errorLines}`\n\n const hasInvalidRef = errors?.some((e) => e.message?.includes('Error-ModelName'))\n if (hasInvalidRef) {\n message += '\\n\\n [Hint] \"Error-ModelName\" in $ref indicates that SpringDoc failed to resolve a Java class. Check that the referenced class (e.g. cn.dotfashion.soa.api.vo.Response) is on the classpath and properly annotated with @Schema.'\n }\n\n const hasExtensionsError = errors?.some((e) => e.message?.includes('Property extensions is not expected to be here'))\n if (hasExtensionsError) {\n message += '\\n\\n [Hint] \"Property extensions is not expected to be here\" is typically caused by SpringDoc/Swagger wrapping x- extensions in an \"extensions\" object. Add SpringdocCompatPlugin to your config plugins to fix this automatically.'\n }\n\n if (options.tolerant) {\n return { valid: false, warning: message }\n }\n\n throw new Exception(options.moduleDefinition, message)\n}\n","import { ListrTask, PRESET_TIMER } from 'listr2'\nimport { ModuleDefinition, ApiDocumentV3_1 } from '~/models/index.js'\nimport { BaseTaskOptions } from '../types/base-task-options.js'\nimport type { Compiler } from '~/compiler/compiler.js'\nimport { CompilerContext } from '~/compiler/index.js'\nimport { Exception } from '~/exception.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { validateSpec } from './validate-spec.js'\n\n\ninterface DownloadTaskOptions {\n skipFilteredModules?: boolean\n}\n\nfunction main(compiler: Compiler, options?: DownloadTaskOptions): ListrTask<CompilerContext> {\n return {\n task: (context, task) => {\n if (!context.rc || !context.matcher) {\n throw new Error('Please run setup task first.')\n }\n\n const rc = context.rc\n const matcher = context.matcher\n\n context.documents = []\n\n return task.newListr(\n Object.entries(rc.modules)\n .map(([moduleName, address]) => new ModuleDefinition(moduleName, address))\n .map((moduleDefinition): ListrTask<CompilerContext> => ({\n title: moduleDefinition.name,\n task: async (ctx, task) => {\n if (options?.skipFilteredModules && matcher.isModuleDenied(moduleDefinition)) {\n task.skip(`(${moduleDefinition.name}) is filtered`)\n return\n }\n\n task.output = `Downloaded from ${moduleDefinition.address.url}`\n\n const content = await compiler.hooks.download.promise(moduleDefinition.address, moduleDefinition, task)\n\n if (!content) {\n throw new Exception(moduleDefinition, `Cannot download document from ${moduleDefinition.address.url}`)\n }\n\n const spec = JSON.parse(content)\n\n await compiler.hooks.beforeValidate.promise(spec, moduleDefinition)\n\n const result = await validateSpec(spec, {\n moduleDefinition,\n tolerant: !!compiler.options.tolerant,\n })\n if (result.warning) {\n task.output = result.warning\n }\n\n OpenapiUtils.dereferenceOperation(spec)\n\n const document = new ApiDocumentV3_1(\n spec,\n moduleDefinition,\n )\n\n ctx.documents?.push(document)\n },\n })),\n {\n concurrent: true,\n exitOnError: !compiler.options.tolerant,\n collectErrors: compiler.options.tolerant ? 'minimal' : false,\n rendererOptions: {\n collapseSubtasks: false,\n suffixSkips: true,\n timer: PRESET_TIMER,\n },\n },\n )\n },\n }\n}\n\nexport function createDownloadTask(compiler: Compiler, options?: DownloadTaskOptions & BaseTaskOptions): ListrTask<CompilerContext> {\n return {\n title: 'Download',\n enabled: options?.enabled,\n skip: options?.skip,\n task: (_, task) => task.newListr(\n [\n main(compiler, options),\n {\n task: (context, task) => compiler.hooks.afterDownload\n .promise(task),\n },\n ],\n {\n concurrent: false,\n },\n ),\n }\n}\n","import * as path from 'path'\nimport fs from 'fs-extra'\nimport { ListrTask } from 'listr2'\nimport { BaseTaskOptions } from '../types/base-task-options.js'\nimport type { Compiler, CompilerContext } from '~/compiler/index.js'\nimport { Asset } from '~/models/index.js'\n\n\nfunction createPersistArtifactTask(): ListrTask<CompilerContext> {\n return {\n title: 'Write files',\n task: async (context, task) => {\n if (!context.rc) throw new Error('Please run setup task first.')\n if (!context.artifacts || context.artifacts.length === 0) {\n task.skip('No compiled artifacts to persist.')\n return\n }\n\n const rc = context.rc\n const artifacts = context.artifacts\n\n const total = artifacts.length\n let completed = 0\n\n const files = await Promise.all(artifacts.map(async (artifact): Promise<Asset> => {\n const realpath = `./${path.join(rc.outdir, artifact.filepath)}`\n await fs.ensureFile(realpath)\n await fs.writeFile(realpath, artifact.renderer())\n\n completed += 1\n task.output = `Persisted ${completed}/${total} files`\n\n return new Asset(path.resolve(realpath))\n }))\n\n context.assets = files\n },\n }\n}\n\nfunction createPersistFilterTask(): ListrTask<CompilerContext> {\n return {\n title: 'Update .keqfilter',\n task: async (context, task) => {\n if (!context.matcher) throw new Error('Please run setup task first.')\n\n const matcher = context.matcher\n await matcher.write('.keqfilter')\n },\n }\n}\n\n\nfunction main(): ListrTask<CompilerContext> {\n return {\n task: (context, task) => task.newListr(\n [\n createPersistArtifactTask(),\n createPersistFilterTask(),\n ],\n {\n concurrent: true,\n rendererOptions: {\n collapseSubtasks: true,\n },\n },\n ),\n }\n}\n\nexport function createPersistTask(compiler: Compiler, options?: BaseTaskOptions): ListrTask<CompilerContext> {\n return {\n title: 'Persist',\n enabled: options?.enabled,\n skip: options?.skip,\n task: (context, task) => task.newListr(\n [\n {\n task: (context, task) => compiler.hooks.beforePersist\n .promise(task),\n },\n main(),\n {\n task: (context, task) => compiler.hooks.afterPersist\n .promise(task),\n },\n ],\n {\n concurrent: false,\n },\n ),\n }\n}\n","import { ListrTask } from 'listr2'\nimport { BaseTaskOptions } from '../types/base-task-options.js'\nimport type { Compiler } from '~/compiler/compiler.js'\nimport { CompilerContext } from '~/compiler/index.js'\n// import { RequestGenerator } from '~/generators/index.js'\n\n\nfunction main(compiler: Compiler): ListrTask<CompilerContext> {\n return {\n task: async (context, task) => {\n if (!context.rc) throw new Error('Please run setup task first.')\n if (!context.documents) throw new Error('Please run shaking task first.')\n\n context.artifacts = []\n\n await compiler.hooks.compile.promise(task)\n },\n }\n}\n\nexport function createCompileTask(compiler: Compiler, options?: BaseTaskOptions): ListrTask<CompilerContext> {\n return {\n title: 'Compile',\n enabled: options?.enabled,\n skip: options?.skip,\n task: (context, task) => task.newListr(\n [\n {\n task: (context, task) => compiler.hooks.beforeCompile\n .promise(task),\n },\n main(compiler),\n {\n task: (context, task) => compiler.hooks.afterCompile\n .promise(task),\n },\n ],\n {\n concurrent: false,\n },\n ),\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport { FullTap, HookInterceptor } from 'tapable'\nimport { TaskWrapper } from '../tasks/index.js'\n\n\nexport function proxyTaskWrapper(pluginName: string, task: TaskWrapper): TaskWrapper {\n return new Proxy(task, {\n set(target, prop, value) {\n if (prop !== 'output') {\n return Reflect.set(target, prop, value)\n }\n\n target.output = `[Plugin: ${pluginName}] ${value}`\n return true\n },\n })\n}\n\n\nexport function printInformation(taskIndex: number): HookInterceptor<unknown, unknown> {\n return {\n register: <T extends FullTap>(tap: T): T => {\n const fn = tap.fn\n\n if (tap.type === 'promise') {\n tap.fn = (...args: any[]) => {\n const task = args[taskIndex] as TaskWrapper\n const proxyTask = proxyTaskWrapper(tap.name, task)\n args[taskIndex] = proxyTask\n proxyTask.output = 'Processing...'\n return fn(...args)\n }\n }\n\n if (tap.type === 'sync') {\n tap.fn = (...args: any[]) => {\n const task = args[taskIndex] as TaskWrapper\n const proxyTask = proxyTaskWrapper(tap.name, task)\n args[taskIndex] = proxyTask\n proxyTask.output = 'Processing...'\n return fn(...args)\n }\n }\n\n if (tap.type === 'async') {\n tap.fn = (...args: any[]) => {\n const task = args[taskIndex] as TaskWrapper\n const proxyTask = proxyTaskWrapper(tap.name, task)\n args[taskIndex] = proxyTask\n proxyTask.output = 'Processing...'\n return fn(...args)\n }\n }\n\n return tap\n },\n }\n}\n\n","/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport * as R from 'ramda'\nimport { FullTap, HookInterceptor, InnerCallback } from 'tapable'\n\nexport function perfectErrorMessage(): HookInterceptor<unknown, unknown> {\n return {\n register: <T extends FullTap>(tap: T): T => {\n const fn = tap.fn\n\n function prefix(err: unknown): void {\n if (err instanceof Error) {\n err.message = `[Plugin: ${tap.name}] ${err.message}`\n }\n }\n\n if (tap.type === 'promise') {\n tap.fn = async (...args: any[]) => {\n try {\n return await fn(...args)\n } catch (err) {\n prefix(err)\n throw err\n }\n }\n }\n\n if (tap.type === 'sync') {\n tap.fn = (...args: any[]) => {\n try {\n return fn(...args)\n } catch (err) {\n prefix(err)\n throw err\n }\n }\n }\n\n if (tap.type === 'async') {\n tap.fn = (...args: any[]) => {\n const callback = R.last(args) as InnerCallback<Error, any>\n\n return fn(...R.init(args), (err: Error | null, result: any) => {\n prefix(err)\n return callback(err, result)\n })\n }\n }\n\n return tap\n },\n }\n}\n","\n\nimport { Listr } from 'listr2'\nimport { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } from 'tapable'\nimport { CompilerHooks, CompilerContext } from './types/index.js'\nimport {\n ModuleDefinition,\n} from '~/models/index.js'\nimport {\n createCompileTask,\n createDownloadTask,\n createPersistTask,\n createSetupTask,\n SetupTaskOptions,\n TaskWrapper,\n} from './tasks/index.js'\nimport {\n perfectErrorMessage,\n printInformation,\n} from './intercepter/index.js'\nimport {\n InitializePlugin,\n TerminalSelectPluginOptions,\n} from '~/plugins/index.js'\nimport { Address } from '~/types/index.js'\n\n\ninterface Options extends SetupTaskOptions {\n build: boolean\n persist?: boolean\n silent?: boolean\n fresh?: boolean\n interactive?: boolean | TerminalSelectPluginOptions\n}\n\n\nexport class Compiler {\n context: CompilerContext = {}\n\n hooks: CompilerHooks = {\n setup: new AsyncParallelHook<[TaskWrapper]>(['task']),\n afterSetup: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n\n beforeDownload: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n download: new AsyncSeriesBailHook<[Address, ModuleDefinition, TaskWrapper], string | undefined>(['address', 'moduleDefinition', 'task']),\n beforeValidate: new AsyncSeriesHook<[object, ModuleDefinition]>(['spec', 'moduleDefinition']),\n afterDownload: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n\n beforeCompile: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n compile: new AsyncParallelHook<[TaskWrapper]>(['task']),\n afterCompile: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n\n beforePersist: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n persist: new AsyncParallelHook<[TaskWrapper]>(['task']),\n afterPersist: new AsyncSeriesHook<[TaskWrapper]>(['task']),\n\n done: new SyncHook<[]>(),\n }\n\n constructor(\n public options: Options,\n ) {\n for (const hook of Object.values(this.hooks)) {\n hook.intercept(perfectErrorMessage())\n }\n\n this.hooks.afterSetup.intercept(printInformation(0))\n this.hooks.afterPersist.intercept(printInformation(0))\n\n new InitializePlugin({\n build: options.build,\n fresh: options.fresh,\n interactive: options.interactive,\n }).apply(this)\n }\n\n async run(): Promise<void> {\n const options = this.options\n\n const tasks = new Listr<CompilerContext, 'default' | 'silent'>(\n [\n createSetupTask(this, options),\n createDownloadTask(this, { skipFilteredModules: !options.interactive }),\n createCompileTask(this, { enabled: !!options.build }),\n createPersistTask(this, { enabled: !!options.persist }),\n ],\n {\n concurrent: false,\n renderer: options.silent ? 'silent' : 'default',\n rendererOptions: {\n suffixSkips: true,\n collapseSubtasks: false,\n collapseErrors: false,\n },\n },\n )\n\n await tasks.run(this.context)\n\n await this.hooks.done.promise()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,IAAY,kBAAL,yBAAA,iBAAA;;AAEL,iBAAA,eAAA;;AAEA,iBAAA,iBAAA;;AAEA,iBAAA,kBAAA;;AAEA,iBAAA,aAAA;;AAEA,iBAAA,gBAAA;;AAEA,iBAAA,YAAA;;AAEA,iBAAA,eAAA;;AAEA,iBAAA,gBAAA;;AAEA,iBAAA,cAAA;;AAEA,iBAAA,kBAAA;;AAEA,iBAAA,eAAA;;AAEA,iBAAA,eAAA;;KACD;;;ACtBD,MAAM,mBAAmB;CAAC;CAAO;CAAQ;CAAO;CAAU;CAAS;CAAQ;CAAU;AAmBrF,SAAS,iBAAiB,OAAmC;CAC3D,MAAM,SAAS,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM;AAC9C,QAAO,EAAE,UACN,GAAG,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,mBAChH,OACD;;AAGH,SAAS,mBAAmB,OAAmC;AAC7D,QAAO,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM;AAC/B,MAAI,EAAE,eAAe,OAAO,EAAE,eAAe,IAAK,QAAO;AACzD,MAAI,EAAE,eAAe,OAAO,EAAE,eAAe,IAAK,QAAO;AACzD,MAAI,EAAE,eAAe,EAAE,WAAY,QAAO,EAAE,WAAW,cAAc,EAAE,WAAW;AAClF,MAAI,EAAE,oBAAoB,OAAO,EAAE,oBAAoB,IAAK,QAAO;AACnE,MAAI,EAAE,oBAAoB,OAAO,EAAE,oBAAoB,IAAK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B,MAAM,UAAU,KAAK;AAoBrB,QAAM,IAlBY,MAChB;GACE,gBAAgB,MAAM,QAAQ;GAC9B,mBAAmB,MAAM,EAAE,qBAAqB,CAAC,QAAQ,aAAa,CAAC;GACvE,kBAAkB,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,OAAO,CAAC;GACrD,kBAAkB,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,SAAS,CAAC;GACxD,EACD;GACE,YAAY;GACZ,UAAU,QAAQ,SAAS,WAAW;GACtC,iBAAiB;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IACjB;GACF,CAGQ,CAAC,IAAI,KAAK,QAAQ;AAE7B,QAAM,KAAK,MAAM,KAAK,SAAS"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_compiler = require("./compiler-0Kli6UCr.cjs");
|
|
3
|
-
const require_plugins = require("./plugins-CgMhaNZq.cjs");
|
|
4
|
-
//#region src/define-config.ts
|
|
5
|
-
function defineConfig(config) {
|
|
6
|
-
return config;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.ApiDocumentV3_1 = require_plugins.ApiDocumentV3_1;
|
|
10
|
-
exports.Artifact = require_plugins.Artifact;
|
|
11
|
-
exports.Asset = require_plugins.Asset;
|
|
12
|
-
exports.Compiler = require_compiler.Compiler;
|
|
13
|
-
exports.FileNamingStyle = require_compiler.FileNamingStyle;
|
|
14
|
-
exports.ModuleDefinition = require_plugins.ModuleDefinition;
|
|
15
|
-
exports.OperationDefinition = require_plugins.OperationDefinition;
|
|
16
|
-
exports.QsArrayFormat = require_plugins.QsArrayFormat;
|
|
17
|
-
exports.SchemaDefinition = require_plugins.SchemaDefinition;
|
|
18
|
-
exports.defineConfig = defineConfig;
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/define-config.ts"],"sourcesContent":["import { RawConfig } from './types/runtime-config.js'\n\n\nexport function defineConfig(config: RawConfig): RawConfig {\n return config\n}\n"],"mappings":";;;;AAGA,SAAgB,aAAa,QAA8B;AACzD,QAAO"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { $ as SchemaDefinition, Q as OperationDefinition, X as Asset, Y as TaskWrapper, Z as ApiDocumentV3_1, et as ModuleDefinition, n as Plugin, nt as Artifact, q as CompilerContext, r as Compiler, rt as FileNamingStyle, t as RawConfig, tt as Address } from "./runtime-config-BWQlPhiB.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/constants/qs-array-format.d.ts
|
|
4
|
-
declare enum QsArrayFormat {
|
|
5
|
-
brackets = "brackets",
|
|
6
|
-
indices = "indices",
|
|
7
|
-
repeat = "repeat",
|
|
8
|
-
comma = "comma",
|
|
9
|
-
space = "space",
|
|
10
|
-
pipe = "pipe"
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/define-config.d.ts
|
|
14
|
-
declare function defineConfig(config: RawConfig): RawConfig;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { type Address, ApiDocumentV3_1, Artifact, Asset, Compiler, type CompilerContext, type RawConfig as Config, FileNamingStyle, ModuleDefinition, OperationDefinition, type Plugin, QsArrayFormat, SchemaDefinition, type TaskWrapper, defineConfig };
|
|
17
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/constants/qs-array-format.ts","../src/define-config.ts"],"mappings":";;;aAAY,aAAA;EACV,QAAA;EACA,OAAA;EACA,MAAA;EACA,KAAA;EACA,KAAA;EACA,IAAA;AAAA;;;iBCHc,YAAA,CAAa,MAAA,EAAQ,SAAA,GAAY,SAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { $ as SchemaDefinition, Q as OperationDefinition, X as Asset, Y as TaskWrapper, Z as ApiDocumentV3_1, et as ModuleDefinition, n as Plugin, nt as Artifact, q as CompilerContext, r as Compiler, rt as FileNamingStyle, t as RawConfig, tt as Address } from "./runtime-config-CrzK-Ucf.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/constants/qs-array-format.d.ts
|
|
4
|
-
declare enum QsArrayFormat {
|
|
5
|
-
brackets = "brackets",
|
|
6
|
-
indices = "indices",
|
|
7
|
-
repeat = "repeat",
|
|
8
|
-
comma = "comma",
|
|
9
|
-
space = "space",
|
|
10
|
-
pipe = "pipe"
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/define-config.d.ts
|
|
14
|
-
declare function defineConfig(config: RawConfig): RawConfig;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { type Address, ApiDocumentV3_1, Artifact, Asset, Compiler, type CompilerContext, type RawConfig as Config, FileNamingStyle, ModuleDefinition, OperationDefinition, type Plugin, QsArrayFormat, SchemaDefinition, type TaskWrapper, defineConfig };
|
|
17
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants/qs-array-format.ts","../src/define-config.ts"],"mappings":";;;aAAY,aAAA;EACV,QAAA;EACA,OAAA;EACA,MAAA;EACA,KAAA;EACA,KAAA;EACA,IAAA;AAAA;;;iBCHc,YAAA,CAAa,MAAA,EAAQ,SAAA,GAAY,SAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { r as FileNamingStyle, t as Compiler } from "./compiler-C3AE8j54.mjs";
|
|
2
|
-
import { B as ModuleDefinition, G as QsArrayFormat, I as Asset, L as ApiDocumentV3_1, R as OperationDefinition, V as Artifact, z as SchemaDefinition } from "./plugins-DCvJ8iHR.mjs";
|
|
3
|
-
//#region src/define-config.ts
|
|
4
|
-
function defineConfig(config) {
|
|
5
|
-
return config;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { ApiDocumentV3_1, Artifact, Asset, Compiler, FileNamingStyle, ModuleDefinition, OperationDefinition, QsArrayFormat, SchemaDefinition, defineConfig };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/define-config.ts"],"sourcesContent":["import { RawConfig } from './types/runtime-config.js'\n\n\nexport function defineConfig(config: RawConfig): RawConfig {\n return config\n}\n"],"mappings":";;;AAGA,SAAgB,aAAa,QAA8B;AACzD,QAAO"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { t as logger } from "./logger-QLBHySQ3.mjs";
|
|
2
|
-
import * as fs$1 from "fs-extra";
|
|
3
|
-
import * as path$1 from "path";
|
|
4
|
-
//#region src/init.ts
|
|
5
|
-
const TS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
// Output directory for generated files
|
|
9
|
-
outdir: './apis',
|
|
10
|
-
|
|
11
|
-
// Rendering options for code generation
|
|
12
|
-
rendering: {
|
|
13
|
-
// File naming style for generated files
|
|
14
|
-
fileNamingStyle: FileNamingStyle.kebabCase,
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
// OpenAPI/Swagger document sources
|
|
18
|
-
modules: {
|
|
19
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
// Plugins to extend code generation functionality
|
|
23
|
-
plugins: [],
|
|
24
|
-
})
|
|
25
|
-
`;
|
|
26
|
-
const JS_CONFIG_TEMPLATE = `const { defineConfig } = require('@keq-request/cli')
|
|
27
|
-
|
|
28
|
-
module.exports = defineConfig({
|
|
29
|
-
// Output directory for generated files
|
|
30
|
-
outdir: './apis',
|
|
31
|
-
|
|
32
|
-
// Rendering options for code generation
|
|
33
|
-
rendering: {
|
|
34
|
-
// File naming style for generated files
|
|
35
|
-
// Options: 'camelCase', 'capitalCase', 'constantCase', 'dotCase', 'headerCase',
|
|
36
|
-
// 'noCase', 'paramCase', 'pascalCase', 'pathCase', 'sentenceCase',
|
|
37
|
-
// 'snakeCase', 'kebabCase'
|
|
38
|
-
fileNamingStyle: 'kebabCase',
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
// OpenAPI/Swagger document sources
|
|
42
|
-
modules: {
|
|
43
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
// Plugins to extend code generation functionality
|
|
47
|
-
plugins: [],
|
|
48
|
-
})
|
|
49
|
-
`;
|
|
50
|
-
const MJS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'
|
|
51
|
-
|
|
52
|
-
export default defineConfig({
|
|
53
|
-
// Output directory for generated files
|
|
54
|
-
outdir: './apis',
|
|
55
|
-
|
|
56
|
-
// Rendering options for code generation
|
|
57
|
-
rendering: {
|
|
58
|
-
// File naming style for generated files
|
|
59
|
-
fileNamingStyle: FileNamingStyle.kebabCase,
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
// OpenAPI/Swagger document sources
|
|
63
|
-
modules: {
|
|
64
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
// Plugins to extend code generation functionality
|
|
68
|
-
plugins: [],
|
|
69
|
-
})
|
|
70
|
-
`;
|
|
71
|
-
/**
|
|
72
|
-
* Check if a file exists in the current directory or any parent directory
|
|
73
|
-
*/
|
|
74
|
-
async function findFileInParents(filename, startDir = process.cwd()) {
|
|
75
|
-
let currentDir = startDir;
|
|
76
|
-
while (true) {
|
|
77
|
-
const filePath = path$1.join(currentDir, filename);
|
|
78
|
-
if (await fs$1.pathExists(filePath)) return filePath;
|
|
79
|
-
const parentDir = path$1.dirname(currentDir);
|
|
80
|
-
if (parentDir === currentDir) return null;
|
|
81
|
-
currentDir = parentDir;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Detect if project uses TypeScript by checking for tsconfig.json
|
|
86
|
-
*/
|
|
87
|
-
async function detectTypeScript() {
|
|
88
|
-
return await findFileInParents("tsconfig.json") !== null;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Detect project module system from package.json
|
|
92
|
-
*/
|
|
93
|
-
async function detectModuleSystem() {
|
|
94
|
-
const packageJsonPath = await findFileInParents("package.json");
|
|
95
|
-
if (packageJsonPath) try {
|
|
96
|
-
if ((await fs$1.readJson(packageJsonPath)).type === "module") return "esm";
|
|
97
|
-
} catch (error) {}
|
|
98
|
-
return "cjs";
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Get the appropriate config filename and content based on project setup
|
|
102
|
-
*/
|
|
103
|
-
async function getConfigFileInfo() {
|
|
104
|
-
const hasTypeScript = await detectTypeScript();
|
|
105
|
-
const moduleSystem = await detectModuleSystem();
|
|
106
|
-
if (hasTypeScript) return {
|
|
107
|
-
filename: ".keqrc.ts",
|
|
108
|
-
content: TS_CONFIG_TEMPLATE
|
|
109
|
-
};
|
|
110
|
-
if (moduleSystem === "esm") return {
|
|
111
|
-
filename: ".keqrc.mjs",
|
|
112
|
-
content: MJS_CONFIG_TEMPLATE
|
|
113
|
-
};
|
|
114
|
-
return {
|
|
115
|
-
filename: ".keqrc.js",
|
|
116
|
-
content: JS_CONFIG_TEMPLATE
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Check if any config file already exists
|
|
121
|
-
*/
|
|
122
|
-
async function findExistingConfigFile() {
|
|
123
|
-
for (const filename of [
|
|
124
|
-
".keqrc",
|
|
125
|
-
".keqrc.ts",
|
|
126
|
-
".keqrc.js",
|
|
127
|
-
".keqrc.mjs",
|
|
128
|
-
".keqrc.cjs",
|
|
129
|
-
".keqrc.json",
|
|
130
|
-
".keqrc.yml",
|
|
131
|
-
".keqrc.yaml",
|
|
132
|
-
"keq.config.ts",
|
|
133
|
-
"keq.config.js",
|
|
134
|
-
"keq.config.mjs",
|
|
135
|
-
"keq.config.cjs",
|
|
136
|
-
"keq.config.json",
|
|
137
|
-
"keq.config.yml",
|
|
138
|
-
"keq.config.yaml"
|
|
139
|
-
]) {
|
|
140
|
-
const filePath = path$1.join(process.cwd(), filename);
|
|
141
|
-
if (await fs$1.pathExists(filePath)) return filename;
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
async function initConfig(options) {
|
|
146
|
-
try {
|
|
147
|
-
const existingConfig = await findExistingConfigFile();
|
|
148
|
-
if (existingConfig && !options.force) {
|
|
149
|
-
logger.error(`Config file already exists: ${existingConfig}`);
|
|
150
|
-
logger.error("Use --force to overwrite");
|
|
151
|
-
process.exit(1);
|
|
152
|
-
}
|
|
153
|
-
const { filename, content } = await getConfigFileInfo();
|
|
154
|
-
const filePath = path$1.join(process.cwd(), filename);
|
|
155
|
-
await fs$1.writeFile(filePath, content, "utf8");
|
|
156
|
-
logger.log(`Created config file: ${filename}`);
|
|
157
|
-
console.log("\nNext steps:");
|
|
158
|
-
console.log("1. Edit the config file to add your OpenAPI/Swagger document URLs");
|
|
159
|
-
console.log("2. Run \"keq build\" to generate API client code");
|
|
160
|
-
} catch (error) {
|
|
161
|
-
logger.error(error instanceof Error ? error.message : String(error));
|
|
162
|
-
process.exit(1);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
export { initConfig };
|
|
167
|
-
|
|
168
|
-
//# sourceMappingURL=init-BNhD2oCI.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-BNhD2oCI.mjs","names":["path","fs"],"sources":["../src/init.ts"],"sourcesContent":["import * as fs from 'fs-extra'\nimport * as path from 'path'\nimport { logger } from './utils/logger.js'\n\n\ninterface InitOptions {\n force?: boolean\n}\n\nconst TS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'\n\nexport default defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n fileNamingStyle: FileNamingStyle.kebabCase,\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\nconst JS_CONFIG_TEMPLATE = `const { defineConfig } = require('@keq-request/cli')\n\nmodule.exports = defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n // Options: 'camelCase', 'capitalCase', 'constantCase', 'dotCase', 'headerCase',\n // 'noCase', 'paramCase', 'pascalCase', 'pathCase', 'sentenceCase',\n // 'snakeCase', 'kebabCase'\n fileNamingStyle: 'kebabCase',\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\nconst MJS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'\n\nexport default defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n fileNamingStyle: FileNamingStyle.kebabCase,\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\n/**\n * Check if a file exists in the current directory or any parent directory\n */\nasync function findFileInParents(filename: string, startDir: string = process.cwd()): Promise<string | null> {\n let currentDir = startDir\n\n while (true) {\n const filePath = path.join(currentDir, filename)\n if (await fs.pathExists(filePath)) {\n return filePath\n }\n\n const parentDir = path.dirname(currentDir)\n // Reached the root directory\n if (parentDir === currentDir) {\n return null\n }\n currentDir = parentDir\n }\n}\n\n/**\n * Detect if project uses TypeScript by checking for tsconfig.json\n */\nasync function detectTypeScript(): Promise<boolean> {\n const tsconfigPath = await findFileInParents('tsconfig.json')\n return tsconfigPath !== null\n}\n\n/**\n * Detect project module system from package.json\n */\nasync function detectModuleSystem(): Promise<'esm' | 'cjs'> {\n const packageJsonPath = await findFileInParents('package.json')\n\n if (packageJsonPath) {\n try {\n const packageJson = await fs.readJson(packageJsonPath)\n if (packageJson.type === 'module') {\n return 'esm'\n }\n } catch (error) {\n // Ignore JSON parse errors\n }\n }\n\n return 'cjs'\n}\n\n/**\n * Get the appropriate config filename and content based on project setup\n */\nasync function getConfigFileInfo(): Promise<{ filename: string; content: string }> {\n const hasTypeScript = await detectTypeScript()\n const moduleSystem = await detectModuleSystem()\n\n if (hasTypeScript) {\n return {\n filename: '.keqrc.ts',\n content: TS_CONFIG_TEMPLATE,\n }\n }\n\n if (moduleSystem === 'esm') {\n return {\n filename: '.keqrc.mjs',\n content: MJS_CONFIG_TEMPLATE,\n }\n }\n\n return {\n filename: '.keqrc.js',\n content: JS_CONFIG_TEMPLATE,\n }\n}\n\n/**\n * Check if any config file already exists\n */\nasync function findExistingConfigFile(): Promise<string | null> {\n const possibleConfigFiles = [\n '.keqrc',\n\n '.keqrc.ts',\n '.keqrc.js',\n '.keqrc.mjs',\n '.keqrc.cjs',\n '.keqrc.json',\n '.keqrc.yml',\n '.keqrc.yaml',\n\n 'keq.config.ts',\n 'keq.config.js',\n 'keq.config.mjs',\n 'keq.config.cjs',\n 'keq.config.json',\n 'keq.config.yml',\n 'keq.config.yaml',\n ]\n\n for (const filename of possibleConfigFiles) {\n const filePath = path.join(process.cwd(), filename)\n if (await fs.pathExists(filePath)) {\n return filename\n }\n }\n\n return null\n}\n\nexport async function initConfig(options: InitOptions): Promise<void> {\n try {\n // Check for existing config file\n const existingConfig = await findExistingConfigFile()\n\n if (existingConfig && !options.force) {\n logger.error(`Config file already exists: ${existingConfig}`)\n logger.error('Use --force to overwrite')\n process.exit(1)\n }\n\n // Get config file info based on project setup\n const { filename, content } = await getConfigFileInfo()\n const filePath = path.join(process.cwd(), filename)\n\n // Write config file\n await fs.writeFile(filePath, content, 'utf8')\n\n logger.log(`Created config file: ${filename}`)\n\n // Print helpful next steps\n console.log('\\nNext steps:')\n console.log('1. Edit the config file to add your OpenAPI/Swagger document URLs')\n console.log('2. Run \"keq build\" to generate API client code')\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;AASA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;AAsB3B,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;AAyB3B,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;AAyB5B,eAAe,kBAAkB,UAAkB,WAAmB,QAAQ,KAAK,EAA0B;CAC3G,IAAI,aAAa;AAEjB,QAAO,MAAM;EACX,MAAM,WAAWA,OAAK,KAAK,YAAY,SAAS;AAChD,MAAI,MAAMC,KAAG,WAAW,SAAS,CAC/B,QAAO;EAGT,MAAM,YAAYD,OAAK,QAAQ,WAAW;AAE1C,MAAI,cAAc,WAChB,QAAO;AAET,eAAa;;;;;;AAOjB,eAAe,mBAAqC;AAElD,QAAO,MADoB,kBAAkB,gBAAgB,KACrC;;;;;AAM1B,eAAe,qBAA6C;CAC1D,MAAM,kBAAkB,MAAM,kBAAkB,eAAe;AAE/D,KAAI,gBACF,KAAI;AAEF,OAAI,MADsBC,KAAG,SAAS,gBAAgB,EACtC,SAAS,SACvB,QAAO;UAEF,OAAO;AAKlB,QAAO;;;;;AAMT,eAAe,oBAAoE;CACjF,MAAM,gBAAgB,MAAM,kBAAkB;CAC9C,MAAM,eAAe,MAAM,oBAAoB;AAE/C,KAAI,cACF,QAAO;EACL,UAAU;EACV,SAAS;EACV;AAGH,KAAI,iBAAiB,MACnB,QAAO;EACL,UAAU;EACV,SAAS;EACV;AAGH,QAAO;EACL,UAAU;EACV,SAAS;EACV;;;;;AAMH,eAAe,yBAAiD;AAqB9D,MAAK,MAAM,YAAY;EAnBrB;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAGwC,EAAE;EAC1C,MAAM,WAAWD,OAAK,KAAK,QAAQ,KAAK,EAAE,SAAS;AACnD,MAAI,MAAMC,KAAG,WAAW,SAAS,CAC/B,QAAO;;AAIX,QAAO;;AAGT,eAAsB,WAAW,SAAqC;AACpE,KAAI;EAEF,MAAM,iBAAiB,MAAM,wBAAwB;AAErD,MAAI,kBAAkB,CAAC,QAAQ,OAAO;AACpC,UAAO,MAAM,+BAA+B,iBAAiB;AAC7D,UAAO,MAAM,2BAA2B;AACxC,WAAQ,KAAK,EAAE;;EAIjB,MAAM,EAAE,UAAU,YAAY,MAAM,mBAAmB;EACvD,MAAM,WAAWD,OAAK,KAAK,QAAQ,KAAK,EAAE,SAAS;AAGnD,QAAMC,KAAG,UAAU,UAAU,SAAS,OAAO;AAE7C,SAAO,IAAI,wBAAwB,WAAW;AAG9C,UAAQ,IAAI,gBAAgB;AAC5B,UAAQ,IAAI,oEAAoE;AAChF,UAAQ,IAAI,mDAAiD;UACtD,OAAO;AACd,SAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AACpE,UAAQ,KAAK,EAAE"}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
const require_logger = require("./logger-D7PyVZo3.cjs");
|
|
2
|
-
let fs_extra = require("fs-extra");
|
|
3
|
-
fs_extra = require_logger.__toESM(fs_extra, 1);
|
|
4
|
-
let path = require("path");
|
|
5
|
-
path = require_logger.__toESM(path, 1);
|
|
6
|
-
//#region src/init.ts
|
|
7
|
-
const TS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'
|
|
8
|
-
|
|
9
|
-
export default defineConfig({
|
|
10
|
-
// Output directory for generated files
|
|
11
|
-
outdir: './apis',
|
|
12
|
-
|
|
13
|
-
// Rendering options for code generation
|
|
14
|
-
rendering: {
|
|
15
|
-
// File naming style for generated files
|
|
16
|
-
fileNamingStyle: FileNamingStyle.kebabCase,
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
// OpenAPI/Swagger document sources
|
|
20
|
-
modules: {
|
|
21
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
// Plugins to extend code generation functionality
|
|
25
|
-
plugins: [],
|
|
26
|
-
})
|
|
27
|
-
`;
|
|
28
|
-
const JS_CONFIG_TEMPLATE = `const { defineConfig } = require('@keq-request/cli')
|
|
29
|
-
|
|
30
|
-
module.exports = defineConfig({
|
|
31
|
-
// Output directory for generated files
|
|
32
|
-
outdir: './apis',
|
|
33
|
-
|
|
34
|
-
// Rendering options for code generation
|
|
35
|
-
rendering: {
|
|
36
|
-
// File naming style for generated files
|
|
37
|
-
// Options: 'camelCase', 'capitalCase', 'constantCase', 'dotCase', 'headerCase',
|
|
38
|
-
// 'noCase', 'paramCase', 'pascalCase', 'pathCase', 'sentenceCase',
|
|
39
|
-
// 'snakeCase', 'kebabCase'
|
|
40
|
-
fileNamingStyle: 'kebabCase',
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
// OpenAPI/Swagger document sources
|
|
44
|
-
modules: {
|
|
45
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
// Plugins to extend code generation functionality
|
|
49
|
-
plugins: [],
|
|
50
|
-
})
|
|
51
|
-
`;
|
|
52
|
-
const MJS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'
|
|
53
|
-
|
|
54
|
-
export default defineConfig({
|
|
55
|
-
// Output directory for generated files
|
|
56
|
-
outdir: './apis',
|
|
57
|
-
|
|
58
|
-
// Rendering options for code generation
|
|
59
|
-
rendering: {
|
|
60
|
-
// File naming style for generated files
|
|
61
|
-
fileNamingStyle: FileNamingStyle.kebabCase,
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
// OpenAPI/Swagger document sources
|
|
65
|
-
modules: {
|
|
66
|
-
// Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
// Plugins to extend code generation functionality
|
|
70
|
-
plugins: [],
|
|
71
|
-
})
|
|
72
|
-
`;
|
|
73
|
-
/**
|
|
74
|
-
* Check if a file exists in the current directory or any parent directory
|
|
75
|
-
*/
|
|
76
|
-
async function findFileInParents(filename, startDir = process.cwd()) {
|
|
77
|
-
let currentDir = startDir;
|
|
78
|
-
while (true) {
|
|
79
|
-
const filePath = path.join(currentDir, filename);
|
|
80
|
-
if (await fs_extra.pathExists(filePath)) return filePath;
|
|
81
|
-
const parentDir = path.dirname(currentDir);
|
|
82
|
-
if (parentDir === currentDir) return null;
|
|
83
|
-
currentDir = parentDir;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Detect if project uses TypeScript by checking for tsconfig.json
|
|
88
|
-
*/
|
|
89
|
-
async function detectTypeScript() {
|
|
90
|
-
return await findFileInParents("tsconfig.json") !== null;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Detect project module system from package.json
|
|
94
|
-
*/
|
|
95
|
-
async function detectModuleSystem() {
|
|
96
|
-
const packageJsonPath = await findFileInParents("package.json");
|
|
97
|
-
if (packageJsonPath) try {
|
|
98
|
-
if ((await fs_extra.readJson(packageJsonPath)).type === "module") return "esm";
|
|
99
|
-
} catch (error) {}
|
|
100
|
-
return "cjs";
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Get the appropriate config filename and content based on project setup
|
|
104
|
-
*/
|
|
105
|
-
async function getConfigFileInfo() {
|
|
106
|
-
const hasTypeScript = await detectTypeScript();
|
|
107
|
-
const moduleSystem = await detectModuleSystem();
|
|
108
|
-
if (hasTypeScript) return {
|
|
109
|
-
filename: ".keqrc.ts",
|
|
110
|
-
content: TS_CONFIG_TEMPLATE
|
|
111
|
-
};
|
|
112
|
-
if (moduleSystem === "esm") return {
|
|
113
|
-
filename: ".keqrc.mjs",
|
|
114
|
-
content: MJS_CONFIG_TEMPLATE
|
|
115
|
-
};
|
|
116
|
-
return {
|
|
117
|
-
filename: ".keqrc.js",
|
|
118
|
-
content: JS_CONFIG_TEMPLATE
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Check if any config file already exists
|
|
123
|
-
*/
|
|
124
|
-
async function findExistingConfigFile() {
|
|
125
|
-
for (const filename of [
|
|
126
|
-
".keqrc",
|
|
127
|
-
".keqrc.ts",
|
|
128
|
-
".keqrc.js",
|
|
129
|
-
".keqrc.mjs",
|
|
130
|
-
".keqrc.cjs",
|
|
131
|
-
".keqrc.json",
|
|
132
|
-
".keqrc.yml",
|
|
133
|
-
".keqrc.yaml",
|
|
134
|
-
"keq.config.ts",
|
|
135
|
-
"keq.config.js",
|
|
136
|
-
"keq.config.mjs",
|
|
137
|
-
"keq.config.cjs",
|
|
138
|
-
"keq.config.json",
|
|
139
|
-
"keq.config.yml",
|
|
140
|
-
"keq.config.yaml"
|
|
141
|
-
]) {
|
|
142
|
-
const filePath = path.join(process.cwd(), filename);
|
|
143
|
-
if (await fs_extra.pathExists(filePath)) return filename;
|
|
144
|
-
}
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
async function initConfig(options) {
|
|
148
|
-
try {
|
|
149
|
-
const existingConfig = await findExistingConfigFile();
|
|
150
|
-
if (existingConfig && !options.force) {
|
|
151
|
-
require_logger.logger.error(`Config file already exists: ${existingConfig}`);
|
|
152
|
-
require_logger.logger.error("Use --force to overwrite");
|
|
153
|
-
process.exit(1);
|
|
154
|
-
}
|
|
155
|
-
const { filename, content } = await getConfigFileInfo();
|
|
156
|
-
const filePath = path.join(process.cwd(), filename);
|
|
157
|
-
await fs_extra.writeFile(filePath, content, "utf8");
|
|
158
|
-
require_logger.logger.log(`Created config file: ${filename}`);
|
|
159
|
-
console.log("\nNext steps:");
|
|
160
|
-
console.log("1. Edit the config file to add your OpenAPI/Swagger document URLs");
|
|
161
|
-
console.log("2. Run \"keq build\" to generate API client code");
|
|
162
|
-
} catch (error) {
|
|
163
|
-
require_logger.logger.error(error instanceof Error ? error.message : String(error));
|
|
164
|
-
process.exit(1);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
//#endregion
|
|
168
|
-
exports.initConfig = initConfig;
|
|
169
|
-
|
|
170
|
-
//# sourceMappingURL=init-DqxLcRSQ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-DqxLcRSQ.cjs","names":["fs"],"sources":["../src/init.ts"],"sourcesContent":["import * as fs from 'fs-extra'\nimport * as path from 'path'\nimport { logger } from './utils/logger.js'\n\n\ninterface InitOptions {\n force?: boolean\n}\n\nconst TS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'\n\nexport default defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n fileNamingStyle: FileNamingStyle.kebabCase,\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\nconst JS_CONFIG_TEMPLATE = `const { defineConfig } = require('@keq-request/cli')\n\nmodule.exports = defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n // Options: 'camelCase', 'capitalCase', 'constantCase', 'dotCase', 'headerCase',\n // 'noCase', 'paramCase', 'pascalCase', 'pathCase', 'sentenceCase',\n // 'snakeCase', 'kebabCase'\n fileNamingStyle: 'kebabCase',\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\nconst MJS_CONFIG_TEMPLATE = `import { defineConfig, FileNamingStyle } from '@keq-request/cli'\n\nexport default defineConfig({\n // Output directory for generated files\n outdir: './apis',\n\n // Rendering options for code generation\n rendering: {\n // File naming style for generated files\n fileNamingStyle: FileNamingStyle.kebabCase,\n },\n\n // OpenAPI/Swagger document sources\n modules: {\n // Example: petstore: 'https://petstore3.swagger.io/api/v3/openapi.json'\n },\n\n // Plugins to extend code generation functionality\n plugins: [],\n})\n`\n\n/**\n * Check if a file exists in the current directory or any parent directory\n */\nasync function findFileInParents(filename: string, startDir: string = process.cwd()): Promise<string | null> {\n let currentDir = startDir\n\n while (true) {\n const filePath = path.join(currentDir, filename)\n if (await fs.pathExists(filePath)) {\n return filePath\n }\n\n const parentDir = path.dirname(currentDir)\n // Reached the root directory\n if (parentDir === currentDir) {\n return null\n }\n currentDir = parentDir\n }\n}\n\n/**\n * Detect if project uses TypeScript by checking for tsconfig.json\n */\nasync function detectTypeScript(): Promise<boolean> {\n const tsconfigPath = await findFileInParents('tsconfig.json')\n return tsconfigPath !== null\n}\n\n/**\n * Detect project module system from package.json\n */\nasync function detectModuleSystem(): Promise<'esm' | 'cjs'> {\n const packageJsonPath = await findFileInParents('package.json')\n\n if (packageJsonPath) {\n try {\n const packageJson = await fs.readJson(packageJsonPath)\n if (packageJson.type === 'module') {\n return 'esm'\n }\n } catch (error) {\n // Ignore JSON parse errors\n }\n }\n\n return 'cjs'\n}\n\n/**\n * Get the appropriate config filename and content based on project setup\n */\nasync function getConfigFileInfo(): Promise<{ filename: string; content: string }> {\n const hasTypeScript = await detectTypeScript()\n const moduleSystem = await detectModuleSystem()\n\n if (hasTypeScript) {\n return {\n filename: '.keqrc.ts',\n content: TS_CONFIG_TEMPLATE,\n }\n }\n\n if (moduleSystem === 'esm') {\n return {\n filename: '.keqrc.mjs',\n content: MJS_CONFIG_TEMPLATE,\n }\n }\n\n return {\n filename: '.keqrc.js',\n content: JS_CONFIG_TEMPLATE,\n }\n}\n\n/**\n * Check if any config file already exists\n */\nasync function findExistingConfigFile(): Promise<string | null> {\n const possibleConfigFiles = [\n '.keqrc',\n\n '.keqrc.ts',\n '.keqrc.js',\n '.keqrc.mjs',\n '.keqrc.cjs',\n '.keqrc.json',\n '.keqrc.yml',\n '.keqrc.yaml',\n\n 'keq.config.ts',\n 'keq.config.js',\n 'keq.config.mjs',\n 'keq.config.cjs',\n 'keq.config.json',\n 'keq.config.yml',\n 'keq.config.yaml',\n ]\n\n for (const filename of possibleConfigFiles) {\n const filePath = path.join(process.cwd(), filename)\n if (await fs.pathExists(filePath)) {\n return filename\n }\n }\n\n return null\n}\n\nexport async function initConfig(options: InitOptions): Promise<void> {\n try {\n // Check for existing config file\n const existingConfig = await findExistingConfigFile()\n\n if (existingConfig && !options.force) {\n logger.error(`Config file already exists: ${existingConfig}`)\n logger.error('Use --force to overwrite')\n process.exit(1)\n }\n\n // Get config file info based on project setup\n const { filename, content } = await getConfigFileInfo()\n const filePath = path.join(process.cwd(), filename)\n\n // Write config file\n await fs.writeFile(filePath, content, 'utf8')\n\n logger.log(`Created config file: ${filename}`)\n\n // Print helpful next steps\n console.log('\\nNext steps:')\n console.log('1. Edit the config file to add your OpenAPI/Swagger document URLs')\n console.log('2. Run \"keq build\" to generate API client code')\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;AASA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;AAsB3B,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;AAyB3B,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;AAyB5B,eAAe,kBAAkB,UAAkB,WAAmB,QAAQ,KAAK,EAA0B;CAC3G,IAAI,aAAa;AAEjB,QAAO,MAAM;EACX,MAAM,WAAW,KAAK,KAAK,YAAY,SAAS;AAChD,MAAI,MAAMA,SAAG,WAAW,SAAS,CAC/B,QAAO;E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,WAAW;AAG9C,UAAQ,IAAI,gBAAgB;AAC5B,UAAQ,IAAI,oEAAoE;AAChF,UAAQ,IAAI,mDAAiD;UACtD,OAAO;AACd,iBAAA,OAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AACpE,UAAQ,KAAK,EAAE"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
|
-
let chalk = require("chalk");
|
|
24
|
-
chalk = __toESM(chalk, 1);
|
|
25
|
-
//#region src/utils/logger.ts
|
|
26
|
-
const logger = {
|
|
27
|
-
log: (str) => console.log(chalk.default.green(str)),
|
|
28
|
-
raw: (str) => console.log(str),
|
|
29
|
-
warn: (str) => console.warn(chalk.default.yellow(str)),
|
|
30
|
-
error: (str) => console.error(chalk.default.red(str))
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
Object.defineProperty(exports, "__toESM", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function() {
|
|
36
|
-
return __toESM;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "logger", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function() {
|
|
42
|
-
return logger;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=logger-D7PyVZo3.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger-D7PyVZo3.cjs","names":[],"sources":["../src/utils/logger.ts"],"sourcesContent":["import chalk from 'chalk'\n\n\nexport const logger = {\n log: (str: string) => console.log(chalk.green(str)),\n raw: (str: string) => console.log(str),\n warn: (str: string) => console.warn(chalk.yellow(str)),\n error: (str: string) => console.error(chalk.red(str)),\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,SAAS;CACpB,MAAM,QAAgB,QAAQ,IAAI,MAAA,QAAM,MAAM,IAAI,CAAC;CACnD,MAAM,QAAgB,QAAQ,IAAI,IAAI;CACtC,OAAO,QAAgB,QAAQ,KAAK,MAAA,QAAM,OAAO,IAAI,CAAC;CACtD,QAAQ,QAAgB,QAAQ,MAAM,MAAA,QAAM,IAAI,IAAI,CAAC;CACtD"}
|