{"version":3,"file":"plugins-DYBHdcBs.mjs","names":["MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","path","CommentRenderer","CommentRenderer","CommentRenderer","CommentRenderer","path","MetadataStorage","MetadataStorage","path","MetadataStorage","path","MetadataStorage","path","MetadataStorage","RequestGenerator","MetadataStorage","path","RequestGenerator","RequestGenerator","MetadataStorage","MetadataStorage","MetadataStorage","path","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","path","MetadataStorage","MetadataStorage","path","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","fs","path","MetadataStorage","MetadataStorage","execFileAsync","DEFAULT_TIMEOUT_MS","DEFAULT_MAX_BUFFER","path","fs","MetadataStorage","MetadataStorage","path","fs","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage","MetadataStorage"],"sources":["../src/constants/file-naming-style.ts","../src/constants/qs-array-format.ts","../src/constants/supported-methods.ts","../src/models/plugin-metadata-storage.ts","../src/plugins/eslint/constants/metadata-storage.ts","../src/plugins/eslint/eslint.plugin.ts","../src/plugins/prettier/constants/metadata-storage.ts","../src/plugins/prettier/prettier.plugin.ts","../src/utils/json-schema-utils/is-array.ts","../src/utils/json-schema-utils/is-mixed.ts","../src/utils/json-schema-utils/is-non-array.ts","../src/utils/json-schema-utils/is-ref.ts","../src/utils/json-schema-utils/index.ts","../src/plugins/generate-micro-function/constants/metadata-storage.ts","../src/models/anchor.ts","../src/models/artifact.ts","../src/models/module-definition.ts","../src/utils/is-keywords.ts","../src/utils/is-reserved-word.ts","../src/models/schema-definition.ts","../src/models/response-definition.ts","../src/models/operation-definition.ts","../src/models/api-document_v3_1.ts","../src/models/asset.ts","../src/transformers/json-schema/comment.renderer.ts","../src/utils/indent.ts","../src/transformers/json-schema/reference.transformer.ts","../src/transformers/json-schema/declaration.renderer.ts","../src/transformers/json-schema/valibot.renderer.ts","../src/transformers/json-schema/json-schema.transformer.ts","../src/transformers/schema-definition/schema-definition.transformer.ts","../src/utils/import-alias-manager.ts","../src/transformers/response-definition/response-definition.transformer.ts","../src/transformers/operation-definition/comment.renderer.ts","../src/transformers/operation-definition/utils/type-name-factory.ts","../src/transformers/operation-definition/utils/rewrite-additional-properties-for-parameter.ts","../src/utils/openapi-utils/dereference.ts","../src/utils/openapi-utils/is-ref-defined.ts","../src/utils/openapi-utils/remove-undefined-ref.ts","../src/utils/openapi-utils/dereference-operation.ts","../src/utils/openapi-utils/dereference-deep.ts","../src/utils/openapi-utils/to-3_1.ts","../src/utils/openapi-utils/map-operation.ts","../src/utils/openapi-utils/map-parameter.ts","../src/utils/openapi-utils/map-schema.ts","../src/utils/openapi-utils/index.ts","../src/transformers/operation-definition/declaration.renders.ts","../src/transformers/operation-definition/modular-declaration.renderer.ts","../src/utils/to-safe-identifier.ts","../src/exception.ts","../src/transformers/operation-definition/typescript-snippet.ts","../src/transformers/operation-definition/micro-function.renderer.ts","../src/transformers/operation-definition/nestjs-method.renderer.ts","../src/transformers/operation-definition/isolated.renderer.ts","../src/transformers/operation-definition/operation-definition.transformer.ts","../src/transformers/entrypoint/entrypoint.transformer.ts","../src/transformers/api-document/nestjs-client.renderer.ts","../src/transformers/api-document/nestjs-module.renderer.ts","../src/transformers/api-document/api-document.transformer.ts","../src/utils/convert-filename.ts","../src/plugins/generate-declaration/constants/metadata-storage.ts","../src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts","../src/plugins/generate-declaration/generators/response-declaration/response.generator.ts","../src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts","../src/plugins/generate-declaration/generate-declaration.plugin.ts","../src/plugins/generate-micro-function/generators/request/request.generator.ts","../src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts","../src/plugins/generate-micro-function/generate-micro-function.plugin.ts","../src/plugins/generate-isolated/constants/metadata-storage.ts","../src/plugins/generate-isolated/generators/request/request.generator.ts","../src/plugins/generate-isolated/generators/isolated-operation/isolated-operation.generator.ts","../src/plugins/generate-isolated/generate-isolated.plugin.ts","../src/plugins/body-fallback/constants/metadata-storage.ts","../src/plugins/body-fallback/index.ts","../src/plugins/use-valibot/constants/metadata-storage.ts","../src/plugins/use-valibot/use-valibot.plugin.ts","../src/plugins/generate-nestjs-module/constants/metadata-storage.ts","../src/plugins/generate-nestjs-module/generators/nestjs-module.generator.ts","../src/plugins/generate-nestjs-module/generate-nestjs-module.ts","../src/plugins/chinese-to-pinyin/constants/metadata-storage.ts","../src/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.ts","../src/plugins/download-http-file/constants/metadata-storage.ts","../src/plugins/download-http-file/download-http-file.plugin.ts","../src/plugins/download-local-file/constants/metadata-storage.ts","../src/plugins/download-local-file/download-local-file.plugin.ts","../src/plugins/download-by-bash/constants/metadata-storage.ts","../src/plugins/download-by-bash/download-by-bash.plugin.ts","../src/plugins/download-by-sh/constants/metadata-storage.ts","../src/plugins/download-by-sh/download-by-sh.plugin.ts","../src/plugins/shaking/constants/metadata-storage.ts","../src/plugins/shaking/shaking.plugin.ts","../src/plugins/terminal-select/utils/select-operation-definitions.ts","../src/plugins/terminal-select/constants/metadata-storage.ts","../src/plugins/terminal-select/terminal-select.plugin.ts","../src/plugins/clean/clean.plugin.ts","../src/plugins/initialize/initialize.plugin.ts","../src/plugins/overwrite-operation-id/overwrite-operation-id.plugin.ts","../src/plugins/overwrite-schema-name/overwrite-schema-name.plugin.ts","../src/plugins/overwrite-query-options/overwrite-query-options.plugin.ts","../src/plugins/overwrite-additional-properties/constants/metadata-storage.ts","../src/plugins/overwrite-additional-properties/overwrite-additional-properties.plugin.ts","../src/plugins/lint-schema/lint-schema.plugin.ts","../src/plugins/springdoc-compat/springdoc-compat.plugin.ts","../src/plugins/mock/mock.plugin.ts"],"sourcesContent":["/**\n * File naming style options\n */\nexport enum FileNamingStyle {\n  /** Raw style - keeps the original name without any transformation */\n  raw = 'raw',\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","export enum QsArrayFormat {\n  brackets = 'brackets',\n  indices = 'indices',\n  repeat = 'repeat',\n  comma = 'comma',\n  space = 'space',\n  pipe = 'pipe',\n}\n","export const SupportedMethods = [\n  'get',\n  'post',\n  'put',\n  'delete',\n  'patch',\n  'head',\n  'options',\n]\n","import { Compiler } from '~/compiler/index.js'\n\n\n/**\n * A WeakMap-backed metadata storage for plugins.\n *\n * When a `key` is provided, the underlying WeakMap is stored in `globalThis` via\n * `Symbol.for(key)`, ensuring the same instance is shared across CJS and ESM module\n * boundaries. This is required for plugins that are imported by user config files\n * (e.g. via `@keq-request/cli/plugins`) and need to interoperate with the CLI's\n * internal plugins.\n *\n * When no `key` is provided, a plain `new WeakMap()` is used, which is sufficient\n * for plugins that always run within the same module system.\n */\nexport class PluginMetadataStorage<V> {\n  private readonly storage: WeakMap<Compiler, V>\n\n  constructor(key?: string) {\n    if (key !== undefined) {\n      const storageKey = Symbol.for(key)\n      const g = globalThis as Record<symbol, unknown>\n      if (!g[storageKey]) {\n        g[storageKey] = new WeakMap<Compiler, V>()\n      }\n      this.storage = g[storageKey] as WeakMap<Compiler, V>\n    } else {\n      this.storage = new WeakMap<Compiler, V>()\n    }\n  }\n\n  has(key: Compiler): boolean {\n    return this.storage.has(key)\n  }\n\n  get(key: Compiler): V | undefined {\n    return this.storage.get(key)\n  }\n\n  set(key: Compiler, value: V): this {\n    this.storage.set(key, value)\n    return this\n  }\n\n  delete(key: Compiler): boolean {\n    return this.storage.delete(key)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface EslintPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<EslintPluginMetadata>(\n  '@keq-request/cli:EslintPlugin:MetadataStorage',\n)\n","import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { ESLint } from 'eslint'\nimport { EslintPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\ninterface EslintPluginOptions {\n  /**\n   * List of ESLint rules to disable\n   */\n  disable?: string[]\n}\n\nexport class EslintPlugin implements Plugin {\n  constructor(private options: EslintPluginOptions = {}) {}\n\n\n  apply(compiler: Compiler): void {\n    if (!compiler.options.build) return\n\n    // Prevent duplicate registration by checking applied flag\n    const metadata = EslintPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    if (this.options.disable && this.options.disable.length > 0) {\n      const $rules = [\n        ...this.options.disable.map((rule) => `/* eslint-disable ${rule} */`),\n      ].join('\\n')\n\n      compiler.hooks.afterCompile.tap(EslintPlugin.name, () => {\n        const artifacts = compiler.context.artifacts || []\n\n        for (const artifact of artifacts) {\n          artifact.anchor.append('file:start', $rules)\n        }\n      })\n    }\n\n    compiler.hooks.afterPersist.tapPromise(EslintPlugin.name, async (task) => {\n      const files = compiler.context.assets || []\n      if (files.length === 0) return\n\n      const eslint = new ESLint({ fix: true })\n      const results = await eslint.lintFiles(files.map((file) => file.path))\n      await ESLint.outputFixes(results)\n    })\n  }\n\n  static register(compiler: Compiler): EslintPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: { },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): EslintPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface PrettierPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<PrettierPluginMetadata>(\n  '@keq-request/cli:PrettierPlugin:MetadataStorage',\n)\n","import { Compiler } from '~/compiler/compiler.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { exec } from 'child_process'\nimport { promisify } from 'util'\nimport { PrettierPluginMetadata, MetadataStorage } from './constants/index.js'\n\nconst execAsync = promisify(exec)\n\n\nexport class PrettierPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    if (!compiler.options.build) return\n\n    // Prevent duplicate registration by checking applied flag\n    const metadata = PrettierPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.afterPersist.tapPromise(PrettierPlugin.name, async () => {\n      const files = compiler.context.assets || []\n      if (files.length === 0) return\n\n      const filePaths = files.map((file) => file.path).join(' ')\n      await execAsync(`prettier --write ${filePaths}`)\n    })\n  }\n\n  static register(compiler: Compiler): PrettierPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n        },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): PrettierPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.ArraySchemaObject {\n  return schema.type === 'array'\n}\n","\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\n\nexport function isMixed(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is MixedSchemaObject {\n  return Array.isArray(schema.type)\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function isNonArray(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): schema is OpenAPIV3_1.NonArraySchemaObject {\n  return typeof schema.type === 'string' && schema.type !== 'array'\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function isRef(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject): schema is OpenAPIV3_1.ReferenceObject {\n  return '$ref' in schema\n}\n","import { isArray } from './is-array.js'\nimport { isMixed } from './is-mixed.js'\nimport { isNonArray } from './is-non-array.js'\nimport { isRef } from './is-ref.js'\n\n\nexport class JsonSchemaUtils {\n  static isRef = isRef\n  static isArray = isArray\n  static isNonArray = isNonArray\n  static isMixed = isMixed\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\nexport interface GenerateMicroFunctionPluginMetadata {\n  applied: boolean\n  hooks: {\n    afterEntrypointArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>\n    afterMicroFunctionArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>\n  }\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<GenerateMicroFunctionPluginMetadata>(\n  '@keq-request/cli:GenerateMicroFunctionPlugin:MetadataStorage',\n)\n","import type { Artifact } from './artifact.js'\n\nclass AnchorBlock {\n  constructor(\n    private artifact: Artifact,\n  ) {}\n\n  /**\n   * Append content to the end of the anchor block.\n   */\n  append(anchorName: string, content: string): void {\n    const lines = this.artifact.content.split('\\n')\n\n    const anchor = `@anchor:${anchorName}:end`\n    const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n    if (anchorIndex === -1) {\n      throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n    }\n\n    lines.splice(anchorIndex, 0, content)\n    this.artifact.content = lines.join('\\n')\n  }\n\n  prepend(anchorName: string, content: string): void {\n    const lines = this.artifact.content.split('\\n')\n\n    const anchor = `@anchor:${anchorName}:start`\n    const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n    if (anchorIndex === -1) {\n      throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n    }\n\n    lines.splice(anchorIndex + 1, 0, content)\n    this.artifact.content = lines.join('\\n')\n  }\n\n  replace(anchorName: string, content: string): void {\n    const lines = this.artifact.content.split('\\n')\n    const startIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:start */`))\n    const endIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:end */`))\n\n    if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {\n      throw new Error(`\"@anchor:${anchorName}:start\" or \"@anchor:${anchorName}:end\" not found in artifact \"${this.artifact.filepath}\".`)\n    }\n\n    lines.splice(startIndex + 1, endIndex - startIndex - 1, content)\n    this.artifact.content = lines.join('\\n')\n  }\n}\n\n\nexport class Anchor {\n  block: AnchorBlock\n\n  constructor(\n    private artifact: Artifact,\n  ) {\n    this.block = new AnchorBlock(artifact)\n  }\n\n  append(anchorName: string, content: string): void {\n    const lines = this.artifact.content.split('\\n')\n\n    const anchor = `@anchor:${anchorName}`\n    const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n    if (anchorIndex === -1) {\n      throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n    }\n\n    lines.splice(anchorIndex + 1, 0, content)\n    this.artifact.content = lines.join('\\n')\n  }\n\n  prepend(anchorName: string, content: string): void {\n    const lines = this.artifact.content.split('\\n')\n\n    const anchor = `@anchor:${anchorName}`\n    const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`))\n\n    if (anchorIndex === -1) {\n      throw new Error(`\"${anchor}\" not found in artifact \"${this.artifact.filepath}\".`)\n    }\n\n    lines.splice(anchorIndex, 0, content)\n    this.artifact.content = lines.join('\\n')\n  }\n}\n","import * as path from 'path'\nimport { Anchor } from './anchor.js'\n\n\nconst HeaderComment = [\n  '// Code generated by @keq-request/cli. DO NOT EDIT.',\n  '// Code generated by @keq-request/cli. DO NOT EDIT.',\n  '// Code generated by @keq-request/cli. DO NOT EDIT.',\n].join('\\n')\n\nexport class Artifact {\n  id: string\n  filepath: string\n  content: string\n  extensionName\n  anchor = new Anchor(this)\n\n  constructor(options: {\n    id: string\n    filepath: string\n    content: string\n    extensionName?: string\n  }) {\n    this.id = options.id\n    this.filepath = options.filepath\n    this.extensionName = options.extensionName || path.extname(options.filepath)\n    this.content = options.content\n  }\n\n  get dirname(): string {\n    return path.dirname(this.filepath)\n  }\n\n  renderer(): string {\n    return `${HeaderComment}\\n${this.content}`\n  }\n}\n","import { Address } from '~/types/address.js'\n\n\nexport class ModuleDefinition {\n  name: string\n  address: Address\n\n  constructor(name: string, address: string | Address) {\n    this.name = name\n\n    if (typeof address === 'string') {\n      this.address = { url: address, headers: {}, encoding: 'utf8' }\n    } else {\n      this.address = address\n    }\n  }\n\n  static unknown(): ModuleDefinition {\n    return new ModuleDefinition('', { url: '', headers: {}, encoding: 'utf8' })\n  }\n}\n","const keywords = [\n  'break',\n  'case',\n  'catch',\n  'continue',\n  'default',\n  'delete',\n  'do',\n  'else',\n  'finally',\n  'for',\n  'function',\n  'if',\n  'in',\n  'instanceof',\n  'new',\n  'return',\n  'switch',\n  'this',\n  'throw',\n  'try',\n  'typeof',\n  'var',\n  'void',\n  'while',\n  'with',\n]\n\nexport function isKeywords(str: string): boolean {\n  return keywords.includes(str)\n}\n","\nconst reservedWords = [\n  'abstract',\n  'boolean',\n  'byte',\n  'char',\n  'class',\n  'const',\n  'debugger',\n  'double',\n  'enum',\n  'export',\n  'extends',\n  'final',\n  'float',\n  'goto',\n  'implements',\n  'import',\n  'int',\n  'interface',\n  'long',\n  'native',\n  'package',\n  'private',\n  'protected',\n  'public',\n  'short',\n  'static',\n  'super',\n  'synchronized',\n  'throws',\n  'transient',\n  'volatile',\n]\n\nexport function isReservedWord(str: string): boolean {\n  return reservedWords.includes(str)\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { JSONPath } from 'jsonpath-plus'\nimport { ApiDocumentV3_1 } from './api-document_v3_1.js'\n\n\nexport class SchemaDefinition {\n  readonly name: string\n  readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject\n  readonly module: ModuleDefinition\n  readonly document: ApiDocumentV3_1\n\n  get id(): string {\n    return `${this.module.address.url}#/components/schemas/${this.name}`\n  }\n\n  constructor(args: {\n    name: string\n    schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject\n    module: ModuleDefinition\n    document: ApiDocumentV3_1\n  }) {\n    this.module = args.module\n    this.name = args.name\n    this.schema = args.schema\n    this.document = args.document\n  }\n\n  getDependencies(): SchemaDefinition[] {\n    const refs: string[] = R.uniq(JSONPath({\n      path: \"$..*['$ref']\",\n      json: this.schema,\n    }))\n\n    return refs\n      .filter((ref) => typeof ref === 'string' && !!ref.trim())\n      .map((ref) => {\n        const definition = this.document.dereference(ref)\n        if (definition instanceof SchemaDefinition) return definition\n\n        return SchemaDefinition.unknown()\n      })\n      .filter((dep) => dep.id !== this.id)\n  }\n\n  static unknown(): SchemaDefinition {\n    return new SchemaDefinition({\n      name: '',\n      schema: {},\n      module: ModuleDefinition.unknown(),\n      document: ApiDocumentV3_1.unknown(),\n    })\n  }\n\n  static isUnknown(definition: SchemaDefinition): boolean {\n    return definition.name === ''\n  }\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { JSONPath } from 'jsonpath-plus'\nimport { ApiDocumentV3_1 } from './api-document_v3_1.js'\nimport { SchemaDefinition } from './schema-definition.js'\n\n\nexport class ResponseDefinition {\n  readonly name: string\n  readonly response: OpenAPIV3_1.ResponseObject\n  readonly module: ModuleDefinition\n  readonly document: ApiDocumentV3_1\n\n  get id(): string {\n    return `${this.module.address.url}#/components/responses/${this.name}`\n  }\n\n  constructor(args: {\n    name: string\n    response: OpenAPIV3_1.ResponseObject\n    module: ModuleDefinition\n    document: ApiDocumentV3_1\n  }) {\n    this.module = args.module\n    this.name = args.name\n    this.response = args.response\n    this.document = args.document\n  }\n\n  getDependencies(): SchemaDefinition[] {\n    const refs: string[] = R.uniq(JSONPath({\n      path: \"$.content..schema..$['$ref']\",\n      json: this.response,\n    }))\n\n    return refs\n      .filter((ref) => typeof ref === 'string' && !!ref.trim())\n      .map((ref) => {\n        const definition = this.document.dereference(ref)\n        if (definition instanceof SchemaDefinition) return definition\n\n        return SchemaDefinition.unknown()\n      })\n      .filter((dep) => dep.id !== this.id)\n  }\n\n  static unknown(): ResponseDefinition {\n    return new ResponseDefinition({\n      name: '',\n      response: { description: '' },\n      module: ModuleDefinition.unknown(),\n      document: ApiDocumentV3_1.unknown(),\n    })\n  }\n\n  static isUnknown(definition: ResponseDefinition): boolean {\n    return definition.name === ''\n  }\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { isKeywords } from '~/utils/is-keywords.js'\nimport { isReservedWord } from '~/utils/is-reserved-word.js'\nimport { ApiDocumentV3_1 } from './api-document_v3_1.js'\nimport { JSONPath } from 'jsonpath-plus'\nimport { SchemaDefinition } from './schema-definition.js'\nimport { ResponseDefinition } from './response-definition.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\n\n\nexport class OperationDefinition {\n  readonly module: ModuleDefinition\n\n  readonly operationId: string\n  readonly method: string\n  readonly pathname: string\n  readonly operation: OpenAPIV3_1.OperationObject\n  readonly document: ApiDocumentV3_1\n\n  get id(): string {\n    return `${this.module.address.url}#/paths/${this.pathname}/${this.method}`\n  }\n\n  constructor(args: {\n    method: string\n    pathname: string\n    operation: OpenAPIV3_1.OperationObject\n    module: ModuleDefinition\n    document: ApiDocumentV3_1\n  }) {\n    this.module = args.module\n    this.method = args.method.toLowerCase()\n    this.pathname = args.pathname\n    this.document = args.document\n    this.operationId = this.formatOperationId(args.method, args.pathname, args.operation)\n\n    this.operation = {\n      ...args.operation,\n      operationId: this.operationId,\n    }\n  }\n\n  private formatOperationId(method: string, pathname: string, operation: OpenAPIV3_1.OperationObject): string {\n    const operationId = operation.operationId\n\n    if (\n      operationId\n      && operationId !== 'index'\n      && !isKeywords(operationId)\n      && !isReservedWord(operationId)\n    ) {\n      return operationId as string\n    }\n\n    return `${method}_${pathname}`\n      .replace(/\\//g, '_')\n      .replace(/-/g, '_')\n      .replace(/:/g, '$$')\n      .replace(/{(.+)}/, '$$$1')\n  }\n\n  getDependencies(): SchemaDefinition[] {\n    const refs = R.uniq([\n      ...JSONPath<string>({\n        path: '$.requestBody.content..schema..$ref',\n        json: this.operation,\n      }),\n      ...JSONPath<string>({\n        path: '$.responses..content..schema..$ref',\n        json: this.operation,\n      }),\n      ...JSONPath<string>({\n        path: '$.parameters..schema..$ref',\n        json: this.operation,\n      }),\n    ])\n\n    const dependencies = refs\n      .filter((ref) => typeof ref === 'string' && ref)\n      .map((ref) => {\n        const definition = this.document.dereference(ref)\n        if (definition instanceof SchemaDefinition) return definition\n\n        return SchemaDefinition.unknown()\n      })\n\n    return dependencies\n  }\n\n  getResponseDependencies(): ResponseDefinition[] {\n    const responses = this.operation.responses || {}\n\n    return R.uniqBy(\n      (dep) => dep.id,\n      Object.values(responses)\n        .filter((response): response is OpenAPIV3_1.ReferenceObject => JsonSchemaUtils.isRef(response))\n        .map((response) => {\n          const definition = this.document.dereference(response.$ref)\n          if (definition instanceof ResponseDefinition) return definition\n\n          return ResponseDefinition.unknown()\n        })\n        .filter((dep) => !ResponseDefinition.isUnknown(dep)),\n    )\n  }\n}\n","import * as R from 'ramda'\nimport { createHash } from 'crypto'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ModuleDefinition } from './module-definition.js'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\nimport { OperationDefinition } from './operation-definition.js'\nimport { SchemaDefinition } from './schema-definition.js'\nimport { ResponseDefinition } from './response-definition.js'\nimport { logger } from '~/utils/logger.js'\n\n\nexport class ApiDocumentV3_1 {\n  readonly module: ModuleDefinition\n  readonly specification: OpenAPIV3_1.Document\n  readonly fingerprint: string\n\n  constructor(specification: OpenAPIV3_1.Document, module: ModuleDefinition, fingerprint?: string) {\n    this.module = module\n    this.specification = specification\n    this.fingerprint = fingerprint ?? createHash('md5').update(JSON.stringify(specification)).digest('hex')\n  }\n\n  get schemas(): SchemaDefinition[] {\n    const module = this.module\n\n    return Object.entries(this.specification.components?.schemas || {})\n      .map(([name, schema]) => new SchemaDefinition({\n        name,\n        schema,\n        module,\n        document: this,\n      }))\n  }\n\n  get responses(): ResponseDefinition[] {\n    const module = this.module\n\n    return Object.entries(this.specification.components?.responses || {})\n      .filter((entry): entry is [string, OpenAPIV3_1.ResponseObject] => {\n        const [, response] = entry\n        return typeof response === 'object' && !('$ref' in response)\n      })\n      .map(([name, response]) => new ResponseDefinition({\n        name,\n        response,\n        module,\n        document: this,\n      }))\n  }\n\n  get operations(): OperationDefinition[] {\n    const module = this.module\n\n    return Object.entries(this.specification.paths || {})\n      .flatMap(([pathname, pathItem]) => Object.entries(pathItem || {})\n        .filter(([method]) => SupportedMethods.includes(method.toLowerCase()))\n        .map(([method, operation]) => new OperationDefinition({\n          method,\n          pathname,\n          operation,\n          module,\n          document: this,\n        })))\n  }\n\n  isEmpty(): boolean {\n    return R.isEmpty(this.specification.paths)\n  }\n\n  dereference($ref: string): SchemaDefinition | ResponseDefinition | undefined {\n    if ($ref.startsWith('#/')) {\n      if ($ref.startsWith('#/components/responses/')) {\n        return this.responses.find((response) => response.id.endsWith($ref))\n      }\n\n      return this.schemas.find((schema) => schema.id.endsWith($ref))\n    }\n\n    logger.warn(`The $ref(${$ref}) is not defined in ${this.module.name} openapi/swagger.`)\n  }\n\n  isRefDefined($ref: string): boolean {\n    if ($ref.startsWith('#/')) {\n      const path = $ref.replace('#/', '').split('/')\n      return R.path(path, this.specification) !== undefined\n    }\n\n    return false\n  }\n\n  static unknown(): ApiDocumentV3_1 {\n    return new ApiDocumentV3_1({}, ModuleDefinition.unknown())\n  }\n}\n","export class Asset {\n  path: string\n\n  constructor(path: string) {\n    this.path = path\n  }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport class CommentRenderer implements Renderer {\n  constructor(\n    private readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n  ) {}\n\n  render(): string {\n    const schema = this.schema\n\n    const lines = ['/**']\n\n    if (schema.description) {\n      const description = schema.description\n        .replace('*/', '*\\\\/')\n        .replace(/\\t/g, '  ')\n        .replace(/\\r\\n?/g, '\\n')\n\n      lines.push(...description.split('\\n').map((line) => ` * ${line.trimEnd()}`))\n    }\n\n    if (schema.deprecated) {\n      lines.push(' * @deprecated')\n    }\n\n    if (schema.readOnly) {\n      lines.push(' * @readonly')\n    }\n\n    if (schema.format) {\n      lines.push(` * @format ${schema.format}`)\n    }\n\n    lines.push(' */')\n\n    if (lines.length === 2) return ''\n    return lines.join('\\n')\n  }\n}\n","export function indent(space: number, text: string): string {\n  if (text === '') return ''\n\n  const indentation = ' '.repeat(space)\n  return text.split('\\n')\n    .map((line) => (line ? `${indentation}${line}` : line))\n    .join('\\n')\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport class ReferenceTransformer {\n  static toDeclaration(schema: OpenAPIV3_1.ReferenceObject, alias: (name: string) => string = R.identity): string {\n    if (!schema.$ref || !schema.$ref.startsWith('#')) return `unknown /* ${schema.$ref.replace('*/', '*\\\\/')} */`\n\n    const parts: string[] = schema.$ref.split('/')\n    // return parts[parts.length - 1] || 'unknown'\n\n    return alias(parts[parts.length - 1]) || 'unknown'\n  }\n\n  /**\n   * Render the case where the $ref target does not exist\n   */\n  static toNotFoundDeclaration(schema: OpenAPIV3_1.ReferenceObject, hint?: string): string {\n    const safeRef = schema.$ref.replace('*/', '*\\\\/')\n    const message = hint\n      ? `Cannot find $ref \"${safeRef}\". ${hint}`\n      : `Cannot find $ref \"${safeRef}\"`\n    return `unknown /* ${message} */`\n  }\n\n  /**\n   * Render the case where the $ref format is invalid\n   */\n  static toInvalidDeclaration(schema: OpenAPIV3_1.ReferenceObject, hint?: string): string {\n    const safeRef = schema.$ref.replace('*/', '*\\\\/')\n    const message = hint\n      ? `Invalid $ref \"${safeRef}\". ${hint}`\n      : `Invalid $ref \"${safeRef}\"`\n    return `unknown /* ${message} */`\n  }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { ReferenceTransformer } from './reference.transformer.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport interface JsonSchemaDeclarationRendererOptions {\n  /**\n   * Custom renderer for `$ref` reference objects in TypeScript type declarations.\n   *\n   * When not provided, defaults to `ReferenceTransformer.toDeclaration`,\n   * which converts the `$ref` path to a type name.\n   *\n   * @example\n   * // Default behavior (without referenceTransformer):\n   * // { $ref: '#/components/schemas/User' } → 'User'\n   *\n   * @example\n   * // Custom transformer with alias mapping to avoid type name conflicts:\n   * // Given aliases = { '#/components/schemas/User': 'UserV2' }\n   * // { $ref: '#/components/schemas/User' } → 'UserV2'\n   * const renderer = new DeclarationRenderer(schema, {\n   *   referenceTransformer: (ref) => aliases.get(ref.$ref) ?? ReferenceTransformer.toDeclaration(ref),\n   * })\n   */\n  referenceTransformer?: (schema: OpenAPIV3_1.ReferenceObject) => string\n\n  /**\n   * Controls how `additionalProperties: true` (or undefined) is rendered.\n   * @default 'unknown'\n   */\n  additionalPropertiesType?: 'unknown' | 'any'\n}\n\nexport class DeclarationRenderer implements Renderer {\n  constructor(\n    private readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n    private readonly options: JsonSchemaDeclarationRendererOptions = {},\n  ) {\n  }\n\n  render(): string {\n    return this.renderSchema(this.schema)\n  }\n\n  private renderSchema(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): string {\n    if (typeof schema === 'boolean') return 'unknown'\n\n    if (JsonSchemaUtils.isRef(schema)) return this.renderReference(schema)\n    if (JsonSchemaUtils.isMixed(schema)) return this.renderMixed(schema)\n    if (JsonSchemaUtils.isArray(schema)) return this.renderArray(schema)\n\n    if (schema.type === 'object') return this.renderObject(schema)\n    if (schema.enum) return this.renderEnum(schema)\n    if (schema.oneOf) return this.renderOneOf(schema)\n    if (schema.anyOf) return this.renderAnyOf(schema)\n    if (schema.allOf) return this.renderAllOf(schema)\n    if (schema.type === 'string') return this.renderString(schema)\n    if (schema.type === 'number') return this.renderNumber(schema)\n    if (schema.type === 'boolean') return this.renderBoolean(schema)\n    if (schema.type === 'null') return this.renderNull(schema)\n    if (schema.type === 'integer') return this.renderInteger(schema)\n\n    return 'unknown'\n  }\n\n\n  private renderMixed(schema: MixedSchemaObject): string {\n    if (Array.isArray(schema.type)) {\n      return schema.type\n        .map((type): (OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject) => ({ ...schema, type }))\n        .map((schema) => this.renderSchema(schema))\n        .join(' | ')\n    }\n\n    return 'unknown'\n  }\n\n  private renderReference(schema: OpenAPIV3_1.ReferenceObject): string {\n    if (!this.options.referenceTransformer) {\n      return ReferenceTransformer.toDeclaration(schema)\n    }\n\n    return this.options.referenceTransformer(schema)\n  }\n\n  private renderArray(schema: OpenAPIV3_1.ArraySchemaObject): string {\n    if (schema.items && Array.isArray(schema.items)) {\n      const items = schema.items.map((s) => this.renderSchema(s)).join(', ')\n      return `[${items}]`\n    }\n\n    if (schema.items && typeof schema.items === 'object') {\n      return `${this.renderSchema(schema.items)}[]`\n    }\n\n    return 'any[]'\n  }\n\n\n  private renderObject(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    const hasProperties = schema.properties && !R.isEmpty(schema.properties)\n\n    const apType = this.options.additionalPropertiesType ?? 'unknown'\n\n    // No named properties: produce Record<K, V> forms\n    if (!hasProperties) {\n      if (schema.additionalProperties === false) {\n        return 'Record<string, never>'\n      }\n\n      if (typeof schema.additionalProperties === 'object') {\n        return `Record<string, ${this.renderSchema(schema.additionalProperties)}>`\n      }\n\n      // additionalProperties true or undefined (implicit open object per OpenAPI 3.1 spec)\n      return `Record<string, ${apType}>`\n    }\n\n    // Has named properties: render as object literal\n    const $properties = Object.entries(schema.properties || {})\n      .map(([propertyName, propertySchema]) => {\n        let $comment = new CommentRenderer(propertySchema).render()\n        if ($comment) $comment += '\\n'\n\n        const $key = `\"${propertyName}\"${schema.required?.includes(propertyName) ? '' : '?'}`\n        const $value = this.renderSchema(propertySchema)\n\n        return indent(2, `${$comment}${$key}: ${$value}`)\n      })\n\n    // Add index signature when additionalProperties is not false\n    if (schema.additionalProperties !== false) {\n      if (typeof schema.additionalProperties === 'object') {\n        $properties.push(indent(2, `[key: string]: ${this.renderSchema(schema.additionalProperties)}`))\n      } else {\n        // additionalProperties true or undefined (implicit open object per OpenAPI 3.1 spec)\n        $properties.push(indent(2, `[key: string]: ${apType}`))\n      }\n    }\n\n    return [\n      '{',\n      ...$properties,\n      '}',\n    ].join('\\n')\n  }\n\n  private renderOneOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.oneOf) return 'unknown'\n\n    return schema.oneOf.map((s) => this.renderSchema(s)).join(' | ')\n  }\n\n  private renderAnyOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.anyOf) return 'unknown'\n\n    return schema.anyOf.map((s) => this.renderSchema(s)).join(' | ')\n  }\n\n  private renderAllOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.allOf) return 'unknown'\n\n    return schema.allOf.map((s) => this.renderSchema(s)).join(' & ')\n  }\n\n  private renderEnum(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.enum) return 'unknown'\n    return `(${schema.enum.map((v) => JSON.stringify(v)).join(' | ')})`\n  }\n\n  private renderString(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (schema.contentMediaType === 'application/octet-stream') return 'ArrayBuffer'\n    if (schema.format === 'binary') return 'ArrayBuffer'\n    return 'string'\n  }\n\n  private renderNumber(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'number'\n  }\n\n  private renderBoolean(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'boolean'\n  }\n\n  private renderNull(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'null'\n  }\n\n  private renderInteger(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'number'\n  }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { MixedSchemaObject } from './types/mixed-schema-object.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { ReferenceTransformer } from './reference.transformer.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport interface JsonSchemaValibotRendererOptions {\n  /**\n   * Custom renderer for `$ref` reference objects in Valibot schema generation.\n   *\n   * When not provided, defaults to `ReferenceTransformer.toDeclaration` with a `Schema` suffix appended.\n   *\n   * @example\n   * // Default behavior (without referenceTransformer):\n   * // { $ref: '#/components/schemas/User' } → 'UserSchema'\n   *\n   * @example\n   * // Custom transformer with alias mapping:\n   * // Given aliases = { '#/components/schemas/User': 'UserV2Schema' }\n   * // { $ref: '#/components/schemas/User' } → 'UserV2Schema'\n   * const renderer = new ValibotRenderer(schema, {\n   *   referenceTransformer: (ref) => aliases.get(ref.$ref) ?? `${ReferenceTransformer.toDeclaration(ref)}Schema`,\n   * })\n   */\n  referenceTransformer?: (schema: OpenAPIV3_1.ReferenceObject) => string\n\n  /**\n   * Controls how `additionalProperties: true` (or undefined) is rendered.\n   * @default 'unknown'\n   */\n  additionalPropertiesType?: 'unknown' | 'any'\n}\n\nexport class ValibotRenderer implements Renderer {\n  constructor(\n    private readonly schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n    private readonly options: JsonSchemaValibotRendererOptions = {},\n  ) {\n  }\n\n  render(): string {\n    return this.renderSchema(this.schema)\n  }\n\n  private renderSchema(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): string {\n    if (typeof schema === 'boolean') return 'v.unknown()'\n\n    if (JsonSchemaUtils.isRef(schema)) return this.renderReference(schema)\n    if (JsonSchemaUtils.isMixed(schema)) return this.renderMixed(schema)\n    if (JsonSchemaUtils.isArray(schema)) return this.renderArray(schema)\n\n    if (schema.type === 'object') return this.renderObject(schema)\n    if (schema.enum) return this.renderEnum(schema)\n    if (schema.oneOf) return this.renderOneOf(schema)\n    if (schema.anyOf) return this.renderAnyOf(schema)\n    if (schema.allOf) return this.renderAllOf(schema)\n    if (schema.type === 'string') return this.renderString(schema)\n    if (schema.type === 'number') return this.renderNumber(schema)\n    if (schema.type === 'boolean') return this.renderBoolean(schema)\n    if (schema.type === 'null') return this.renderNull(schema)\n    if (schema.type === 'integer') return this.renderInteger(schema)\n\n    return 'v.unknown()'\n  }\n\n\n  private renderMixed(schema: MixedSchemaObject): string {\n    if (Array.isArray(schema.type)) {\n      const schemas = schema.type\n        .map((type): (OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject) => ({ ...schema, type }))\n        .map((schema) => this.renderSchema(schema))\n\n      return `v.union([${schemas.join(', ')}])`\n    }\n\n    return 'v.unknown()'\n  }\n\n  private renderReference(schema: OpenAPIV3_1.ReferenceObject): string {\n    if (!this.options.referenceTransformer) {\n      return ReferenceTransformer.toDeclaration(schema, (name) => `${name}Schema`)\n    }\n\n    return this.options.referenceTransformer(schema)\n  }\n\n  private renderArray(schema: OpenAPIV3_1.ArraySchemaObject): string {\n    let result: string\n\n    if (schema.items && Array.isArray(schema.items)) {\n      const items = schema.items.map((s) => this.renderSchema(s)).join(', ')\n      result = `v.tuple([${items}])`\n    } else if (schema.items && typeof schema.items === 'object') {\n      result = `v.array(${this.renderSchema(schema.items)})`\n    } else {\n      result = 'v.array(v.any())'\n    }\n\n    // Add array length constraints using pipe\n    const constraints: string[] = []\n    if (schema.minItems !== undefined) {\n      constraints.push(`v.minLength(${schema.minItems})`)\n    }\n    if (schema.maxItems !== undefined) {\n      constraints.push(`v.maxLength(${schema.maxItems})`)\n    }\n\n    if (constraints.length > 0) {\n      result = `v.pipe(${result}, ${constraints.join(', ')})`\n    }\n\n    return result\n  }\n\n\n  private renderObject(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    const hasProperties = schema.properties && !R.isEmpty(schema.properties)\n\n    const apType = this.options.additionalPropertiesType ?? 'unknown'\n\n    // No named properties: produce v.record or v.object({}) forms\n    if (!hasProperties) {\n      if (schema.additionalProperties === false) {\n        return 'v.object({})'\n      }\n\n      if (typeof schema.additionalProperties === 'object') {\n        return `v.record(v.string(), ${this.renderSchema(schema.additionalProperties)})`\n      }\n\n      // additionalProperties true or undefined (implicit open object per OpenAPI 3.1 spec)\n      return `v.record(v.string(), v.${apType}())`\n    }\n\n    // Has named properties\n    const $properties = Object.entries(schema.properties || {})\n      .map(([propertyName, propertySchema]) => {\n        let $comment = new CommentRenderer(propertySchema).render()\n        if ($comment) $comment += '\\n'\n\n        const $key = `\"${propertyName}\"`\n        let $value = this.renderSchema(propertySchema)\n\n        if (!schema.required?.includes(propertyName)) {\n          $value = `v.optional(${$value})`\n        }\n\n        return indent(2, `${$comment}${$key}: ${$value},`)\n      })\n\n    let result = [\n      'v.object({',\n      ...$properties,\n      '})',\n    ].join('\\n')\n\n    // Handle additionalProperties when properties exist\n    if (schema.additionalProperties !== false) {\n      if (typeof schema.additionalProperties === 'object') {\n        const $value = this.renderSchema(schema.additionalProperties)\n        result = `v.intersect([${result}, v.record(v.string(), ${$value})])`\n      } else {\n        // undefined or true: use looseObject\n        result = result.replace('v.object({', 'v.looseObject({')\n      }\n    }\n\n    return result\n  }\n\n  private renderOneOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.oneOf) return 'v.unknown()'\n\n    const schemas = schema.oneOf.map((s) => this.renderSchema(s))\n    return `v.union([${schemas.join(', ')}])`\n  }\n\n  private renderAnyOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.anyOf) return 'v.unknown()'\n\n    const schemas = schema.anyOf.map((s) => this.renderSchema(s))\n    return `v.union([${schemas.join(', ')}])`\n  }\n\n  private renderAllOf(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.allOf || schema.allOf.length === 0) return 'v.unknown()'\n\n    const schemas = schema.allOf.map((s) => this.renderSchema(s))\n\n    // Valibot uses v.intersect with an array of schemas\n    return `v.intersect([${schemas.join(', ')}])`\n  }\n\n  private renderEnum(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (!schema.enum || schema.enum.length === 0) return 'v.unknown()'\n\n    // For single value, use literal\n    if (schema.enum.length === 1) {\n      return `v.literal(${JSON.stringify(schema.enum[0])})`\n    }\n\n    // For multiple values of the same type, use v.picklist for strings or v.union of literals for mixed types\n    const allStrings = schema.enum.every((v) => typeof v === 'string')\n\n    if (allStrings) {\n      const values = schema.enum.map((v) => JSON.stringify(v)).join(', ')\n      return `v.picklist([${values}])`\n    }\n\n    // Mixed types: use union of literals\n    const literals = schema.enum.map((v) => `v.literal(${JSON.stringify(v)})`)\n    return `v.union([${literals.join(', ')}])`\n  }\n\n  private renderString(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    if (schema.contentMediaType === 'application/octet-stream') {\n      return 'v.instance(ArrayBuffer)'\n    }\n\n    if (schema.format === 'binary') {\n      return 'v.instance(ArrayBuffer)'\n    }\n\n    let result = 'v.string()'\n    const constraints: string[] = []\n\n    // Add format validations\n    if (schema.format === 'email') {\n      constraints.push('v.email()')\n    } else if (schema.format === 'uri' || schema.format === 'url') {\n      constraints.push('v.url()')\n    } else if (schema.format === 'uuid') {\n      constraints.push('v.uuid()')\n    } else if (schema.format === 'date-time') {\n      constraints.push('v.isoDateTime()')\n    } else if (schema.format === 'date') {\n      constraints.push('v.isoDate()')\n    } else if (schema.format === 'time') {\n      constraints.push('v.isoTime()')\n    }\n\n    // Add length constraints\n    if (schema.minLength !== undefined) {\n      constraints.push(`v.minLength(${schema.minLength})`)\n    }\n    if (schema.maxLength !== undefined) {\n      constraints.push(`v.maxLength(${schema.maxLength})`)\n    }\n\n    // Add pattern validation\n    if (schema.pattern) {\n      const escapedPattern = schema.pattern.replace(/[\\\\/]/g, '\\\\$&')\n      constraints.push(`v.regex(/${escapedPattern}/)`)\n    }\n\n    if (constraints.length > 0) {\n      result = `v.pipe(${result}, ${constraints.join(', ')})`\n    }\n\n    return result\n  }\n\n  private renderNumber(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    let result = 'v.number()'\n    const constraints: string[] = []\n\n    // Add numeric constraints\n    if (schema.minimum !== undefined) {\n      if (schema.exclusiveMinimum) {\n        constraints.push(`v.minValue(${schema.minimum + Number.EPSILON})`)\n      } else {\n        constraints.push(`v.minValue(${schema.minimum})`)\n      }\n    }\n    if (schema.maximum !== undefined) {\n      if (schema.exclusiveMaximum) {\n        constraints.push(`v.maxValue(${schema.maximum - Number.EPSILON})`)\n      } else {\n        constraints.push(`v.maxValue(${schema.maximum})`)\n      }\n    }\n\n    // Add multipleOf constraint\n    if (schema.multipleOf !== undefined) {\n      constraints.push(`v.multipleOf(${schema.multipleOf})`)\n    }\n\n    if (constraints.length > 0) {\n      result = `v.pipe(${result}, ${constraints.join(', ')})`\n    }\n\n    return result\n  }\n\n  private renderBoolean(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'v.boolean()'\n  }\n\n  private renderNull(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    return 'v.null()'\n  }\n\n  private renderInteger(schema: OpenAPIV3_1.NonArraySchemaObject): string {\n    let result = 'v.number()'\n    const constraints: string[] = ['v.integer()']\n\n    // Add numeric constraints\n    if (schema.minimum !== undefined) {\n      if (schema.exclusiveMinimum) {\n        constraints.push(`v.minValue(${schema.minimum + 1})`)\n      } else {\n        constraints.push(`v.minValue(${schema.minimum})`)\n      }\n    }\n    if (schema.maximum !== undefined) {\n      if (schema.exclusiveMaximum) {\n        constraints.push(`v.maxValue(${schema.maximum - 1})`)\n      } else {\n        constraints.push(`v.maxValue(${schema.maximum})`)\n      }\n    }\n\n    // Add multipleOf constraint\n    if (schema.multipleOf !== undefined) {\n      constraints.push(`v.multipleOf(${schema.multipleOf})`)\n    }\n\n    result = `v.pipe(${result}, ${constraints.join(', ')})`\n\n    return result\n  }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { DeclarationRenderer, JsonSchemaDeclarationRendererOptions } from './declaration.renderer.js'\nimport { ValibotRenderer, JsonSchemaValibotRendererOptions } from './valibot.renderer.js'\n\n\nexport class JsonSchemaTransformer {\n  static toComment(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject): string {\n    return new CommentRenderer(schema).render()\n  }\n\n  static toDeclaration(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject, options?: JsonSchemaDeclarationRendererOptions): string {\n    return new DeclarationRenderer(schema, options).render()\n  }\n\n  static toValibot(schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject, options?: JsonSchemaValibotRendererOptions): string {\n    return new ValibotRenderer(schema, options).render()\n  }\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SchemaDefinition } from '~/models/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { JsonSchemaTransformer, ReferenceTransformer } from '../json-schema/index.js'\n\n\ninterface SchemaDefinitionDeclarationRendererOptions {\n  esm?: boolean\n  additionalPropertiesType?: 'unknown' | 'any'\n\n  getDependentSchemaDefinitionFilepath: (schemaDefinition: SchemaDefinition) => string\n}\n\ninterface SchemaDefinitionValibotRendererOptions {\n  esm?: boolean\n  additionalPropertiesType?: 'unknown' | 'any'\n\n  getDependentSchemaDefinitionFilepath: (schemaDefinition: SchemaDefinition) => string\n}\n\nexport class SchemaDefinitionTransformer {\n  static toDeclaration(schemaDefinition: SchemaDefinition, options: SchemaDefinitionDeclarationRendererOptions): string {\n    const hint = `Referenced from schema definition \"${schemaDefinition.name}\".`\n    const referenceTransformer = (schema: OpenAPIV3_1.ReferenceObject): string => {\n      if (!schema.$ref || !schema.$ref.startsWith('#')) {\n        return ReferenceTransformer.toInvalidDeclaration(schema, hint)\n      }\n\n      if (!schemaDefinition.document.isRefDefined(schema.$ref)) {\n        return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n      }\n\n      return ReferenceTransformer.toDeclaration(schema)\n    }\n\n    const dependencies = schemaDefinition.getDependencies()\n    let $dependencies = dependencies\n      .filter((dep) => !SchemaDefinition.isUnknown(dep))\n      .map((dep) => {\n        const filepath = options.getDependentSchemaDefinitionFilepath(dep)\n        return `import type { ${dep.name} } from \"${filepath}\"`\n      })\n      .map((str) => str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, options.esm ? ' from \"$1.js\"' : ' from \"$1\"'))\n      .join('\\n')\n\n    if ($dependencies) $dependencies += '\\n'\n\n    let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema)\n    if ($comment) $comment += '\\n'\n\n    if (typeof schemaDefinition.schema === 'boolean') {\n      return [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        $dependencies,\n        $comment || undefined,\n        `type ${schemaDefinition.name} = unknown`,\n        '',\n        '/* @anchor:file:end */',\n      ].filter(R.isNotNil).join('\\n')\n    }\n\n    if (JsonSchemaUtils.isNonArray(schemaDefinition.schema) && schemaDefinition.schema.type === 'object') {\n      const $schema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema, { referenceTransformer, additionalPropertiesType: options.additionalPropertiesType })\n\n      const $declaration = $schema.startsWith('{')\n        ? `export interface ${schemaDefinition.name} ${$schema}`\n        : `export type ${schemaDefinition.name} = ${$schema}`\n\n      return [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        $dependencies,\n        $comment || undefined,\n        $declaration,\n        '',\n        '/* @anchor:file:end */',\n      ].filter(R.isNotNil).join('\\n')\n    }\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $dependencies,\n      $comment || undefined,\n      `export type ${schemaDefinition.name} = ${JsonSchemaTransformer.toDeclaration(schemaDefinition.schema, { referenceTransformer, additionalPropertiesType: options.additionalPropertiesType })}`,\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  static toValibot(schemaDefinition: SchemaDefinition, options: SchemaDefinitionValibotRendererOptions): string {\n    const hint = `Referenced from schema definition \"${schemaDefinition.name}\".`\n    const referenceTransformer = (schema: OpenAPIV3_1.ReferenceObject): string => {\n      if (!schema.$ref || !schema.$ref.startsWith('#')) {\n        const base = ReferenceTransformer.toInvalidDeclaration(schema, hint)\n        return base.replace(/^unknown/, 'v.unknown()')\n      }\n\n      if (!schemaDefinition.document.isRefDefined(schema.$ref)) {\n        const base = ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n        return base.replace(/^unknown/, 'v.unknown()')\n      }\n\n      const schemaVarName = ReferenceTransformer.toDeclaration(schema, (name) => `${name}Schema`)\n      return `v.lazy(() => ${schemaVarName})`\n    }\n\n    const declarationReferenceTransformer = (schema: OpenAPIV3_1.ReferenceObject): string => {\n      if (!schema.$ref || !schema.$ref.startsWith('#')) {\n        return ReferenceTransformer.toInvalidDeclaration(schema, hint)\n      }\n\n      if (!schemaDefinition.document.isRefDefined(schema.$ref)) {\n        return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n      }\n\n      return ReferenceTransformer.toDeclaration(schema)\n    }\n\n    const dependencies = schemaDefinition.getDependencies()\n    let $dependencies = dependencies\n      .filter((dep) => !SchemaDefinition.isUnknown(dep))\n      .map((dep) => {\n        const filepath = options.getDependentSchemaDefinitionFilepath(dep)\n        return `import { type ${dep.name}, ${dep.name}Schema } from \"${filepath}\"`\n      })\n      .map((str) => str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, options.esm ? ' from \"$1.js\"' : ' from \"$1\"'))\n      .join('\\n')\n\n    if ($dependencies) $dependencies += '\\n'\n\n    let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema)\n    if ($comment) $comment += '\\n'\n\n    // Add valibot import\n    const $valibotImport = 'import * as v from \\'valibot\\'\\n'\n\n    if (typeof schemaDefinition.schema === 'boolean') {\n      return [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        $valibotImport,\n        $dependencies,\n        $comment || undefined,\n        `export const ${schemaDefinition.name}Schema = v.unknown()`,\n        `export type ${schemaDefinition.name} = v.InferOutput<typeof ${schemaDefinition.name}Schema>`,\n        '',\n        '/* @anchor:file:end */',\n      ].filter(R.isNotNil).join('\\n')\n    }\n\n    const $schema = JsonSchemaTransformer.toValibot(schemaDefinition.schema, { referenceTransformer, additionalPropertiesType: options.additionalPropertiesType })\n\n    const $typeSchema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema, { referenceTransformer: declarationReferenceTransformer, additionalPropertiesType: options.additionalPropertiesType })\n    const $typeDeclaration = $typeSchema.startsWith('{')\n      ? `export interface ${schemaDefinition.name} ${$typeSchema}`\n      : `export type ${schemaDefinition.name} = ${$typeSchema}`\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $valibotImport,\n      $dependencies,\n      $comment || undefined,\n      $typeDeclaration,\n      `export const ${schemaDefinition.name}Schema: v.GenericSchema<${schemaDefinition.name}> = ${$schema}`,\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n}\n","export type AliasCategory = 'schema' | 'response'\n\n/**\n * Manages import alias naming with collision detection for generated TypeScript files.\n *\n * When generating `import type { X as XSchema }` statements, the alias (e.g., `XSchema`)\n * may collide with fixed names already present in the generated file (e.g., the file's own\n * `export type` name). This class tracks all used names and automatically falls back to\n * numbered suffixes (e.g., `XSchema$1`) when a collision is detected.\n *\n * Usage: call `register()` during import generation, then `resolve()` in referenceTransformer.\n * `register()` must always be called before `resolve()` for the same dependency, because\n * the first `register()` call determines the alias name.\n */\nexport class ImportAliasManager {\n  /** \"category:originalName\" → alias */\n  private aliasMap = new Map<string, string>()\n  /** All alias names + reserved names currently in use */\n  private usedNames = new Set<string>()\n\n  /**\n   * @param reservedNames - Fixed names in the generated file that aliases must not collide with.\n   *   For example, the file's own export type name.\n   */\n  constructor(reservedNames: Iterable<string> = []) {\n    for (const name of reservedNames) {\n      this.usedNames.add(name)\n    }\n  }\n\n  /**\n   * Register a dependency and return its alias. Idempotent — calling with the same\n   * category + originalName always returns the same alias.\n   */\n  register(category: AliasCategory, originalName: string): string {\n    const key = `${category}:${originalName}`\n    const existing = this.aliasMap.get(key)\n    if (existing) return existing\n\n    const suffix = category === 'schema' ? 'Schema' : 'Response'\n    let candidate = `${originalName}${suffix}`\n\n    if (this.usedNames.has(candidate)) {\n      let i = 1\n      while (this.usedNames.has(`${candidate}$${i}`)) {\n        i++\n      }\n      candidate = `${candidate}$${i}`\n    }\n\n    this.aliasMap.set(key, candidate)\n    this.usedNames.add(candidate)\n    return candidate\n  }\n\n  /**\n   * Look up alias for an already-registered dependency.\n   * Returns undefined if not yet registered.\n   */\n  resolve(category: AliasCategory, originalName: string): string | undefined {\n    return this.aliasMap.get(`${category}:${originalName}`)\n  }\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { ResponseDefinition } from '~/models/index.js'\nimport { SchemaDefinition } from '~/models/index.js'\nimport { ImportAliasManager } from '~/utils/import-alias-manager.js'\nimport { JsonSchemaTransformer, ReferenceTransformer } from '../json-schema/index.js'\n\n\ninterface ResponseDefinitionDeclarationRendererOptions {\n  esm?: boolean\n  additionalPropertiesType?: 'unknown' | 'any'\n\n  getDependentSchemaDefinitionFilepath: (schemaDefinition: SchemaDefinition) => string\n}\n\nexport class ResponseDefinitionTransformer {\n  static toDeclaration(responseDefinition: ResponseDefinition, options: ResponseDefinitionDeclarationRendererOptions): string {\n    const hint = `Referenced from response definition \"${responseDefinition.name}\".`\n    const aliasManager = new ImportAliasManager([responseDefinition.name])\n\n    // NOTE: Import generation (register) must run BEFORE referenceTransformer (resolve),\n    // because the first register() call determines each alias name.\n    const dependencies = responseDefinition.getDependencies()\n      .filter((dep) => !SchemaDefinition.isUnknown(dep))\n\n    let $dependencies = dependencies\n      .map((dep) => {\n        const filepath = options.getDependentSchemaDefinitionFilepath(dep)\n        return `import type { ${dep.name} as ${aliasManager.register('schema', dep.name)} } from \"${filepath}\"`\n      })\n      .map((str) => str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, options.esm ? ' from \"$1.js\"' : ' from \"$1\"'))\n      .join('\\n')\n\n    if ($dependencies) $dependencies += '\\n'\n\n    const referenceTransformer = (schema: OpenAPIV3_1.ReferenceObject): string => {\n      if (!schema.$ref || !schema.$ref.startsWith('#')) {\n        return ReferenceTransformer.toInvalidDeclaration(schema, hint)\n      }\n\n      if (!responseDefinition.document.isRefDefined(schema.$ref)) {\n        return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n      }\n\n      return ReferenceTransformer.toDeclaration(schema, (name) => aliasManager.resolve('schema', name) ?? `${name}Schema`)\n    }\n\n    const $type = ResponseDefinitionTransformer.renderContentType(\n      responseDefinition.response,\n      { referenceTransformer, additionalPropertiesType: options.additionalPropertiesType },\n    )\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $dependencies,\n      `export type ${responseDefinition.name} = ${$type}`,\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  private static renderContentType(\n    response: OpenAPIV3_1.ResponseObject,\n    options: { referenceTransformer: (schema: OpenAPIV3_1.ReferenceObject) => string; additionalPropertiesType?: 'unknown' | 'any' },\n  ): string {\n    const content = response.content\n    if (!content || R.isEmpty(content)) return 'void'\n\n    const $types = Object.entries(content)\n      .map(([mediaType, mediaTypeObject]) => {\n        if (mediaType.includes('text/event-stream')) return 'ReadableStream<ServerSentEvent>'\n        if (mediaType.includes('multipart/form-data')) return 'FormData'\n        if (\n          mediaType.startsWith('image/')\n          || mediaType.startsWith('audio/')\n          || mediaType.startsWith('video/')\n          || mediaType.startsWith('font/')\n          || mediaType === 'application/octet-stream'\n          || mediaType === 'application/pdf'\n        ) return 'ArrayBuffer'\n        if (!mediaTypeObject.schema) return 'unknown'\n\n        return JsonSchemaTransformer.toDeclaration(mediaTypeObject.schema, options)\n      })\n\n    return R.uniq($types).join(' | ') || 'void'\n  }\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\n\n\nexport class CommentRenderer implements Renderer {\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n  ) {}\n\n  render(): string {\n    const operation = this.operationDefinition.operation\n    if (!operation.summary && !operation.description) return ''\n\n    const lines = ['/**']\n\n    if (operation.summary && typeof operation.summary === 'string') {\n      const summary = R.trim(operation.summary)\n        .replace(/\\t/g, '  ')\n        .replace(/\\r\\n?/g, '\\n')\n\n      lines.push(...summary.split('\\n').map((line) => ` * ${line.trimEnd()}`))\n      lines.push(' *')\n    }\n\n    if (operation.description && typeof operation.description === 'string') {\n      const description = R.trim(operation.description)\n        .replace(/\\t/g, '  ')\n        .replace(/\\r\\n?/g, '\\n')\n\n      const descriptionLines = description.split('\\n').map((line) => line.trimEnd())\n      lines.push(` * @description ${descriptionLines[0]}`)\n      lines.push(...descriptionLines.slice(1).map((line) => ` * ${line}`))\n    }\n\n    lines.push(' */')\n\n    return lines.join('\\n')\n  }\n}\n","import * as changeCase from 'change-case'\nimport { OperationDefinition } from '~/models/index.js'\n\nexport type TypeNameFn = (name: string) => string\n\nexport function typeNameFactory(operationDefinition: OperationDefinition): TypeNameFn {\n  const pascalCaseOperationId = changeCase.pascalCase(operationDefinition.operationId)\n  return (name: string) => `${pascalCaseOperationId}${name}`\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\n\n\nconst PARAMETER_AP_SCHEMAS: Record<string, OpenAPIV3_1.SchemaObject | undefined> = {\n  query: {\n    oneOf: [\n      { type: 'string' },\n      { type: 'number' },\n      { type: 'integer' },\n      { type: 'null' },\n    ],\n  },\n  path: {\n    oneOf: [\n      { type: 'string' },\n      { type: 'number' },\n      { type: 'integer' },\n      { type: 'boolean' },\n      { type: 'null' },\n    ],\n  },\n  header: {\n    oneOf: [\n      { type: 'string' },\n      { type: 'number' },\n      { type: 'integer' },\n    ],\n  },\n}\n\n/**\n * Recursively rewrite `additionalProperties` in object schemas for parameter types.\n * When additionalProperties is `true` or `undefined`, replace it with a keq-compatible schema\n * based on the parameter location (query/path/header).\n */\nexport function rewriteAdditionalPropertiesForParameter(\n  schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject,\n  parameterIn: string,\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject {\n  if (JsonSchemaUtils.isRef(schema)) return schema\n  if (typeof schema === 'boolean') return schema\n\n  const replacement = PARAMETER_AP_SCHEMAS[parameterIn]\n  if (!replacement) return schema\n\n  const cloned = { ...schema }\n\n  // Rewrite additionalProperties on object schemas\n  if (cloned.type === 'object' || cloned.properties) {\n    if (cloned.additionalProperties === true || cloned.additionalProperties === undefined) {\n      cloned.additionalProperties = replacement\n    } else if (typeof cloned.additionalProperties === 'object' && !JsonSchemaUtils.isRef(cloned.additionalProperties)) {\n      cloned.additionalProperties = rewriteAdditionalPropertiesForParameter(cloned.additionalProperties, parameterIn) as OpenAPIV3_1.SchemaObject\n    }\n  }\n\n  // Recursively handle nested properties\n  if (cloned.properties) {\n    cloned.properties = Object.fromEntries(\n      Object.entries(cloned.properties).map(([key, value]) => [key, rewriteAdditionalPropertiesForParameter(value, parameterIn)]),\n    )\n  }\n\n  // Recursively handle items\n  if (cloned.items && typeof cloned.items === 'object' && !Array.isArray(cloned.items)) {\n    cloned.items = rewriteAdditionalPropertiesForParameter(cloned.items, parameterIn) as OpenAPIV3_1.SchemaObject\n  }\n\n  // Recursively handle composition keywords\n  for (const keyword of ['allOf', 'oneOf', 'anyOf'] as const) {\n    if (cloned[keyword]) {\n      cloned[keyword] = cloned[keyword].map((s) => rewriteAdditionalPropertiesForParameter(s, parameterIn))\n    }\n  }\n\n  return cloned\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function dereference<T extends OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject | OpenAPIV3_1.RequestBodyObject | OpenAPIV3_1.ReferenceObject>($ref: string, swagger: OpenAPIV3_1.Document): T {\n  let value\n\n  for (const key of $ref.split('/')) {\n    if (key === '#') {\n      value = swagger\n    } else {\n      value = value[key]\n    }\n\n    if (!value) break\n  }\n\n  return value as T\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\n\nexport function isRefDefined($ref: string, swagger: OpenAPIV3_1.Document): boolean {\n  if ($ref.startsWith('#/')) {\n    const path = $ref.replace('#/', '').split('/')\n    return R.path(path, swagger) !== undefined\n  }\n\n  return false\n}\n\n","import * as R from 'ramda'\nimport jsonpointer from 'jsonpointer'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { JSONPath } from 'jsonpath-plus'\nimport { isRefDefined } from './is-ref-defined.js'\n\n\n// remove schema $ref if the reference is not founded\nexport function removeUndefinedRef(swagger: OpenAPIV3_1.Document): OpenAPIV3_1.Document {\n  const shadow = R.clone(swagger)\n\n  const matches = JSONPath({\n    path: \"$..*['$ref']^\",\n    json: swagger,\n    resultType: 'all',\n  })\n\n  for (const match of matches) {\n    if (match.value.$ref && !isRefDefined(match.value.$ref, swagger)) {\n      jsonpointer.set(shadow, match.pointer, R.omit(['$ref'], match.value))\n    }\n  }\n\n  return shadow\n}\n","import * as R from 'ramda'\nimport jsonpointer from 'jsonpointer'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { JSONPath } from 'jsonpath-plus'\nimport { removeUndefinedRef } from './remove-undefined-ref.js'\nimport { dereference } from './dereference.js'\n\n\nfunction dereferencePathObject(swagger: OpenAPIV3_1.Document): void {\n  const matches = JSONPath({\n    path: '$.paths.*.$ref^',\n    json: swagger,\n    resultType: 'all',\n  })\n\n  for (const match of matches) {\n    const value = dereference(match.value.$ref, swagger)\n    jsonpointer.set(swagger, match.pointer, value)\n  }\n}\n\nfunction dereferenceRequestBody(swagger: OpenAPIV3_1.Document): void {\n  const matches = JSONPath({\n    path: '$.paths.*.*.requestBody.$ref^',\n    json: swagger,\n    resultType: 'all',\n  })\n\n  for (const match of matches) {\n    const value = dereference(match.value.$ref, swagger)\n    jsonpointer.set(swagger, match.pointer, value)\n  }\n}\n\nexport function dereferenceResponses(swagger: OpenAPIV3_1.Document): void {\n  const responseMatches = JSONPath({\n    path: '$.paths.*.*.responses.*.$ref^',\n    json: swagger,\n    resultType: 'all',\n  })\n\n  // Only dereference response refs that do NOT point to #/components/responses/\n  // Preserve response-level refs so they can be reused as shared types\n  for (const match of responseMatches) {\n    if (match.value.$ref && !match.value.$ref.startsWith('#/components/responses/')) {\n      const value = dereference(match.value.$ref, swagger)\n      jsonpointer.set(swagger, match.pointer, value)\n    }\n  }\n\n  const headerMatches = JSONPath({\n    path: '$.paths.*.*.responses.*.headers.*.$ref^',\n    json: swagger,\n    resultType: 'all',\n  })\n\n  for (const match of headerMatches) {\n    const value = dereference(match.value.$ref, swagger)\n    jsonpointer.set(swagger, match.pointer, value)\n  }\n}\n\nfunction dereferenceParameters(swagger: OpenAPIV3_1.Document): void {\n  const matches = JSONPath({\n    path: '$.paths.*.*.parameters.*.$ref^',\n    json: swagger,\n    resultType: 'all',\n  })\n\n  for (const match of matches) {\n    const value = dereference(match.value.$ref, swagger)\n    jsonpointer.set(swagger, match.pointer, value)\n  }\n}\n\nexport function dereferenceOperation(swagger: OpenAPIV3_1.Document): OpenAPIV3_1.Document {\n  const shadow = R.clone(swagger)\n\n  dereferencePathObject(shadow)\n  dereferenceRequestBody(shadow)\n  dereferenceResponses(shadow)\n  dereferenceParameters(shadow)\n\n  return removeUndefinedRef(shadow)\n}\n","import type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { dereference } from './dereference.js'\nimport { JsonSchemaUtils } from '../json-schema-utils/index.js'\n\n\nexport function dereferenceDeep<T extends OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject | OpenAPIV3_1.RequestBodyObject>($ref: string, swagger: OpenAPIV3_1.Document): T {\n  const stack = [$ref]\n  let value\n\n  while (true) {\n    const last = stack[stack.length - 1]\n    value = dereference(last, swagger)\n\n    if (JsonSchemaUtils.isRef(value)) {\n      if (!stack.includes(value.$ref)) {\n        stack.push(value.$ref)\n        continue\n      } else {\n        // Circular reference detected\n        throw new Error(`Circular reference detected: ${stack.join(' -> ')} -> ${value.$ref}`)\n      }\n    }\n\n    break\n  }\n\n  return value as T\n}\n","import { upgrade } from '@scalar/openapi-parser'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport function To3_1(openapi: object): OpenAPIV3_1.Document {\n  const { specification } = upgrade(openapi)\n  return specification\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\n\n\nexport type OpenapiOperationMapper = (method: string, pathname: string, operation: OpenAPIV3_1.OperationObject) => OpenAPIV3_1.OperationObject\n\n\nexport function mapOperation(specification: OpenAPIV3_1.Document, mapper: OpenapiOperationMapper): OpenAPIV3_1.Document {\n  const shadow = R.clone(specification)\n\n  for (const [pathname, pathItem] of Object.entries(shadow.paths || {})) {\n    for (const m in pathItem) {\n      const method = m.toLowerCase()\n      if (!SupportedMethods.includes(method)) continue\n      if (typeof pathItem[m] !== 'object' || Array.isArray(pathItem[m]) || pathItem[m] === null) continue\n\n      const operation: OpenAPIV3_1.OperationObject = pathItem[m]\n      pathItem[m] = mapper(method, pathname, operation)\n    }\n  }\n\n  return shadow\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { mapOperation } from './map-operation.js'\n\n\nexport type OpenapiParameterMapper = (method: string, pathname: string, operation: OpenAPIV3_1.OperationObject, parameter: OpenAPIV3_1.ParameterObject) => OpenAPIV3_1.ParameterObject\n\nexport function mapParameter(\n  specification: OpenAPIV3_1.Document,\n  mapper: OpenapiParameterMapper,\n): OpenAPIV3_1.Document {\n  return mapOperation(specification, (method, pathname, operation) => {\n    if (!operation.parameters) return operation\n\n    operation.parameters = operation.parameters\n      .map((parameter) => mapper(method, pathname, operation, parameter as OpenAPIV3_1.ParameterObject))\n\n    return operation\n  })\n}\n","import * as R from 'ramda'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\n\n\n/**\n * A function that transforms a single schema object.\n * Receives a non-`$ref` schema and returns the transformed schema.\n * The mapper does NOT need to handle recursion — `mapSchema` walks the tree automatically.\n */\nexport type SchemaMapper = (schema: OpenAPIV3_1.SchemaObject) => OpenAPIV3_1.SchemaObject\n\nfunction walkSchema(\n  schema: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject | undefined,\n  mapper: SchemaMapper,\n): OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject | undefined {\n  if (!schema) return schema\n  if (typeof schema === 'boolean') return schema\n  if ('$ref' in schema) return schema\n\n  let result: OpenAPIV3_1.NonArraySchemaObject | OpenAPIV3_1.ArraySchemaObject = mapper(schema) as OpenAPIV3_1.NonArraySchemaObject | OpenAPIV3_1.ArraySchemaObject\n\n  // Recursively walk nested schemas\n  if (result.properties) {\n    const newProperties: Record<string, OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject> = {}\n    for (const [key, value] of Object.entries(result.properties)) {\n      newProperties[key] = walkSchema(value, mapper) as OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject\n    }\n    result = Object.assign({}, result, { properties: newProperties })\n  }\n\n  if (typeof result.additionalProperties === 'object' && result.additionalProperties !== null && !('$ref' in result.additionalProperties)) {\n    result = Object.assign({}, result, { additionalProperties: walkSchema(result.additionalProperties, mapper) as OpenAPIV3_1.SchemaObject })\n  }\n\n  if ('items' in result && result.items && typeof result.items === 'object' && !Array.isArray(result.items)) {\n    result = Object.assign({}, result, { items: walkSchema(result.items, mapper) })\n  }\n\n  for (const keyword of ['allOf', 'oneOf', 'anyOf'] as const) {\n    if (result[keyword]) {\n      result = Object.assign({}, result, { [keyword]: result[keyword].map((s) => walkSchema(s, mapper)) })\n    }\n  }\n\n  return result\n}\n\nfunction walkMediaTypeSchemas(\n  content: Record<string, OpenAPIV3_1.MediaTypeObject> | undefined,\n  mapper: SchemaMapper,\n): void {\n  if (!content) return\n  for (const mediaType of Object.values(content)) {\n    if (mediaType.schema) {\n      mediaType.schema = walkSchema(mediaType.schema, mapper) as OpenAPIV3_1.SchemaObject\n    }\n  }\n}\n\n/**\n * Recursively walk and transform every non-`$ref` schema in an OpenAPI 3.1 document.\n *\n * Returns a **deep clone** of the document — the original is never mutated.\n * The `mapper` is called on each `SchemaObject` (skipping `$ref` and `boolean` schemas),\n * and then `mapSchema` continues into the mapper's return value to process nested schemas\n * (`properties`, `additionalProperties`, `items`, `allOf`/`oneOf`/`anyOf`).\n *\n * Traversal covers:\n * - `components.schemas`\n * - Inline schemas in operation parameters, request bodies, and responses\n *\n * @example\n * // Set `additionalProperties: false` on every object schema that doesn't define it\n * const patched = mapSchema(doc, (schema) => {\n *   if ((schema.type === 'object' || schema.properties) && schema.additionalProperties === undefined) {\n *     return Object.assign({}, schema, { additionalProperties: false })\n *   }\n *   return schema\n * })\n *\n * @example\n * // Add a `description` fallback to all string schemas\n * const annotated = mapSchema(doc, (schema) => {\n *   if (schema.type === 'string' && !schema.description) {\n *     return Object.assign({}, schema, { description: 'No description provided' })\n *   }\n *   return schema\n * })\n */\nexport function mapSchema(specification: OpenAPIV3_1.Document, mapper: SchemaMapper): OpenAPIV3_1.Document {\n  const shadow = R.clone(specification)\n\n  // Walk components.schemas\n  if (shadow.components?.schemas) {\n    for (const [name, schema] of Object.entries(shadow.components.schemas)) {\n      shadow.components.schemas[name] = walkSchema(schema, mapper) as OpenAPIV3_1.SchemaObject\n    }\n  }\n\n  // Walk operations: parameters, requestBody, responses\n  for (const [, pathItem] of Object.entries(shadow.paths || {})) {\n    for (const m in pathItem) {\n      const method = m.toLowerCase()\n      if (!SupportedMethods.includes(method)) continue\n      if (typeof pathItem[m] !== 'object' || Array.isArray(pathItem[m]) || pathItem[m] === null) continue\n\n      const operation: OpenAPIV3_1.OperationObject = pathItem[m]\n\n      // Walk parameter schemas\n      if (operation.parameters) {\n        for (const param of operation.parameters) {\n          if ('$ref' in param) continue\n          if (param.schema) {\n            param.schema = walkSchema(param.schema, mapper) as OpenAPIV3_1.SchemaObject\n          }\n        }\n      }\n\n      // Walk request body schemas\n      if (operation.requestBody && !('$ref' in operation.requestBody)) {\n        walkMediaTypeSchemas(operation.requestBody.content, mapper)\n      }\n\n      // Walk response schemas\n      if (operation.responses) {\n        for (const response of Object.values(operation.responses)) {\n          if ('$ref' in response) continue\n          walkMediaTypeSchemas(response.content, mapper)\n        }\n      }\n    }\n  }\n\n  return shadow\n}\n","import { dereference } from './dereference.js'\nimport { dereferenceOperation } from './dereference-operation.js'\nimport { isRefDefined } from './is-ref-defined.js'\nimport { removeUndefinedRef } from './remove-undefined-ref.js'\nimport { dereferenceDeep } from './dereference-deep.js'\nimport { To3_1 } from './to-3_1.js'\nimport { mapOperation } from './map-operation.js'\nimport { mapParameter } from './map-parameter.js'\nimport { mapSchema } from './map-schema.js'\n\n\nexport class OpenapiUtils {\n  static isRefDefined = isRefDefined\n  static dereference = dereference\n  static dereferenceDeep = dereferenceDeep\n  static removeUndefinedRef = removeUndefinedRef\n  static dereferenceOperation = dereferenceOperation\n  static mapOperation = mapOperation\n  static mapParameter = mapParameter\n  static mapSchema = mapSchema\n  static to3_1 = To3_1\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition } from '~/models/index.js'\nimport { TypeNameFn } from './utils/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { JsonSchemaTransformer, JsonSchemaDeclarationRendererOptions } from '../json-schema/index.js'\nimport { rewriteAdditionalPropertiesForParameter } from './utils/rewrite-additional-properties-for-parameter.js'\n\n\nexport interface DeclarationRendersOptions {\n  typeName: TypeNameFn\n  jsonSchemaOptions: JsonSchemaDeclarationRendererOptions\n  resolveRefResponse?: (refName: string) => string\n}\n\n\nexport class DeclarationRenders {\n  private readonly typeName: TypeNameFn\n  private readonly jsonSchemaOptions: JsonSchemaDeclarationRendererOptions\n  private readonly resolveRefResponse: (refName: string) => string\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    options: DeclarationRendersOptions,\n  ) {\n    this.typeName = options.typeName\n    this.jsonSchemaOptions = options.jsonSchemaOptions\n    this.resolveRefResponse = options.resolveRefResponse ?? ((name) => name)\n  }\n\n  renderResponseBodies(): string {\n    const { operation } = this.operationDefinition\n\n    if (!operation.responses || R.isEmpty(operation.responses)) {\n      return `export interface ${this.typeName('ResponseBodies')} {}`\n    }\n\n    const $responses = Object.entries(operation.responses)\n      .map(([statusCode, response]) => {\n        if (JsonSchemaUtils.isRef(response)) {\n          const refName = response.$ref.split('/').pop() || ''\n          return indent(2, `${statusCode}: ${this.resolveRefResponse(refName)}`)\n        }\n\n        const $value = R.uniq(\n          Object.entries(response.content || {})\n            .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n            .map(([mediaType, schema]) => {\n              if (mediaType.includes('text/event-stream')) return 'ReadableStream<ServerSentEvent>'\n              if (mediaType.includes('multipart/form-data')) return 'FormData'\n              if (\n                mediaType.startsWith('image/')\n                || mediaType.startsWith('audio/')\n                || mediaType.startsWith('video/')\n                || mediaType.startsWith('font/')\n                || mediaType === 'application/octet-stream'\n                || mediaType === 'application/pdf'\n              ) return 'ArrayBuffer'\n              if (!schema) return 'unknown'\n\n              return JsonSchemaTransformer.toDeclaration(schema, this.jsonSchemaOptions)\n            }),\n        ).join(' | ')\n\n        return indent(2, `${statusCode}: ${$value || 'void'}`)\n      })\n      .join('\\n')\n\n    return [\n      `export interface ${this.typeName('ResponseBodies')} {`,\n      $responses,\n      '}',\n    ].join('\\n')\n  }\n\n  renderRequestBodies(): string {\n    const { operation } = this.operationDefinition\n    let $requestBodies = `export interface ${this.typeName('RequestBodies')} {}`\n\n    if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {\n      const $mediaTypes = Object.entries(operation.requestBody.content || {})\n        .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n        .map(([mediaType, schema]) => {\n          if (!schema) return `${JSON.stringify(mediaType)}: unknown`\n          return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schema, this.jsonSchemaOptions)}`\n        })\n        .map((pair) => indent(2, pair))\n\n      $requestBodies = [\n        `export interface ${this.typeName('RequestBodies')} {`,\n        ...$mediaTypes,\n        '}',\n      ].join('\\n')\n    }\n\n    return $requestBodies\n  }\n\n  renderParameterBodies(): string {\n    const { operation } = this.operationDefinition\n\n    if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {\n      const $mediaTypes = Object.entries(operation.requestBody.content || {})\n        .map(([mediaType, mediaTypeObject]) => <const>[mediaType, mediaTypeObject.schema])\n        .map(([mediaType, schemaOrRef]) => {\n          if (!schemaOrRef) return `${JSON.stringify(mediaType)}: unknown`\n\n          const schema = JsonSchemaUtils.isRef(schemaOrRef)\n            ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(schemaOrRef.$ref, this.operationDefinition.document.specification)\n            : schemaOrRef\n\n          if (schema.type === 'object' || schema.properties) {\n            return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schemaOrRef, this.jsonSchemaOptions)} & { [key: string]: any }`\n          }\n\n          return `${JSON.stringify(mediaType)}: { [key: string]: any }`\n        })\n        .map((pair) => indent(2, pair))\n\n      return [\n        `interface ${this.typeName('ParameterBodies')} {`,\n        ...$mediaTypes,\n        '}',\n        '',\n      ].join('\\n')\n    }\n\n    return ''\n  }\n\n  renderRequestParameters(): string {\n    const { operation } = this.operationDefinition\n\n    const mediaTypes = operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)\n      ? Object.keys(operation.requestBody.content || {})\n      : []\n\n    const base = `${this.typeName('RequestQuery')} & ${this.typeName('RouteParameters')} & ${this.typeName('RequestHeaders')}`\n\n    if (mediaTypes.length === 1) {\n      return `export type ${this.typeName('RequestParameters')} = ${base} & ${this.typeName('RequestBodies')}[${JSON.stringify(mediaTypes[0])}]`\n    }\n\n    if (mediaTypes.length > 1) {\n      const unions = mediaTypes\n        .map((mediaType) => `(${base} & ${this.typeName('RequestBodies')}[${JSON.stringify(mediaType)}] & { \"content-type\": ${JSON.stringify(mediaType)} })`)\n        .join('\\n| ')\n\n      return `export type ${this.typeName('RequestParameters')} = ${unions}`\n    }\n\n    return `export type ${this.typeName('RequestParameters')} = ${base}`\n  }\n\n  renderParameters(name: string, parameters: OpenAPIV3_1.ParameterObject[]): string {\n    if (parameters.length === 0) {\n      return `export type ${name} = {}`\n    }\n\n    const $parameters = parameters.map((parameter) => {\n      const parameterName = `\"${parameter.name}\"`\n      const $key = parameter.required ? parameterName : `${parameterName}?`\n      const schema = parameter.schema\n        ? rewriteAdditionalPropertiesForParameter(parameter.schema, parameter.in!)\n        : { type: 'any' as const }\n      const $value = JsonSchemaTransformer.toDeclaration(schema, this.jsonSchemaOptions)\n\n      return indent(2, `${$key}: ${$value}`)\n    })\n      .join('\\n')\n\n    return [\n      `export type ${name} = {`,\n      $parameters,\n      '}',\n    ].filter(Boolean).join('\\n')\n  }\n\n  renderFileComment(): string {\n    const { operation, method, pathname } = this.operationDefinition\n\n    const lines: string[] = ['//']\n\n    if (operation.deprecated) {\n      lines.push('// This API has been deprecated.')\n      lines.push('//')\n    }\n\n    lines.push(`// Method: ${method.toUpperCase()}`)\n    lines.push(`// Pathname: ${pathname}`)\n\n    if (operation.summary && typeof operation.summary === 'string') {\n      const summary = operation.summary\n        .trim()\n        .replace(/\\t/g, '  ')\n        .replace(/\\r\\n?/g, '\\n')\n\n      lines.push(`// Summary: ${summary.split('\\n')[0]}`)\n      for (const line of summary.split('\\n').slice(1)) {\n        lines.push(`//   ${line.trimEnd()}`)\n      }\n    }\n\n    if (operation.description && typeof operation.description === 'string') {\n      const description = operation.description\n        .trim()\n        .replace(/\\t/g, '  ')\n        .replace(/\\r\\n?/g, '\\n')\n\n      lines.push(`// Description: ${description.split('\\n')[0]}`)\n      for (const line of description.split('\\n').slice(1)) {\n        lines.push(`//   ${line.trimEnd()}`)\n      }\n    }\n\n    if (operation.tags && operation.tags.length > 0) {\n      lines.push(`// Tags: ${operation.tags.join(', ')}`)\n    }\n\n    return lines.join('\\n')\n  }\n\n  renderOperationInterface(): string {\n    const $parameterBodies = this.renderParameterBodies()\n\n    return [\n      `export interface ${this.typeName('Operation')}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${$parameterBodies ? `keyof ${this.typeName('ParameterBodies')}` : 'string'} > extends KeqOperation {`,\n      `  requestParams: ${this.typeName('RouteParameters')} & { [key: string]: KeqPathParameterInit }`,\n      `  requestQuery: ${this.typeName('RequestQuery')} & { [key: string]: KeqQueryInit }`,\n      `  requestHeaders: ${this.typeName('RequestHeaders')} & { [key: string]: string | number }`,\n      `  requestBody: ${$parameterBodies ? `${this.typeName('ParameterBodies')}[CONTENT_TYPE] | ` : 'object | '}BodyInit`,\n      `  responseBody: ${this.typeName('ResponseBodies')}[STATUS]`,\n      '}',\n    ].join('\\n')\n  }\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition, ResponseDefinition, SchemaDefinition } from '~/models/index.js'\nimport { typeNameFactory } from './utils/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { JsonSchemaDeclarationRendererOptions, ReferenceTransformer } from '../json-schema/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { DeclarationRenders } from './declaration.renders.js'\n\n\nexport interface ModularDeclarationRendererOptions {\n  esm?: boolean\n  additionalPropertiesType?: 'unknown' | 'any'\n\n  getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string\n  getDependentResponseDefinitionFilepath(dependentResponseDefinition: ResponseDefinition): string\n}\n\nconst alias = (name: string): string => `${name}Schema`\nconst responseAlias = (name: string): string => `${name}Response`\n\nexport class ModularDeclarationRenderer implements Renderer {\n  private renders: DeclarationRenders\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    private readonly options: ModularDeclarationRendererOptions,\n  ) {\n    const typeName = typeNameFactory(operationDefinition)\n    const hint = `Referenced from operation \"${operationDefinition.method.toUpperCase()} ${operationDefinition.pathname}\".`\n\n    const jsonSchemaOptions: JsonSchemaDeclarationRendererOptions = {\n      referenceTransformer: (schema: OpenAPIV3_1.ReferenceObject) => {\n        if (schema.$ref && schema.$ref.startsWith('#') && !operationDefinition.document.isRefDefined(schema.$ref)) {\n          return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n        }\n\n        return ReferenceTransformer.toDeclaration(schema, alias)\n      },\n      additionalPropertiesType: options.additionalPropertiesType,\n    }\n\n    this.renders = new DeclarationRenders(operationDefinition, {\n      typeName,\n      jsonSchemaOptions,\n      resolveRefResponse: responseAlias,\n    })\n  }\n\n  private renderDependencies(): string {\n    const schemaDefinitions = this.operationDefinition.getDependencies()\n      .filter((schemaDefinition) => !SchemaDefinition.isUnknown(schemaDefinition))\n\n    const $schemaDefinitions = schemaDefinitions\n      .map((schemaDefinition) => {\n        const filepath = this.options.getDependentSchemaDefinitionFilepath(schemaDefinition)\n        const schemaName = schemaDefinition.name\n\n        return `import type { ${schemaName} as ${alias(schemaName)} } from \"${filepath}\"`\n      })\n      .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n\n    const responseDefinitions = this.operationDefinition.getResponseDependencies()\n      .filter((responseDefinition) => !ResponseDefinition.isUnknown(responseDefinition))\n\n    const $responseDefinitions = responseDefinitions\n      .map((responseDefinition) => {\n        const filepath = this.options.getDependentResponseDefinitionFilepath(responseDefinition)\n        const responseName = responseDefinition.name\n\n        return `import type { ${responseName} as ${responseAlias(responseName)} } from \"${filepath}\"`\n      })\n      .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n\n    return [\n      'import type { KeqOperation, KeqPathParameterInit, KeqQueryInit, ServerSentEvent } from \"keq\"',\n      ...$schemaDefinitions,\n      ...$responseDefinitions,\n    ].join('\\n')\n  }\n\n  render(): string {\n    const { operation } = this.operationDefinition\n\n    if (!operation.responses) return ''\n\n    const parameters = operation.parameters?.filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p)) || []\n    const typeName = typeNameFactory(this.operationDefinition)\n\n    const $dependencies = this.renderDependencies()\n    const $responseBodies = this.renders.renderResponseBodies()\n    const $requestBodies = this.renders.renderRequestBodies()\n    const $parameterBodies = this.renders.renderParameterBodies()\n    const $requestParameters = this.renders.renderRequestParameters()\n    const $requestQuery = this.renders.renderParameters(\n      `${typeName('RequestQuery')}`,\n      parameters.filter((p) => p.in === 'query'),\n    )\n    const $routeParameters = this.renders.renderParameters(\n      `${typeName('RouteParameters')}`,\n      parameters.filter((p) => p.in === 'path'),\n    )\n    const $requestHeaders = this.renders.renderParameters(\n      `${typeName('RequestHeaders')}`,\n      parameters.filter((p) => p.in === 'header'),\n    )\n    const $fileComment = this.renders.renderFileComment()\n    const $operationInterface = this.renders.renderOperationInterface()\n\n    return [\n      $fileComment,\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $dependencies,\n      '',\n      $responseBodies,\n      '',\n      $requestBodies,\n      '',\n      $requestQuery,\n      '',\n      $routeParameters,\n      '',\n      $requestHeaders,\n      '',\n      $parameterBodies || undefined,\n      $requestParameters,\n      '',\n      $operationInterface,\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n}\n","import * as changeCase from 'change-case'\n\n/**\n * Check if a string is a valid JavaScript/TypeScript identifier.\n */\nexport function isValidIdentifier(str: string): boolean {\n  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(str)\n}\n\n/**\n * Convert a string to a valid JavaScript/TypeScript identifier.\n * If the string is already a valid identifier, return it as-is.\n * Otherwise, convert it to camelCase and ensure it starts with a valid character.\n */\nexport function toSafeIdentifier(str: string): string {\n  if (isValidIdentifier(str)) return str\n\n  const camelCased = changeCase.camelCase(str)\n\n  if (!camelCased) {\n    return `_${str.replace(/[^a-zA-Z0-9_$]/g, '_')}`\n  }\n\n  // camelCase may produce a string starting with a digit (e.g. \"123-get\" -> \"123Get\")\n  if (/^[0-9]/.test(camelCased)) {\n    return `_${camelCased}`\n  }\n\n  if (!isValidIdentifier(camelCased)) {\n    return `_${camelCased.replace(/[^a-zA-Z0-9_$]/g, '_')}`\n  }\n\n  return camelCased\n}\n","import { CustomError } from 'ts-custom-error'\nimport wrap from 'word-wrap'\nimport { ModuleDefinition } from '~/models/index.js'\n\n\nexport class Exception extends CustomError {\n  constructor(module: ModuleDefinition | string, message: string) {\n    const moduleName = typeof module === 'string' ? module : module.name\n\n    const msg = wrap(message, { width: 60, indent: '    ' })\n    super(`${moduleName} module failed to compile:\\n${msg}`)\n\n    Object.defineProperty(this, 'name', { value: 'KeqCLI_Exception' })\n  }\n}\n","import * as R from 'ramda'\nimport { KeqQueryOptions } from 'keq'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition } from '~/models/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { QsArrayFormat } from '~/constants/index.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\n\n\nexport interface OperationDefinitionSnippetOptions {\n  esm?: boolean\n  emptyJsonRequestBodyMode?: 'strict' | 'omit' | 'empty-object' | 'null'\n}\n\nexport class OperationDefinitionSnippet {\n  typeName: TypeNameFn\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    private readonly options: OperationDefinitionSnippetOptions,\n  ) {\n    this.typeName = typeNameFactory(operationDefinition)\n  }\n\n\n  private getQsParameters(parameter: OpenAPIV3_1.ParameterObject): KeqQueryOptions | undefined {\n    let arrayFormat: QsArrayFormat | undefined\n    let allowDots: boolean | undefined\n    let indices: boolean | undefined\n\n    const style = parameter.style || 'form'\n    const explode = parameter.explode ?? true\n\n    if ('x-qs-array-format' in parameter) {\n      arrayFormat = parameter['x-qs-array-format'] as QsArrayFormat\n    } else {\n      if (style === 'deepObject') {\n        arrayFormat = QsArrayFormat.brackets\n      } else if (explode) {\n        arrayFormat = QsArrayFormat.repeat\n      } else {\n        if (style === 'form') {\n          arrayFormat = QsArrayFormat.comma\n        } else if (style === 'spaceDelimited') {\n          arrayFormat = QsArrayFormat.space\n        } else if (style === 'pipeDelimited') {\n          arrayFormat = QsArrayFormat.pipe\n        }\n      }\n    }\n\n    if ('x-qs-allow-dots' in parameter) {\n      allowDots = Boolean(parameter['x-qs-allow-dots'])\n    }\n\n    if ('x-qs-indices' in parameter) {\n      indices = Boolean(parameter['x-qs-indices'])\n    }\n\n\n    if (arrayFormat || allowDots !== undefined || indices !== undefined) {\n      return {\n        ...(arrayFormat ? { arrayFormat } : {}),\n        ...(allowDots !== undefined ? { allowDots } : {}),\n        ...(indices !== undefined ? { indices } : {}),\n      }\n    }\n\n    return undefined\n  }\n\n\n  // render: \"if (args && 'Authorization' in args) req.header('Authorization', args['Authorization'])\"\n  renderRequestHeaders(): string {\n    const { operation } = this.operationDefinition\n\n    const $headers = (operation.parameters || [])\n      .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n      .filter((p) => p.in === 'header')\n      .map((p) => `if (args && ${JSON.stringify(p.name)} in args) void req.header(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`)\n      .join('\\n')\n\n    return $headers\n  }\n\n  // render: \"if (args && 'id' in args) req.query('id', args['id'], options)\"\n  renderRequestQuery(): string {\n    const { operation } = this.operationDefinition\n\n    const $query = (operation.parameters || [])\n      .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n      .filter((p) => p.in === 'query')\n      .map((p) => {\n        const option = this.getQsParameters(p)\n        const $option = (!option || R.isEmpty(option)) ? '' : `, ${JSON.stringify(option)}`\n\n        return `if (args && ${JSON.stringify(p.name)} in args) void req.query(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}]${$option})`\n      })\n      .join('\\n')\n\n    return $query\n  }\n\n  // render: \"if (args && 'id' in args) req.params('id', args['id'])\"\n  renderRequestPathParameters(): string {\n    const { operation } = this.operationDefinition\n\n    const $pathParameters = (operation.parameters || [])\n      .filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p))\n      .filter((p) => p.in === 'path')\n      .map((p) => `if (args && ${JSON.stringify(p.name)} in args) void req.params(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`)\n      .join('\\n')\n\n    return $pathParameters\n  }\n\n  getRequestMediaTypes(): string[] {\n    const { operation } = this.operationDefinition\n    const requestBodyContent = (operation.requestBody?.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n    return Object.keys(requestBodyContent)\n  }\n\n  // render \"req.type(\"application/json\")\"\n  renderMediaType(): string {\n    const mediaTypes = this.getRequestMediaTypes()\n\n    if (mediaTypes.length === 1 && !mediaTypes[0].endsWith('/*')) {\n      if (this.options.emptyJsonRequestBodyMode === 'omit' && mediaTypes[0] === 'application/json') {\n        return ''\n      }\n      return `void req.type(\"${mediaTypes[0]}\")\\n`\n    } else if (mediaTypes.some((mediaType) => mediaType === '*/*')) {\n    // no-op\n    } else if (mediaTypes.some((mediaType) => mediaType.endsWith('/*'))) {\n      return 'if(args?.[\"content-type\"]) void req.type(args[\"content-type\"])\\n'\n    } else if (mediaTypes.length > 1) {\n      return 'if(args?.[\"content-type\"]) void req.type(args[\"content-type\"])\\n'\n    }\n\n    return ''\n  }\n\n\n  // render body\n\n  private requestBodyFormDataPropertyRenderer(\n    propertyName: string,\n    propertySchema: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject,\n    mediaType: string,\n  ): string {\n    try {\n      const $propertyName = JSON.stringify(propertyName)\n\n      const schema = JsonSchemaUtils.isRef(propertySchema)\n        ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(propertySchema.$ref, this.operationDefinition.document.specification)\n        : propertySchema\n\n      if (\n        (schema.type === 'string' && schema.format === 'binary')\n        || schema.contentMediaType === 'application/octet-stream') {\n        return `if (args && ${$propertyName} in args && args[${$propertyName}]) void req.attach(${$propertyName}, args[${$propertyName}])`\n      } else if (\n        schema.type === 'string'\n        || (schema.type === 'array' && schema.items && schema.items.type === 'string')\n      ) {\n        return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) void req.field(${$propertyName}, args[${$propertyName}])`\n      } else if (schema.type === 'number' || schema.type === 'integer') {\n        return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) void req.field(${$propertyName}, String(args[${$propertyName}]))`\n      }\n\n      return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) void req.field(${$propertyName}, String(args[${$propertyName}]) /* type is non-string in schema; triggers type coercion here */)`\n    } catch (err) {\n      return this.renderErrorComment(err, mediaType)\n    }\n  }\n\n  private requestBodyPropertyRenderer(\n    propertyName: string,\n    propertySchema: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject,\n    mediaType: string,\n  ): string {\n    if (mediaType === 'application/json') {\n      const $propertyName = JSON.stringify(propertyName)\n      return `if (args && ${$propertyName} in args) void req.send({ ${$propertyName}: args[${$propertyName}] })`\n    } else if (mediaType === 'multipart/form-data') {\n      return this.requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType)\n    } else {\n      throw new Error(`Unsupported media type: ${mediaType}`)\n    }\n  }\n\n  renderRequestBody(): string {\n    const { operation } = this.operationDefinition\n    const requestBodyContent = (operation.requestBody?.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n\n    const $requestBody = Object.entries(requestBodyContent)\n      .map(([mediaType, mediaTypeObject]): string | undefined => {\n        if (!mediaTypeObject.schema) return\n\n        try {\n          const schema = JsonSchemaUtils.isRef(mediaTypeObject.schema)\n            ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(mediaTypeObject.schema.$ref, this.operationDefinition.document.specification)\n            : mediaTypeObject.schema\n\n          if (schema.type !== 'object') return\n\n          const properties = (schema.properties || {}) as OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject\n\n          return Object.entries(properties)\n            .map(([propertyName, propertySchema]) => this.requestBodyPropertyRenderer(propertyName, propertySchema, mediaType))\n            .join('\\n')\n        } catch (err) {\n          return this.renderErrorComment(err, mediaType)\n        }\n      })\n      .filter(R.isNotNil)\n      .join('\\n')\n\n    // For emptyJsonRequestBodyMode 'empty-object' or 'null', add body fallback\n    if (\n      this.options.emptyJsonRequestBodyMode\n      && this.options.emptyJsonRequestBodyMode !== 'strict'\n      && this.options.emptyJsonRequestBodyMode !== 'omit'\n    ) {\n      const jsonContent = requestBodyContent['application/json']\n      if (jsonContent?.schema) {\n        const fallbackValue = this.options.emptyJsonRequestBodyMode === 'empty-object' ? '{}' : 'null'\n\n        try {\n          const schema = JsonSchemaUtils.isRef(jsonContent.schema)\n            ? OpenapiUtils.dereferenceDeep<OpenAPIV3_1.SchemaObject>(jsonContent.schema.$ref, this.operationDefinition.document.specification)\n            : jsonContent.schema\n\n          if (schema.type === 'object' && schema.properties) {\n            const propNames = Object.keys(schema.properties)\n            if (propNames.length > 0) {\n              const checks = propNames.map((p) => `\"${p}\" in args`).join(' || ')\n              const fallback = `if (!args || !((${checks}))) void req.send(${fallbackValue})`\n              return [fallback, $requestBody].filter(Boolean).join('\\n')\n            }\n          }\n        } catch {\n          // If dereferencing fails, fallthrough to unconditional fallback\n        }\n\n        // No properties or deref failed: always send fallback\n        const fallback = `void req.send(${fallbackValue})`\n        return [fallback, $requestBody].filter(Boolean).join('\\n')\n      }\n    }\n\n    return $requestBody\n  }\n\n  private renderErrorComment(err: unknown, mediaType: string): string {\n    const $err = String(err)\n      .split('\\n')\n      .map(((line) => ` * ${line}`))\n      .join('\\n')\n\n    return [\n      '/**',\n      ` * Unable to dereference schema for media type ${mediaType}`,\n      $err,\n      ' */',\n    ].join('\\n')\n  }\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\nimport { indent } from '~/utils/indent.js'\nimport { toSafeIdentifier } from '~/utils/to-safe-identifier.js'\nimport { Exception } from '~/exception.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { OperationDefinitionSnippet, OperationDefinitionSnippetOptions } from './typescript-snippet.js'\n\n\nexport interface OperationDefinitionMicroFunctionRendererOptions extends OperationDefinitionSnippetOptions {\n  /** @deprecated */\n  v2Compat?: boolean\n  getOperationDefinitionDeclarationFilepath(operationDefinition: OperationDefinition): string\n  getRequestFilepath(): string\n}\n\nexport class OperationDefinitionMicroFunctionRenderer implements Renderer {\n  helper: OperationDefinitionSnippet\n  typeName: TypeNameFn\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    private readonly options: OperationDefinitionMicroFunctionRendererOptions,\n  ) {\n    this.typeName = typeNameFactory(operationDefinition)\n    this.helper = new OperationDefinitionSnippet(operationDefinition, options)\n  }\n\n  private get operationId(): string {\n    return toSafeIdentifier(this.operationDefinition.operationId)\n  }\n\n  render(): string {\n    const { operation, method, pathname } = this.operationDefinition\n    if (!operation.responses) return ''\n\n    const operationId = this.operationId\n\n    const $dependencies = this.renderDependencies()\n    const $comment = new CommentRenderer(this.operationDefinition).render()\n\n    const $method = method.toLowerCase()\n    const $queryParameters = this.helper.renderRequestQuery()\n    const $headerParameters = this.helper.renderRequestHeaders()\n    const $pathParameters = this.helper.renderRequestPathParameters()\n\n    const $mediaType = this.helper.renderMediaType()\n\n    const $requestBody = this.helper.renderRequestBody()\n\n    const $operationDeclaration = this.renderOperationDeclaration()\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $dependencies,\n      '',\n      this.options.v2Compat ? `const moduleName = \"${this.operationDefinition.module.name}\"` : undefined,\n      `const method = \"${method}\"`,\n      `const pathname = \"${pathname}\"`,\n      '',\n      $comment || undefined,\n      `export ${$operationDeclaration} {`,\n      `  const req = request.${$method}<${this.typeName('ResponseBodies')}[STATUS]>(\"${pathname}\")`,\n      this.options.v2Compat ? '    .option(\\'module\\', { name: moduleName, pathname, method })' : undefined,\n      '',\n      $mediaType ? indent(2, $mediaType) : undefined,\n      '  /* @anchor:query:start */',\n      $queryParameters ? indent(2, $queryParameters) : undefined,\n      '  /* @anchor:query:end */',\n      '',\n      '  /* @anchor:headers:start */',\n      $headerParameters ? indent(2, $headerParameters) : undefined,\n      '  /* @anchor:headers:end */',\n      '',\n      '  /* @anchor:path-parameters:start */',\n      $pathParameters ? indent(2, $pathParameters) : undefined,\n      '  /* @anchor:path-parameters:end */',\n      '',\n      '  /* @anchor:body:start */',\n      $requestBody ? indent(2, $requestBody) : undefined,\n      '  /* @anchor:body:end */',\n      '',\n      '  /* @anchor:operation-return */',\n      `  return req as ReturnType<typeof ${operationId}<STATUS${$operationDeclaration.includes('CONTENT_TYPE') ? ', CONTENT_TYPE' : ''}>>`,\n      '}',\n      '',\n      `${operationId}.pathname = pathname`,\n      `${operationId}.method = method`,\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  private renderDependencies(): string {\n    const declarationFilepath = this.options.getOperationDefinitionDeclarationFilepath(this.operationDefinition)\n    const requestFilepath = this.options.getRequestFilepath()\n\n    return [\n      'import { Keq } from \"keq\"',\n      `import { request } from \"${requestFilepath}\"`,\n      `import type { ${this.typeName('Operation')}, ${this.typeName('ResponseBodies')}, ${this.typeName('RequestParameters')} } from \"${declarationFilepath}\"`,\n      `export type { ${this.typeName('RequestQuery')}, ${this.typeName('RequestHeaders')}, ${this.typeName('RequestBodies')} } from \"${declarationFilepath}\"`,\n    ]\n      .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n      .join('\\n')\n  }\n\n  private renderOperationDeclaration(): string {\n    const operationId = this.operationId\n\n    const mediaTypes = this.helper.getRequestMediaTypes()\n\n    if (mediaTypes.length === 0) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends never = never>(args?: ${this.typeName('RequestParameters')}): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length === 1) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${this.typeName('RequestParameters')}): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length > 1) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${this.typeName('RequestParameters')}[\"content-type\"]>(args?: Extract<${this.typeName('RequestParameters')}, { \"content-type\": CONTENT_TYPE }>): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    }\n\n    throw new Exception(this.operationDefinition.module, '[operationDeclarationRenderer] Unreachable')\n  }\n}\n","import * as R from 'ramda'\nimport { TypeNameFn, typeNameFactory } from './utils/index.js'\nimport { OperationDefinition } from '~/models/index.js'\nimport { OperationDefinitionSnippet, OperationDefinitionSnippetOptions } from './typescript-snippet.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { indent } from '~/utils/indent.js'\nimport { toSafeIdentifier } from '~/utils/to-safe-identifier.js'\nimport { Renderer } from '../types/renderer.js'\nimport { Exception } from '~/exception.js'\n\n\nexport type OperationDefinitionNestjsMethodRendererOptions = OperationDefinitionSnippetOptions\n\nexport class OperationDefinitionNestjsMethodRenderer implements Renderer {\n  helper: OperationDefinitionSnippet\n  typeName: TypeNameFn\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    private readonly options: OperationDefinitionNestjsMethodRendererOptions,\n  ) {\n    this.typeName = typeNameFactory(operationDefinition)\n    this.helper = new OperationDefinitionSnippet(operationDefinition, options)\n  }\n\n  private get operationId(): string {\n    return toSafeIdentifier(this.operationDefinition.operationId)\n  }\n\n  render(): string {\n    const pathname = this.operationDefinition.pathname\n\n    const $comment = new CommentRenderer(this.operationDefinition).render()\n    const $method = this.operationDefinition.method.toLowerCase()\n    const $mediaType = this.helper.renderMediaType()\n    const $operationDeclaration = this.renderOperationDeclaration(this.operationDefinition)\n    const $queryParameters = this.helper.renderRequestQuery()\n    const $headerParameters = this.helper.renderRequestHeaders()\n    const $pathParameters = this.helper.renderRequestPathParameters()\n    const $requestBody = this.helper.renderRequestBody()\n\n    return [\n      $comment,\n      `${$operationDeclaration} {`,\n      `  const req = this.request.${$method}<${this.typeName('ResponseBodies')}[STATUS]>(${JSON.stringify(pathname)})`,\n      '',\n      $mediaType ? indent(2, $mediaType) : undefined,\n      '',\n      '  /* @anchor:query:start */',\n      $queryParameters ? indent(2, $queryParameters) : undefined,\n      '  /* @anchor:query:end */',\n      '',\n      '  /* @anchor:headers:start */',\n      $headerParameters ? indent(2, $headerParameters) : undefined,\n      '  /* @anchor:headers:end */',\n      '',\n      '  /* @anchor:path-parameters:start */',\n      $pathParameters ? indent(2, $pathParameters) : undefined,\n      '  /* @anchor:path-parameters:end */',\n      '',\n      '  /* @anchor:body:start */',\n      $requestBody ? indent(2, $requestBody) : undefined,\n      '  /* @anchor:body:end */',\n      '',\n      '  return req',\n      '}',\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  private renderOperationDeclaration(operationDefinition: OperationDefinition): string {\n    const operationId = this.operationId\n    const typeName = typeNameFactory(operationDefinition)\n\n    const mediaTypes = this.helper.getRequestMediaTypes()\n\n    if (mediaTypes.length === 0) {\n      return `${operationId}<STATUS extends keyof ${typeName('ResponseBodies')}, CONTENT_TYPE extends never = never>(args?: ${typeName('RequestParameters')}): Keq<${typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length === 1) {\n      return `${operationId}<STATUS extends keyof ${typeName('ResponseBodies')}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${typeName('RequestParameters')}): Keq<${typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length > 1) {\n      return `${operationId}<STATUS extends keyof ${typeName('ResponseBodies')}, CONTENT_TYPE extends ${typeName('RequestParameters')}[\"content-type\"]>(args?: Extract<${typeName('RequestParameters')}, { \"content-type\": CONTENT_TYPE }>): Keq<${typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    }\n\n    throw new Exception(operationDefinition.module, '[operationDeclarationRenderer] Unreachable')\n  }\n}\n","import * as R from 'ramda'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { OperationDefinition, SchemaDefinition } from '~/models/index.js'\nimport { typeNameFactory, TypeNameFn } from './utils/index.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { JsonSchemaTransformer, JsonSchemaDeclarationRendererOptions, ReferenceTransformer } from '../json-schema/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { toSafeIdentifier } from '~/utils/to-safe-identifier.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { OperationDefinitionSnippet, OperationDefinitionSnippetOptions } from './typescript-snippet.js'\nimport { Exception } from '~/exception.js'\nimport { DeclarationRenders } from './declaration.renders.js'\nimport { indent } from '~/utils/indent.js'\n\n\nexport interface OperationDefinitionIsolatedRendererOptions extends OperationDefinitionSnippetOptions {\n  additionalPropertiesType?: 'unknown' | 'any'\n  v2Compat?: boolean\n  getRequestFilepath(): string\n}\n\n\nexport class IsolatedRenderer implements Renderer {\n  private typeName: TypeNameFn\n  private helper: OperationDefinitionSnippet\n  private renders: DeclarationRenders\n\n  constructor(\n    private readonly operationDefinition: OperationDefinition,\n    private readonly options: OperationDefinitionIsolatedRendererOptions,\n  ) {\n    this.typeName = typeNameFactory(operationDefinition)\n    this.helper = new OperationDefinitionSnippet(operationDefinition, options)\n\n    const hint = `Referenced from operation \"${operationDefinition.method.toUpperCase()} ${operationDefinition.pathname}\".`\n    const jsonSchemaOptions: JsonSchemaDeclarationRendererOptions = {\n      referenceTransformer: (schema: OpenAPIV3_1.ReferenceObject) => {\n        if (schema.$ref && schema.$ref.startsWith('#') && !operationDefinition.document.isRefDefined(schema.$ref)) {\n          return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n        }\n\n        return ReferenceTransformer.toDeclaration(schema)\n      },\n      additionalPropertiesType: options.additionalPropertiesType,\n    }\n\n    this.renders = new DeclarationRenders(operationDefinition, {\n      typeName: this.typeName,\n      jsonSchemaOptions,\n    })\n  }\n\n  private get operationId(): string {\n    return toSafeIdentifier(this.operationDefinition.operationId)\n  }\n\n  render(): string {\n    const { operation } = this.operationDefinition\n    if (!operation.responses) return ''\n\n    const parameters = operation.parameters?.filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p)) || []\n\n    const $imports = this.renderImports()\n    const $inlineSchemas = this.renderInlineSchemas()\n    const $responseBodies = this.renders.renderResponseBodies()\n    const $requestBodies = this.renders.renderRequestBodies()\n    const $parameterBodies = this.renders.renderParameterBodies()\n    const $requestParameters = this.renders.renderRequestParameters()\n    const $requestQuery = this.renders.renderParameters(\n      `${this.typeName('RequestQuery')}`,\n      parameters.filter((p) => p.in === 'query'),\n    )\n    const $routeParameters = this.renders.renderParameters(\n      `${this.typeName('RouteParameters')}`,\n      parameters.filter((p) => p.in === 'path'),\n    )\n    const $requestHeaders = this.renders.renderParameters(\n      `${this.typeName('RequestHeaders')}`,\n      parameters.filter((p) => p.in === 'header'),\n    )\n    const $operationInterface = this.renders.renderOperationInterface()\n    const $function = this.renderFunction()\n    const $fileComment = this.renders.renderFileComment()\n\n    return [\n      $fileComment,\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $imports,\n      '',\n      $inlineSchemas || undefined,\n      $responseBodies,\n      '',\n      $requestBodies,\n      '',\n      $requestQuery,\n      '',\n      $routeParameters,\n      '',\n      $requestHeaders,\n      '',\n      $parameterBodies || undefined,\n      $requestParameters,\n      '',\n      $operationInterface,\n      '',\n      $function,\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  private renderImports(): string {\n    const requestFilepath = this.options.getRequestFilepath()\n\n    return [\n      'import { Keq } from \"keq\"',\n      'import type { KeqOperation, KeqPathParameterInit, KeqQueryInit, ServerSentEvent } from \"keq\"',\n      `import { request } from \"${requestFilepath}\"`,\n    ]\n      .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n      .join('\\n')\n  }\n\n  private renderInlineSchemas(): string {\n    const schemaDeps = this.collectAllSchemaDependencies()\n\n    if (schemaDeps.length === 0) return ''\n\n    const rendered = schemaDeps.map((schemaDefinition) => {\n      return this.renderSingleSchema(schemaDefinition)\n    })\n\n    return rendered.join('\\n\\n') + '\\n'\n  }\n\n  private renderSingleSchema(schemaDefinition: SchemaDefinition): string {\n    const referenceTransformer = (schema: OpenAPIV3_1.ReferenceObject): string => {\n      const hint = `Referenced from schema definition \"${schemaDefinition.name}\".`\n      if (!schema.$ref || !schema.$ref.startsWith('#')) {\n        return ReferenceTransformer.toInvalidDeclaration(schema, hint)\n      }\n\n      if (!schemaDefinition.document.isRefDefined(schema.$ref)) {\n        return ReferenceTransformer.toNotFoundDeclaration(schema, hint)\n      }\n\n      return ReferenceTransformer.toDeclaration(schema)\n    }\n\n    const options: JsonSchemaDeclarationRendererOptions = {\n      referenceTransformer,\n      additionalPropertiesType: this.options.additionalPropertiesType,\n    }\n\n    let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema)\n    if ($comment) $comment += '\\n'\n\n    if (typeof schemaDefinition.schema === 'boolean') {\n      return `${$comment ? $comment : ''}type ${schemaDefinition.name} = unknown`\n    }\n\n    if (JsonSchemaUtils.isNonArray(schemaDefinition.schema) && schemaDefinition.schema.type === 'object') {\n      const $schema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema, options)\n      if ($schema.startsWith('{')) {\n        return `${$comment ? $comment : ''}interface ${schemaDefinition.name} ${$schema}`\n      }\n      return `${$comment ? $comment : ''}type ${schemaDefinition.name} = ${$schema}`\n    }\n\n    return `${$comment ? $comment : ''}type ${schemaDefinition.name} = ${JsonSchemaTransformer.toDeclaration(schemaDefinition.schema, options)}`\n  }\n\n  private collectAllSchemaDependencies(): SchemaDefinition[] {\n    const collected = new Map<string, SchemaDefinition>()\n    const queue = [...this.operationDefinition.getDependencies()]\n\n    while (queue.length > 0) {\n      const current = queue.shift()!\n      if (SchemaDefinition.isUnknown(current)) continue\n      if (collected.has(current.id)) continue\n\n      collected.set(current.id, current)\n\n      for (const dep of current.getDependencies()) {\n        if (!SchemaDefinition.isUnknown(dep) && !collected.has(dep.id)) {\n          queue.push(dep)\n        }\n      }\n    }\n\n    return Array.from(collected.values())\n  }\n\n  private renderFunction(): string {\n    const { method, pathname } = this.operationDefinition\n    const operationId = this.operationId\n\n    const $comment = new CommentRenderer(this.operationDefinition).render()\n\n    const $method = method.toLowerCase()\n    const $queryParameters = this.helper.renderRequestQuery()\n    const $headerParameters = this.helper.renderRequestHeaders()\n    const $pathParameters = this.helper.renderRequestPathParameters()\n    const $mediaType = this.helper.renderMediaType()\n    const $requestBody = this.helper.renderRequestBody()\n    const $operationDeclaration = this.renderOperationDeclaration()\n\n    return [\n      this.options.v2Compat ? `const moduleName = \"${this.operationDefinition.module.name}\"` : undefined,\n      `const method = \"${method}\"`,\n      `const pathname = \"${pathname}\"`,\n      '',\n      $comment || undefined,\n      `export ${$operationDeclaration} {`,\n      `  const req = request.${$method}<${this.typeName('ResponseBodies')}[STATUS]>(\"${pathname}\")`,\n      this.options.v2Compat ? '    .option(\\'module\\', { name: moduleName, pathname, method })' : undefined,\n      '',\n      $mediaType ? indent(2, $mediaType) : undefined,\n      '  /* @anchor:query:start */',\n      $queryParameters ? indent(2, $queryParameters) : undefined,\n      '  /* @anchor:query:end */',\n      '',\n      '  /* @anchor:headers:start */',\n      $headerParameters ? indent(2, $headerParameters) : undefined,\n      '  /* @anchor:headers:end */',\n      '',\n      '  /* @anchor:path-parameters:start */',\n      $pathParameters ? indent(2, $pathParameters) : undefined,\n      '  /* @anchor:path-parameters:end */',\n      '',\n      '  /* @anchor:body:start */',\n      $requestBody ? indent(2, $requestBody) : undefined,\n      '  /* @anchor:body:end */',\n      '',\n      '  /* @anchor:operation-return */',\n      `  return req as ReturnType<typeof ${operationId}<STATUS${$operationDeclaration.includes('CONTENT_TYPE') ? ', CONTENT_TYPE' : ''}>>`,\n      '}',\n      '',\n      `${operationId}.pathname = pathname`,\n      `${operationId}.method = method`,\n    ].filter(R.isNotNil).join('\\n')\n  }\n\n  private renderOperationDeclaration(): string {\n    const operationId = this.operationId\n    const mediaTypes = this.helper.getRequestMediaTypes()\n\n    if (mediaTypes.length === 0) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends never = never>(args?: ${this.typeName('RequestParameters')}): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length === 1) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${this.typeName('RequestParameters')}): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    } else if (mediaTypes.length > 1) {\n      return `function ${operationId}<STATUS extends keyof ${this.typeName('ResponseBodies')}, CONTENT_TYPE extends ${this.typeName('RequestParameters')}[\"content-type\"]>(args?: Extract<${this.typeName('RequestParameters')}, { \"content-type\": CONTENT_TYPE }>): Keq<${this.typeName('Operation')}<STATUS, CONTENT_TYPE>>`\n    }\n\n    throw new Exception(this.operationDefinition.module, '[isolatedRenderer] Unreachable')\n  }\n}\n","import * as R from 'ramda'\nimport { OperationDefinition } from '~/models/index.js'\nimport { CommentRenderer } from './comment.renderer.js'\nimport { ModularDeclarationRenderer, ModularDeclarationRendererOptions } from './modular-declaration.renderer.js'\nimport { OperationDefinitionMicroFunctionRendererOptions, OperationDefinitionMicroFunctionRenderer } from './micro-function.renderer.js'\nimport { OperationDefinitionNestjsMethodRenderer, OperationDefinitionNestjsMethodRendererOptions } from './nestjs-method.renderer.js'\nimport { IsolatedRenderer, OperationDefinitionIsolatedRendererOptions } from './isolated.renderer.js'\n\n\nexport class OperationDefinitionTransformer {\n  static toDeclaration(operationDefinition: OperationDefinition, options: ModularDeclarationRendererOptions): string {\n    return new ModularDeclarationRenderer(operationDefinition, options).render()\n  }\n\n  static toMicroFunction(operationDefinition: OperationDefinition, options: OperationDefinitionMicroFunctionRendererOptions): string {\n    return new OperationDefinitionMicroFunctionRenderer(operationDefinition, options).render()\n  }\n\n  static toNestjsMethod(operationDefinition: OperationDefinition, options: OperationDefinitionNestjsMethodRendererOptions): string {\n    return new OperationDefinitionNestjsMethodRenderer(operationDefinition, options).render()\n  }\n\n  static toIsolated(operationDefinition: OperationDefinition, options: OperationDefinitionIsolatedRendererOptions): string {\n    return new IsolatedRenderer(operationDefinition, options).render()\n  }\n\n  static toComment(operationDefinition: OperationDefinition): string {\n    return new CommentRenderer(operationDefinition).render()\n  }\n}\n","import * as path from 'path'\nimport { Artifact } from '~/models/index.js'\n\n\ninterface EntrypointTypescriptRendererOptions {\n  esm?: boolean\n\n  // The directory path of the entrypoint file being generated\n  dirpath: string\n}\n\nexport class EntrypointTransformer {\n  static toTypescript(exports: Artifact[], options: EntrypointTypescriptRendererOptions): string {\n    const $exports = exports.length === 0\n      ? ['export {}']\n      : exports.map((exportArtifact) => {\n        const relativePath = path.relative(\n          options.dirpath,\n          exportArtifact.filepath,\n        )\n          .replace(/(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?$/, options.esm ? '.js' : '')\n\n        return relativePath.startsWith('.')\n          ? `export * from '${relativePath}'`\n          : `export * from './${relativePath}'`\n      })\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      ...$exports,\n      '',\n      '/* @anchor:file:end */',\n    ].join('\\n')\n  }\n}\n","import * as R from 'ramda'\nimport * as changeCase from 'change-case'\nimport { ApiDocumentV3_1, OperationDefinition } from '~/models/index.js'\nimport { Renderer } from '../types/renderer.js'\nimport { OperationDefinitionTransformer, typeNameFactory } from '../operation-definition/index.js'\nimport { indent } from '~/utils/indent.js'\n\n\nexport interface ApiDocumentNestjsClientRendererOptions {\n  esm?: boolean\n  emptyJsonRequestBodyMode?: 'strict' | 'omit' | 'empty-object' | 'null'\n\n  getOperationDefinitionDeclarationFilepath(this: void, operationDefinition: OperationDefinition): string\n}\n\n\nexport class NestjsClientRenderer implements Renderer {\n  constructor(\n    private readonly document: ApiDocumentV3_1,\n    private readonly options: ApiDocumentNestjsClientRendererOptions,\n  ) {\n\n  }\n\n  private renderDependencies(): string {\n    const $operations = this.document.operations\n      .map((operationDefinition) => {\n        const filepath = this.options.getOperationDefinitionDeclarationFilepath(operationDefinition)\n        const typeName = typeNameFactory(operationDefinition)\n\n        return `import type { ${typeName('Operation')}, ${typeName('ResponseBodies')}, ${typeName('RequestParameters')} } from \"${filepath}\"`\n      })\n      .map((str) => (str.replace(/ from \"(\\.\\.?\\/.+?)(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?\"/, this.options.esm ? ' from \"$1.js\"' : ' from \"$1\"')))\n\n    return [\n      'import { Injectable, Logger } from \"@nestjs/common\"',\n      'import { Keq, KeqRequest } from \"keq\"',\n      ...$operations,\n    ]\n      .join('\\n')\n  }\n\n  render(): string {\n    const moduleName = changeCase.pascalCase(this.document.module.name)\n\n    const $dependencies = this.renderDependencies()\n    const $operations = this.document.operations\n      .map((operation) => OperationDefinitionTransformer.toNestjsMethod(operation, {\n        esm: this.options.esm,\n        emptyJsonRequestBodyMode: this.options.emptyJsonRequestBodyMode,\n      }))\n      .join('\\n\\n')\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      '',\n      $dependencies,\n      '',\n      '@Injectable()',\n      `export class ${moduleName}Client {`,\n      `  private readonly logger = new Logger(${moduleName}Client.name)`,\n      '',\n      '  constructor(',\n      '    // @anchor:client-constructor-parameters:start',\n      '    private readonly request: KeqRequest,',\n      '    // @anchor:client-constructor-parameters:end',\n      '  ) {}',\n      '',\n      indent(2, $operations),\n      '}',\n      '',\n      '/* @anchor:file:end */',\n    ].filter(R.isNotNil).join('\\n')\n  }\n}\n","import * as changeCase from 'change-case'\nimport { ApiDocumentV3_1 } from '~/models/api-document_v3_1.js'\n\nexport interface ApiDocumentNestjsModuleRendererOptions {\n  esm?: boolean\n\n  getNestjsClientFilepath(document: ApiDocumentV3_1): string\n}\n\nexport class NestjsModuleRenderer {\n  constructor(\n    private readonly document: ApiDocumentV3_1,\n    private readonly options: ApiDocumentNestjsModuleRendererOptions,\n  ) {\n  }\n\n  render(): string {\n    const moduleName = changeCase.pascalCase(this.document.module.name)\n    const clientFilepath = this.options.getNestjsClientFilepath(this.document)\n      .replace(/(\\.ts|\\.mts|\\.cts|\\.js|\\.cjs|\\.mjs)?$/, this.options.esm ? '.js' : '')\n\n    return [\n      '',\n      '/* @anchor:file:start */',\n      'import { Module, ConfigurableModuleBuilder, Provider } from \"@nestjs/common\"',\n      'import { KeqRequest } from \"keq\"',\n      'import { KeqModule, type KeqModuleOptions, KeqConsumer } from \"@keq-request/nestjs\"',\n      `import { ${moduleName}Client } from \"${clientFilepath}\"`,\n      '',\n      '',\n      `export interface ${moduleName}ModuleOptions extends KeqModuleOptions {`,\n      '  /**',\n      '   * Whether to register the module globally.',\n      '   * @default false',\n      '   */',\n      '  isGlobal?: boolean',\n      '}',\n      '',\n      `const KEQ_REQUEST_TOKEN = Symbol(\"${moduleName}KeqRequest\")`,\n      `const KEQ_CONSUMER_TOKEN = Symbol(\"${moduleName}KeqConsumer\")`,\n      '',\n      `const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = new ConfigurableModuleBuilder<${moduleName}ModuleOptions>()`,\n      '  .setExtras({ isGlobal: false }, (definition, extras) => ({',\n      '    ...definition,',\n      '    global: extras.isGlobal,',\n      '  }))',\n      '  .build()',\n      '',\n      'const REQUEST_PROVIDER: Provider = {',\n      '  provide: KEQ_REQUEST_TOKEN,',\n      `  useFactory: (options: ${moduleName}ModuleOptions, globalRequest?: KeqRequest) => {`,\n      '',\n      '    if (!options.isolate && !globalRequest) {',\n      `      console.warn(\"${moduleName}Module: No global KeqRequest found, creating an isolated instance. Import KeqModule globally or set { isolate: true } to suppress this warning.\")`,\n      '    }',\n      '',\n      '    const request = (!options.isolate && globalRequest)',\n      '      ? globalRequest.fork()',\n      '      : new KeqRequest()',\n      '',\n      '    if (options.middlewares) {',\n      '      for (const middleware of options.middlewares) {',\n      '        request.use(middleware)',\n      '      }',\n      '    }',\n      '',\n      '    return request',\n      '  },',\n      '  inject: [',\n      '    MODULE_OPTIONS_TOKEN,',\n      '    { token: KeqRequest, optional: true },',\n      '  ],',\n      '}',\n      '',\n      'const CLIENT_PROVIDER: Provider = {',\n      `  provide: ${moduleName}Client,`,\n      `  useFactory: (request: KeqRequest) => new ${moduleName}Client(request),`,\n      '  inject: [KEQ_REQUEST_TOKEN],',\n      '}',\n      '',\n      'const CONSUMER_PROVIDER: Provider = {',\n      '  provide: KEQ_CONSUMER_TOKEN,',\n      '  useFactory: (request: KeqRequest) => new KeqConsumer(request),',\n      '  inject: [KEQ_REQUEST_TOKEN],',\n      '}',\n      '',\n      '/**',\n      ` * NestJS module that provides the {@link ${moduleName}Client} for dependency injection.`,\n      ' *',\n      ' * This module requires a `KeqRequest` instance, which can be provided in two ways:',\n      ' *',\n      ' * **Option 1: Use the global `KeqModule` (recommended)**',\n      ' *',\n      ' * Import `KeqModule` globally, then register this module.',\n      ' * The module will fork from the global KeqRequest and inherit its middlewares.',\n      ' *',\n      ' * ```typescript',\n      ' * // app.module.ts',\n      \" * import { KeqModule } from '@keq-request/nestjs'\",\n      ' * ',\n      ' * @Module({',\n      ' *   imports: [',\n      ' *     KeqModule,',\n      ` *     ${moduleName}Module.register({`,\n      ' *       isGlobal: true, // optional, default false',\n      ' *       middlewares: [], // module-level middlewares',\n      ' *     }),',\n      ' *   ],',\n      ' * })',\n      ' * export class AppModule {}',\n      ' * ```',\n      ' *',\n      ' * **Option 2: Provide an isolated `KeqRequest` instance**',\n      ' *',\n      ' * ```typescript',\n      ' * @Module({',\n      ' *   imports: [',\n      ` *     ${moduleName}Module.register({`,\n      ' *       isolate: true, // no inherited middlewares',\n      ' *     }),',\n      ' *   ],',\n      ' * })',\n      ' * export class SomeFeatureModule {}',\n      ' * ```',\n      ' *',\n      ' * Then inject `' + moduleName + 'Client` in your services:',\n      ' *',\n      ' * ```typescript',\n      ' * @Injectable()',\n      ' * export class SomeService {',\n      ` *   constructor(private readonly client: ${moduleName}Client) {}`,\n      ' * }',\n      ' * ```',\n      ' */',\n      '@Module({',\n      '  imports: [KeqModule],',\n      '  providers: [REQUEST_PROVIDER, CONSUMER_PROVIDER, CLIENT_PROVIDER],',\n      `  exports: [${moduleName}Client, KEQ_CONSUMER_TOKEN],`,\n      '})',\n      `export class ${moduleName}Module extends ConfigurableModuleClass {`,\n      '  static readonly KEQ_REQUEST = KEQ_REQUEST_TOKEN',\n      '  static readonly KEQ_CONSUMER = KEQ_CONSUMER_TOKEN',\n      '}',\n      '',\n      '/* @anchor:file:end */',\n    ].join('\\n')\n  }\n}\n","import { ApiDocumentV3_1 } from '~/models/index.js'\nimport { ApiDocumentNestjsClientRendererOptions, NestjsClientRenderer } from './nestjs-client.renderer.js'\nimport { ApiDocumentNestjsModuleRendererOptions, NestjsModuleRenderer } from './nestjs-module.renderer.js'\n\n\nexport class ApiDocumentTransformer {\n  static toNestjsModule(document: ApiDocumentV3_1, options: ApiDocumentNestjsModuleRendererOptions): string {\n    return new NestjsModuleRenderer(document, options).render()\n  }\n\n  static toNestjsClient(document: ApiDocumentV3_1, options: ApiDocumentNestjsClientRendererOptions): string {\n    return new NestjsClientRenderer(document, options).render()\n  }\n}\n","import * as changeCase from 'change-case'\nimport { FileNamingStyle } from '~/constants/file-naming-style.js'\n\nexport function convertFilename(name: string, style: FileNamingStyle): string {\n  if (style === FileNamingStyle.raw) return name\n  return changeCase[style](name)\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition, ResponseDefinition, SchemaDefinition } from '~/models/index.js'\nimport { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface GenerateDeclarationPluginMetadata {\n  applied: boolean\n  hooks: {\n    afterEntrypointArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>\n    afterSchemaDeclarationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, SchemaDefinition, TaskWrapper]>\n    afterResponseDeclarationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, ResponseDefinition, TaskWrapper]>\n    afterOperationDeclarationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>\n  }\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<GenerateDeclarationPluginMetadata>(\n  '@keq-request/cli:GenerateDeclarationPlugin:MetadataStorage',\n)\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport { Artifact, ModuleDefinition, SchemaDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { SchemaDefinitionTransformer } from '~/transformers/schema-definition/index.js'\nimport { EntrypointTransformer } from '~/transformers/entrypoint/entrypoint.transformer.js'\nimport { FileNamingStyle } from '~/constants/file-naming-style.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport type { Generator, RuntimeConfig } from '~/types/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\n\n\nexport const SCHEMA_GENERATOR = 'schemaGenerator'\n\nexport class SchemaDeclarationGenerator implements Generator {\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const context = compiler.context\n    const metadata = MetadataStorage.get(compiler)!\n\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const schemaDefinitions = documents.flatMap((document) => document.schemas)\n\n    const artifactMap = new Map<SchemaDefinition, Artifact>(\n      await Promise.all(\n        schemaDefinitions.map(async (schemaDefinition) => (<const>[\n          schemaDefinition,\n          await metadata.hooks.afterSchemaDeclarationArtifactGenerated.promise(\n            this.generateSchemaDefinitionsArtifact(schemaDefinition, rc),\n            schemaDefinition,\n            task,\n          ),\n        ])),\n      ),\n    )\n\n    if (!rc.rendering.entrypoint) {\n      return [...artifactMap.values()]\n    }\n\n    const schemaDefinitionsByModuleName = new Map<string, SchemaDefinition[]>()\n    for (const schemaDefinition of schemaDefinitions) {\n      const definitions = schemaDefinitionsByModuleName.get(schemaDefinition.module.name) ?? []\n      definitions.push(schemaDefinition)\n      schemaDefinitionsByModuleName.set(schemaDefinition.module.name, definitions)\n    }\n\n    const entrypoints = R.collectBy(\n      (document) => document.module.name,\n      documents,\n    )\n      .map((documents) => <const>[\n        documents[0].module,\n        (schemaDefinitionsByModuleName.get(documents[0].module.name) ?? [])\n          .map((schemaDefinition) => artifactMap.get(schemaDefinition))\n          .filter((artifact): artifact is Artifact => Boolean(artifact)),\n      ])\n\n      .map(([moduleDefinition, artifacts]) => this.generateEntrypointArtifact(\n        moduleDefinition,\n        artifacts,\n        rc,\n      ))\n\n    return [...artifactMap.values(), ...entrypoints]\n  }\n\n  private generateSchemaDefinitionsArtifact(schemaDefinition: SchemaDefinition, rc: RuntimeConfig): Artifact {\n    const filepath = SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(schemaDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: SchemaDeclarationGenerator.getSchemaDefinitionArtifactId(schemaDefinition),\n      filepath,\n      content: SchemaDefinitionTransformer.toDeclaration(\n        schemaDefinition,\n        {\n          esm: rc.rendering.esm,\n          additionalPropertiesType: rc.rendering.additionalPropertiesType,\n          getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string {\n            const relativePath = path.relative(\n              dirpath,\n              SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.rendering.fileNamingStyle),\n            )\n\n            return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n          },\n        },\n      ),\n      extensionName: '.schema.ts',\n    })\n\n    return artifact\n  }\n\n  private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n    const filepath = SchemaDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: SchemaDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),\n      filepath,\n      content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n    })\n\n    return artifact\n  }\n\n  static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n    return [\n      '.',\n      convertFilename(moduleDefinition.name, fileNamingStyle),\n      'types',\n      'components',\n      'schemas',\n      'index.ts',\n    ].join('/')\n  }\n\n  static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n    return `${moduleDefinition.address.url}/components/schemas/entrypoint?generator=${SCHEMA_GENERATOR}`\n  }\n\n  static getSchemaDefinitionArtifactFilepath(schemaDefinition: SchemaDefinition, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(schemaDefinition.name, fileNamingStyle)}.schema.ts`\n    return [\n      '.',\n      convertFilename(schemaDefinition.module.name, fileNamingStyle),\n      'types',\n      'components',\n      'schemas',\n      filename,\n    ].join('/')\n  }\n\n  static getSchemaDefinitionArtifactId(schemaDefinition: SchemaDefinition): string {\n    return `${schemaDefinition.id}?generator=${SCHEMA_GENERATOR}`\n  }\n}\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport { Artifact, ModuleDefinition, ResponseDefinition, SchemaDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ResponseDefinitionTransformer } from '~/transformers/response-definition/index.js'\nimport { EntrypointTransformer } from '~/transformers/entrypoint/entrypoint.transformer.js'\nimport { FileNamingStyle } from '~/constants/file-naming-style.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport type { Generator, RuntimeConfig } from '~/types/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\nimport { SchemaDeclarationGenerator } from '../schema-declaration/index.js'\n\n\nexport const RESPONSE_GENERATOR = 'responseGenerator'\n\nexport class ResponseDeclarationGenerator implements Generator {\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const context = compiler.context\n    const metadata = MetadataStorage.get(compiler)!\n\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const responseDefinitions = documents.flatMap((document) => document.responses)\n\n    const artifactMap = new Map<ResponseDefinition, Artifact>(\n      await Promise.all(\n        responseDefinitions.map(async (responseDefinition) => (<const>[\n          responseDefinition,\n          await metadata.hooks.afterResponseDeclarationArtifactGenerated.promise(\n            this.generateResponseDefinitionArtifact(responseDefinition, rc),\n            responseDefinition,\n            task,\n          ),\n        ])),\n      ),\n    )\n\n    if (!rc.rendering.entrypoint) {\n      return [...artifactMap.values()]\n    }\n\n    const responseDefinitionsByModuleName = new Map<string, ResponseDefinition[]>()\n    for (const responseDefinition of responseDefinitions) {\n      const definitions = responseDefinitionsByModuleName.get(responseDefinition.module.name) ?? []\n      definitions.push(responseDefinition)\n      responseDefinitionsByModuleName.set(responseDefinition.module.name, definitions)\n    }\n\n    const entrypoints = R.collectBy(\n      (document) => document.module.name,\n      documents,\n    )\n      .map((documents) => <const>[\n        documents[0].module,\n        (responseDefinitionsByModuleName.get(documents[0].module.name) ?? [])\n          .map((responseDefinition) => artifactMap.get(responseDefinition))\n          .filter((artifact): artifact is Artifact => Boolean(artifact)),\n      ])\n      .map(([moduleDefinition, artifacts]) => this.generateEntrypointArtifact(\n        moduleDefinition,\n        artifacts,\n        rc,\n      ))\n\n    return [...artifactMap.values(), ...entrypoints]\n  }\n\n  private generateResponseDefinitionArtifact(responseDefinition: ResponseDefinition, rc: RuntimeConfig): Artifact {\n    const filepath = ResponseDeclarationGenerator.getResponseDefinitionArtifactFilepath(responseDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: ResponseDeclarationGenerator.getResponseDefinitionArtifactId(responseDefinition),\n      filepath,\n      content: ResponseDefinitionTransformer.toDeclaration(\n        responseDefinition,\n        {\n          esm: rc.rendering.esm,\n          additionalPropertiesType: rc.rendering.additionalPropertiesType,\n          getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string {\n            const relativePath = path.relative(\n              dirpath,\n              SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.rendering.fileNamingStyle),\n            )\n\n            return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n          },\n        },\n      ),\n      extensionName: '.response.ts',\n    })\n\n    return artifact\n  }\n\n  private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n    const filepath = ResponseDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: ResponseDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),\n      filepath,\n      content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n    })\n\n    return artifact\n  }\n\n  static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n    return [\n      '.',\n      convertFilename(moduleDefinition.name, fileNamingStyle),\n      'types',\n      'components',\n      'responses',\n      'index.ts',\n    ].join('/')\n  }\n\n  static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n    return `${moduleDefinition.address.url}/components/responses/entrypoint?generator=${RESPONSE_GENERATOR}`\n  }\n\n  static getResponseDefinitionArtifactFilepath(responseDefinition: ResponseDefinition, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(responseDefinition.name, fileNamingStyle)}.response.ts`\n    return [\n      '.',\n      convertFilename(responseDefinition.module.name, fileNamingStyle),\n      'types',\n      'components',\n      'responses',\n      filename,\n    ].join('/')\n  }\n\n  static getResponseDefinitionArtifactId(responseDefinition: ResponseDefinition): string {\n    return `${responseDefinition.id}?generator=${RESPONSE_GENERATOR}`\n  }\n}\n","import * as path from 'path'\nimport { Artifact, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { OperationDefinitionTransformer, EntrypointTransformer } from '~/transformers/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport type { Generator, RuntimeConfig } from '~/types/index.js'\nimport { SchemaDeclarationGenerator } from '../schema-declaration/index.js'\nimport { ResponseDeclarationGenerator } from '../response-declaration/index.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\n\n\nexport const OPERATION_GENERATOR = 'operationDeclarationGenerator'\n\nexport class OperationDeclarationGenerator implements Generator {\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const context = compiler.context\n    const metadata = MetadataStorage.get(compiler)!\n\n    const rc = context.rc!\n    // const matcher = context.matcher!\n    const documents = context.documents!\n    // .filter((document) => !matcher.isModuleDenied(document.module))\n\n    const operationDefinitions = documents.flatMap((document) => document.operations)\n\n    const artifactMap = new Map<OperationDefinition, Artifact>(\n      await Promise.all(\n        operationDefinitions.map(async (operationDefinition) => (<const>[\n          operationDefinition,\n          await metadata.hooks.afterOperationDeclarationArtifactGenerated.promise(\n            this.generateOperationDefinitionArtifact(operationDefinition, rc),\n            operationDefinition,\n            task,\n          ),\n        ])),\n      ),\n    )\n\n    return Array.from(artifactMap.values())\n  }\n\n\n  private generateOperationDefinitionArtifact(operationDefinition: OperationDefinition, rc: RuntimeConfig): Artifact {\n    const filepath = OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: OperationDeclarationGenerator.getOperationDefinitionArtifactId(operationDefinition),\n      filepath,\n      content: OperationDefinitionTransformer.toDeclaration(\n        operationDefinition,\n        {\n          esm: rc.rendering.esm,\n          additionalPropertiesType: rc.rendering.additionalPropertiesType,\n          getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {\n            const relativePath = path.relative(\n              dirpath,\n              SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.rendering.fileNamingStyle),\n            )\n            return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n          },\n          getDependentResponseDefinitionFilepath(dependentResponseDefinition) {\n            const relativePath = path.relative(\n              dirpath,\n              ResponseDeclarationGenerator.getResponseDefinitionArtifactFilepath(dependentResponseDefinition, rc.rendering.fileNamingStyle),\n            )\n            return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n          },\n        },\n      ),\n      extensionName: '.type.ts',\n    })\n\n    return artifact\n  }\n\n  private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n    const filepath = OperationDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: OperationDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),\n      filepath,\n      content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n    })\n\n    return artifact\n  }\n\n\n  static getOperationDefinitionArtifactFilepath(operationDefinition: OperationDefinition, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(operationDefinition.operationId, fileNamingStyle)}.type.ts`\n    const filepath = [\n      '.',\n      convertFilename(operationDefinition.module.name, fileNamingStyle),\n      'types',\n      'operations',\n      filename,\n    ].join('/')\n\n    return filepath\n  }\n\n  static getOperationDefinitionArtifactId(operationDefinition: OperationDefinition): string {\n    return `${operationDefinition.id}?generator=${OPERATION_GENERATOR}`\n  }\n\n  static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n    return [\n      '.',\n      convertFilename(moduleDefinition.name, fileNamingStyle),\n      'types',\n      'operations',\n      'index.ts',\n    ].join('/')\n  }\n\n  static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n    return `${moduleDefinition.address.url}/paths/entrypoint?generator=${OPERATION_GENERATOR}`\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/plugin.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition, ResponseDefinition, SchemaDefinition } from '~/models/index.js'\nimport { OperationDeclarationGenerator, SchemaDeclarationGenerator, ResponseDeclarationGenerator } from './generators/index.js'\nimport { GenerateDeclarationPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\nexport const DECLARATION_GENERATOR = 'declarationGenerator'\n\nexport class GenerateDeclarationPlugin implements Plugin {\n  name = DECLARATION_GENERATOR\n\n  operationGenerator = new OperationDeclarationGenerator()\n  schemaGenerator = new SchemaDeclarationGenerator()\n  responseGenerator = new ResponseDeclarationGenerator()\n\n  constructor() {}\n\n  apply(compiler: Compiler): void {\n    // Prevent duplicate registration by checking applied flag\n    const metadata = GenerateDeclarationPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.compile.tapPromise(GenerateDeclarationPlugin.name, async (task: TaskWrapper) => {\n      compiler.context.artifacts?.push(\n        ...await this.schemaGenerator.compile(compiler, task),\n        ...await this.responseGenerator.compile(compiler, task),\n        ...await this.operationGenerator.compile(compiler, task),\n      )\n    })\n  }\n\n  static register(compiler: Compiler): GenerateDeclarationPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n          afterEntrypointArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, TaskWrapper], Artifact>(['artifact', 'task']),\n          afterSchemaDeclarationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, SchemaDefinition, TaskWrapper], Artifact>(['artifact', 'schemaDefinition', 'task']),\n          afterResponseDeclarationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, ResponseDefinition, TaskWrapper], Artifact>(['artifact', 'responseDefinition', 'task']),\n          afterOperationDeclarationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper], Artifact>(['artifact', 'operationDefinition', 'task']),\n        },\n      })\n    }\n\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): GenerateDeclarationPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact } from '~/models/index.js'\nimport { Generator } from '~/types/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\n\n\nexport const MICRO_FUNCTION_REQUEST_GENERATOR = 'microFunctionRequestGenerator'\n\nexport class RequestGenerator implements Generator {\n  private generateRequestArtifact(moduleName: string, fileNamingStyle: FileNamingStyle, options?: { v2Compat?: boolean }): Artifact {\n    const v2Compat = options?.v2Compat ?? false\n\n    const content = v2Compat\n      ? [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        'import { KeqRequest, request as globalRequest } from \"keq\"',\n        '',\n        '/* @anchor:request-declaration */',\n        'export const request = new KeqRequest()',\n        'request.inherit(globalRequest)',\n        '',\n        '/* @anchor:file:end */',\n      ].join('\\n')\n      : [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        'import { KeqRequest } from \"keq\"',\n        '',\n        '/* @anchor:request-declaration */',\n        'export const request = new KeqRequest()',\n        '',\n        '/* @anchor:file:end */',\n      ].join('\\n')\n\n    return new Artifact({\n      id: RequestGenerator.getRequestArtifactId(moduleName),\n      filepath: RequestGenerator.getRequestArtifactFilepath(moduleName, fileNamingStyle),\n      content,\n    })\n  }\n\n\n  // eslint-disable-next-line @typescript-eslint/require-await\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const context = compiler.context\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const moduleNames = [...new Set(\n      documents.flatMap((doc) => doc.operations.map((op) => op.module.name)),\n    )]\n\n    return moduleNames.map((moduleName) =>\n      this.generateRequestArtifact(moduleName, rc.rendering.fileNamingStyle, {\n        v2Compat: rc.rendering.v2Compat,\n      }),\n    )\n  }\n\n  static getRequestArtifactFilepath(moduleName: string, fileNamingStyle: FileNamingStyle): string {\n    return `./${convertFilename(moduleName, fileNamingStyle)}/request.ts`\n  }\n\n  static getRequestArtifactId(moduleName: string): string {\n    return `request?module=${moduleName}&generator=${MICRO_FUNCTION_REQUEST_GENERATOR}`\n  }\n}\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Generator, RuntimeConfig } from '~/types/index.js'\nimport { Artifact, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { OperationDeclarationGenerator } from '~/plugins/generate-declaration/index.js'\nimport { OperationDefinitionTransformer } from '~/transformers/index.js'\nimport { EntrypointTransformer } from '~/transformers/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\nimport { RequestGenerator } from '../request/index.js'\n\n\nexport const MICRO_FUNCTION_GENERATOR = 'microFunctionGenerator'\n\nexport class MicroFunctionGenerator implements Generator {\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const metadata = MetadataStorage.get(compiler)!\n    const context = compiler.context\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const operationDefinitions = documents.flatMap((document) => document.operations)\n\n    const artifactMap = new Map<OperationDefinition, Artifact>(\n      await Promise.all(\n        operationDefinitions.map(async (operationDefinition) => (<const>[\n          operationDefinition,\n          await metadata.hooks.afterMicroFunctionArtifactGenerated.promise(\n            this.generateOperationDefinitionArtifact(operationDefinition, rc),\n            operationDefinition,\n            task,\n          ),\n        ])),\n      ),\n    )\n\n    if (!rc.rendering.entrypoint) {\n      return [...artifactMap.values()]\n    }\n\n    const operationDefinitionsByModuleName = new Map<string, OperationDefinition[]>()\n    for (const operationDefinition of operationDefinitions) {\n      const definitions = operationDefinitionsByModuleName.get(operationDefinition.module.name) ?? []\n      definitions.push(operationDefinition)\n      operationDefinitionsByModuleName.set(operationDefinition.module.name, definitions)\n    }\n\n    const entrypoints = await Promise.all(\n      R.collectBy(\n        (document) => document.module.name,\n        documents,\n      )\n        .map((documents) => (<const>[\n          documents[0].module,\n          (operationDefinitionsByModuleName.get(documents[0].module.name) ?? [])\n            .map((operationDefinition) => artifactMap.get(operationDefinition))\n            .filter((artifact): artifact is Artifact => Boolean(artifact)),\n        ]))\n        .map(async ([moduleDefinition, artifacts]) => await metadata.hooks.afterEntrypointArtifactGenerated.promise(\n          this.generateEntrypointArtifact(\n            moduleDefinition,\n            artifacts,\n            rc,\n          ),\n          task,\n        )),\n    )\n\n    return [...entrypoints, ...artifactMap.values()]\n  }\n\n\n  private generateOperationDefinitionArtifact(operationDefinition: OperationDefinition, rc: RuntimeConfig): Artifact {\n    const filepath = MicroFunctionGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: MicroFunctionGenerator.getOperationDefinitionArtifactId(operationDefinition),\n      filepath,\n      content: OperationDefinitionTransformer.toMicroFunction(operationDefinition, {\n        esm: rc.rendering.esm,\n        emptyJsonRequestBodyMode: rc.rendering.emptyJsonRequestBodyMode,\n        v2Compat: rc.rendering.v2Compat,\n        getOperationDefinitionDeclarationFilepath(operationDefinition: OperationDefinition): string {\n          const relativePath = path.relative(\n            dirpath,\n            OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.rendering.fileNamingStyle),\n          )\n\n          return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n        },\n        getRequestFilepath(): string {\n          const relativePath = path.relative(\n            dirpath,\n            RequestGenerator.getRequestArtifactFilepath(operationDefinition.module.name, rc.rendering.fileNamingStyle),\n          )\n\n          return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n        },\n      }),\n      extensionName: '.type.ts',\n    })\n\n    return artifact\n  }\n\n  private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n    const filepath = MicroFunctionGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = filepath.substring(0, filepath.lastIndexOf('/'))\n\n    const artifact = new Artifact({\n      id: MicroFunctionGenerator.getEntrypointArtifactId(moduleDefinition),\n      filepath,\n      content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n    })\n\n    return artifact\n  }\n\n\n  static getOperationDefinitionArtifactFilepath(operationDefinition: OperationDefinition, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(operationDefinition.operationId, fileNamingStyle)}.fn.ts`\n    const filepath = [\n      '.',\n      convertFilename(operationDefinition.module.name, fileNamingStyle),\n      'operations',\n      filename,\n    ].join('/')\n\n    return filepath\n  }\n\n  static getOperationDefinitionArtifactId(operationDefinition: OperationDefinition): string {\n    return `${operationDefinition.id}?generator=${MICRO_FUNCTION_GENERATOR}`\n  }\n\n  static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n    return [\n      '.',\n      convertFilename(moduleDefinition.name, fileNamingStyle),\n      'operations',\n      'index.ts',\n    ].join('/')\n  }\n\n  static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n    return `${moduleDefinition.address.url}/paths/entrypoint?generator=${MICRO_FUNCTION_GENERATOR}`\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { GenerateMicroFunctionPluginMetadata, MetadataStorage } from './constants/index.js'\nimport { MicroFunctionGenerator, RequestGenerator } from './generators/index.js'\n\n\nexport class GenerateMicroFunctionPlugin implements Plugin {\n  private readonly microFunctionGenerator = new MicroFunctionGenerator()\n  private readonly requestGenerator = new RequestGenerator()\n\n  apply(compiler: Compiler): void {\n    // Prevent duplicate registration by checking applied flag\n    const metadata = GenerateMicroFunctionPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.compile.tapPromise(GenerateMicroFunctionPlugin.name, async (task: TaskWrapper) => {\n      const artifacts = [\n        ...(await this.requestGenerator.compile(compiler, task)),\n        ...(await this.microFunctionGenerator.compile(compiler, task)),\n      ]\n\n      compiler.context.artifacts!.push(...artifacts)\n    })\n  }\n\n  static register(compiler: Compiler): GenerateMicroFunctionPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n          afterEntrypointArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>(['artifact', 'task']),\n          afterMicroFunctionArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>(['artifact', 'operationDefinition', 'task']),\n        },\n      })\n    }\n\n    return MetadataStorage.get(compiler)!\n  }\n\n\n  static of(compiler: Compiler): GenerateMicroFunctionPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\n\nexport interface GenerateIsolatedPluginMetadata {\n  applied: boolean\n  hooks: {\n    afterEntrypointArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, TaskWrapper], Artifact>\n    afterIsolatedOperationArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper], Artifact>\n  }\n}\n\nexport const MetadataStorage = new WeakMap<Compiler, GenerateIsolatedPluginMetadata>()\n","import { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact } from '~/models/index.js'\nimport { Generator } from '~/types/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\n\n\nexport const ISOLATED_REQUEST_GENERATOR = 'isolatedRequestGenerator'\n\nexport class RequestGenerator implements Generator {\n  private generateRequestArtifact(moduleName: string, fileNamingStyle: FileNamingStyle, options?: { v2Compat?: boolean }): Artifact {\n    const v2Compat = options?.v2Compat ?? false\n\n    const content = v2Compat\n      ? [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        'import { KeqRequest, request as globalRequest } from \"keq\"',\n        '',\n        '/* @anchor:request-declaration */',\n        'export const request = new KeqRequest()',\n        'request.inherit(globalRequest)',\n        '',\n        '/* @anchor:file:end */',\n      ].join('\\n')\n      : [\n        '',\n        '/* @anchor:file:start */',\n        '',\n        'import { KeqRequest } from \"keq\"',\n        '',\n        '/* @anchor:request-declaration */',\n        'export const request = new KeqRequest()',\n        '',\n        '/* @anchor:file:end */',\n      ].join('\\n')\n\n    return new Artifact({\n      id: RequestGenerator.getRequestArtifactId(moduleName),\n      filepath: RequestGenerator.getRequestArtifactFilepath(moduleName, fileNamingStyle),\n      content,\n    })\n  }\n\n  // eslint-disable-next-line @typescript-eslint/require-await\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const context = compiler.context\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const moduleNames = [...new Set(\n      documents.flatMap((doc) => doc.operations.map((op) => op.module.name)),\n    )]\n\n    return moduleNames.map((moduleName) =>\n      this.generateRequestArtifact(moduleName, rc.rendering.fileNamingStyle, {\n        v2Compat: rc.rendering.v2Compat,\n      }),\n    )\n  }\n\n  static getRequestArtifactFilepath(moduleName: string, fileNamingStyle: FileNamingStyle): string {\n    return `./${convertFilename(moduleName, fileNamingStyle)}/request.ts`\n  }\n\n  static getRequestArtifactId(moduleName: string): string {\n    return `request?module=${moduleName}&generator=${ISOLATED_REQUEST_GENERATOR}`\n  }\n}\n","import * as R from 'ramda'\nimport * as path from 'path'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Generator, RuntimeConfig } from '~/types/index.js'\nimport { Artifact, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { OperationDefinitionTransformer } from '~/transformers/index.js'\nimport { EntrypointTransformer } from '~/transformers/index.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport { MetadataStorage } from '../../constants/metadata-storage.js'\nimport { RequestGenerator } from '../request/index.js'\n\n\nexport const ISOLATED_OPERATION_GENERATOR = 'isolatedOperationGenerator'\n\nexport class IsolatedOperationGenerator implements Generator {\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const metadata = MetadataStorage.get(compiler)!\n    const context = compiler.context\n    const rc = context.rc!\n    const documents = context.documents!\n\n    const operationDefinitions = documents.flatMap((document) => document.operations)\n\n    const artifactMap = new Map<OperationDefinition, Artifact>(\n      await Promise.all(\n        operationDefinitions.map(async (operationDefinition) => (<const>[\n          operationDefinition,\n          await metadata.hooks.afterIsolatedOperationArtifactGenerated.promise(\n            this.generateOperationArtifact(operationDefinition, rc),\n            operationDefinition,\n            task,\n          ),\n        ])),\n      ),\n    )\n\n    if (!rc.rendering.entrypoint) {\n      return [...artifactMap.values()]\n    }\n\n    const operationDefinitionsByModuleName = new Map<string, OperationDefinition[]>()\n    for (const operationDefinition of operationDefinitions) {\n      const definitions = operationDefinitionsByModuleName.get(operationDefinition.module.name) ?? []\n      definitions.push(operationDefinition)\n      operationDefinitionsByModuleName.set(operationDefinition.module.name, definitions)\n    }\n\n    const entrypoints = await Promise.all(\n      R.collectBy(\n        (document) => document.module.name,\n        documents,\n      )\n        .map((documents) => (<const>[\n          documents[0].module,\n          (operationDefinitionsByModuleName.get(documents[0].module.name) ?? [])\n            .map((operationDefinition) => artifactMap.get(operationDefinition))\n            .filter((artifact): artifact is Artifact => Boolean(artifact)),\n        ]))\n        .map(async ([moduleDefinition, artifacts]) => await metadata.hooks.afterEntrypointArtifactGenerated.promise(\n          this.generateEntrypointArtifact(moduleDefinition, artifacts, rc),\n          task,\n        )),\n    )\n\n    return [...entrypoints, ...artifactMap.values()]\n  }\n\n  private generateOperationArtifact(operationDefinition: OperationDefinition, rc: RuntimeConfig): Artifact {\n    const filepath = IsolatedOperationGenerator.getOperationArtifactFilepath(operationDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: IsolatedOperationGenerator.getOperationArtifactId(operationDefinition),\n      filepath,\n      content: OperationDefinitionTransformer.toIsolated(operationDefinition, {\n        esm: rc.rendering.esm,\n        emptyJsonRequestBodyMode: rc.rendering.emptyJsonRequestBodyMode,\n        additionalPropertiesType: rc.rendering.additionalPropertiesType,\n        v2Compat: rc.rendering.v2Compat,\n        getRequestFilepath(): string {\n          const relativePath = path.relative(\n            dirpath,\n            RequestGenerator.getRequestArtifactFilepath(operationDefinition.module.name, rc.rendering.fileNamingStyle),\n          )\n          return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n        },\n      }),\n    })\n\n    return artifact\n  }\n\n  private generateEntrypointArtifact(moduleDefinition: ModuleDefinition, exports: Artifact[], rc: RuntimeConfig): Artifact {\n    const filepath = IsolatedOperationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: IsolatedOperationGenerator.getEntrypointArtifactId(moduleDefinition),\n      filepath,\n      content: EntrypointTransformer.toTypescript(exports, { dirpath }),\n    })\n\n    return artifact\n  }\n\n  static getOperationArtifactFilepath(operationDefinition: OperationDefinition, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(operationDefinition.operationId, fileNamingStyle)}.ts`\n    return [\n      '.',\n      convertFilename(operationDefinition.module.name, fileNamingStyle),\n      'operations',\n      filename,\n    ].join('/')\n  }\n\n  static getOperationArtifactId(operationDefinition: OperationDefinition): string {\n    return `${operationDefinition.id}?generator=${ISOLATED_OPERATION_GENERATOR}`\n  }\n\n  static getEntrypointArtifactFilepath(moduleDefinition: ModuleDefinition, fileNamingStyle: FileNamingStyle): string {\n    return [\n      '.',\n      convertFilename(moduleDefinition.name, fileNamingStyle),\n      'operations',\n      'index.ts',\n    ].join('/')\n  }\n\n  static getEntrypointArtifactId(moduleDefinition: ModuleDefinition): string {\n    return `${moduleDefinition.address.url}/operations/entrypoint?generator=${ISOLATED_OPERATION_GENERATOR}`\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { GenerateIsolatedPluginMetadata, MetadataStorage } from './constants/index.js'\nimport { IsolatedOperationGenerator, RequestGenerator } from './generators/index.js'\n\n\nexport class GenerateIsolatedPlugin implements Plugin {\n  private readonly isolatedOperationGenerator = new IsolatedOperationGenerator()\n  private readonly requestGenerator = new RequestGenerator()\n\n  apply(compiler: Compiler): void {\n    const metadata = GenerateIsolatedPlugin.register(compiler)\n    if (metadata.applied) return\n\n    metadata.applied = true\n\n    compiler.hooks.compile.tapPromise(GenerateIsolatedPlugin.name, async (task: TaskWrapper) => {\n      const artifacts = [\n        ...(await this.requestGenerator.compile(compiler, task)),\n        ...(await this.isolatedOperationGenerator.compile(compiler, task)),\n      ]\n\n      compiler.context.artifacts!.push(...artifacts)\n    })\n  }\n\n  static register(compiler: Compiler): GenerateIsolatedPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n          afterEntrypointArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, TaskWrapper]>(['artifact', 'task']),\n          afterIsolatedOperationArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, OperationDefinition, TaskWrapper]>(['artifact', 'operationDefinition', 'task']),\n        },\n      })\n    }\n\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): GenerateIsolatedPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface BodyFallbackPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<BodyFallbackPluginMetadata>(\n  '@keq-request/cli:BodyFallbackPlugin:MetadataStorage',\n)\n","import * as R from 'ramda'\nimport { Compiler } from '~/compiler/compiler.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { JsonSchemaUtils } from '~/utils/json-schema-utils/index.js'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nimport { GenerateMicroFunctionPlugin } from '../generate-micro-function/index.js'\nimport { GenerateIsolatedPlugin } from '../generate-isolated/index.js'\nimport { BodyFallbackPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\nexport class BodyFallbackPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = BodyFallbackPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.setup.tap(BodyFallbackPlugin.name, () => {\n      const generateMicroFunctionPluginMetadata = GenerateMicroFunctionPlugin.of(compiler)\n\n      if (!generateMicroFunctionPluginMetadata) {\n        throw new Error('BodyFallbackPlugin requires GenerateMicroFunctionPlugin to be applied first.')\n      }\n\n      generateMicroFunctionPluginMetadata.hooks.afterMicroFunctionArtifactGenerated\n        .tap(BodyFallbackPlugin.name, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n          this.applyBodyFallback(artifact, operationDefinition)\n          return artifact\n        })\n\n      const generateIsolatedPluginMetadata = GenerateIsolatedPlugin.of(compiler)\n\n      if (generateIsolatedPluginMetadata) {\n        generateIsolatedPluginMetadata.hooks.afterIsolatedOperationArtifactGenerated\n          .tap(BodyFallbackPlugin.name, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n            this.applyBodyFallback(artifact, operationDefinition)\n            return artifact\n          })\n      }\n    })\n  }\n\n  private applyBodyFallback(artifact: Artifact, operationDefinition: OperationDefinition): void {\n    const operation = operationDefinition.operation\n\n    const parameters = operation.parameters?.filter((p): p is OpenAPIV3_1.ParameterObject => !JsonSchemaUtils.isRef(p)) || []\n    const keys = parameters.map((p) => p.name).filter(R.isNotNil)\n\n    const $acc = !keys.length\n      ? '        acc[key] = args[key]'\n      : [\n        `        if (![${keys.map((k) => JSON.stringify(k)).join(', ')}].includes(key)) {`,\n        '          acc[key] = args[key]',\n        '        }',\n      ].join('\\n')\n\n    artifact.anchor.block.replace('body', [\n      '  if (typeof args === \"object\" && args !== null && !Array.isArray(args)) {',\n      '    const requestBody = Object.keys(args)',\n      '      .reduce((acc, key) => {',\n      $acc,\n      '        return acc',\n      '      }, {} as Record<string, unknown>)',\n      '',\n      '    if (Object.keys(requestBody).length > 0) {',\n      '      void req.send(requestBody)',\n      '    }',\n      '  }',\n    ].filter(R.isNotNil).join('\\n'))\n  }\n\n  static register(compiler: Compiler): BodyFallbackPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: { },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): BodyFallbackPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface UseValibotPluginMetadata {\n  applied: boolean\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<UseValibotPluginMetadata>(\n  '@keq-request/cli:UseValibotPlugin:MetadataStorage',\n)\n","import { Plugin } from '~/types/plugin.js'\nimport { Compiler } from '~/compiler/index.js'\nimport { Artifact, SchemaDefinition } from '~/models/index.js'\nimport { SchemaDefinitionTransformer } from '~/transformers/index.js'\nimport { GenerateDeclarationPlugin, SchemaDeclarationGenerator } from '../generate-declaration/index.js'\nimport { MetadataStorage, UseValibotPluginMetadata } from './constants/index.js'\nimport * as path from 'path'\n\n\nexport const USE_VALIBOT = 'useValibot'\n\nexport class UseValibotPlugin implements Plugin {\n  name = USE_VALIBOT\n\n  constructor() {}\n\n  apply(compiler: Compiler): void {\n    // Prevent duplicate registration by checking applied flag\n    const metadata = UseValibotPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n\n    // Get the metadata - this will register hooks but not apply the plugin\n    const declarationMetadata = GenerateDeclarationPlugin.of(compiler)\n    if (!declarationMetadata) {\n      throw new Error('UseValibotPlugin requires GenerateDeclarationPlugin to be registered first')\n    }\n\n    // Hook into afterSchemaDeclarationArtifactGenerated to replace TypeScript declaration with Valibot schema\n    declarationMetadata.hooks.afterSchemaDeclarationArtifactGenerated.tap(\n      UseValibotPlugin.name,\n      (artifact: Artifact, schemaDefinition: SchemaDefinition) => {\n        const rc = compiler.context.rc!\n        const filepath = artifact.filepath\n        const dirpath = path.dirname(filepath)\n\n        // Generate Valibot schema content\n        const valibotContent = SchemaDefinitionTransformer.toValibot(\n          schemaDefinition,\n          {\n            esm: rc.rendering.esm,\n            additionalPropertiesType: rc.rendering.additionalPropertiesType,\n            getDependentSchemaDefinitionFilepath(dependentSchemaDefinition: SchemaDefinition): string {\n              const relativePath = path.relative(\n                dirpath,\n                SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.rendering.fileNamingStyle),\n              )\n\n              return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n            },\n          },\n        )\n\n        // Replace artifact content with Valibot schema\n        return new Artifact({\n          ...artifact,\n          content: valibotContent,\n        })\n      },\n    )\n  }\n\n  static register(compiler: Compiler): UseValibotPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n      })\n    }\n\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): UseValibotPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\nimport { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\nexport interface GenerateNestjsModulePluginMetadata {\n  applied: boolean\n  hooks: {\n    afterNestjsModuleArtifactGenerated: AsyncSeriesWaterfallHook<[Artifact, ApiDocumentV3_1, TaskWrapper]>\n  }\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<GenerateNestjsModulePluginMetadata>(\n  '@keq-request/cli:GenerateNestjsModulePlugin:MetadataStorage',\n)\n","import * as path from 'path'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\nimport { MetadataStorage } from '../constants/metadata-storage.js'\nimport { FileNamingStyle } from '~/constants/index.js'\nimport { convertFilename } from '~/utils/convert-filename.js'\nimport { Generator, RuntimeConfig } from '~/types/index.js'\nimport { ApiDocumentTransformer } from '~/transformers/index.js'\nimport { OperationDeclarationGenerator } from '~/plugins/generate-declaration/index.js'\n\n\nconst NESTJS_MODULE_GENERATOR = 'nestjs-module-generator'\n\nexport class NestjsModuleGenerator implements Generator {\n  private generateNestjsModuleArtifact(document: ApiDocumentV3_1, rc: RuntimeConfig): Artifact {\n    const filepath = NestjsModuleGenerator.getNestjsModuleArtifactFilepath(document, rc.rendering.fileNamingStyle)\n    const dirname = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: NestjsModuleGenerator.getNestjsModuleArtifactId(document),\n      filepath,\n      content: ApiDocumentTransformer.toNestjsModule(document, {\n        esm: rc.rendering.esm,\n        getNestjsClientFilepath(document) {\n          const relativePath = path.relative(\n            dirname,\n            NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.rendering.fileNamingStyle),\n          )\n\n          return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n        },\n      }),\n    })\n\n    return artifact\n  }\n\n  private generateNestjsClientArtifact(document: ApiDocumentV3_1, rc: RuntimeConfig): Artifact {\n    const filepath = NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.rendering.fileNamingStyle)\n    const dirpath = path.dirname(filepath)\n\n    const artifact = new Artifact({\n      id: NestjsModuleGenerator.getNestjsClientArtifactId(document),\n      filepath,\n      content: ApiDocumentTransformer.toNestjsClient(document, {\n        esm: rc.rendering.esm,\n        emptyJsonRequestBodyMode: rc.rendering.emptyJsonRequestBodyMode,\n        getOperationDefinitionDeclarationFilepath(operationDefinition) {\n          const relativePath = path.relative(\n            dirpath,\n            OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.rendering.fileNamingStyle),\n          )\n\n          return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n        },\n      }),\n    })\n\n    return artifact\n  }\n\n  async compile(compiler: Compiler, task: TaskWrapper): Promise<Artifact[]> {\n    const metadata = MetadataStorage.get(compiler)!\n    const rc = compiler.context.rc!\n    const documents = compiler.context.documents!\n\n    const nestjsModuleArtifacts = await Promise.all(\n      documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(\n        this.generateNestjsModuleArtifact(document, rc),\n        document,\n        task,\n      )),\n    )\n\n    const nestjsClientArtifacts = await Promise.all(\n      documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(\n        this.generateNestjsClientArtifact(document, rc),\n        document,\n        task,\n      )),\n    )\n\n    return [...nestjsModuleArtifacts, ...nestjsClientArtifacts]\n  }\n\n  static getNestjsModuleArtifactFilepath(document: ApiDocumentV3_1, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(document.module.name, fileNamingStyle)}.module.ts`\n\n    const filepath = [\n      '.',\n      convertFilename(document.module.name, fileNamingStyle),\n      filename,\n    ]\n\n    return filepath.join('/')\n  }\n\n  static getNestjsModuleArtifactId(document: ApiDocumentV3_1): string {\n    return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}`\n  }\n\n  static getNestjsClientArtifactFilepath(document: ApiDocumentV3_1, fileNamingStyle: FileNamingStyle): string {\n    const filename = `${convertFilename(document.module.name, fileNamingStyle)}.client.ts`\n\n    const filepath = [\n      '.',\n      convertFilename(document.module.name, fileNamingStyle),\n      filename,\n    ]\n\n    return filepath.join('/')\n  }\n\n  static getNestjsClientArtifactId(document: ApiDocumentV3_1): string {\n    return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}-client`\n  }\n}\n","import { AsyncSeriesWaterfallHook } from 'tapable'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler, TaskWrapper } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, Artifact } from '~/models/index.js'\nimport { GenerateNestjsModulePluginMetadata, MetadataStorage } from './constants/index.js'\nimport { NestjsModuleGenerator } from './generators/nestjs-module.generator.js'\n\n\nexport class GenerateNestjsModulePlugin implements Plugin {\n  private readonly nestjsModuleGenerator = new NestjsModuleGenerator()\n\n  apply(compiler: Compiler): void {\n    // Prevent duplicate registration by checking applied flag\n    const metadata = GenerateNestjsModulePlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.compile.tapPromise(GenerateNestjsModulePlugin.name, async (task) => {\n      const artifacts = await this.nestjsModuleGenerator.compile(compiler, task)\n      compiler.context.artifacts!.push(...artifacts)\n    })\n  }\n\n  static register(compiler: Compiler): GenerateNestjsModulePluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n          afterNestjsModuleArtifactGenerated: new AsyncSeriesWaterfallHook<[Artifact, ApiDocumentV3_1, TaskWrapper]>(['artifact', 'document', 'task']),\n        },\n      })\n    }\n\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): GenerateNestjsModulePluginMetadata | undefined {\n    return MetadataStorage.get(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface ChineseToPinyinPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<ChineseToPinyinPluginMetadata>(\n  '@keq-request/cli:ChineseToPinyinPlugin:MetadataStorage',\n)\n","\nimport { fixSwagger } from 'swagger-fix'\nimport { Compiler } from '~/compiler/index.js'\nimport { ChineseToPinyinPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\nexport class ChineseToPinyinPlugin {\n  apply(compiler: Compiler): void {\n    const metadata = ChineseToPinyinPlugin.register(compiler)\n    if (metadata.applied) return\n\n    metadata.applied = true\n\n    compiler.hooks.beforeValidate.tap(ChineseToPinyinPlugin.name, (spec) => {\n      const fixed = fixSwagger(spec as any)\n      for (const key of Object.keys(spec as any)) {\n        delete (spec as any)[key]\n      }\n      Object.assign(spec, fixed)\n    })\n  }\n\n  static register(compiler: Compiler): ChineseToPinyinPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: { },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): ChineseToPinyinPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface DownloadHttpFilePluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<DownloadHttpFilePluginMetadata>(\n  '@keq-request/cli:DownloadHttpFilePlugin:MetadataStorage',\n)\n","import { Compiler } from '~/compiler/index.js'\nimport { Plugin, Address } from '~/types/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { DownloadHttpFilePluginMetadata, MetadataStorage } from './constants/index.js'\nimport type { CacheStore } from '~/cache-store/index.js'\nimport type { DownloadResult } from '~/types/index.js'\n\ninterface HttpCacheEntry {\n  content: string\n  etag: string\n  lastModified: string\n}\n\nexport class DownloadHttpFilePlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = DownloadHttpFilePlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    const cache: CacheStore = compiler.getCacheStore(DownloadHttpFilePlugin.name)\n\n    compiler.hooks.download.tapPromise(DownloadHttpFilePlugin.name, async (address, task) => {\n      const { url } = address\n\n      if (!url.startsWith('http://') && !url.startsWith('https://')) return undefined\n\n      const cacheKey = url\n      const cached = await cache.get<HttpCacheEntry>(cacheKey)\n\n      const headers: Record<string, string> = { ...address.headers }\n      if (cached) {\n        if (cached.etag) headers['If-None-Match'] = cached.etag\n        if (cached.lastModified) headers['If-Modified-Since'] = cached.lastModified\n      }\n\n      const res = await this.fetch(url, headers)\n\n      if (res.status === 304 && cached) {\n        await cache.set(cacheKey, cached)\n        const fingerprint = cached.etag || cached.lastModified || undefined\n        return { content: cached.content, fingerprint }\n      }\n\n      if (res.status >= 400) {\n        const body = await res.text().catch(() => '')\n        const detail = body ? `\\n  Response Body: ${body}` : ''\n        throw new Error(`Unable get the openapi/swagger file from ${url}: failed with status code ${res.status}${detail}`)\n      }\n\n      const text = await res.text()\n      const spec = this.deserialize(text)\n      const content = JSON.stringify(spec)\n\n      const etag = res.headers.get('etag') || ''\n      const lastModified = res.headers.get('last-modified') || ''\n\n      await cache.set<HttpCacheEntry>(cacheKey, {\n        content,\n        etag,\n        lastModified,\n      })\n\n      const fingerprint = etag || lastModified || undefined\n      return { content, fingerprint } satisfies DownloadResult\n    })\n  }\n\n  private async fetch(url: string, headers: Record<string, string>): Promise<Response> {\n    try {\n      return await fetch(url, { headers })\n    } catch (e) {\n      if (e instanceof Error) {\n        e.message = `Unable get the openapi/swagger file from ${url}: ${e.message}`\n      }\n      throw e\n    }\n  }\n\n  deserialize(content: string): object {\n    const json = JSON.parse(content)\n    const spec = OpenapiUtils.to3_1(json)\n    return spec\n  }\n\n  static register(compiler: Compiler): DownloadHttpFilePluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n        },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): DownloadHttpFilePluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface DownloadLocalFilePluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<DownloadLocalFilePluginMetadata>(\n  '@keq-request/cli:DownloadLocalFilePlugin:MetadataStorage',\n)\n","import * as path from 'path'\nimport * as fs from 'fs/promises'\nimport * as yaml from 'js-yaml'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { fileURLToPath } from 'url'\nimport { DownloadLocalFilePluginMetadata, MetadataStorage } from './constants/index.js'\nimport type { CacheStore } from '~/cache-store/index.js'\nimport type { DownloadResult } from '~/types/index.js'\n\ninterface LocalFileCacheEntry {\n  content: string\n  mtimeMs: number\n}\n\nexport class DownloadLocalFilePlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = DownloadLocalFilePlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    const cache: CacheStore = compiler.getCacheStore(DownloadLocalFilePlugin.name)\n\n    compiler.hooks.download.tapPromise(DownloadLocalFilePlugin.name, async (address, task) => {\n      const { url, encoding } = address\n      if (!url.startsWith('file://')) return undefined\n      const filepath = fileURLToPath(url)\n\n      const stat = await fs.stat(filepath)\n      const fingerprint = `${filepath}:${stat.mtimeMs}`\n      const cacheKey = filepath\n      const cached = await cache.get<LocalFileCacheEntry>(cacheKey)\n\n      if (cached && cached.mtimeMs === stat.mtimeMs) {\n        return { content: cached.content, fingerprint } satisfies DownloadResult\n      }\n\n      const fileExt = path.extname(filepath)\n      const rawContent = await fs.readFile(filepath, encoding)\n      const str = typeof rawContent === 'string' ? rawContent : rawContent.toString(encoding)\n\n      let content: string | undefined\n      if (['.yml', '.yaml'].includes(fileExt)) {\n        const value = yaml.load(str)\n        content = JSON.stringify(OpenapiUtils.to3_1(value))\n      } else if (fileExt === '.json') {\n        content = JSON.stringify(OpenapiUtils.to3_1(JSON.parse(str)))\n      }\n\n      if (content) {\n        await cache.set<LocalFileCacheEntry>(cacheKey, {\n          content,\n          mtimeMs: stat.mtimeMs,\n        })\n        return { content, fingerprint } satisfies DownloadResult\n      }\n\n      return undefined\n    })\n  }\n\n  static register(compiler: Compiler): DownloadLocalFilePluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n        },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): DownloadLocalFilePluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface DownloadByBashPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<DownloadByBashPluginMetadata>(\n  '@keq-request/cli:DownloadByBashPlugin:MetadataStorage',\n)\n","import * as path from 'path'\nimport * as fs from 'fs/promises'\nimport * as yaml from 'js-yaml'\nimport { execFile } from 'child_process'\nimport { promisify } from 'util'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { DownloadByBashPluginMetadata, MetadataStorage } from './constants/index.js'\nimport type { CacheStore } from '~/cache-store/index.js'\nimport type { DownloadResult } from '~/types/index.js'\n\nconst execFileAsync = promisify(execFile)\n\nconst DEFAULT_TIMEOUT_MS = 30_000\nconst DEFAULT_MAX_BUFFER = 50 * 1024 * 1024\n\ninterface ShellCacheEntry {\n  content: string\n  mtimeMs: number\n}\n\nexport class DownloadByBashPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = DownloadByBashPlugin.register(compiler)\n    if (metadata.applied) return\n\n    metadata.applied = true\n\n    const cache: CacheStore = compiler.getCacheStore(DownloadByBashPlugin.name)\n\n    compiler.hooks.download.tapPromise(DownloadByBashPlugin.name, async (address) => {\n      const { url } = address\n      if (!url.startsWith('bash://')) return undefined\n\n      const rawPath = url.slice('bash://'.length)\n      const filepath = path.resolve(compiler.context.workdir ?? process.cwd(), rawPath)\n\n      const stat = await fs.stat(filepath).catch(() => undefined)\n      if (!stat) {\n        throw new Error(`DownloadByBashPlugin: script not found: ${filepath}`)\n      }\n\n      const fingerprint = `${filepath}:${stat.mtimeMs}`\n      const cacheKey = filepath\n      const cached = await cache.get<ShellCacheEntry>(cacheKey)\n\n      if (cached && cached.mtimeMs === stat.mtimeMs) {\n        return { content: cached.content, fingerprint } satisfies DownloadResult\n      }\n\n      const { stdout, stderr } = await execFileAsync('/bin/bash', [filepath], {\n        timeout: DEFAULT_TIMEOUT_MS,\n        maxBuffer: DEFAULT_MAX_BUFFER,\n        cwd: compiler.context.workdir,\n      })\n\n      const output = stdout.trim()\n      if (!output) {\n        const detail = stderr ? `\\n  stderr: ${stderr}` : ''\n        throw new Error(`DownloadByBashPlugin: script produced no output: ${filepath}${detail}`)\n      }\n\n      const content = this.parseOutput(output, filepath)\n\n      await cache.set<ShellCacheEntry>(cacheKey, {\n        content,\n        mtimeMs: stat.mtimeMs,\n      })\n\n      return { content, fingerprint } satisfies DownloadResult\n    })\n  }\n\n  private parseOutput(output: string, filepath: string): string {\n    try {\n      return JSON.stringify(OpenapiUtils.to3_1(JSON.parse(output)))\n    } catch { /* not JSON */ }\n\n    try {\n      const value = yaml.load(output)\n      if (typeof value === 'object' && value !== null) {\n        return JSON.stringify(OpenapiUtils.to3_1(value))\n      }\n    } catch { /* not YAML */ }\n\n    throw new Error(\n      `DownloadByBashPlugin: script output is neither valid JSON nor YAML: ${filepath}`,\n    )\n  }\n\n  static register(compiler: Compiler): DownloadByBashPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {},\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): DownloadByBashPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface DownloadByShPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<DownloadByShPluginMetadata>(\n  '@keq-request/cli:DownloadByShPlugin:MetadataStorage',\n)\n","import * as path from 'path'\nimport * as fs from 'fs/promises'\nimport * as yaml from 'js-yaml'\nimport { execFile } from 'child_process'\nimport { promisify } from 'util'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/index.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { DownloadByShPluginMetadata, MetadataStorage } from './constants/index.js'\nimport type { CacheStore } from '~/cache-store/index.js'\nimport type { DownloadResult } from '~/types/index.js'\n\nconst execFileAsync = promisify(execFile)\n\nconst DEFAULT_TIMEOUT_MS = 30_000\nconst DEFAULT_MAX_BUFFER = 50 * 1024 * 1024\n\ninterface ShellCacheEntry {\n  content: string\n  mtimeMs: number\n}\n\nexport class DownloadByShPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = DownloadByShPlugin.register(compiler)\n    if (metadata.applied) return\n\n    metadata.applied = true\n\n    const cache: CacheStore = compiler.getCacheStore(DownloadByShPlugin.name)\n\n    compiler.hooks.download.tapPromise(DownloadByShPlugin.name, async (address) => {\n      const { url } = address\n      if (!url.startsWith('sh://')) return undefined\n\n      const rawPath = url.slice('sh://'.length)\n      const filepath = path.resolve(compiler.context.workdir ?? process.cwd(), rawPath)\n\n      const stat = await fs.stat(filepath).catch(() => undefined)\n      if (!stat) {\n        throw new Error(`DownloadByShPlugin: script not found: ${filepath}`)\n      }\n\n      const fingerprint = `${filepath}:${stat.mtimeMs}`\n      const cacheKey = filepath\n      const cached = await cache.get<ShellCacheEntry>(cacheKey)\n\n      if (cached && cached.mtimeMs === stat.mtimeMs) {\n        return { content: cached.content, fingerprint } satisfies DownloadResult\n      }\n\n      const { stdout, stderr } = await execFileAsync('/bin/sh', [filepath], {\n        timeout: DEFAULT_TIMEOUT_MS,\n        maxBuffer: DEFAULT_MAX_BUFFER,\n        cwd: compiler.context.workdir,\n      })\n\n      const output = stdout.trim()\n      if (!output) {\n        const detail = stderr ? `\\n  stderr: ${stderr}` : ''\n        throw new Error(`DownloadByShPlugin: script produced no output: ${filepath}${detail}`)\n      }\n\n      const content = this.parseOutput(output, filepath)\n\n      await cache.set<ShellCacheEntry>(cacheKey, {\n        content,\n        mtimeMs: stat.mtimeMs,\n      })\n\n      return { content, fingerprint } satisfies DownloadResult\n    })\n  }\n\n  private parseOutput(output: string, filepath: string): string {\n    try {\n      return JSON.stringify(OpenapiUtils.to3_1(JSON.parse(output)))\n    } catch { /* not JSON */ }\n\n    try {\n      const value = yaml.load(output)\n      if (typeof value === 'object' && value !== null) {\n        return JSON.stringify(OpenapiUtils.to3_1(value))\n      }\n    } catch { /* not YAML */ }\n\n    throw new Error(\n      `DownloadByShPlugin: script output is neither valid JSON nor YAML: ${filepath}`,\n    )\n  }\n\n  static register(compiler: Compiler): DownloadByShPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {},\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): DownloadByShPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface ShakingPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<ShakingPluginMetadata>(\n  '@keq-request/cli:ShakingPlugin:MetadataStorage',\n)\n","import { Plugin } from '~/types/index.js'\nimport { Compiler } from '~/compiler/index.js'\nimport { ApiDocumentV3_1, ModuleDefinition, OperationDefinition } from '~/models/index.js'\nimport { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { SupportedMethods } from '~/constants/index.js'\nimport { openapiShakingSync } from '@opendoc/openapi-shaking'\nimport { ShakingPluginMetadata, MetadataStorage } from './constants/index.js'\n\nexport class ShakingPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    const metadata = ShakingPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.beforeCompile.tap(ShakingPlugin.name, (task) => {\n      const matcher = compiler.context.matcher!\n      const documents = compiler.context.documents!\n\n      compiler.context.documents = documents\n        .map((document) => this.shaking(compiler, document))\n        .filter((document) => !document.isEmpty())\n        .filter((document) => !matcher.isModuleDenied(document.module))\n    })\n  }\n\n  shaking(compiler: Compiler, document: ApiDocumentV3_1): ApiDocumentV3_1 {\n    const rc = compiler.context.rc!\n    const matcher = compiler.context.matcher!\n\n    const isAccepted = (pathname: string, method: string, operation: OpenAPIV3_1.Document): boolean => {\n      if (!SupportedMethods.includes(method)) return false\n\n      return !matcher.isOperationDenied(new OperationDefinition({\n        method,\n        pathname,\n        operation,\n        module: document.module,\n        document: document,\n      }))\n    }\n\n\n    const sharkedSwagger = openapiShakingSync(\n      document.specification as any,\n      isAccepted as any,\n      { tolerant: rc.tolerant },\n    ) as OpenAPIV3_1.Document\n\n    return new ApiDocumentV3_1(\n      sharkedSwagger,\n      new ModuleDefinition(\n        document.module.name,\n        {\n          url: `memory://${document.module.name}.v3_1.sharked.json`,\n          headers: {},\n          encoding: 'utf8',\n        },\n      ),\n    )\n  }\n\n\n  static register(compiler: Compiler): ShakingPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {\n        },\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): ShakingPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import { ListrTaskWrapper } from 'listr2'\nimport { OperationDefinition } from '~/models/index.js'\nimport { select } from 'inquirer-select-pro'\nimport { ListrInquirerPromptAdapter } from '@listr2/prompt-adapter-inquirer'\nimport { CompilerContext } from '~/compiler/index.js'\n\nexport async function selectOperationDefinitions(\n  task: ListrTaskWrapper<CompilerContext, any, any>,\n  operationDefinitions: OperationDefinition[],\n): Promise<OperationDefinition[]> {\n  const selectedOperationDefinitions = await task.prompt(ListrInquirerPromptAdapter).run(\n    select<OperationDefinition>,\n    {\n      message: 'Select Pathname',\n      defaultValue: [],\n      options: (input) => {\n        const items = operationDefinitions.map((op) => ({ name: `${op.module.name} ${op.method.toUpperCase()} ${op.pathname}`, value: op }))\n\n        if (!input) return items\n        const keys = input\n          .trim()\n          .toLowerCase()\n          .split(/\\s+/)\n\n        return items.filter((i) => {\n          const name = i.name.toLowerCase()\n          return keys.every((q) => name.includes(q))\n        })\n      },\n    },\n  )\n\n  return selectedOperationDefinitions\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface TerminalSelectPluginMetadata {\n  applied: boolean\n  hooks: object\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<TerminalSelectPluginMetadata>(\n  '@keq-request/cli:TerminalSelectPlugin:MetadataStorage',\n)\n","import { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { selectOperationDefinitions } from './utils/select-operation-definitions.js'\nimport { FilterMode } from './types/index.js'\nimport { MetadataStorage, TerminalSelectPluginMetadata } from './constants/index.js'\n\nexport interface TerminalSelectPluginOptions {\n  mode: FilterMode\n\n  persist?: boolean\n}\n\n\nexport class TerminalSelectPlugin implements Plugin {\n  constructor(private options: TerminalSelectPluginOptions) {}\n\n  apply(compiler: Compiler): void {\n    const metadata = TerminalSelectPlugin.register(compiler)\n    if (metadata.applied) return\n\n    // Mark as applied immediately to prevent re-entry\n    metadata.applied = true\n\n    compiler.hooks.afterDownload.tapPromise(TerminalSelectPlugin.name, async (task) => {\n      const context = compiler.context\n\n      const matcher = context.matcher!\n      const documents = context.documents!\n      const operationDefinitions = documents.flatMap((document) => document.operations)\n      const selectedOperationDefinitions = await selectOperationDefinitions(task, operationDefinitions)\n\n      for (const op of selectedOperationDefinitions) {\n        matcher.append({\n          persist: !!this.options.persist,\n          deny: this.options.mode === 'deny',\n          moduleName: op.module.name,\n          operationMethod: op.method,\n          operationPathname: op.pathname,\n        })\n      }\n    })\n  }\n\n  static register(compiler: Compiler): TerminalSelectPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n        hooks: {},\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): TerminalSelectPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import fs from 'fs-extra'\nimport { Plugin } from '~/types/index.js'\nimport { Compiler } from '~/compiler/index.js'\n\n\nexport class CleanPlugin implements Plugin {\n  apply(compiler: Compiler): void {\n    compiler.hooks.beforePersist.tapPromise(CleanPlugin.name, async () => {\n      const rc = compiler.context.rc\n      if (!rc) throw new Error('Please run setup task first.')\n\n      const outdir = rc.outdir\n      await fs.emptyDir(outdir)\n    })\n  }\n}\n","import * as R from 'ramda'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { DownloadHttpFilePlugin } from '../download-http-file/index.js'\nimport { DownloadLocalFilePlugin } from '../download-local-file/index.js'\nimport { DownloadByBashPlugin } from '../download-by-bash/index.js'\nimport { DownloadByShPlugin } from '../download-by-sh/index.js'\nimport { ShakingPlugin } from '../shaking/index.js'\nimport { TerminalSelectPlugin, TerminalSelectPluginOptions } from '../terminal-select/index.js'\nimport { CleanPlugin } from '../clean/index.js'\n\n\ninterface InitializePluginOptions {\n  build?: boolean\n  fresh?: boolean\n  interactive?: boolean | TerminalSelectPluginOptions\n\n}\n\nexport class InitializePlugin implements Plugin {\n  constructor(private options: InitializePluginOptions) {\n  }\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.setup.tap(InitializePlugin.name, (task) => {\n      const plugins: Plugin[] = [\n        new DownloadHttpFilePlugin(),\n        new DownloadLocalFilePlugin(),\n        new DownloadByBashPlugin(),\n        new DownloadByShPlugin(),\n      ]\n\n      if (this.options.build) {\n        plugins.push(new ShakingPlugin())\n      }\n\n      if (this.options.interactive) {\n        plugins.push(\n          new TerminalSelectPlugin(\n            typeof this.options.interactive === 'object'\n              ? this.options.interactive\n              : { mode: 'allow' },\n          ),\n        )\n      }\n\n      const rc = compiler.context.rc!\n\n      plugins.push(\n        ...R.unnest(\n          (rc.translators || []).map((translator) => {\n            const plugins = translator.apply()\n            return plugins\n          }),\n        ),\n      )\n\n      if (this.options.fresh) {\n        plugins.push(new CleanPlugin())\n      }\n\n      if (rc.plugins && rc.plugins.length) {\n        plugins.push(...rc.plugins)\n      }\n\n      for (const plugin of plugins) {\n        plugin.apply(compiler)\n      }\n    })\n  }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { Compiler } from '~/compiler/index.js'\nimport { Exception } from '~/exception.js'\nimport { ApiDocumentV3_1 } from '~/models/api-document_v3_1.js'\nimport { ModuleDefinition } from '~/models/module-definition.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\n/**\n * A factory function that generates an operationId for a given operation.\n * If undefined is returned, the operationId will not be modified.\n */\nexport type OperationIdFactory = (context: {\n  module: ModuleDefinition\n  method: string\n  pathname: string\n  operation: OpenAPIV3_1.OperationObject\n}) => string | undefined\n\n\nexport class OverwriteOperationIdPlugin implements Plugin {\n  constructor(private readonly factory: OperationIdFactory) {}\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.afterDownload.tap(OverwriteOperationIdPlugin.name, () => {\n      const documents = compiler.context.documents!\n      const factory = this.factory\n\n      compiler.context.documents = documents.map((document) => {\n        const spec = OpenapiUtils.mapOperation(\n          document.specification,\n          (method, pathname, operation) => {\n            const operationId = factory({ method, pathname, operation, module: document.module })\n            if (typeof operationId === 'string') {\n              if (operationId.length === 0) {\n                throw new Exception(document.module, `The generated operationId for [${method.toUpperCase()} ${pathname}] is an empty string.`)\n              }\n              operation.operationId = operationId\n              return operation\n            }\n\n            return operation\n          },\n        )\n\n        return new ApiDocumentV3_1(spec, document.module)\n      })\n    })\n  }\n}\n","import { JSONPath } from 'jsonpath-plus'\nimport { Compiler } from '~/compiler/index.js'\nimport { ModuleDefinition } from '~/models/module-definition.js'\nimport { Plugin } from '~/types/plugin.js'\n\n\nexport type SchemaNameFactory = (context: {\n  name: string\n  module: ModuleDefinition\n}) => string | undefined\n\n\nexport class OverwriteSchemaNamePlugin implements Plugin {\n  constructor(private readonly factory: SchemaNameFactory) {}\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.beforeValidate.tap(OverwriteSchemaNamePlugin.name, (spec, moduleDefinition) => {\n      const schemas = (spec as Record<string, unknown> & { components?: { schemas?: Record<string, unknown> } }).components?.schemas\n      if (!schemas) return\n\n      const renameMap = new Map<string, string>()\n      for (const name of Object.keys(schemas)) {\n        const newName = this.factory({ name, module: moduleDefinition })\n        if (typeof newName === 'string' && newName !== name) {\n          renameMap.set(name, newName)\n        }\n      }\n\n      if (renameMap.size === 0) return\n\n      for (const [oldName, newName] of renameMap) {\n        schemas[newName] = schemas[oldName]\n        delete schemas[oldName]\n      }\n\n      const refMap = new Map<string, string>()\n      for (const [oldName, newName] of renameMap) {\n        refMap.set(\n          `#/components/schemas/${oldName}`,\n          `#/components/schemas/${newName}`,\n        )\n      }\n\n      const matches: Array<{ value: Record<string, unknown> }> = JSONPath({\n        path: \"$..*['$ref']^\",\n        json: spec,\n        resultType: 'all',\n      })\n\n      for (const match of matches) {\n        const ref = match.value.$ref\n        if (typeof ref === 'string' && refMap.has(ref)) {\n          match.value.$ref = refMap.get(ref)\n        }\n      }\n    })\n  }\n}\n","import { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { KeqQueryOptions } from 'keq'\nimport { Compiler } from '~/compiler/index.js'\nimport { QsArrayFormat } from '~/constants/qs-array-format.js'\nimport { Exception } from '~/exception.js'\nimport { ApiDocumentV3_1, ModuleDefinition } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\n\n\nexport type OverwriteQueryOptionsFactory = (\n  (options: {\n    module: ModuleDefinition\n    method: string\n    pathname: string\n    operation: OpenAPIV3_1.OperationObject\n    parameter: OpenAPIV3_1.ParameterObject\n  }) => KeqQueryOptions | undefined\n) | KeqQueryOptions\n\nconst QsArrayFormatUnion: string[] = Object.values(QsArrayFormat)\n\nexport class OverwriteQueryOptionsPlugin implements Plugin {\n  constructor(private readonly factory: OverwriteQueryOptionsFactory) {}\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.afterDownload.tap(OverwriteQueryOptionsPlugin.name, (task) => {\n      const documents = compiler.context.documents!\n      const factory = this.factory\n\n      compiler.context.documents = documents.map((document) => {\n        const specification = OpenapiUtils.mapParameter(\n          document.specification,\n          (method, pathname, operation, parameter) => {\n            const qsOptions = typeof factory === 'function' ? factory({ parameter, operation, pathname, method, module: document.module }) : factory\n            if (!qsOptions) return parameter\n\n            if (qsOptions.arrayFormat) {\n              if (!QsArrayFormatUnion.includes(qsOptions.arrayFormat)) {\n                throw new Exception(document.module, `The 'arrayFormat' value '${qsOptions.arrayFormat}' for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] is invalid.`)\n              }\n\n              parameter['x-qs-array-format'] = qsOptions.arrayFormat\n            }\n\n            if (qsOptions.allowDots !== undefined) {\n              if (typeof qsOptions.allowDots !== 'boolean') {\n                throw new Exception(document.module, `The 'allowDots' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`)\n              }\n\n              parameter['x-qs-allow-dots'] = Boolean(qsOptions.allowDots)\n            }\n\n            if (qsOptions.indices !== undefined) {\n              if (typeof qsOptions.indices !== 'boolean') {\n                throw new Exception(document.module, `The 'indices' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`)\n              }\n\n              parameter['x-qs-indices'] = Boolean(qsOptions.indices)\n            }\n\n            return parameter\n          },\n        )\n\n        return new ApiDocumentV3_1(\n          specification,\n          document.module,\n        )\n      })\n    })\n  }\n}\n","import { PluginMetadataStorage } from '~/models/plugin-metadata-storage.js'\n\n\nexport interface OverwriteAdditionalPropertiesPluginMetadata {\n  applied: boolean\n}\n\nexport const MetadataStorage = new PluginMetadataStorage<OverwriteAdditionalPropertiesPluginMetadata>(\n  '@keq-request/cli:OverwriteAdditionalPropertiesPlugin:MetadataStorage',\n)\n","import { Compiler } from '~/compiler/index.js'\nimport { ApiDocumentV3_1 } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { OverwriteAdditionalPropertiesPluginMetadata, MetadataStorage } from './constants/index.js'\n\n\nexport interface OverwriteAdditionalPropertiesPluginOptions {\n  /**\n   * When `true`, schemas without explicit `additionalProperties`\n   * will be set to `additionalProperties: false`.\n   * When `false` (default), respect OpenAPI 3.1 spec behavior\n   * (undefined additionalProperties = true).\n   * @default false\n   */\n  disallowIfNotPresent?: boolean\n}\n\nexport class OverwriteAdditionalPropertiesPlugin implements Plugin {\n  constructor(private readonly options: OverwriteAdditionalPropertiesPluginOptions = {}) {}\n\n  apply(compiler: Compiler): void {\n    const metadata = OverwriteAdditionalPropertiesPlugin.register(compiler)\n    if (metadata.applied) return\n\n    metadata.applied = true\n\n    const { disallowIfNotPresent = false } = this.options\n\n    if (!disallowIfNotPresent) return\n\n    compiler.hooks.afterDownload.tap(OverwriteAdditionalPropertiesPlugin.name, () => {\n      const documents = compiler.context.documents!\n\n      compiler.context.documents = documents.map((document) => {\n        const specification = OpenapiUtils.mapSchema(\n          document.specification,\n          (schema) => {\n            if (schema.type !== 'object' && !schema.properties) return schema\n\n            if (schema.additionalProperties === undefined) {\n              return Object.assign({}, schema, { additionalProperties: false as const })\n            }\n\n            return schema\n          },\n        )\n\n        return new ApiDocumentV3_1(\n          specification,\n          document.module,\n        )\n      })\n    })\n  }\n\n  static register(compiler: Compiler): OverwriteAdditionalPropertiesPluginMetadata {\n    if (!MetadataStorage.has(compiler)) {\n      MetadataStorage.set(compiler, {\n        applied: false,\n      })\n    }\n    return MetadataStorage.get(compiler)!\n  }\n\n  static of(compiler: Compiler): OverwriteAdditionalPropertiesPluginMetadata | undefined {\n    return this.register(compiler)\n  }\n}\n","import Ajv2020 from 'ajv/dist/2020.js'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { logger } from '~/utils/logger.js'\nimport { SupportedMethods } from '~/constants/supported-methods.js'\nimport { ApiDocumentV3_1 } from '~/models/api-document_v3_1.js'\nimport { OpenapiUtils } from '~/utils/openapi-utils/index.js'\nimport { Exception } from '~/exception.js'\n\n\nexport interface LintSchemaPluginOptions {\n  /**\n   * When true, throw an error and stop the build if schema validation fails.\n   * When false (default), log warnings and continue.\n   * @default false\n   */\n  strict?: boolean\n}\n\nexport class LintSchemaPlugin implements Plugin {\n  constructor(private readonly options: LintSchemaPluginOptions = {}) {}\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.beforeCompile.tap(LintSchemaPlugin.name, () => {\n      const documents = compiler.context.documents!\n\n      const ajv = new Ajv2020({ allErrors: true, strict: false })\n      const validate = ajv.getSchema('https://json-schema.org/draft/2020-12/schema')\n\n      if (!validate) {\n        logger.warn('Failed to load JSON Schema Draft 2020-12 meta-schema for validation')\n        return\n      }\n\n      let hasErrors = false\n\n      for (const document of documents) {\n        const spec = document.specification\n        const moduleName = document.module.name\n\n        // Validate components.schemas\n        if (spec.components?.schemas) {\n          for (const [name, schema] of Object.entries(spec.components.schemas)) {\n            if (typeof schema === 'boolean' || '$ref' in schema) continue\n\n            if (!validate(schema) && validate.errors) {\n              hasErrors = true\n              for (const error of validate.errors) {\n                logger.warn(`[${moduleName}] components.schemas.${name}${error.instancePath}: ${error.message}`)\n              }\n            }\n          }\n        }\n\n        // Validate operation schemas\n        for (const [path, pathItem] of Object.entries(spec.paths || {})) {\n          if (!pathItem) continue\n\n          for (const method of SupportedMethods) {\n            const operation = (pathItem as Record<string, OpenAPIV3_1.OperationObject>)[method]\n            if (!operation) continue\n\n            const operationId = operation.operationId || `${method.toUpperCase()} ${path}`\n\n            // Parameters\n            if (operation.parameters) {\n              for (const param of operation.parameters) {\n                if ('$ref' in param || !param.schema) continue\n                if (typeof param.schema === 'boolean' || '$ref' in param.schema) continue\n\n                if (!validate(param.schema) && validate.errors) {\n                  hasErrors = true\n                  for (const error of validate.errors) {\n                    logger.warn(`[${moduleName}] ${operationId} parameter \"${param.name}\" schema${error.instancePath}: ${error.message}`)\n                  }\n                }\n              }\n            }\n\n            // RequestBody\n            if (operation.requestBody && !('$ref' in operation.requestBody)) {\n              const content = (operation.requestBody.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n              for (const [mediaType, mediaTypeObj] of Object.entries(content)) {\n                if (!mediaTypeObj.schema || typeof mediaTypeObj.schema === 'boolean' || '$ref' in mediaTypeObj.schema) continue\n\n                if (!validate(mediaTypeObj.schema) && validate.errors) {\n                  hasErrors = true\n                  for (const error of validate.errors) {\n                    logger.warn(`[${moduleName}] ${operationId} requestBody ${mediaType} schema${error.instancePath}: ${error.message}`)\n                  }\n                }\n              }\n            }\n\n            // Responses\n            if (operation.responses) {\n              for (const [statusCode, response] of Object.entries(operation.responses)) {\n                if ('$ref' in response) continue\n\n                const content = (response.content || {}) as Record<string, OpenAPIV3_1.MediaTypeObject>\n                for (const [mediaType, mediaTypeObj] of Object.entries(content)) {\n                  if (!mediaTypeObj.schema || typeof mediaTypeObj.schema === 'boolean' || '$ref' in mediaTypeObj.schema) continue\n\n                  if (!validate(mediaTypeObj.schema) && validate.errors) {\n                    hasErrors = true\n                    for (const error of validate.errors) {\n                      logger.warn(`[${moduleName}] ${operationId} response ${statusCode} ${mediaType} schema${error.instancePath}: ${error.message}`)\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n\n      if (this.options.strict && hasErrors) {\n        throw new Error('Schema validation failed. Fix the errors above or set LintSchemaPlugin strict option to false.')\n      }\n\n      this.lintDuplicateOperationId(compiler, documents)\n    })\n  }\n\n  /**\n   * Detect duplicate operationId across all operations within each API document.\n   *\n   * In tolerant mode, duplicates are auto-resolved by appending `__{method}_{pathname}` suffix\n   * and the patched document replaces the original in the compiler context.\n   * In strict mode (tolerant=false), an Exception is thrown immediately.\n   */\n  private lintDuplicateOperationId(compiler: Compiler, documents: ApiDocumentV3_1[]): void {\n    for (let i = 0; i < documents.length; i++) {\n      const document = documents[i]\n      const spec = document.specification\n      const moduleName = document.module.name\n\n      const operationIdMap = new Map<string, Array<{ method: string; pathname: string }>>()\n      for (const [pathname, pathItem] of Object.entries(spec.paths || {})) {\n        if (!pathItem) continue\n        for (const method of SupportedMethods) {\n          const operation = (pathItem as Record<string, OpenAPIV3_1.OperationObject>)[method]\n          if (!operation?.operationId) continue\n          const list = operationIdMap.get(operation.operationId) || []\n          list.push({ method, pathname })\n          operationIdMap.set(operation.operationId, list)\n        }\n      }\n\n      const duplicates = [...operationIdMap.entries()].filter(([, ops]) => ops.length > 1)\n      if (duplicates.length === 0) continue\n\n      if (!compiler.options.tolerant) {\n        const messages = duplicates.map(([id, ops]) => `  - operationId \"${id}\" is used by: ${ops.map((o) => `[${o.method.toUpperCase()} ${o.pathname}]`).join(', ')}`,\n        )\n        throw new Exception(document.module, `Duplicate operationId found:\\n${messages.join('\\n')}`)\n      }\n\n      const duplicateIds = new Set(duplicates.map(([id]) => id))\n      for (const [id, ops] of duplicates) {\n        logger.warn(`[${moduleName}] Duplicate operationId \"${id}\" found in: ${ops.map((o) => `[${o.method.toUpperCase()} ${o.pathname}]`).join(', ')}`)\n      }\n\n      const newSpec = OpenapiUtils.mapOperation(spec, (method, pathname, operation) => {\n        if (operation.operationId && duplicateIds.has(operation.operationId)) {\n          const sanitized = pathname\n            .replace(/\\//g, '_')\n            .replace(/-/g, '_')\n            .replace(/:/g, '$$')\n            .replace(/{(.+)}/, '$$$1')\n          const newId = `${operation.operationId}__${method}${sanitized}`\n          logger.warn(`[${moduleName}] Renamed: \"${operation.operationId}\" -> \"${newId}\" for [${method.toUpperCase()} ${pathname}]`)\n          operation.operationId = newId\n        }\n        return operation\n      })\n\n      compiler.context.documents![i] = new ApiDocumentV3_1(newSpec, document.module)\n    }\n  }\n}\n","import { Compiler } from '~/compiler/index.js'\nimport { Artifact, OperationDefinition } from '~/models/index.js'\nimport { Plugin } from '~/types/plugin.js'\nimport { GenerateMicroFunctionPlugin } from '../generate-micro-function/index.js'\nimport { GenerateIsolatedPlugin } from '../generate-isolated/index.js'\n\n\nexport interface SpringdocCompatPluginOptions {\n  /**\n   * Ensure application/json requests always carry a body.\n   * When enabled, an empty object `{}` is sent even if no body properties are provided.\n   * Compatible with Spring Boot Jackson and other backends that require a JSON body.\n   * @default false\n   * @deprecated Use `rendering.emptyJsonRequestBodyMode: 'empty-object'` instead.\n   */\n  ensureJsonBody?: boolean\n}\n\n\nfunction flattenExtensions(obj: unknown): void {\n  if (typeof obj !== 'object' || obj === null) return\n\n  if (Array.isArray(obj)) {\n    for (const item of obj) {\n      flattenExtensions(item)\n    }\n    return\n  }\n\n  const record = obj as Record<string, unknown>\n\n  if ('extensions' in record && typeof record.extensions === 'object' && record.extensions !== null) {\n    const extensions = record.extensions as Record<string, unknown>\n    for (const [key, value] of Object.entries(extensions)) {\n      if (!(key in record)) {\n        record[key] = value\n      }\n    }\n    delete record.extensions\n  }\n\n  for (const value of Object.values(record)) {\n    flattenExtensions(value)\n  }\n}\n\nfunction patchParameterList(parameters: unknown): void {\n  if (!Array.isArray(parameters)) return\n\n  for (const param of parameters) {\n    if (typeof param !== 'object' || param === null) continue\n    if ('$ref' in param) continue\n\n    const record = param as Record<string, unknown>\n    if (!('schema' in record) && !('content' in record)) {\n      record.schema = {}\n    }\n  }\n}\n\nfunction ensureParameterSchema(spec: unknown): void {\n  if (typeof spec !== 'object' || spec === null) return\n\n  const root = spec as Record<string, unknown>\n  const paths = root.paths as Record<string, unknown> | undefined\n  if (paths) {\n    for (const pathItem of Object.values(paths)) {\n      if (typeof pathItem !== 'object' || pathItem === null) continue\n      const item = pathItem as Record<string, unknown>\n\n      patchParameterList(item.parameters)\n\n      for (const method of ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']) {\n        const operation = item[method] as Record<string, unknown> | undefined\n        if (operation) {\n          patchParameterList(operation.parameters)\n        }\n      }\n    }\n  }\n\n  const components = root.components as Record<string, unknown> | undefined\n  if (components?.parameters) {\n    const params = components.parameters as Record<string, unknown>\n    for (const param of Object.values(params)) {\n      if (typeof param !== 'object' || param === null) continue\n      if ('$ref' in param) continue\n\n      const record = param as Record<string, unknown>\n      if (!('schema' in record) && !('content' in record)) {\n        record.schema = {}\n      }\n    }\n  }\n}\n\nfunction dropEmptyContactEmail(spec: unknown): void {\n  if (typeof spec !== 'object' || spec === null) return\n\n  const info = (spec as Record<string, unknown>).info\n  if (typeof info !== 'object' || info === null) return\n\n  const contact = (info as Record<string, unknown>).contact\n  if (typeof contact !== 'object' || contact === null) return\n\n  const record = contact as Record<string, unknown>\n  if (record.email === '') {\n    delete record.email\n  }\n}\n\nfunction hasJsonContent(operation: OperationDefinition): boolean {\n  const content = operation.operation.requestBody?.content\n  if (!content || typeof content !== 'object') return false\n  return 'application/json' in content\n}\n\n\n/**\n * Compatibility plugin for OpenAPI documents generated by Springdoc (Java/Spring Boot).\n *\n * Springdoc outputs documents with structures that do not conform to the OpenAPI spec.\n * This plugin applies corrections before validation.\n * Current processing:\n * - Flatten nested `extensions` objects into sibling x-* properties\n * - Add `schema: {}` to parameters missing both `schema` and `content`\n * - Remove an empty-string `info.contact.email`, which otherwise fails `format: \"email\"` validation\n * - (Optional) Ensure application/json requests always carry a body\n */\nexport class SpringdocCompatPlugin implements Plugin {\n  constructor(private readonly options: SpringdocCompatPluginOptions = {}) {}\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.beforeValidate.tap(SpringdocCompatPlugin.name, (spec) => {\n      flattenExtensions(spec)\n      ensureParameterSchema(spec)\n      dropEmptyContactEmail(spec)\n    })\n\n    if (this.options.ensureJsonBody) {\n      this.applyEnsureJsonBody(compiler)\n    }\n  }\n\n  private applyEnsureJsonBody(compiler: Compiler): void {\n    const metadata = GenerateMicroFunctionPlugin.of(compiler)\n    if (metadata) {\n      metadata.hooks.afterMicroFunctionArtifactGenerated\n        .tap({ name: SpringdocCompatPlugin.name, stage: 100 }, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n          if (hasJsonContent(operationDefinition)) {\n            artifact.anchor.block.prepend('body', '  void req.send({})')\n          }\n          return artifact\n        })\n    }\n\n    const isolatedMetadata = GenerateIsolatedPlugin.of(compiler)\n    if (isolatedMetadata) {\n      isolatedMetadata.hooks.afterIsolatedOperationArtifactGenerated\n        .tap({ name: SpringdocCompatPlugin.name, stage: 100 }, (artifact: Artifact, operationDefinition: OperationDefinition) => {\n          if (hasJsonContent(operationDefinition)) {\n            artifact.anchor.block.prepend('body', '  void req.send({})')\n          }\n          return artifact\n        })\n    }\n  }\n}\n","import { JSONPath } from 'jsonpath-plus'\nimport { Compiler } from '~/compiler/index.js'\nimport { Plugin } from '~/types/plugin.js'\n\n\nexport interface MockRule {\n  given: string\n  when?: {\n    type?: string | string[]\n    format?: string\n  }\n  then:\n    | { example: unknown }\n    | { faker: string; args?: unknown }\n    | { default: unknown }\n}\n\nexport interface MockPluginOptions {\n  rules: MockRule[]\n}\n\ntype SchemaNode = Record<string, unknown>\n\nfunction resolveRef(root: object, ref: string): SchemaNode | undefined {\n  if (!ref.startsWith('#/')) return undefined\n  const parts = ref.slice(2).split('/')\n  let current: unknown = root\n  for (const part of parts) {\n    if (typeof current !== 'object' || current === null) return undefined\n    current = (current as Record<string, unknown>)[part]\n  }\n  return typeof current === 'object' && current !== null ? current as SchemaNode : undefined\n}\n\nfunction resolveSchemaNode(root: object, node: SchemaNode): SchemaNode | undefined {\n  if ('$ref' in node && typeof node['$ref'] === 'string') {\n    return resolveRef(root, node['$ref'])\n  }\n  return node\n}\n\nfunction hasExplicitValue(node: SchemaNode): boolean {\n  return 'example' in node\n    || 'examples' in node\n    || 'enum' in node\n    || 'const' in node\n    || 'x-faker' in node\n}\n\nfunction matchesCondition(node: SchemaNode, when: NonNullable<MockRule['when']>): boolean {\n  if (when.type) {\n    const types = Array.isArray(when.type) ? when.type : [when.type]\n    if (!types.includes(node.type as string)) return false\n  }\n  if (when.format && node.format !== when.format) return false\n  return true\n}\n\nfunction applyAction(node: SchemaNode, then: MockRule['then']): void {\n  if ('example' in then) {\n    node.example = then.example\n  } else if ('faker' in then) {\n    node['x-faker'] = then.args\n      ? { [then.faker]: then.args }\n      : then.faker\n  } else if ('default' in then) {\n    node.default = then.default\n  }\n}\n\nfunction extractPropertyTarget(given: string): string | undefined {\n  const match = given.match(/\\.properties\\.([^.[]+)$/)\n  return match ? match[1] : undefined\n}\n\nfunction extractSchemaEntryPath(given: string): string | undefined {\n  const idx = given.lastIndexOf('.properties.')\n  if (idx === -1) return undefined\n  return given.slice(0, idx)\n}\n\nfunction walkSchemaProperties(\n  schema: SchemaNode,\n  root: object,\n  visitor: (propName: string, propSchema: SchemaNode) => void,\n  visited: Set<object> = new Set(),\n): void {\n  const resolved = resolveSchemaNode(root, schema)\n  if (!resolved) return\n  if (visited.has(resolved)) return\n  visited.add(resolved)\n\n  if (resolved.properties && typeof resolved.properties === 'object') {\n    for (const [name, propValue] of Object.entries(resolved.properties as Record<string, unknown>)) {\n      if (typeof propValue !== 'object' || propValue === null) continue\n      const propSchema = propValue as SchemaNode\n      visitor(name, propSchema)\n      walkSchemaProperties(propSchema, root, visitor, visited)\n    }\n  }\n\n  if (resolved.items && typeof resolved.items === 'object') {\n    walkSchemaProperties(resolved.items as SchemaNode, root, visitor, visited)\n  }\n\n  for (const key of ['allOf', 'oneOf', 'anyOf'] as const) {\n    const arr = resolved[key]\n    if (Array.isArray(arr)) {\n      for (const sub of arr) {\n        if (typeof sub === 'object' && sub !== null) {\n          walkSchemaProperties(sub as SchemaNode, root, visitor, visited)\n        }\n      }\n    }\n  }\n}\n\nexport class MockPlugin implements Plugin {\n  private rules: MockRule[]\n\n  constructor(options: MockPluginOptions) {\n    this.rules = options.rules\n  }\n\n  apply(compiler: Compiler): void {\n    compiler.hooks.beforeValidate.tap(MockPlugin.name, (spec) => {\n      for (const rule of this.rules) {\n        this.applyRule(spec, rule)\n      }\n    })\n  }\n\n  private applyRule(spec: object, rule: MockRule): void {\n    const propertyTarget = extractPropertyTarget(rule.given)\n\n    if (!propertyTarget) {\n      const matches: Array<{ value: unknown }> = JSONPath({\n        path: rule.given,\n        json: spec,\n        resultType: 'all',\n      })\n      for (const match of matches) {\n        const node = match.value\n        if (typeof node !== 'object' || node === null) continue\n        const schema = node as SchemaNode\n        if (hasExplicitValue(schema)) continue\n        if (rule.when && !matchesCondition(schema, rule.when)) continue\n        applyAction(schema, rule.then)\n      }\n      return\n    }\n\n    const schemaEntryPath = extractSchemaEntryPath(rule.given)\n    if (!schemaEntryPath) return\n\n    const entries: Array<{ value: unknown }> = JSONPath({\n      path: schemaEntryPath,\n      json: spec,\n      resultType: 'all',\n    })\n\n    for (const entry of entries) {\n      if (typeof entry.value !== 'object' || entry.value === null) continue\n      const schemaEntry = entry.value as SchemaNode\n\n      walkSchemaProperties(schemaEntry, spec, (propName, propSchema) => {\n        if (propName !== propertyTarget) return\n        if (hasExplicitValue(propSchema)) return\n        if (rule.when && !matchesCondition(propSchema, rule.when)) return\n        applyAction(propSchema, rule.then)\n      })\n    }\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAY,kBAAL,yBAAA,iBAAA;;AAEL,iBAAA,SAAA;;AAEA,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;;;AC9BD,IAAY,gBAAL,yBAAA,eAAA;AACL,eAAA,cAAA;AACA,eAAA,aAAA;AACA,eAAA,YAAA;AACA,eAAA,WAAA;AACA,eAAA,WAAA;AACA,eAAA,UAAA;;KACD;;;ACPD,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;ACOD,IAAa,wBAAb,MAAsC;CACpC;CAEA,YAAY,KAAc;AACxB,MAAI,QAAQ,KAAA,GAAW;GACrB,MAAM,aAAa,OAAO,IAAI,IAAI;GAClC,MAAM,IAAI;AACV,OAAI,CAAC,EAAE,YACL,GAAE,8BAAc,IAAI,SAAsB;AAE5C,QAAK,UAAU,EAAE;QAEjB,MAAK,0BAAU,IAAI,SAAsB;;CAI7C,IAAI,KAAwB;AAC1B,SAAO,KAAK,QAAQ,IAAI,IAAI;;CAG9B,IAAI,KAA8B;AAChC,SAAO,KAAK,QAAQ,IAAI,IAAI;;CAG9B,IAAI,KAAe,OAAgB;AACjC,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ACA,oBAAoB,WAAW;GAC/B;GACA;GACA;GACA;GACA;GACA;GACA;GACA,qCAAqC,WAAW;GAChD,sCAAsC,WAAW;GACjD;GACA,2FAA2F,WAAW;GACtG;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,2BAA2B,WAAW;GACtC;GACA;GACA,uBAAuB,WAAW;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,cAAc,WAAW;GACzB,8CAA8C,WAAW;GACzD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,6CAA6C,WAAW;GACxD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,UAAU,WAAW;GACrB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,UAAU,WAAW;GACrB;GACA;GACA;GACA;GACA;GACA;GACA;GACA,qBAAqB,aAAa;GAClC;GACA;GACA;GACA;GACA,6CAA6C,WAAW;GACxD;GACA;GACA;GACA;GACA;GACA;GACA,eAAe,WAAW;GAC1B;GACA,gBAAgB,WAAW;GAC3B;GACA;GACA;GACA;GACA;GACD,CAAC,KAAK,KAAK;;;;;AC5IhB,IAAa,yBAAb,MAAoC;CAClC,OAAO,eAAe,UAA2B,SAAyD;AACxG,SAAO,IAAI,qBAAqB,UAAU,QAAQ,CAAC,QAAQ;;CAG7D,OAAO,eAAe,UAA2B,SAAyD;AACxG,SAAO,IAAI,qBAAqB,UAAU,QAAQ,CAAC,QAAQ;;;;;ACR/D,SAAgB,gBAAgB,MAAc,OAAgC;AAC5E,KAAI,UAAA,MAA+B,QAAO;AAC1C,QAAO,WAAW,OAAO,KAAK;;;;ACWhC,MAAaC,qBAAkB,IAAI,sBACjC,6DACD;;;ACND,MAAa,mBAAmB;AAEhC,IAAa,6BAAb,MAAa,2BAAgD;CAC3D,MAAM,Q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