@kubb/ast 5.25.1 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/{combineFileMembers-DJHNAZBN.js → combineFileMembers-B-mdjXrG.js} +2 -2
  2. package/dist/{combineFileMembers-DJHNAZBN.js.map → combineFileMembers-B-mdjXrG.js.map} +1 -1
  3. package/dist/{combineFileMembers-DmmuOmY8.cjs → combineFileMembers-DZCKxAN0.cjs} +2 -2
  4. package/dist/{combineFileMembers-DmmuOmY8.cjs.map → combineFileMembers-DZCKxAN0.cjs.map} +1 -1
  5. package/dist/factory.cjs +2 -2
  6. package/dist/factory.d.cts +2 -2
  7. package/dist/factory.d.ts +2 -2
  8. package/dist/factory.js +2 -2
  9. package/dist/{file-HwCmj--S.js → file-BOFEjuUC.js} +2 -2
  10. package/dist/{file-HwCmj--S.js.map → file-BOFEjuUC.js.map} +1 -1
  11. package/dist/{file-z3xToonr.cjs → file-DyVzXu0Y.cjs} +2 -2
  12. package/dist/{file-z3xToonr.cjs.map → file-DyVzXu0Y.cjs.map} +1 -1
  13. package/dist/file.cjs +2 -2
  14. package/dist/file.js +2 -2
  15. package/dist/{graph-DDh1FFrm.cjs → graph-D6Ffy9YD.cjs} +19 -22
  16. package/dist/graph-D6Ffy9YD.cjs.map +1 -0
  17. package/dist/{graph-DImDxlJE.js → graph-DWlCmvm6.js} +19 -22
  18. package/dist/graph-DWlCmvm6.js.map +1 -0
  19. package/dist/graph.cjs +1 -1
  20. package/dist/graph.d.cts +1 -1
  21. package/dist/graph.d.ts +1 -1
  22. package/dist/graph.js +1 -1
  23. package/dist/{guards-l2AsKeHR.d.ts → guards-CTqHwyNs.d.ts} +1 -1
  24. package/dist/{guards-B6LgmDhJ.d.cts → guards-EpQMJGyF.d.cts} +1 -1
  25. package/dist/http.d.cts +2 -2
  26. package/dist/http.d.ts +2 -2
  27. package/dist/{index-f90iIhHX.d.ts → index-B8ZxUpy4.d.ts} +1 -1
  28. package/dist/{index-DerFkxlp.d.ts → index-BGhhO3z8.d.ts} +4 -3
  29. package/dist/{index-D2tWPgnK.d.cts → index-BXv0B9Pd.d.cts} +1 -1
  30. package/dist/{index-Br4bwEnS.d.ts → index-C0_Y9yA1.d.ts} +1 -1
  31. package/dist/{index-DfTgdgaH.d.cts → index-C4ZZnf_X.d.cts} +4 -3
  32. package/dist/{index-DNDNDzyJ.d.cts → index-CKd3ogUZ.d.cts} +2 -2
  33. package/dist/{index-CCUB1hoV.d.cts → index-CiVsdeOh.d.cts} +3 -3
  34. package/dist/{index-C5SXJAtZ.d.cts → index-Ck6nqnxZ.d.cts} +1 -1
  35. package/dist/{index-YTyLBHFN.d.ts → index-CuQPyRve.d.ts} +1 -1
  36. package/dist/{index-2hzFweaD.d.cts → index-DSW89P6k.d.cts} +1 -1
  37. package/dist/index-DT-_5NUx.d.cts +5 -0
  38. package/dist/{index-DXdwkq7X.d.ts → index-DVX6E3vZ.d.ts} +2 -2
  39. package/dist/{index-BjmAaymt.d.cts → index-DdD4PIY8.d.cts} +1 -1
  40. package/dist/{index-Bz33tfQo.d.ts → index-DjwCRndP.d.ts} +1 -1
  41. package/dist/{index-MzcNxet1.d.ts → index-DphKh9u9.d.ts} +3 -3
  42. package/dist/index-kxuajWM1.d.ts +5 -0
  43. package/dist/index.cjs +6 -6
  44. package/dist/index.d.cts +13 -13
  45. package/dist/index.d.ts +13 -13
  46. package/dist/index.js +6 -6
  47. package/dist/json.d.cts +1 -1
  48. package/dist/json.d.ts +1 -1
  49. package/dist/macro.d.cts +1 -1
  50. package/dist/macro.d.ts +1 -1
  51. package/dist/node.d.cts +2 -2
  52. package/dist/node.d.ts +2 -2
  53. package/dist/{nodes-TtDfZ9qf.cjs → nodes-BGxHocS_.cjs} +2 -2
  54. package/dist/{nodes-TtDfZ9qf.cjs.map → nodes-BGxHocS_.cjs.map} +1 -1
  55. package/dist/{nodes-u9i-tqFp.js → nodes-KgbYiyJQ.js} +2 -2
  56. package/dist/{nodes-u9i-tqFp.js.map → nodes-KgbYiyJQ.js.map} +1 -1
  57. package/dist/{operation-De4lbIZS.d.cts → operation-B86IER5K.d.cts} +1 -1
  58. package/dist/{operation-Dd0-l2VB.d.ts → operation-DJ7F0cFp.d.ts} +1 -1
  59. package/dist/{promise-DScaykew.cjs → promise-DMQPWp6M.cjs} +37 -22
  60. package/dist/promise-DMQPWp6M.cjs.map +1 -0
  61. package/dist/{promise-B3YkZ4C8.js → promise-bi4pc8Xr.js} +37 -22
  62. package/dist/promise-bi4pc8Xr.js.map +1 -0
  63. package/dist/{ref-Dlxn7eu7.js → ref-BU7sfEFr.js} +2 -2
  64. package/dist/{ref-Dlxn7eu7.js.map → ref-BU7sfEFr.js.map} +1 -1
  65. package/dist/{ref-Ck-0j8NV.cjs → ref-CGeCLkAk.cjs} +2 -2
  66. package/dist/{ref-Ck-0j8NV.cjs.map → ref-CGeCLkAk.cjs.map} +1 -1
  67. package/dist/ref.cjs +2 -2
  68. package/dist/ref.d.cts +1 -1
  69. package/dist/ref.d.ts +1 -1
  70. package/dist/ref.js +2 -2
  71. package/dist/{refs-Bgf8_9Ui.js → refs-C0hb_qu-.js} +2 -2
  72. package/dist/{refs-Bgf8_9Ui.js.map → refs-C0hb_qu-.js.map} +1 -1
  73. package/dist/{refs-rmr2LFV1.cjs → refs-CJZBa9hL.cjs} +2 -2
  74. package/dist/{refs-rmr2LFV1.cjs.map → refs-CJZBa9hL.cjs.map} +1 -1
  75. package/dist/{schema-BvUrXIoX.js → schema-B05JSQRq.js} +3 -3
  76. package/dist/{schema-BvUrXIoX.js.map → schema-B05JSQRq.js.map} +1 -1
  77. package/dist/{schema-DfLGJ-oh.cjs → schema-XGRiAvok.cjs} +3 -3
  78. package/dist/{schema-DfLGJ-oh.cjs.map → schema-XGRiAvok.cjs.map} +1 -1
  79. package/dist/schema.cjs +1 -1
  80. package/dist/schema.d.cts +3 -3
  81. package/dist/schema.d.ts +3 -3
  82. package/dist/schema.js +1 -1
  83. package/dist/{visitor-BN5QJX7-.d.cts → visitor-BIldddZd.d.cts} +2 -2
  84. package/dist/{visitor-BNGMMmpe.d.ts → visitor-xxcbpM5-.d.ts} +2 -2
  85. package/package.json +1 -1
  86. package/dist/graph-DDh1FFrm.cjs.map +0 -1
  87. package/dist/graph-DImDxlJE.js.map +0 -1
  88. package/dist/index-BiXrjYNm.d.cts +0 -5
  89. package/dist/index-CC5Rmgcm.d.ts +0 -5
  90. package/dist/promise-B3YkZ4C8.js.map +0 -1
  91. package/dist/promise-DScaykew.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-z3xToonr.cjs","names":["getNames","createFile","nodeKinds","getNodeText","createImport","CODE_NODE_TEXT_FIELDS"],"sources":["../src/utils/inline.ts","../src/file/index.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport type { CodeNode } from '../nodes/code.ts'\nimport { createFile, createImport } from '../nodes/file.ts'\nimport type { FileNode, ImportNode, SourceNode } from '../nodes/file.ts'\nimport { getNames } from './moduleNames.ts'\nimport { CODE_NODE_TEXT_FIELDS, getNodeText } from './nodeText.ts'\n\nexport type InlineFilesResult = {\n /**\n * Files that imported an inline name, rewritten to hold its definition.\n */\n files: Array<FileNode>\n /**\n * Paths of the virtual files, which are not written.\n */\n virtualPaths: Array<string>\n /**\n * One message per name that could not be inlined.\n */\n problems: Array<{ path: string; message: string }>\n}\n\ntype Definition = { expression: string; imports: Array<ImportNode> }\n\n/**\n * The language-specific half of {@link inlineFiles}, supplied by the parser that prints the file.\n */\nexport type InlineLanguage = {\n /**\n * Swaps in what `replace` returns for every identifier in `text` that references a name, skipping strings and comments.\n */\n replaceIdentifiers(text: string, replace: (name: string) => string | undefined): string\n /**\n * Makes `expression` safe to put where a name was, such as `(A | B)` in TypeScript.\n */\n wrap(expression: string): string\n}\n\nexport type InlineFilesOptions = {\n /**\n * The inline support for a file's language, or `undefined` when it has none.\n */\n language: (file: FileNode) => InlineLanguage | undefined\n}\n\n/**\n * Replaces every name a file imports from a virtual file (one marked `inline`, so it is never written) with the body of that name's\n * declaration, until no inline names are left. The definitions' own imports move to the importing file.\n */\nexport function inlineFiles(files: ReadonlyArray<FileNode>, { language }: InlineFilesOptions): InlineFilesResult {\n const virtualFiles = new Map(files.filter(isInlineFile).map((file) => [file.path, file]))\n const result: InlineFilesResult = { files: [], virtualPaths: [...virtualFiles.keys()], problems: [] }\n if (virtualFiles.size === 0) return result\n\n // `null` marks a definition that is being resolved, so a name that reaches itself is a cycle.\n const definitions = new Map<string, Definition | null>()\n\n function define(path: string, name: string, from: string, lang: InlineLanguage): Definition | undefined {\n const key = `${path}\\0${name}`\n if (definitions.has(key)) {\n const definition = definitions.get(key)\n if (definition === null) result.problems.push({ path: from, message: `\"${name}\" from \"${path}\" is defined in terms of itself.` })\n return definition ?? undefined\n }\n\n const file = virtualFiles.get(path)!\n const expression = bodyOf(file.sources.find((source) => source.name === name))\n if (expression === undefined) {\n result.problems.push({ path: from, message: `\"${name}\" is imported from \"${path}\", which never writes it and has no inline definition for it.` })\n return undefined\n }\n\n definitions.set(key, null)\n const imports: Array<ImportNode> = []\n const { text, used } = replaceNames(expression, file, lang, imports)\n imports.push(...file.imports.flatMap((imp) => (virtualFiles.has(imp.path) ? [] : pickNames(imp, used))))\n\n const definition = { expression: text, imports }\n definitions.set(key, definition)\n return definition\n }\n\n // Pushes the imports the replaced definitions need onto `imports`; `used` holds the names left as they are.\n function replaceNames(input: string, file: FileNode, lang: InlineLanguage, imports: Array<ImportNode>) {\n const used = new Set<string>()\n const text = lang.replaceIdentifiers(input, (local) => {\n const target = findTarget(file, local)\n const definition = target && define(target.path, target.name, file.path, lang)\n if (!definition) {\n used.add(local)\n return undefined\n }\n\n imports.push(...definition.imports)\n return lang.wrap(definition.expression)\n })\n\n return { text, used }\n }\n\n function findTarget(file: FileNode, local: string): { path: string; name: string } | undefined {\n if (virtualFiles.has(file.path) && file.sources.some((source) => source.name === local)) return { path: file.path, name: local }\n\n for (const imp of file.imports) {\n const item = virtualFiles.has(imp.path) && getNames(imp).find((item) => (item.alias ?? item.name) === local)\n if (item) return { path: imp.path, name: item.name }\n }\n\n return undefined\n }\n\n for (const file of files) {\n if (virtualFiles.has(file.path) || !file.imports.some((imp) => virtualFiles.has(imp.path))) continue\n\n const lang = language(file)\n if (!lang) {\n result.problems.push({ path: file.path, message: `No parser for \"${file.extname}\" files supports inline sources.` })\n continue\n }\n\n const carried: Array<ImportNode> = []\n const sources = file.sources.map((source) => ({ ...source, nodes: rewriteNodes(source.nodes, (text) => replaceNames(text, file, lang, carried).text) }))\n\n // A carried import keeps its target; `root` moves to the importing file so the relative path is computed from there.\n const imports = [...file.imports.filter((imp) => !virtualFiles.has(imp.path)), ...carried.map((imp) => (imp.root ? { ...imp, root: file.path } : imp))]\n\n result.files.push(createFile({ ...file, sources, imports }))\n }\n\n return result\n}\n\n// A file of only deprecated per-source `inline` counts as inline too.\nfunction isInlineFile(file: FileNode): boolean {\n return !!file.inline || (file.sources.length > 0 && file.sources.every((source) => source.inline))\n}\n\n// The right-hand side of a `Const` or `Type`. A function body is not an expression, and printed text such as `Code` has none.\nfunction bodyOf(source: SourceNode | undefined): string | undefined {\n if (source?.inline) return source.inline.expression\n const node = source?.nodes?.length === 1 ? source.nodes[0] : undefined\n if (node?.kind !== nodeKinds.const && node?.kind !== nodeKinds.type) return undefined\n return getNodeText(node.nodes) || undefined\n}\n\nfunction pickNames(imp: ImportNode, used: ReadonlySet<string>): Array<ImportNode> {\n const names = getNames(imp).filter((item) => used.has(item.alias ?? item.name))\n return names.length > 0 ? [createImport({ path: imp.path, ...(imp.root != null ? { root: imp.root } : {}), names })] : []\n}\n\n// Rewrites the string fields `getNodeText` reads; JSDoc stays as written.\nfunction rewriteNodes(nodes: Array<CodeNode> | undefined, rewrite: (text: string) => string): Array<CodeNode> | undefined {\n return nodes?.map((node): CodeNode => {\n // Backward-compat: compiled plugins may still pass bare strings at runtime\n if (typeof node === 'string') return rewrite(node) as unknown as CodeNode\n if (node.kind === nodeKinds.break) return node\n\n const next = { ...node } as unknown as Record<string, unknown>\n for (const field of CODE_NODE_TEXT_FIELDS[node.kind] ?? []) {\n const value = next[field]\n if (Array.isArray(value)) next[field] = value.map(rewrite)\n if (typeof value === 'string' && value) next[field] = rewrite(value)\n }\n if ('nodes' in node && node.nodes) next.nodes = rewriteNodes(node.nodes, rewrite)\n return next as unknown as CodeNode\n })\n}\n","export { getRelativePath } from '../utils/combineFileMembers.ts'\nexport { inlineFiles as inline } from '../utils/inline.ts'\nexport { getNames, getSpace, isExported } from '../utils/moduleNames.ts'\n"],"mappings":";;;;;;;;;AAiDA,SAAgB,YAAY,OAAgC,EAAE,YAAmD;CAC/G,MAAM,eAAe,IAAI,IAAI,MAAM,OAAO,YAAY,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;CACxF,MAAM,SAA4B;EAAE,OAAO,CAAC;EAAG,cAAc,CAAC,GAAG,aAAa,KAAK,CAAC;EAAG,UAAU,CAAC;CAAE;CACpG,IAAI,aAAa,SAAS,GAAG,OAAO;CAGpC,MAAM,8BAAc,IAAI,IAA+B;CAEvD,SAAS,OAAO,MAAc,MAAc,MAAc,MAA8C;EACtG,MAAM,MAAM,GAAG,KAAK,IAAI;EACxB,IAAI,YAAY,IAAI,GAAG,GAAG;GACxB,MAAM,aAAa,YAAY,IAAI,GAAG;GACtC,IAAI,eAAe,MAAM,OAAO,SAAS,KAAK;IAAE,MAAM;IAAM,SAAS,IAAI,KAAK,UAAU,KAAK;GAAkC,CAAC;GAChI,OAAO,cAAc,KAAA;EACvB;EAEA,MAAM,OAAO,aAAa,IAAI,IAAI;EAClC,MAAM,aAAa,OAAO,KAAK,QAAQ,MAAM,WAAW,OAAO,SAAS,IAAI,CAAC;EAC7E,IAAI,eAAe,KAAA,GAAW;GAC5B,OAAO,SAAS,KAAK;IAAE,MAAM;IAAM,SAAS,IAAI,KAAK,sBAAsB,KAAK;GAA+D,CAA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AK,SAAS,KAAK,IAAI,CAAC;CAC9E,OAAO,MAAM,SAAS,IAAI,CAACI,2BAAAA,aAAa;EAAE,MAAM,IAAI;EAAM,GAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;EAAI;CAAM,CAAC,CAAC,IAAI,CAAC;AAC1H;AAGA,SAAS,aAAa,OAAoC,SAAgE;CACxH,OAAO,OAAO,KAAK,SAAmB;EAEpC,IAAI,OAAO,SAAS,UAAU,OAAO,QAAQ,IAAI;EACjD,IAAI,KAAK,SAASF,kBAAAA,UAAU,OAAO,OAAO;EAE1C,MAAM,OAAO,EAAE,GAAG,KAAK;EACvB,KAAK,MAAM,SAASG,iBAAAA,sBAAsB,KAAK,SAAS,CAAC,GAAG;GAC1D,MAAM,QAAQ,KAAK;GACnB,IAAI,MAAM,QAAQ,KAAK,GAAG,KAAK,SAAS,MAAM,IAAI,OAAO;GACzD,IAAI,OAAO,UAAU,YAAY,OAAO,KAAK,SAAS,QAAQ,KAAK;EACrE;EACA,IAAI,WAAW,QAAQ,KAAK,OAAO,KAAK,QAAQ,aAAa,KAAK,OAAO,OAAO;EAChF,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"file-DyVzXu0Y.cjs","names":["getNames","createFile","nodeKinds","getNodeText","createImport","CODE_NODE_TEXT_FIELDS"],"sources":["../src/utils/inline.ts","../src/file/index.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport type { CodeNode } from '../nodes/code.ts'\nimport { createFile, createImport } from '../nodes/file.ts'\nimport type { FileNode, ImportNode, SourceNode } from '../nodes/file.ts'\nimport { getNames } from './moduleNames.ts'\nimport { CODE_NODE_TEXT_FIELDS, getNodeText } from './nodeText.ts'\n\nexport type InlineFilesResult = {\n /**\n * Files that imported an inline name, rewritten to hold its definition.\n */\n files: Array<FileNode>\n /**\n * Paths of the virtual files, which are not written.\n */\n virtualPaths: Array<string>\n /**\n * One message per name that could not be inlined.\n */\n problems: Array<{ path: string; message: string }>\n}\n\ntype Definition = { expression: string; imports: Array<ImportNode> }\n\n/**\n * The language-specific half of {@link inlineFiles}, supplied by the parser that prints the file.\n */\nexport type InlineLanguage = {\n /**\n * Swaps in what `replace` returns for every identifier in `text` that references a name, skipping strings and comments.\n */\n replaceIdentifiers(text: string, replace: (name: string) => string | undefined): string\n /**\n * Makes `expression` safe to put where a name was, such as `(A | B)` in TypeScript.\n */\n wrap(expression: string): string\n}\n\nexport type InlineFilesOptions = {\n /**\n * The inline support for a file's language, or `undefined` when it has none.\n */\n language: (file: FileNode) => InlineLanguage | undefined\n}\n\n/**\n * Replaces every name a file imports from a virtual file (one marked `inline`, so it is never written) with the body of that name's\n * declaration, until no inline names are left. The definitions' own imports move to the importing file.\n */\nexport function inlineFiles(files: ReadonlyArray<FileNode>, { language }: InlineFilesOptions): InlineFilesResult {\n const virtualFiles = new Map(files.filter(isInlineFile).map((file) => [file.path, file]))\n const result: InlineFilesResult = { files: [], virtualPaths: [...virtualFiles.keys()], problems: [] }\n if (virtualFiles.size === 0) return result\n\n // `null` marks a definition that is being resolved, so a name that reaches itself is a cycle.\n const definitions = new Map<string, Definition | null>()\n\n function define(path: string, name: string, from: string, lang: InlineLanguage): Definition | undefined {\n const key = `${path}\\0${name}`\n if (definitions.has(key)) {\n const definition = definitions.get(key)\n if (definition === null) result.problems.push({ path: from, message: `\"${name}\" from \"${path}\" is defined in terms of itself.` })\n return definition ?? undefined\n }\n\n const file = virtualFiles.get(path)!\n const expression = bodyOf(file.sources.find((source) => source.name === name))\n if (expression === undefined) {\n result.problems.push({ path: from, message: `\"${name}\" is imported from \"${path}\", which never writes it and has no inline definition for it.` })\n return undefined\n }\n\n definitions.set(key, null)\n const imports: Array<ImportNode> = []\n const { text, used } = replaceNames(expression, file, lang, imports)\n imports.push(...file.imports.flatMap((imp) => (virtualFiles.has(imp.path) ? [] : pickNames(imp, used))))\n\n const definition = { expression: text, imports }\n definitions.set(key, definition)\n return definition\n }\n\n // Pushes the imports the replaced definitions need onto `imports`; `used` holds the names left as they are.\n function replaceNames(input: string, file: FileNode, lang: InlineLanguage, imports: Array<ImportNode>) {\n const used = new Set<string>()\n const text = lang.replaceIdentifiers(input, (local) => {\n const target = findTarget(file, local)\n const definition = target && define(target.path, target.name, file.path, lang)\n if (!definition) {\n used.add(local)\n return undefined\n }\n\n imports.push(...definition.imports)\n return lang.wrap(definition.expression)\n })\n\n return { text, used }\n }\n\n function findTarget(file: FileNode, local: string): { path: string; name: string } | undefined {\n if (virtualFiles.has(file.path) && file.sources.some((source) => source.name === local)) return { path: file.path, name: local }\n\n for (const imp of file.imports) {\n const item = virtualFiles.has(imp.path) && getNames(imp).find((item) => (item.alias ?? item.name) === local)\n if (item) return { path: imp.path, name: item.name }\n }\n\n return undefined\n }\n\n for (const file of files) {\n if (virtualFiles.has(file.path) || !file.imports.some((imp) => virtualFiles.has(imp.path))) continue\n\n const lang = language(file)\n if (!lang) {\n result.problems.push({ path: file.path, message: `No parser for \"${file.extname}\" files supports inline sources.` })\n continue\n }\n\n const carried: Array<ImportNode> = []\n const sources = file.sources.map((source) => ({ ...source, nodes: rewriteNodes(source.nodes, (text) => replaceNames(text, file, lang, carried).text) }))\n\n // A carried import keeps its target; `root` moves to the importing file so the relative path is computed from there.\n const imports = [...file.imports.filter((imp) => !virtualFiles.has(imp.path)), ...carried.map((imp) => (imp.root ? { ...imp, root: file.path } : imp))]\n\n result.files.push(createFile({ ...file, sources, imports }))\n }\n\n return result\n}\n\n// A file of only deprecated per-source `inline` counts as inline too.\nfunction isInlineFile(file: FileNode): boolean {\n return !!file.inline || (file.sources.length > 0 && file.sources.every((source) => source.inline))\n}\n\n// The right-hand side of a `Const` or `Type`. A function body is not an expression, and printed text such as `Code` has none.\nfunction bodyOf(source: SourceNode | undefined): string | undefined {\n if (source?.inline) return source.inline.expression\n const node = source?.nodes?.length === 1 ? source.nodes[0] : undefined\n if (node?.kind !== nodeKinds.const && node?.kind !== nodeKinds.type) return undefined\n return getNodeText(node.nodes) || undefined\n}\n\nfunction pickNames(imp: ImportNode, used: ReadonlySet<string>): Array<ImportNode> {\n const names = getNames(imp).filter((item) => used.has(item.alias ?? item.name))\n return names.length > 0 ? [createImport({ path: imp.path, ...(imp.root != null ? { root: imp.root } : {}), names })] : []\n}\n\n// Rewrites the string fields `getNodeText` reads; JSDoc stays as written.\nfunction rewriteNodes(nodes: Array<CodeNode> | undefined, rewrite: (text: string) => string): Array<CodeNode> | undefined {\n return nodes?.map((node): CodeNode => {\n // Backward-compat: compiled plugins may still pass bare strings at runtime\n if (typeof node === 'string') return rewrite(node) as unknown as CodeNode\n if (node.kind === nodeKinds.break) return node\n\n const next = { ...node } as unknown as Record<string, unknown>\n for (const field of CODE_NODE_TEXT_FIELDS[node.kind] ?? []) {\n const value = next[field]\n if (Array.isArray(value)) next[field] = value.map(rewrite)\n if (typeof value === 'string' && value) next[field] = rewrite(value)\n }\n if ('nodes' in node && node.nodes) next.nodes = rewriteNodes(node.nodes, rewrite)\n return next as unknown as CodeNode\n })\n}\n","export { getRelativePath } from '../utils/combineFileMembers.ts'\nexport { inlineFiles as inline } from '../utils/inline.ts'\nexport { getNames, getSpace, isExported } from '../utils/moduleNames.ts'\n"],"mappings":";;;;;;;;;AAiDA,SAAgB,YAAY,OAAgC,EAAE,YAAmD;CAC/G,MAAM,eAAe,IAAI,IAAI,MAAM,OAAO,YAAY,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;CACxF,MAAM,SAA4B;EAAE,OAAO,CAAC;EAAG,cAAc,CAAC,GAAG,aAAa,KAAK,CAAC;EAAG,UAAU,CAAC;CAAE;CACpG,IAAI,aAAa,SAAS,GAAG,OAAO;CAGpC,MAAM,8BAAc,IAAI,IAA+B;CAEvD,SAAS,OAAO,MAAc,MAAc,MAAc,MAA8C;EACtG,MAAM,MAAM,GAAG,KAAK,IAAI;EACxB,IAAI,YAAY,IAAI,GAAG,GAAG;GACxB,MAAM,aAAa,YAAY,IA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ClE,IAAI,QAAQ,QAAQ,OAAO,OAAO,OAAO;CACzC,MAAM,OAAO,QAAQ,OAAO,WAAW,IAAI,OAAO,MAAM,KAAK,KAAA;CAC7D,IAAI,MAAM,SAASC,kBAAAA,UAAU,SAAS,MAAM,SAASA,kBAAAA,UAAU,MAAM,OAAO,KAAA;CAC5E,OAAOC,iBAAAA,YAAY,KAAK,KAAK,KAAK,KAAA;AACpC;AAEA,SAAS,UAAU,KAAiB,MAA8C;CAChF,MAAM,QAAQH,2BAAAA,SAAS,GAAG,CAAC,CAAC,QAAQ,SAAS,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,CAAC;CAC9E,OAAO,MAAM,SAAS,IAAI,CAACI,2BAAAA,aAAa;EAAE,MAAM,IAAI;EAAM,GAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;EAAI;CAAM,CAAC,CAAC,IAAI,CAAC;AAC1H;AAGA,SAAS,aAAa,OAAoC,SAAgE;CACxH,OAAO,OAAO,KAAK,SAAmB;EAEpC,IAAI,OAAO,SAAS,UAAU,OAAO,QAAQ,IAAI;EACjD,IAAI,KAAK,SAASF,kBAAAA,UAAU,OAAO,OAAO;EAE1C,MAAM,OAAO,EAAE,GAAG,KAAK;EACvB,KAAK,MAAM,SAASG,iBAAAA,sBAAsB,KAAK,SAAS,CAAC,GAAG;GAC1D,MAAM,QAAQ,KAAK;GACnB,IAAI,MAAM,QAAQ,KAAK,GAAG,KAAK,SAAS,MAAM,IAAI,OAAO;GACzD,IAAI,OAAO,UAAU,YAAY,OAAO,KAAK,SAAS,QAAQ,KAAK;EACrE;EACA,IAAI,WAAW,QAAQ,KAAK,OAAO,KAAK,QAAQ,aAAa,KAAK,OAAO,OAAO;EAChF,OAAO;CACT,CAAC;AACH"}
package/dist/file.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_combineFileMembers = require("./combineFileMembers-DmmuOmY8.cjs");
3
- const require_file = require("./file-z3xToonr.cjs");
2
+ const require_combineFileMembers = require("./combineFileMembers-DZCKxAN0.cjs");
3
+ const require_file = require("./file-DyVzXu0Y.cjs");
4
4
  exports.getNames = require_combineFileMembers.getNames;
5
5
  exports.getRelativePath = require_combineFileMembers.getRelativePath;
6
6
  exports.getSpace = require_combineFileMembers.getSpace;
package/dist/file.js CHANGED
@@ -1,3 +1,3 @@
1
- import { c as getSpace, l as isExported, s as getNames, t as getRelativePath } from "./combineFileMembers-DJHNAZBN.js";
2
- import { n as inlineFiles } from "./file-HwCmj--S.js";
1
+ import { c as getSpace, l as isExported, s as getNames, t as getRelativePath } from "./combineFileMembers-B-mdjXrG.js";
2
+ import { n as inlineFiles } from "./file-BOFEjuUC.js";
3
3
  export { getNames, getRelativePath, getSpace, inlineFiles as inline, isExported };
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
2
- const require_promise = require("./promise-DScaykew.cjs");
2
+ const require_promise = require("./promise-DMQPWp6M.cjs");
3
3
  const require_constants = require("./constants-BCRkFAiy.cjs");
4
4
  const require_visitor = require("./visitor-DhuKS-7x.cjs");
5
- const require_refs = require("./refs-rmr2LFV1.cjs");
5
+ const require_refs = require("./refs-CJZBa9hL.cjs");
6
6
  // src/utils/schemaGraph.ts
7
7
  const refEntries = require_promise.memo.create({ weak: true });
8
8
  const checkRefEntries = require_promise.memo.create({ weak: true });
@@ -66,7 +66,8 @@ function collectImportedRefNames(node, { checks = false } = {}) {
66
66
  return require_promise.memo(checks ? importedCheckRefNames : importedRefNames, node, () => [...new Set(collectRefEntries(node, { checks }).flatMap((entry) => entry.hasPointer ? [entry.name] : []))]);
67
67
  }
68
68
  /**
69
- * Collects the names of all top-level schemas transitively used by a set of operations.
69
+ * Collects the names of all top-level schemas transitively used by a set of operations or schemas.
70
+ * A schema root counts the schemas it references, not itself.
70
71
  *
71
72
  * An operation uses a schema when its parameters, request body, or responses reference it, directly
72
73
  * or through other named schemas. Once a name is added to the result it is not revisited, so
@@ -85,7 +86,7 @@ function collectImportedRefNames(node, { checks = false } = {}) {
85
86
  * }
86
87
  * ```
87
88
  */
88
- function collectUsedSchemaNames(operations, schemas) {
89
+ function collectUsedSchemaNames(roots, schemas) {
89
90
  const schemaMap = /* @__PURE__ */ new Map();
90
91
  for (const schema of schemas) if (schema.name) schemaMap.set(schema.name, schema);
91
92
  const result = /* @__PURE__ */ new Set();
@@ -96,7 +97,7 @@ function collectUsedSchemaNames(operations, schemas) {
96
97
  if (namedSchema) visitSchema(namedSchema);
97
98
  }
98
99
  }
99
- for (const op of operations) for (const schema of require_visitor.collect(op, {
100
+ for (const root of roots) for (const schema of require_visitor.collect(root, {
100
101
  depth: "shallow",
101
102
  schema: (node) => node
102
103
  })) visitSchema(schema);
@@ -114,23 +115,19 @@ function collectUsedSchemaNames(operations, schemas) {
114
115
  function findCircularSchemas(schemas) {
115
116
  const graph = /* @__PURE__ */ new Map();
116
117
  for (const schema of schemas) if (schema.name) graph.set(schema.name, collectSchemaRefs(schema));
117
- const circular = /* @__PURE__ */ new Set();
118
- for (const start of graph.keys()) {
119
- const visited = /* @__PURE__ */ new Set();
120
- const stack = [...graph.get(start) ?? []];
121
- while (stack.length > 0) {
122
- const node = stack.pop();
123
- if (node === start) {
124
- circular.add(start);
125
- break;
126
- }
127
- if (visited.has(node)) continue;
128
- visited.add(node);
129
- const next = graph.get(node);
130
- if (next) for (const r of next) stack.push(r);
131
- }
118
+ return new Set([...graph.keys()].filter((start) => reachesItself(graph, start)));
119
+ }
120
+ function reachesItself(graph, start) {
121
+ const visited = /* @__PURE__ */ new Set();
122
+ const stack = [...graph.get(start) ?? []];
123
+ while (stack.length > 0) {
124
+ const node = stack.pop();
125
+ if (node === start) return true;
126
+ if (visited.has(node)) continue;
127
+ visited.add(node);
128
+ for (const next of graph.get(node) ?? []) stack.push(next);
132
129
  }
133
- return circular;
130
+ return false;
134
131
  }
135
132
  // src/graph/index.ts
136
133
  var graph_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
@@ -170,4 +167,4 @@ Object.defineProperty(exports, "graph_exports", {
170
167
  }
171
168
  });
172
169
 
173
- //# sourceMappingURL=graph-DDh1FFrm.cjs.map
170
+ //# sourceMappingURL=graph-D6Ffy9YD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-D6Ffy9YD.cjs","names":["memo","nodeKinds","resolveRefName","visitChildNodes","collect"],"sources":["../src/utils/schemaGraph.ts","../src/graph/index.ts"],"sourcesContent":["import { memo } from '@internals/utils'\nimport { nodeKinds } from '../constants.ts'\nimport type { Node } from '../nodes/index.ts'\nimport type { OperationNode } from '../nodes/operation.ts'\nimport type { SchemaNode } from '../nodes/schema.ts'\nimport { collect, visitChildNodes } from '../visitor.ts'\nimport { resolveRefName } from './refs.ts'\n\ntype RefEntry = { name: string; hasPointer: boolean }\n\nconst refEntries = memo.create<SchemaNode, ReadonlyArray<RefEntry>>({ weak: true })\nconst checkRefEntries = memo.create<SchemaNode, ReadonlyArray<RefEntry>>({ weak: true })\nconst schemaRefs = memo.create<SchemaNode, ReadonlySet<string>>({ weak: true })\nconst importedRefNames = memo.create<SchemaNode, ReadonlyArray<string>>({ weak: true })\nconst importedCheckRefNames = memo.create<SchemaNode, ReadonlyArray<string>>({ weak: true })\n\n/**\n * Walks a node's subtree once and lists every ref it holds, in traversal order, as the resolved\n * name plus whether the ref carries a `$ref` pointer. Memoized per node and per `checks` mode, so\n * each helper below scans a schema once.\n */\nfunction collectRefEntries(node: SchemaNode, { checks }: { checks: boolean }): ReadonlyArray<RefEntry> {\n return memo(checks ? checkRefEntries : refEntries, node, () => {\n const entries: Array<RefEntry> = []\n const walk = (current: Node): boolean => {\n if (current.kind === nodeKinds.schema && current.type === 'ref') {\n const name = resolveRefName(current)\n if (name) entries.push({ name, hasPointer: Boolean(current.ref) })\n }\n visitChildNodes(current, walk, { checks })\n return false\n }\n walk(node)\n return entries\n })\n}\n\n/**\n * Collects the names of every schema a node's subtree references, resolved with `ast.ref.getName`.\n * Each ref contributes its name only, so the schema it points to is never traversed. Memoized by\n * node identity, so repeated calls on one schema scan it once.\n *\n * @example\n * ```ts\n * collectSchemaRefs(petSchema)\n * // Set { 'Category', 'Tag' }\n * ```\n */\nexport function collectSchemaRefs(node: SchemaNode): ReadonlySet<string> {\n return memo(schemaRefs, node, () => new Set(collectRefEntries(node, { checks: true }).map((entry) => entry.name)))\n}\n\n/**\n * Collects the de-duplicated target names of every pointer-carrying ref in a node's subtree, in\n * first-occurrence order. Memoized by node identity, so `resolver.imports` reads the same result\n * across the ts, zod, and faker plugins instead of re-scanning the same schema per plugin.\n *\n * Only refs that carry a `$ref` pointer count, so a synthesized ref pointing at a sibling in the\n * same file (a union member created by name) is left out. That leaves exactly the set\n * `resolver.imports` emits. Refs inside `conditionals`, `contains` and `content` count only with\n * `checks: true`, for a plugin that prints those checks.\n *\n * @example\n * ```ts\n * collectImportedRefNames(petSchema)\n * // ['Category', 'Tag']\n * ```\n */\nexport function collectImportedRefNames(node: SchemaNode, { checks = false }: { checks?: boolean } = {}): ReadonlyArray<string> {\n return memo(checks ? importedCheckRefNames : importedRefNames, node, () => [\n ...new Set(collectRefEntries(node, { checks }).flatMap((entry) => (entry.hasPointer ? [entry.name] : []))),\n ])\n}\n\n/**\n * Collects the names of all top-level schemas transitively used by a set of operations or schemas.\n * A schema root counts the schemas it references, not itself.\n *\n * An operation uses a schema when its parameters, request body, or responses reference it, directly\n * or through other named schemas. Once a name is added to the result it is not revisited, so\n * reference cycles terminate.\n *\n * Pair it with `include` filters so schemas reachable only from excluded operations stay ungenerated.\n *\n * @example Only generate schemas referenced by included operations\n * ```ts\n * const includedOps = operations.filter((op) => resolver.default.options(op, { options, include }) !== null)\n * const allowed = collectUsedSchemaNames(includedOps, schemas)\n *\n * for (const schema of schemas) {\n * if (schema.name && !allowed.has(schema.name)) continue\n * // generate schema\n * }\n * ```\n */\nexport function collectUsedSchemaNames(roots: ReadonlyArray<OperationNode | SchemaNode>, schemas: ReadonlyArray<SchemaNode>): Set<string> {\n const schemaMap = new Map<string, SchemaNode>()\n for (const schema of schemas) {\n if (schema.name) schemaMap.set(schema.name, schema)\n }\n\n const result = new Set<string>()\n\n function visitSchema(schema: SchemaNode): void {\n for (const name of collectSchemaRefs(schema)) {\n if (!result.has(name)) {\n result.add(name)\n const namedSchema = schemaMap.get(name)\n if (namedSchema) visitSchema(namedSchema)\n }\n }\n }\n\n for (const root of roots) {\n for (const schema of collect<SchemaNode>(root, { depth: 'shallow', schema: (node) => node })) {\n visitSchema(schema)\n }\n }\n\n return result\n}\n\n/**\n * Finds every schema that takes part in a circular dependency chain, including direct self-loops.\n *\n * Wrap the returned schema positions in a deferred construct (a lazy getter or `z.lazy(() => …)`) so\n * the generated code does not recurse forever. Refs are followed by name only, so the walk stays\n * linear in the size of the schema graph.\n *\n * @note Call this once on the full graph, then check a schema's `ast.graph.getRefNames` against the result.\n */\nexport function findCircularSchemas(schemas: ReadonlyArray<SchemaNode>): Set<string> {\n const graph = new Map<string, ReadonlySet<string>>()\n for (const schema of schemas) {\n if (schema.name) graph.set(schema.name, collectSchemaRefs(schema))\n }\n\n return new Set([...graph.keys()].filter((start) => reachesItself(graph, start)))\n}\n\nfunction reachesItself(graph: ReadonlyMap<string, ReadonlySet<string>>, start: string): boolean {\n const visited = new Set<string>()\n const stack: Array<string> = [...(graph.get(start) ?? [])]\n while (stack.length > 0) {\n const node = stack.pop()!\n if (node === start) return true\n if (visited.has(node)) continue\n visited.add(node)\n for (const next of graph.get(node) ?? []) stack.push(next)\n }\n\n return false\n}\n","export {\n collectImportedRefNames as getImportedNames,\n collectSchemaRefs as getRefNames,\n collectUsedSchemaNames as getUsedNames,\n findCircularSchemas as getCircularNames,\n} from '../utils/schemaGraph.ts'\n"],"mappings":";;;;;;AAUA,MAAM,aAAaA,gBAAAA,KAAK,OAA4C,EAAE,MAAM,KAAK,CAAC;AAClF,MAAM,kBAAkBA,gBAAAA,KA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ldown-runtime-BYyVTPww.js";
2
- import { t as memo } from "./promise-B3YkZ4C8.js";
2
+ import { t as memo } from "./promise-bi4pc8Xr.js";
3
3
  import { t as nodeKinds } from "./constants-UorsTFsa.js";
4
4
  import { i as visitChildNodes, t as collect } from "./visitor-DA5yfOJz.js";
5
- import { a as resolveRefName } from "./refs-Bgf8_9Ui.js";
5
+ import { a as resolveRefName } from "./refs-C0hb_qu-.js";
6
6
  // src/utils/schemaGraph.ts
7
7
  const refEntries = memo.create({ weak: true });
8
8
  const checkRefEntries = memo.create({ weak: true });
@@ -66,7 +66,8 @@ function collectImportedRefNames(node, { checks = false } = {}) {
66
66
  return memo(checks ? importedCheckRefNames : importedRefNames, node, () => [...new Set(collectRefEntries(node, { checks }).flatMap((entry) => entry.hasPointer ? [entry.name] : []))]);
67
67
  }
68
68
  /**
69
- * Collects the names of all top-level schemas transitively used by a set of operations.
69
+ * Collects the names of all top-level schemas transitively used by a set of operations or schemas.
70
+ * A schema root counts the schemas it references, not itself.
70
71
  *
71
72
  * An operation uses a schema when its parameters, request body, or responses reference it, directly
72
73
  * or through other named schemas. Once a name is added to the result it is not revisited, so
@@ -85,7 +86,7 @@ function collectImportedRefNames(node, { checks = false } = {}) {
85
86
  * }
86
87
  * ```
87
88
  */
88
- function collectUsedSchemaNames(operations, schemas) {
89
+ function collectUsedSchemaNames(roots, schemas) {
89
90
  const schemaMap = /* @__PURE__ */ new Map();
90
91
  for (const schema of schemas) if (schema.name) schemaMap.set(schema.name, schema);
91
92
  const result = /* @__PURE__ */ new Set();
@@ -96,7 +97,7 @@ function collectUsedSchemaNames(operations, schemas) {
96
97
  if (namedSchema) visitSchema(namedSchema);
97
98
  }
98
99
  }
99
- for (const op of operations) for (const schema of collect(op, {
100
+ for (const root of roots) for (const schema of collect(root, {
100
101
  depth: "shallow",
101
102
  schema: (node) => node
102
103
  })) visitSchema(schema);
@@ -114,23 +115,19 @@ function collectUsedSchemaNames(operations, schemas) {
114
115
  function findCircularSchemas(schemas) {
115
116
  const graph = /* @__PURE__ */ new Map();
116
117
  for (const schema of schemas) if (schema.name) graph.set(schema.name, collectSchemaRefs(schema));
117
- const circular = /* @__PURE__ */ new Set();
118
- for (const start of graph.keys()) {
119
- const visited = /* @__PURE__ */ new Set();
120
- const stack = [...graph.get(start) ?? []];
121
- while (stack.length > 0) {
122
- const node = stack.pop();
123
- if (node === start) {
124
- circular.add(start);
125
- break;
126
- }
127
- if (visited.has(node)) continue;
128
- visited.add(node);
129
- const next = graph.get(node);
130
- if (next) for (const r of next) stack.push(r);
131
- }
118
+ return new Set([...graph.keys()].filter((start) => reachesItself(graph, start)));
119
+ }
120
+ function reachesItself(graph, start) {
121
+ const visited = /* @__PURE__ */ new Set();
122
+ const stack = [...graph.get(start) ?? []];
123
+ while (stack.length > 0) {
124
+ const node = stack.pop();
125
+ if (node === start) return true;
126
+ if (visited.has(node)) continue;
127
+ visited.add(node);
128
+ for (const next of graph.get(node) ?? []) stack.push(next);
132
129
  }
133
- return circular;
130
+ return false;
134
131
  }
135
132
  // src/graph/index.ts
136
133
  var graph_exports = /* @__PURE__ */ __exportAll({
@@ -141,4 +138,4 @@ var graph_exports = /* @__PURE__ */ __exportAll({
141
138
  });
142
139
  export { findCircularSchemas as a, collectUsedSchemaNames as i, collectImportedRefNames as n, collectSchemaRefs as r, graph_exports as t };
143
140
 
144
- //# sourceMappingURL=graph-DImDxlJE.js.map
141
+ //# sourceMappingURL=graph-DWlCmvm6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-DWlCmvm6.js","names":[],"sources":["../src/utils/schemaGraph.ts","../src/graph/index.ts"],"sourcesContent":["import { memo } from '@internals/utils'\nimport { nodeKinds } from '../constants.ts'\nimport type { Node } from '../nodes/index.ts'\nimport type { OperationNode } from '../nodes/operation.ts'\nimport type { SchemaNode } from '../nodes/schema.ts'\nimport { collect, visitChildNodes } from '../visitor.ts'\nimport { resolveRefName } from './refs.ts'\n\ntype RefEntry = { name: string; hasPointer: boolean }\n\nconst refEntries = memo.create<SchemaNode, ReadonlyArray<RefEntry>>({ weak: true })\nconst checkRefEntries = memo.create<SchemaNode, ReadonlyArray<RefEntry>>({ weak: true })\nconst schemaRefs = memo.create<SchemaNode, ReadonlySet<string>>({ weak: true })\nconst importedRefNames = memo.create<SchemaNode, ReadonlyArray<string>>({ weak: true })\nconst importedCheckRefNames = memo.create<SchemaNode, ReadonlyArray<string>>({ weak: true })\n\n/**\n * Walks a node's subtree once and lists every ref it holds, in traversal order, as the resolved\n * name plus whether the ref carries a `$ref` pointer. Memoized per node and per `checks` mode, so\n * each helper below scans a schema once.\n */\nfunction collectRefEntries(node: SchemaNode, { checks }: { checks: boolean }): ReadonlyArray<RefEntry> {\n return memo(checks ? checkRefEntries : refEntries, node, () => {\n const entries: Array<RefEntry> = []\n const walk = (current: Node): boolean => {\n if (current.kind === nodeKinds.schema && current.type === 'ref') {\n const name = resolveRefName(current)\n if (name) entries.push({ name, hasPointer: Boolean(current.ref) })\n }\n visitChildNodes(current, walk, { checks })\n return false\n }\n walk(node)\n return entries\n })\n}\n\n/**\n * Collects the names of every schema a node's subtree references, resolved with `ast.ref.getName`.\n * Each ref contributes its name only, so the schema it points to is never traversed. Memoized by\n * node identity, so repeated calls on one schema scan it once.\n *\n * @example\n * ```ts\n * collectSchemaRefs(petSchema)\n * // Set { 'Category', 'Tag' }\n * ```\n */\nexport function collectSchemaRefs(node: SchemaNode): ReadonlySet<string> {\n return memo(schemaRefs, node, () => new Set(collectRefEntries(node, { checks: true }).map((entry) => entry.name)))\n}\n\n/**\n * Collects the de-duplicated target names of every pointer-carrying ref in a node's subtree, in\n * first-occurrence order. Memoized by node identity, so `resolver.imports` reads the same result\n * across the ts, zod, and faker plugins instead of re-scanning the same schema per plugin.\n *\n * Only refs that carry a `$ref` pointer count, so a synthesized ref pointing at a sibling in the\n * same file (a union member created by name) is left out. That leaves exactly the set\n * `resolver.imports` emits. Refs inside `conditionals`, `contains` and `content` count only with\n * `checks: true`, for a plugin that prints those checks.\n *\n * @example\n * ```ts\n * collectImportedRefNames(petSchema)\n * // ['Category', 'Tag']\n * ```\n */\nexport function collectImportedRefNames(node: SchemaNode, { checks = false }: { checks?: boolean } = {}): ReadonlyArray<string> {\n return memo(checks ? importedCheckRefNames : importedRefNames, node, () => [\n ...new Set(collectRefEntries(node, { checks }).flatMap((entry) => (entry.hasPointer ? [entry.name] : []))),\n ])\n}\n\n/**\n * Collects the names of all top-level schemas transitively used by a set of operations or schemas.\n * A schema root counts the schemas it references, not itself.\n *\n * An operation uses a schema when its parameters, request body, or responses reference it, directly\n * or through other named schemas. Once a name is added to the result it is not revisited, so\n * reference cycles terminate.\n *\n * Pair it with `include` filters so schemas reachable only from excluded operations stay ungenerated.\n *\n * @example Only generate schemas referenced by included operations\n * ```ts\n * const includedOps = operations.filter((op) => resolver.default.options(op, { options, include }) !== null)\n * const allowed = collectUsedSchemaNames(includedOps, schemas)\n *\n * for (const schema of schemas) {\n * if (schema.name && !allowed.has(schema.name)) continue\n * // generate schema\n * }\n * ```\n */\nexport function collectUsedSchemaNames(roots: ReadonlyArray<OperationNode | SchemaNode>, schemas: ReadonlyArray<SchemaNode>): Set<string> {\n const schemaMap = new Map<string, SchemaNode>()\n for (const schema of schemas) {\n if (schema.name) schemaMap.set(schema.name, schema)\n }\n\n const result = new Set<string>()\n\n function visitSchema(schema: SchemaNode): void {\n for (const name of collectSchemaRefs(schema)) {\n if (!result.has(name)) {\n result.add(name)\n const namedSchema = schemaMap.get(name)\n if (namedSchema) visitSchema(namedSchema)\n }\n }\n }\n\n for (const root of roots) {\n for (const schema of collect<SchemaNode>(root, { depth: 'shallow', schema: (node) => node })) {\n visitSchema(schema)\n }\n }\n\n return result\n}\n\n/**\n * Finds every schema that takes part in a circular dependency chain, including direct self-loops.\n *\n * Wrap the returned schema positions in a deferred construct (a lazy getter or `z.lazy(() => …)`) so\n * the generated code does not recurse forever. Refs are followed by name only, so the walk stays\n * linear in the size of the schema graph.\n *\n * @note Call this once on the full graph, then check a schema's `ast.graph.getRefNames` against the result.\n */\nexport function findCircularSchemas(schemas: ReadonlyArray<SchemaNode>): Set<string> {\n const graph = new Map<string, ReadonlySet<string>>()\n for (const schema of schemas) {\n if (schema.name) graph.set(schema.name, collectSchemaRefs(schema))\n }\n\n return new Set([...graph.keys()].filter((start) => reachesItself(graph, start)))\n}\n\nfunction reachesItself(graph: ReadonlyMap<string, ReadonlySet<string>>, start: string): boolean {\n const visited = new Set<string>()\n const stack: Array<string> = [...(graph.get(start) ?? [])]\n while (stack.length > 0) {\n const node = stack.pop()!\n if (node === start) return true\n if (visited.has(node)) continue\n visited.add(node)\n for (const next of graph.get(node) ?? []) stack.push(next)\n }\n\n return false\n}\n","export {\n collectImportedRefNames as getImportedNames,\n collectSchemaRefs as getRefNames,\n collectUsedSchemaNames as getUsedNames,\n findCircularSchemas as getCircularNames,\n} from '../utils/schemaGraph.ts'\n"],"mappings":";;;;;;AAUA,MAAM,aAAa,KAAK,OAA4C,EAAE,MAAM,KAAK,CAAC;AAClF,MAAM,kBAAkB,KAAK,OAA4C,EAAE,MAAM,KAAK,CAAC;AACvF,MAAM,aAAa,KAAK,OAAwC,EAAE,MAAM,KAAK,CAAC;AAC9E,MAAM,mBAAmB,KAAK,OAA0C,EAAE,MAAM,KAAK,CAAC;AACtF,MAAM,wBAAwB,KAAK,OAA0C,EAAE,MAAM,KAAK,CAAC;;;;;;AAO3F,SAAS,kBAAkB,MAAkB,EAAE,UAAwD;CACrG,OAAO,KAAK,SAAS,kBAAkB,YAAY,YAAY;EAC7D,MAAM,UAA2B,CAAC;EAClC,MAAM,QAAQ,YAA2B;GACvC,IAAI,QAAQ,SAAS,UAAU,UAAU,QAAQ,SAAS,OAAO;IAC/D,MAAM,OAAO,eAAe,OAAO;IACnC,IAAI,MAAM,QAAQ,KAAK;KAAE;KAAM,YAAY,QAAQ,QAAQ,GAAG;IAAE,CAAC;GACnE;GACA,gBAAgB,SAAS,MAAM,EAAE,OAAO,CAAC;GACzC,OA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CAAC;CAGnE,OAAO,IAAI,IAAI,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,QAAQ,UAAU,cAAc,OAAO,KAAK,CAAC,CAAC;AACjF;AAEA,SAAS,cAAc,OAAiD,OAAwB;CAC9F,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,QAAuB,CAAC,GAAI,MAAM,IAAI,KAAK,KAAK,CAAC,CAAE;CACzD,OAAO,MAAM,SAAS,GAAG;EACvB,MAAM,OAAO,MAAM,IAAI;EACvB,IAAI,SAAS,OAAO,OAAO;EAC3B,IAAI,QAAQ,IAAI,IAAI,GAAG;EACvB,QAAQ,IAAI,IAAI;EAChB,KAAK,MAAM,QAAQ,MAAM,IAAI,IAAI,KAAK,CAAC,GAAG,MAAM,KAAK,IAAI;CAC3D;CAEA,OAAO;AACT"}
package/dist/graph.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_graph = require("./graph-DDh1FFrm.cjs");
2
+ const require_graph = require("./graph-D6Ffy9YD.cjs");
3
3
  exports.getCircularNames = require_graph.findCircularSchemas;
4
4
  exports.getImportedNames = require_graph.collectImportedRefNames;
5
5
  exports.getRefNames = require_graph.collectSchemaRefs;
package/dist/graph.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as findCircularSchemas, i as collectUsedSchemaNames, n as collectImportedRefNames, r as collectSchemaRefs } from "./index-DfTgdgaH.cjs";
1
+ import { a as findCircularSchemas, i as collectUsedSchemaNames, n as collectImportedRefNames, r as collectSchemaRefs } from "./index-C4ZZnf_X.cjs";
2
2
  export { findCircularSchemas as getCircularNames, collectImportedRefNames as getImportedNames, collectSchemaRefs as getRefNames, collectUsedSchemaNames as getUsedNames };
package/dist/graph.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as findCircularSchemas, i as collectUsedSchemaNames, n as collectImportedRefNames, r as collectSchemaRefs } from "./index-DerFkxlp.js";
1
+ import { a as findCircularSchemas, i as collectUsedSchemaNames, n as collectImportedRefNames, r as collectSchemaRefs } from "./index-BGhhO3z8.js";
2
2
  export { findCircularSchemas as getCircularNames, collectImportedRefNames as getImportedNames, collectSchemaRefs as getRefNames, collectUsedSchemaNames as getUsedNames };
package/dist/graph.js CHANGED
@@ -1 +1 @@
1
- export { a as getCircularNames, n as getImportedNames, r as getRefNames, i as getUsedNames } from "./graph-DImDxlJE.js";
1
+ export { a as getCircularNames, n as getImportedNames, r as getRefNames, i as getUsedNames } from "./graph-DWlCmvm6.js";
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, K as SchemaNodeByType, i as OperationNode, r as HttpOperationNode } from "./operation-Dd0-l2VB.js";
1
+ import { K as SchemaNode, i as OperationNode, q as SchemaNodeByType, r as HttpOperationNode } from "./operation-DJ7F0cFp.js";
2
2
  /**
3
3
  * Narrows a `SchemaNode` to the variant that matches `type`.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, K as SchemaNodeByType, i as OperationNode, r as HttpOperationNode } from "./operation-De4lbIZS.cjs";
1
+ import { K as SchemaNode, i as OperationNode, q as SchemaNodeByType, r as HttpOperationNode } from "./operation-B86IER5K.cjs";
2
2
  /**
3
3
  * Narrows a `SchemaNode` to the variant that matches `type`.
4
4
  *
package/dist/http.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as isHttpOperationNode } from "./guards-B6LgmDhJ.cjs";
2
- import "./index-BiXrjYNm.cjs";
1
+ import { t as isHttpOperationNode } from "./guards-EpQMJGyF.cjs";
2
+ import "./index-DT-_5NUx.cjs";
3
3
  export { isHttpOperationNode as isOperation };
package/dist/http.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as isHttpOperationNode } from "./guards-l2AsKeHR.js";
2
- import "./index-CC5Rmgcm.js";
1
+ import { t as isHttpOperationNode } from "./guards-CTqHwyNs.js";
2
+ import "./index-kxuajWM1.js";
3
3
  export { isHttpOperationNode as isOperation };
@@ -1,4 +1,4 @@
1
- import { D as InputNode } from "./operation-Dd0-l2VB.js";
1
+ import { D as InputNode } from "./operation-DJ7F0cFp.js";
2
2
  declare namespace index_d_exports {
3
3
  export { parse, stringify };
4
4
  }
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, i as OperationNode } from "./operation-Dd0-l2VB.js";
1
+ import { K as SchemaNode, i as OperationNode } from "./operation-DJ7F0cFp.js";
2
2
  /**
3
3
  * Collects the names of every schema a node's subtree references, resolved with `ast.ref.getName`.
4
4
  * Each ref contributes its name only, so the schema it points to is never traversed. Memoized by
@@ -31,7 +31,8 @@ declare function collectImportedRefNames(node: SchemaNode, { checks }?: {
31
31
  checks?: boolean;
32
32
  }): ReadonlyArray<string>;
33
33
  /**
34
- * Collects the names of all top-level schemas transitively used by a set of operations.
34
+ * Collects the names of all top-level schemas transitively used by a set of operations or schemas.
35
+ * A schema root counts the schemas it references, not itself.
35
36
  *
36
37
  * An operation uses a schema when its parameters, request body, or responses reference it, directly
37
38
  * or through other named schemas. Once a name is added to the result it is not revisited, so
@@ -50,7 +51,7 @@ declare function collectImportedRefNames(node: SchemaNode, { checks }?: {
50
51
  * }
51
52
  * ```
52
53
  */
53
- declare function collectUsedSchemaNames(operations: ReadonlyArray<OperationNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
54
+ declare function collectUsedSchemaNames(roots: ReadonlyArray<OperationNode | SchemaNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
54
55
  /**
55
56
  * Finds every schema that takes part in a circular dependency chain, including direct self-loops.
56
57
  *
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, H as RefSchemaNode } from "./operation-De4lbIZS.cjs";
1
+ import { K as SchemaNode, U as RefSchemaNode } from "./operation-B86IER5K.cjs";
2
2
  /**
3
3
  * Follows a resolved ref chain to its target schema. Returns an unresolved or cyclic ref as is.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { i as nodeKinds } from "./base-A-xF4pUL.js";
2
2
  import { g as CodeNode } from "./file-Dg70hXm3.js";
3
- import { a as collect, s as transform } from "./visitor-BNGMMmpe.js";
3
+ import { a as collect, s as transform } from "./visitor-xxcbpM5-.js";
4
4
  /**
5
5
  * Extracts all string content from a `CodeNode` tree recursively.
6
6
  * Collects the text fields and nested node content, to build the source string for import filtering.
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, i as OperationNode } from "./operation-De4lbIZS.cjs";
1
+ import { K as SchemaNode, i as OperationNode } from "./operation-B86IER5K.cjs";
2
2
  /**
3
3
  * Collects the names of every schema a node's subtree references, resolved with `ast.ref.getName`.
4
4
  * Each ref contributes its name only, so the schema it points to is never traversed. Memoized by
@@ -31,7 +31,8 @@ declare function collectImportedRefNames(node: SchemaNode, { checks }?: {
31
31
  checks?: boolean;
32
32
  }): ReadonlyArray<string>;
33
33
  /**
34
- * Collects the names of all top-level schemas transitively used by a set of operations.
34
+ * Collects the names of all top-level schemas transitively used by a set of operations or schemas.
35
+ * A schema root counts the schemas it references, not itself.
35
36
  *
36
37
  * An operation uses a schema when its parameters, request body, or responses reference it, directly
37
38
  * or through other named schemas. Once a name is added to the result it is not revisited, so
@@ -50,7 +51,7 @@ declare function collectImportedRefNames(node: SchemaNode, { checks }?: {
50
51
  * }
51
52
  * ```
52
53
  */
53
- declare function collectUsedSchemaNames(operations: ReadonlyArray<OperationNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
54
+ declare function collectUsedSchemaNames(roots: ReadonlyArray<OperationNode | SchemaNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
54
55
  /**
55
56
  * Finds every schema that takes part in a circular dependency chain, including direct self-loops.
56
57
  *
@@ -1,5 +1,5 @@
1
- import { t as Node } from "./index-BjmAaymt.cjs";
2
- import { i as VisitorKey, n as VisitorContext, r as VisitorDepth, t as Visitor } from "./visitor-BN5QJX7-.cjs";
1
+ import { t as Node } from "./index-DdD4PIY8.cjs";
2
+ import { i as VisitorKey, n as VisitorContext, r as VisitorDepth, t as Visitor } from "./visitor-BIldddZd.cjs";
3
3
  /**
4
4
  * Ordering hint shared by macros and plugins. `pre` runs before unmarked items, `post` after,
5
5
  * and `undefined` keeps declaration order.
@@ -1,7 +1,7 @@
1
- import { $ as PropertyNode, G as SchemaNode, J as StringSchemaNode } from "./operation-De4lbIZS.cjs";
1
+ import { K as SchemaNode, Y as StringSchemaNode, et as PropertyNode } from "./operation-B86IER5K.cjs";
2
2
  import { a as schemaTypes } from "./base-CyJhBRMi.cjs";
3
- import { n as narrowSchema } from "./guards-B6LgmDhJ.cjs";
4
- import { o as findSchema } from "./visitor-BN5QJX7-.cjs";
3
+ import { n as narrowSchema } from "./guards-EpQMJGyF.cjs";
4
+ import { o as findSchema } from "./visitor-BIldddZd.cjs";
5
5
  /**
6
6
  * Generic JSON Schema optionality: a non-required field is optional, and a
7
7
  * non-required nullable field is nullish.
@@ -1,6 +1,6 @@
1
1
  import { i as nodeKinds } from "./base-CyJhBRMi.cjs";
2
2
  import { g as CodeNode } from "./file-DJqd2j3y.cjs";
3
- import { a as collect, s as transform } from "./visitor-BN5QJX7-.cjs";
3
+ import { a as collect, s as transform } from "./visitor-BIldddZd.cjs";
4
4
  /**
5
5
  * Extracts all string content from a `CodeNode` tree recursively.
6
6
  * Collects the text fields and nested node content, to build the source string for import filtering.
@@ -1,4 +1,4 @@
1
- import { G as SchemaNode, H as RefSchemaNode } from "./operation-Dd0-l2VB.js";
1
+ import { K as SchemaNode, U as RefSchemaNode } from "./operation-DJ7F0cFp.js";
2
2
  /**
3
3
  * Follows a resolved ref chain to its target schema. Returns an unresolved or cyclic ref as is.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { D as InputNode } from "./operation-De4lbIZS.cjs";
1
+ import { D as InputNode } from "./operation-B86IER5K.cjs";
2
2
  declare namespace index_d_exports {
3
3
  export { parse, stringify };
4
4
  }
@@ -0,0 +1,5 @@
1
+ import { t as isHttpOperationNode } from "./guards-EpQMJGyF.cjs";
2
+ declare namespace index_d_exports {
3
+ export { isHttpOperationNode as isOperation };
4
+ }
5
+ export { index_d_exports as t };
@@ -1,5 +1,5 @@
1
- import { t as Node } from "./index-Bz33tfQo.js";
2
- import { i as VisitorKey, n as VisitorContext, r as VisitorDepth, t as Visitor } from "./visitor-BNGMMmpe.js";
1
+ import { t as Node } from "./index-DjwCRndP.js";
2
+ import { i as VisitorKey, n as VisitorContext, r as VisitorDepth, t as Visitor } from "./visitor-xxcbpM5-.js";
3
3
  /**
4
4
  * Ordering hint shared by macros and plugins. `pre` runs before unmarked items, `post` after,
5
5
  * and `undefined` keeps declaration order.
@@ -1,5 +1,5 @@
1
1
  import { C as createArrowFunction, D as createJsx, E as createFunction, O as createText, S as TypeNode, T as createConst, _ as ConstNode, a as ImportNode, b as JsxNode, c as Space, d as createFile, f as createImport, h as BreakNode, i as ImportInput, k as createType, l as UserFileNode, m as ArrowFunctionNode, n as ExportNode, o as ModuleName, p as createSource, r as FileNode, s as SourceNode, t as ExportInput, u as createExport, v as FunctionNode, w as createBreak, x as TextNode } from "./file-DJqd2j3y.cjs";
2
- import { $ as PropertyNode, D as InputNode, G as SchemaNode, Q as createSchema, _ as createParameter, a as OperationsNode, d as createResponse, et as createProperty, f as RequestBodyNode, h as ParameterNode, i as OperationNode, j as createInput, l as ResponseNode, o as createOperation, p as createRequestBody, s as createOperations, v as ContentNode, x as createContent } from "./operation-De4lbIZS.cjs";
2
+ import { $ as createSchema, D as InputNode, K as SchemaNode, _ as createParameter, a as OperationsNode, d as createResponse, et as PropertyNode, f as RequestBodyNode, h as ParameterNode, i as OperationNode, j as createInput, l as ResponseNode, o as createOperation, p as createRequestBody, s as createOperations, tt as createProperty, v as ContentNode, x as createContent } from "./operation-B86IER5K.cjs";
3
3
  declare namespace index_d_exports {
4
4
  export { ExportInput, ImportInput, ModuleName, Node, Space, UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createOperations, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { C as createArrowFunction, D as createJsx, E as createFunction, O as createText, S as TypeNode, T as createConst, _ as ConstNode, a as ImportNode, b as JsxNode, c as Space, d as createFile, f as createImport, h as BreakNode, i as ImportInput, k as createType, l as UserFileNode, m as ArrowFunctionNode, n as ExportNode, o as ModuleName, p as createSource, r as FileNode, s as SourceNode, t as ExportInput, u as createExport, v as FunctionNode, w as createBreak, x as TextNode } from "./file-Dg70hXm3.js";
2
- import { $ as PropertyNode, D as InputNode, G as SchemaNode, Q as createSchema, _ as createParameter, a as OperationsNode, d as createResponse, et as createProperty, f as RequestBodyNode, h as ParameterNode, i as OperationNode, j as createInput, l as ResponseNode, o as createOperation, p as createRequestBody, s as createOperations, v as ContentNode, x as createContent } from "./operation-Dd0-l2VB.js";
2
+ import { $ as createSchema, D as InputNode, K as SchemaNode, _ as createParameter, a as OperationsNode, d as createResponse, et as PropertyNode, f as RequestBodyNode, h as ParameterNode, i as OperationNode, j as createInput, l as ResponseNode, o as createOperation, p as createRequestBody, s as createOperations, tt as createProperty, v as ContentNode, x as createContent } from "./operation-DJ7F0cFp.js";
3
3
  declare namespace index_d_exports {
4
4
  export { ExportInput, ImportInput, ModuleName, Node, Space, UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createOperations, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
5
5
  }
@@ -1,7 +1,7 @@
1
- import { $ as PropertyNode, G as SchemaNode, J as StringSchemaNode } from "./operation-Dd0-l2VB.js";
1
+ import { K as SchemaNode, Y as StringSchemaNode, et as PropertyNode } from "./operation-DJ7F0cFp.js";
2
2
  import { a as schemaTypes } from "./base-A-xF4pUL.js";
3
- import { n as narrowSchema } from "./guards-l2AsKeHR.js";
4
- import { o as findSchema } from "./visitor-BNGMMmpe.js";
3
+ import { n as narrowSchema } from "./guards-CTqHwyNs.js";
4
+ import { o as findSchema } from "./visitor-xxcbpM5-.js";
5
5
  /**
6
6
  * Generic JSON Schema optionality: a non-required field is optional, and a
7
7
  * non-required nullable field is nullish.
@@ -0,0 +1,5 @@
1
+ import { t as isHttpOperationNode } from "./guards-CTqHwyNs.js";
2
+ declare namespace index_d_exports {
3
+ export { isHttpOperationNode as isOperation };
4
+ }
5
+ export { index_d_exports as t };
package/dist/index.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
3
3
  const require_constants = require("./constants-BCRkFAiy.cjs");
4
- const require_graph = require("./graph-DDh1FFrm.cjs");
4
+ const require_graph = require("./graph-D6Ffy9YD.cjs");
5
5
  const require_visitor = require("./visitor-DhuKS-7x.cjs");
6
- const require_ref = require("./ref-Ck-0j8NV.cjs");
7
- const require_schema = require("./schema-DfLGJ-oh.cjs");
6
+ const require_ref = require("./ref-CGeCLkAk.cjs");
7
+ const require_schema = require("./schema-XGRiAvok.cjs");
8
8
  const require_guards = require("./guards-4drgx10i.cjs");
9
- const require_refs = require("./refs-rmr2LFV1.cjs");
9
+ const require_refs = require("./refs-CJZBa9hL.cjs");
10
10
  const require_macro = require("./macro-Ywn4-0s5.cjs");
11
11
  const require_node = require("./node-BeccjrHH.cjs");
12
12
  const require_optionality = require("./optionality-C-qULYxo.cjs");
13
- const require_file = require("./file-z3xToonr.cjs");
13
+ const require_file = require("./file-DyVzXu0Y.cjs");
14
14
  const require_nodeText = require("./nodeText-DH4dLGUb.cjs");
15
- const require_nodes = require("./nodes-TtDfZ9qf.cjs");
15
+ const require_nodes = require("./nodes-BGxHocS_.cjs");
16
16
  const require_http = require("./http-Dv8py6wh.cjs");
17
17
  const require_json = require("./json-KV2VhBue.cjs");
18
18
  const require_mediaType = require("./mediaType-BbIfudh0.cjs");
package/dist/index.d.cts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { o as InlineLanguage, s as inlineFiles$1, t as index_d_exports$2 } from "./index-DBKL6vyC.cjs";
2
- import { a as findCircularSchemas$1, i as collectUsedSchemaNames$1, n as collectImportedRefNames$1, r as collectSchemaRefs$1, t as index_d_exports$3 } from "./index-DfTgdgaH.cjs";
3
- import { t as index_d_exports$4 } from "./index-BiXrjYNm.cjs";
4
- import { a as mergeRefWithSchema$1, i as isBareRef$1, n as index_d_exports$9, o as resolveRef$1, t as getName } from "./index-D2tWPgnK.cjs";
5
- import { n as narrowSchema$1, t as isHttpOperationNode$1 } from "./guards-B6LgmDhJ.cjs";
6
- import { a as resolveSchemaProperties$1, d as applyOptionality, i as inferDiscriminatorPropertyName$1, r as getSchemaLiteralValues$1, t as index_d_exports$10 } from "./index-CCUB1hoV.cjs";
2
+ import { a as findCircularSchemas$1, i as collectUsedSchemaNames$1, n as collectImportedRefNames$1, r as collectSchemaRefs$1, t as index_d_exports$3 } from "./index-C4ZZnf_X.cjs";
3
+ import { t as index_d_exports$4 } from "./index-DT-_5NUx.cjs";
4
+ import { a as mergeRefWithSchema$1, i as isBareRef$1, n as index_d_exports$9, o as resolveRef$1, t as getName } from "./index-BXv0B9Pd.cjs";
5
+ import { n as narrowSchema$1, t as isHttpOperationNode$1 } from "./guards-EpQMJGyF.cjs";
6
+ import { a as resolveSchemaProperties$1, d as applyOptionality, i as inferDiscriminatorPropertyName$1, r as getSchemaLiteralValues$1, t as index_d_exports$10 } from "./index-CiVsdeOh.cjs";
7
7
  import { S as TypeNode, _ as ConstNode, a as ImportNode, b as JsxNode, c as Space, g as CodeNode, h as BreakNode, i as ImportInput, l as UserFileNode, m as ArrowFunctionNode, n as ExportNode, o as ModuleName, r as FileNode, s as SourceNode, t as ExportInput, v as FunctionNode, x as TextNode, y as JSDocNode } from "./file-DJqd2j3y.cjs";
8
- import { $ as PropertyNode, A as OAuthFlow, B as ObjectSchemaNode, C as AuthRequirement, D as InputNode, E as InputMeta, F as DatetimeSchemaNode, G as SchemaNode, H as RefSchemaNode, I as EnumSchemaNode, J as StringSchemaNode, K as SchemaNodeByType, L as IntersectionSchemaNode, M as ArraySchemaNode, N as BlobSchemaNode, O as InputServer, P as DateSchemaNode, R as NotSchemaNode, S as AuthCredential, T as ExternalDocs, U as ScalarSchemaNode, V as PrimitiveSchemaType, W as ScalarSchemaType, X as UnionSchemaNode, Y as TimeSchemaNode, Z as UrlSchemaNode, a as OperationsNode, b as ExampleNode, c as ResponseLink, f as RequestBodyNode, g as ParameterStyle, h as ParameterNode, i as OperationNode, k as InputTag, l as ResponseNode, m as ParameterLocation, n as HttpMethod, q as SchemaType, r as HttpOperationNode, t as GenericOperationNode, u as StatusCode, v as ContentNode, w as AuthScheme, y as EncodingNode, z as NumberSchemaNode } from "./operation-De4lbIZS.cjs";
9
- import { a as compareMacroOrder, i as applyMacros$1, n as Enforce, o as defineMacro$1, r as Macro, t as index_d_exports$6 } from "./index-DNDNDzyJ.cjs";
10
- import { n as getNodeText, t as index_d_exports$8 } from "./index-C5SXJAtZ.cjs";
11
- import { n as index_d_exports$1, t as Node } from "./index-BjmAaymt.cjs";
12
- import { t as index_d_exports$5 } from "./index-2hzFweaD.cjs";
8
+ import { A as OAuthFlow, B as NumberSchemaNode, C as AuthRequirement, D as InputNode, E as InputMeta, F as DateSchemaNode, G as ScalarSchemaType, H as PrimitiveSchemaType, I as DatetimeSchemaNode, J as SchemaType, K as SchemaNode, L as EnumSchemaNode, M as ArraySchemaNode, N as BlobSchemaNode, O as InputServer, P as CreateSchemaInput, Q as UrlSchemaNode, R as IntersectionSchemaNode, S as AuthCredential, T as ExternalDocs, U as RefSchemaNode, V as ObjectSchemaNode, W as ScalarSchemaNode, X as TimeSchemaNode, Y as StringSchemaNode, Z as UnionSchemaNode, a as OperationsNode, b as ExampleNode, c as ResponseLink, et as PropertyNode, f as RequestBodyNode, g as ParameterStyle, h as ParameterNode, i as OperationNode, k as InputTag, l as ResponseNode, m as ParameterLocation, n as HttpMethod, q as SchemaNodeByType, r as HttpOperationNode, t as GenericOperationNode, u as StatusCode, v as ContentNode, w as AuthScheme, y as EncodingNode, z as NotSchemaNode } from "./operation-B86IER5K.cjs";
9
+ import { a as compareMacroOrder, i as applyMacros$1, n as Enforce, o as defineMacro$1, r as Macro, t as index_d_exports$6 } from "./index-CKd3ogUZ.cjs";
10
+ import { n as getNodeText, t as index_d_exports$8 } from "./index-Ck6nqnxZ.cjs";
11
+ import { n as index_d_exports$1, t as Node } from "./index-DdD4PIY8.cjs";
12
+ import { t as index_d_exports$5 } from "./index-DSW89P6k.cjs";
13
13
  import { r as index_d_exports$7 } from "./index-OfWkiJ5O.cjs";
14
14
  import { n as DistributiveOmit, r as NodeKind } from "./base-CyJhBRMi.cjs";
15
- import { a as collect$1, n as VisitorContext, o as findSchema$1, s as transform$1, t as Visitor } from "./visitor-BN5QJX7-.cjs";
15
+ import { a as collect$1, n as VisitorContext, o as findSchema$1, s as transform$1, t as Visitor } from "./visitor-BIldddZd.cjs";
16
16
  /**
17
17
  * Runtime context passed to printer handlers, both as `this` and as the second argument.
18
18
  *
@@ -315,6 +315,6 @@ export declare const collect: typeof collect$1;
315
315
  /** @deprecated Use `ast.file.inline`. Removed in Kubb v6. */
316
316
  export declare const inlineFiles: typeof inlineFiles$1;
317
317
  declare namespace index_d_exports {
318
- export { ArraySchemaNode, ArrowFunctionNode, AuthCredential, AuthRequirement, AuthScheme, BlobSchemaNode, BreakNode, CodeNode, ConstNode, ContentNode, DateSchemaNode, DatetimeSchemaNode, DistributiveOmit, EncodingNode, Enforce, EnumSchemaNode, ExampleNode, ExportInput, ExportNode, ExternalDocs, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportInput, ImportNode, InlineLanguage, InputMeta, InputNode, InputServer, InputTag, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, ModuleName, Node, NodeKind, NotSchemaNode, NumberSchemaNode, OAuthFlow, ObjectSchemaNode, OperationNode, OperationsNode, ParameterLocation, ParameterNode, ParameterStyle, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseLink, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, Space, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, applyMacros, index_d_exports as ast, collect, collectImportedRefNames, collectSchemaRefs, collectSync, collectUsedSchemaNames, compareEnforce, createPrinter, defineMacro, extractStringsFromNodes, index_d_exports$1 as factory, index_d_exports$2 as file, findCircularSchemas, findSchema, getSchemaLiteralValues, index_d_exports$3 as graph, index_d_exports$4 as http, inferDiscriminatorPropertyName, inlineFiles, isBareRef, isHttpOperationNode, index_d_exports$5 as json, index_d_exports$6 as macro, index_d_exports$7 as mediaType, mergeRefWithSchema, narrowSchema, index_d_exports$8 as node, nodeKinds, optionality, index_d_exports$9 as ref, refName, resolveRef, resolveRefName, resolveSchemaProperties, index_d_exports$10 as schema, schemaTypes, transform };
318
+ export { ArraySchemaNode, ArrowFunctionNode, AuthCredential, AuthRequirement, AuthScheme, BlobSchemaNode, BreakNode, CodeNode, ConstNode, ContentNode, CreateSchemaInput, DateSchemaNode, DatetimeSchemaNode, DistributiveOmit, EncodingNode, Enforce, EnumSchemaNode, ExampleNode, ExportInput, ExportNode, ExternalDocs, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportInput, ImportNode, InlineLanguage, InputMeta, InputNode, InputServer, InputTag, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, ModuleName, Node, NodeKind, NotSchemaNode, NumberSchemaNode, OAuthFlow, ObjectSchemaNode, OperationNode, OperationsNode, ParameterLocation, ParameterNode, ParameterStyle, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseLink, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, Space, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, applyMacros, index_d_exports as ast, collect, collectImportedRefNames, collectSchemaRefs, collectSync, collectUsedSchemaNames, compareEnforce, createPrinter, defineMacro, extractStringsFromNodes, index_d_exports$1 as factory, index_d_exports$2 as file, findCircularSchemas, findSchema, getSchemaLiteralValues, index_d_exports$3 as graph, index_d_exports$4 as http, inferDiscriminatorPropertyName, inlineFiles, isBareRef, isHttpOperationNode, index_d_exports$5 as json, index_d_exports$6 as macro, index_d_exports$7 as mediaType, mergeRefWithSchema, narrowSchema, index_d_exports$8 as node, nodeKinds, optionality, index_d_exports$9 as ref, refName, resolveRef, resolveRefName, resolveSchemaProperties, index_d_exports$10 as schema, schemaTypes, transform };
319
319
  }
320
- export { type ArraySchemaNode, type ArrowFunctionNode, type AuthCredential, type AuthRequirement, type AuthScheme, type BlobSchemaNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type DateSchemaNode, type DatetimeSchemaNode, type DistributiveOmit, type EncodingNode, type Enforce, type EnumSchemaNode, type ExampleNode, type ExportInput, type ExportNode, type ExternalDocs, type FileNode, type FunctionNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type ImportInput, type ImportNode, type InlineLanguage, type InputMeta, type InputNode, type InputServer, type InputTag, type IntersectionSchemaNode, type JSDocNode, type JsxNode, type Macro, type ModuleName, type Node, type NodeKind, type NotSchemaNode, type NumberSchemaNode, type OAuthFlow, type ObjectSchemaNode, type OperationNode, type OperationsNode, type ParameterLocation, type ParameterNode, type ParameterStyle, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type RequestBodyNode, type ResponseLink, type ResponseNode, type ScalarSchemaNode, type ScalarSchemaType, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type Space, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, index_d_exports as ast, index_d_exports$1 as factory, index_d_exports$2 as file, index_d_exports$3 as graph, index_d_exports$4 as http, index_d_exports$5 as json, index_d_exports$6 as macro, index_d_exports$7 as mediaType, index_d_exports$8 as node, index_d_exports$9 as ref, index_d_exports$10 as schema };
320
+ export { type ArraySchemaNode, type ArrowFunctionNode, type AuthCredential, type AuthRequirement, type AuthScheme, type BlobSchemaNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type CreateSchemaInput, type DateSchemaNode, type DatetimeSchemaNode, type DistributiveOmit, type EncodingNode, type Enforce, type EnumSchemaNode, type ExampleNode, type ExportInput, type ExportNode, type ExternalDocs, type FileNode, type FunctionNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type ImportInput, type ImportNode, type InlineLanguage, type InputMeta, type InputNode, type InputServer, type InputTag, type IntersectionSchemaNode, type JSDocNode, type JsxNode, type Macro, type ModuleName, type Node, type NodeKind, type NotSchemaNode, type NumberSchemaNode, type OAuthFlow, type ObjectSchemaNode, type OperationNode, type OperationsNode, type ParameterLocation, type ParameterNode, type ParameterStyle, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type RequestBodyNode, type ResponseLink, type ResponseNode, type ScalarSchemaNode, type ScalarSchemaType, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type Space, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, index_d_exports as ast, index_d_exports$1 as factory, index_d_exports$2 as file, index_d_exports$3 as graph, index_d_exports$4 as http, index_d_exports$5 as json, index_d_exports$6 as macro, index_d_exports$7 as mediaType, index_d_exports$8 as node, index_d_exports$9 as ref, index_d_exports$10 as schema };