@trpc/openapi 0.0.0-alpha.0 → 11.13.1-alpha

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["value: unknown","schema: $ZodType","wrapperDefTypes: ReadonlySet<$ZodTypeDef['type']>","def: $ZodTypeDef","current: $ZodType","schema: unknown","map: DescriptionMap","prefix: string","ctx: { registry: $ZodRegistry<GlobalMeta>; map: DescriptionMap }","path","mod: Record<string, unknown>","exportName: string","resolvedPath: string","routerOrRecord: AnyTRPCRouter | TRPCRouterRecord","result: Map<string, RuntimeDescriptions>","record: TRPCRouterRecord","inputDescs: DescriptionMap | null","outputDescs: DescriptionMap | null","value: AnyTRPCProcedure | TRPCRouterRecord","schema: JsonSchema","descs: DescriptionMap","pathParts: string[]","description: string","type: ts.Type","flag: ts.TypeFlags","sym: ts.Symbol","name: string","existing: Record<string, unknown>","s: JsonSchema","ctx: SchemaCtx","schema","flags: ts.TypeFlags","checker: ts.TypeChecker","type: ts.UnionType","depth: number","schemas: JsonSchema[]","nonNull: ts.Type[]","hasNull: boolean","type: ts.IntersectionType","properties: Record<string, JsonSchema>","required: string[]","additionalProperties: JsonSchema | boolean | undefined","result: JsonSchema","schema: JsonSchema","autoRegName: string | null","defType: ts.Type","inputType: ts.Type | null","def: ProcedureDef","ctx: WalkCtx","outputSchema: JsonSchema | null","opts: WalkTypeOpts","recordType: ts.Type","prefix: string","startDir: string","options: ts.CompilerOptions","routerType: ts.Type","schemaCtx: SchemaCtx","keys: string[]","DEFAULT_ERROR_SCHEMA: JsonSchema","resultSchema: JsonSchema","proc: ProcedureInfo","method: 'get' | 'post'","operation: Record<string, unknown>","procedures: ProcedureInfo[]","options: GenerateOptions","meta: RouterMeta","paths: Record<string, Record<string, unknown>>","pathItem: Record<string, unknown>","routerFilePath: string","walkCtx: WalkCtx"],"sources":["../src/schemaExtraction.ts","../src/generate.ts"],"sourcesContent":["import { pathToFileURL } from 'node:url';\nimport type {\n AnyTRPCProcedure,\n AnyTRPCRouter,\n TRPCRouterRecord,\n} from '@trpc/server';\nimport type {\n $ZodArrayDef,\n $ZodObjectDef,\n $ZodRegistry,\n $ZodShape,\n $ZodType,\n $ZodTypeDef,\n GlobalMeta,\n} from 'zod/v4/core';\nimport type { JsonSchema } from './generate';\n\n/** Description strings extracted from Zod `.describe()` calls, keyed by dot-delimited property path. */\nexport interface DescriptionMap {\n /** Top-level description on the schema itself (empty-string key). */\n self?: string;\n /** Property-path → description, e.g. `\"name\"` or `\"address.street\"`. */\n properties: Map<string, string>;\n}\n\nexport interface RuntimeDescriptions {\n input: DescriptionMap | null;\n output: DescriptionMap | null;\n}\n\n// ---------------------------------------------------------------------------\n// Zod shape walking — extract .describe() strings\n// ---------------------------------------------------------------------------\n\n/**\n * Zod v4 stores `.describe()` strings in `globalThis.__zod_globalRegistry`,\n * a WeakMap-backed `$ZodRegistry<GlobalMeta>`. We access it via globalThis\n * because zod is an optional peer dependency.\n */\nfunction getZodGlobalRegistry(): $ZodRegistry<GlobalMeta> | null {\n const reg = (\n globalThis as { __zod_globalRegistry?: $ZodRegistry<GlobalMeta> }\n ).__zod_globalRegistry;\n return reg && typeof reg.get === 'function' ? reg : null;\n}\n\n/** Runtime check: does this value look like a `$ZodType` (has `_zod.def`)? */\nfunction isZodSchema(value: unknown): value is $ZodType {\n if (value == null || typeof value !== 'object') return false;\n const zod = (value as { _zod?: unknown })._zod;\n return zod != null && typeof zod === 'object' && 'def' in zod;\n}\n\n/** Get the object shape from a Zod object schema, if applicable. */\nfunction zodObjectShape(schema: $ZodType): $ZodShape | null {\n const def = schema._zod.def;\n if (def.type === 'object' && 'shape' in def) {\n return (def as $ZodObjectDef).shape;\n }\n return null;\n}\n\n/** Get the element schema from a Zod array schema, if applicable. */\nfunction zodArrayElement(schema: $ZodType): $ZodType | null {\n const def = schema._zod.def;\n if (def.type === 'array' && 'element' in def) {\n return (def as $ZodArrayDef).element;\n }\n return null;\n}\n\n/** Wrapper def types whose inner schema is accessible via `innerType` or `in`. */\nconst wrapperDefTypes: ReadonlySet<$ZodTypeDef['type']> = new Set([\n 'optional',\n 'nullable',\n 'nonoptional',\n 'default',\n 'prefault',\n 'catch',\n 'readonly',\n 'pipe',\n 'transform',\n 'promise',\n 'lazy',\n]);\n\n/**\n * Extract the wrapped inner schema from a wrapper def.\n * Most wrappers use `innerType`; `pipe` uses `in`.\n */\nfunction getWrappedInner(def: $ZodTypeDef): $ZodType | null {\n if ('innerType' in def) return (def as { innerType: $ZodType }).innerType;\n if ('in' in def) return (def as { in: $ZodType }).in;\n return null;\n}\n\n/** Unwrap wrapper types (optional, nullable, default, readonly, etc.) to get the inner schema. */\nfunction unwrapZodSchema(schema: $ZodType): $ZodType {\n let current: $ZodType = schema;\n const seen = new Set<$ZodType>();\n while (!seen.has(current)) {\n seen.add(current);\n const def = current._zod.def;\n if (!wrapperDefTypes.has(def.type)) break;\n const inner = getWrappedInner(def);\n if (!inner) break;\n current = inner;\n }\n return current;\n}\n\n/**\n * Walk a Zod schema and collect description strings at each property path.\n * Returns `null` if the value is not a Zod schema or has no descriptions.\n */\nexport function extractZodDescriptions(schema: unknown): DescriptionMap | null {\n if (!isZodSchema(schema)) return null;\n const registry = getZodGlobalRegistry();\n if (!registry) return null;\n\n const map: DescriptionMap = { properties: new Map() };\n let hasAny = false;\n\n // Check top-level description\n const topMeta = registry.get(schema);\n if (topMeta?.description) {\n map.self = topMeta.description;\n hasAny = true;\n }\n\n // Walk object shape\n walkZodShape(schema, '', { registry, map });\n if (map.properties.size > 0) hasAny = true;\n\n return hasAny ? map : null;\n}\n\nfunction walkZodShape(\n schema: $ZodType,\n prefix: string,\n ctx: { registry: $ZodRegistry<GlobalMeta>; map: DescriptionMap },\n): void {\n const unwrapped = unwrapZodSchema(schema);\n\n // If this is an array, check for a description on the element schema itself\n // (stored as `[]` in the path) and recurse into the element's shape.\n const element = zodArrayElement(unwrapped);\n if (element) {\n const unwrappedElement = unwrapZodSchema(element);\n const elemMeta = ctx.registry.get(element);\n const innerElemMeta =\n unwrappedElement !== element\n ? ctx.registry.get(unwrappedElement)\n : undefined;\n const elemDesc = elemMeta?.description ?? innerElemMeta?.description;\n if (elemDesc) {\n const itemsPath = prefix ? `${prefix}.[]` : '[]';\n ctx.map.properties.set(itemsPath, elemDesc);\n }\n walkZodShape(element, prefix, ctx);\n return;\n }\n\n const shape = zodObjectShape(unwrapped);\n if (!shape) return;\n\n for (const [key, fieldSchema] of Object.entries(shape)) {\n const path = prefix ? `${prefix}.${key}` : key;\n\n // Check for description on the field — may be on the wrapper or inner schema\n const meta = ctx.registry.get(fieldSchema);\n const unwrappedField = unwrapZodSchema(fieldSchema);\n const innerMeta =\n unwrappedField !== fieldSchema\n ? ctx.registry.get(unwrappedField)\n : undefined;\n const description = meta?.description ?? innerMeta?.description;\n if (description) {\n ctx.map.properties.set(path, description);\n }\n\n // Recurse into nested objects and arrays\n walkZodShape(unwrappedField, path, ctx);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Router detection & dynamic import\n// ---------------------------------------------------------------------------\n\n/** Check whether a value looks like a tRPC router instance at runtime. */\nfunction isRouterInstance(value: unknown): value is AnyTRPCRouter {\n if (value == null) return false;\n const obj = value as Record<string, unknown>;\n const def = obj['_def'];\n return (\n typeof obj === 'object' &&\n def != null &&\n typeof def === 'object' &&\n (def as Record<string, unknown>)['record'] != null &&\n typeof (def as Record<string, unknown>)['record'] === 'object'\n );\n}\n\n/**\n * Search a module's exports for a tRPC router instance.\n *\n * Tries (in order):\n * 1. Exact `exportName` match\n * 2. lcfirst variant (`AppRouter` → `appRouter`)\n * 3. First export that looks like a router\n */\nexport function findRouterExport(\n mod: Record<string, unknown>,\n exportName: string,\n): AnyTRPCRouter | null {\n // 1. Exact match\n if (isRouterInstance(mod[exportName])) {\n return mod[exportName];\n }\n\n // 2. lcfirst variant (e.g. AppRouter → appRouter)\n const lcFirst = exportName.charAt(0).toLowerCase() + exportName.slice(1);\n if (lcFirst !== exportName && isRouterInstance(mod[lcFirst])) {\n return mod[lcFirst];\n }\n\n // 3. Any export that looks like a router\n for (const value of Object.values(mod)) {\n if (isRouterInstance(value)) {\n return value;\n }\n }\n\n return null;\n}\n\n/**\n * Try to dynamically import the router file and extract a tRPC router\n * instance. Returns `null` if the import fails (e.g. no TS loader) or\n * no router export is found.\n */\nexport async function tryImportRouter(\n resolvedPath: string,\n exportName: string,\n): Promise<AnyTRPCRouter | null> {\n try {\n const mod = await import(pathToFileURL(resolvedPath).href);\n return findRouterExport(mod as Record<string, unknown>, exportName);\n } catch {\n // Dynamic import not available (no TS loader registered) — that's fine,\n // we fall back to type-checker-only schemas.\n return null;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Router walker — collect descriptions per procedure\n// ---------------------------------------------------------------------------\n\n/**\n * Walk a runtime tRPC router/record and collect Zod `.describe()` strings\n * keyed by procedure path.\n */\nexport function collectRuntimeDescriptions(\n routerOrRecord: AnyTRPCRouter | TRPCRouterRecord,\n prefix: string,\n result: Map<string, RuntimeDescriptions>,\n): void {\n // Unwrap router to its record; plain RouterRecords are used as-is.\n const record: TRPCRouterRecord = isRouterInstance(routerOrRecord)\n ? routerOrRecord._def.record\n : routerOrRecord;\n\n for (const [key, value] of Object.entries(record)) {\n const fullPath = prefix ? `${prefix}.${key}` : key;\n\n if (isProcedure(value)) {\n // Procedure — extract descriptions from input and output Zod schemas\n const def = value._def;\n let inputDescs: DescriptionMap | null = null;\n for (const input of def.inputs) {\n const descs = extractZodDescriptions(input);\n if (descs) {\n // Merge multiple .input() descriptions (last wins for conflicts)\n inputDescs ??= { properties: new Map() };\n inputDescs.self = descs.self ?? inputDescs.self;\n for (const [p, d] of descs.properties) {\n inputDescs.properties.set(p, d);\n }\n }\n }\n\n let outputDescs: DescriptionMap | null = null;\n // `output` exists at runtime on the procedure def (from the builder)\n // but is not part of the public Procedure type.\n const outputParser = (def as Record<string, unknown>)['output'];\n if (outputParser) {\n outputDescs = extractZodDescriptions(outputParser);\n }\n\n if (inputDescs || outputDescs) {\n result.set(fullPath, { input: inputDescs, output: outputDescs });\n }\n } else {\n // Sub-router or nested RouterRecord — recurse\n collectRuntimeDescriptions(value, fullPath, result);\n }\n }\n}\n\n/** Type guard: check if a RouterRecord value is a procedure (callable). */\nfunction isProcedure(\n value: AnyTRPCProcedure | TRPCRouterRecord,\n): value is AnyTRPCProcedure {\n return typeof value === 'function';\n}\n\n// ---------------------------------------------------------------------------\n// Apply descriptions to JSON schemas\n// ---------------------------------------------------------------------------\n\n/**\n * Overlay description strings from a `DescriptionMap` onto an existing\n * JSON schema produced by the TypeScript type checker. Mutates in place.\n */\nexport function applyDescriptions(\n schema: JsonSchema,\n descs: DescriptionMap,\n): void {\n if (descs.self) {\n schema.description = descs.self;\n }\n\n for (const [propPath, description] of descs.properties) {\n setNestedDescription(schema, propPath.split('.'), description);\n }\n}\n\nfunction setNestedDescription(\n schema: JsonSchema,\n pathParts: string[],\n description: string,\n): void {\n if (pathParts.length === 0) return;\n\n const [head, ...rest] = pathParts;\n if (!head) return;\n\n // `[]` means \"array items\" — navigate to the `items` sub-schema\n if (head === '[]') {\n const items =\n schema.type === 'array' &&\n schema.items &&\n typeof schema.items === 'object'\n ? schema.items\n : null;\n if (!items) return;\n if (rest.length === 0) {\n items.description = description;\n } else {\n setNestedDescription(items, rest, description);\n }\n return;\n }\n\n const propSchema = schema.properties?.[head];\n if (!propSchema || typeof propSchema !== 'object') return;\n\n if (rest.length === 0) {\n // Leaf — Zod .describe() takes priority over JSDoc\n propSchema.description = description;\n } else {\n // For arrays, step through `items` transparently\n const target =\n propSchema.type === 'array' &&\n propSchema.items &&\n typeof propSchema.items === 'object'\n ? propSchema.items\n : propSchema;\n setNestedDescription(target, rest, description);\n }\n}\n","import * as path from 'node:path';\nimport * as ts from 'typescript';\nimport {\n applyDescriptions,\n collectRuntimeDescriptions,\n tryImportRouter,\n type RuntimeDescriptions,\n} from './schemaExtraction';\n\nconst log = console;\n\n/**\n * A minimal JSON Schema subset used for OpenAPI 3.1 schemas.\n */\nexport interface JsonSchema {\n $ref?: string;\n $defs?: Record<string, JsonSchema>;\n type?: string | string[];\n properties?: Record<string, JsonSchema>;\n required?: string[];\n items?: JsonSchema | false;\n prefixItems?: JsonSchema[];\n const?: string | number | boolean | null;\n enum?: (string | number | boolean | null)[];\n oneOf?: JsonSchema[];\n anyOf?: JsonSchema[];\n allOf?: JsonSchema[];\n not?: JsonSchema;\n additionalProperties?: JsonSchema | boolean;\n discriminator?: { propertyName: string; mapping?: Record<string, string> };\n format?: string;\n description?: string;\n minItems?: number;\n maxItems?: number;\n $schema?: string;\n}\n\ninterface ProcedureInfo {\n path: string;\n type: 'query' | 'mutation' | 'subscription';\n inputSchema: JsonSchema | null;\n outputSchema: JsonSchema | null;\n description?: string;\n}\n\n/** State extracted from the router's root config. */\ninterface RouterMeta {\n errorSchema: JsonSchema | null;\n schemas?: Record<string, JsonSchema>;\n}\n\nexport interface GenerateOptions {\n /**\n * The name of the exported router symbol.\n * @default 'AppRouter'\n */\n exportName?: string;\n /** Title for the generated OpenAPI `info` object. */\n title?: string;\n /** Version string for the generated OpenAPI `info` object. */\n version?: string;\n}\n\nexport interface OpenAPIDocument {\n openapi: string;\n jsonSchemaDialect?: string;\n info: { title: string; version: string };\n paths: Record<string, Record<string, unknown>>;\n components: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Flag helpers\n// ---------------------------------------------------------------------------\n\nconst PRIMITIVE_FLAGS =\n ts.TypeFlags.String |\n ts.TypeFlags.Number |\n ts.TypeFlags.Boolean |\n ts.TypeFlags.StringLiteral |\n ts.TypeFlags.NumberLiteral |\n ts.TypeFlags.BooleanLiteral;\n\nfunction hasFlag(type: ts.Type, flag: ts.TypeFlags): boolean {\n return (type.getFlags() & flag) !== 0;\n}\n\nfunction isPrimitive(type: ts.Type): boolean {\n return hasFlag(type, PRIMITIVE_FLAGS);\n}\n\nfunction isObjectType(type: ts.Type): boolean {\n return hasFlag(type, ts.TypeFlags.Object);\n}\n\nfunction isOptionalSymbol(sym: ts.Symbol): boolean {\n return (sym.flags & ts.SymbolFlags.Optional) !== 0;\n}\n\n// ---------------------------------------------------------------------------\n// JSON Schema conversion — shared state\n// ---------------------------------------------------------------------------\n\n/** Shared state threaded through the type-to-schema recursion. */\ninterface SchemaCtx {\n checker: ts.TypeChecker;\n visited: Set<ts.Type>;\n /** Collected named schemas for components/schemas. */\n schemas: Record<string, JsonSchema>;\n /** Map from TS type identity to its registered schema name. */\n typeToRef: Map<ts.Type, string>;\n}\n\n// ---------------------------------------------------------------------------\n// Brand unwrapping\n// ---------------------------------------------------------------------------\n\n/**\n * If `type` is a branded intersection (primitive & object), return just the\n * primitive part. Otherwise return the type as-is.\n */\nfunction unwrapBrand(type: ts.Type): ts.Type {\n if (!type.isIntersection()) {\n return type;\n }\n const primitives = type.types.filter(isPrimitive);\n const hasObject = type.types.some(isObjectType);\n const [first] = primitives;\n if (first && hasObject) {\n return first;\n }\n return type;\n}\n\n// ---------------------------------------------------------------------------\n// Schema naming helpers\n// ---------------------------------------------------------------------------\n\nconst ANONYMOUS_NAMES = new Set(['__type', '__object', 'Object', '']);\n\n/** Try to determine a meaningful name for a TS type (type alias or interface). */\nfunction getTypeName(type: ts.Type): string | null {\n const aliasName = type.aliasSymbol?.getName();\n if (aliasName && !ANONYMOUS_NAMES.has(aliasName)) {\n return aliasName;\n }\n const symName = type.getSymbol()?.getName();\n if (symName && !ANONYMOUS_NAMES.has(symName) && !symName.startsWith('__')) {\n return symName;\n }\n return null;\n}\n\nfunction ensureUniqueName(\n name: string,\n existing: Record<string, unknown>,\n): string {\n if (!(name in existing)) {\n return name;\n }\n let i = 2;\n while (`${name}${i}` in existing) {\n i++;\n }\n return `${name}${i}`;\n}\n\nfunction schemaRef(name: string): JsonSchema {\n return { $ref: `#/components/schemas/${name}` };\n}\n\nfunction isNonEmptySchema(s: JsonSchema): boolean {\n for (const _ in s) return true;\n return false;\n}\n\n// ---------------------------------------------------------------------------\n// Type → JSON Schema (with component extraction)\n// ---------------------------------------------------------------------------\n\n/**\n * Convert a TS type to a JSON Schema. If the type has been pre-registered\n * (or has a meaningful TS name), it is stored in `ctx.schemas` and a `$ref`\n * is returned instead of an inline schema.\n */\nfunction typeToJsonSchema(\n type: ts.Type,\n ctx: SchemaCtx,\n depth = 0,\n): JsonSchema {\n if (depth > 20) {\n log.warn(\n `[openapi] Schema conversion reached maximum depth (20) for type \"${ctx.checker.typeToString(type)}\". The resulting schema will be incomplete.`,\n );\n return {};\n }\n\n // If this type is already registered as a named schema, return a $ref.\n const refName = ctx.typeToRef.get(type);\n if (refName) {\n if (refName in ctx.schemas) {\n return schemaRef(refName);\n }\n // First encounter: set placeholder (circular ref guard), convert, store.\n ctx.schemas[refName] = {};\n const schema = convertTypeToSchema(type, ctx, depth);\n ctx.schemas[refName] = schema;\n return schemaRef(refName);\n }\n\n const schema = convertTypeToSchema(type, ctx, depth);\n\n // Extract JSDoc from type alias symbol (e.g. `/** desc */ type Foo = string`)\n if (!schema.description && !schema.$ref && type.aliasSymbol) {\n const aliasJsDoc = getJsDocComment(type.aliasSymbol, ctx.checker);\n if (aliasJsDoc) {\n schema.description = aliasJsDoc;\n }\n }\n\n return schema;\n}\n\n// ---------------------------------------------------------------------------\n// Cyclic reference handling\n// ---------------------------------------------------------------------------\n\n/**\n * When we encounter a type we're already visiting, it's recursive.\n * Register it as a named schema and return a $ref.\n */\nfunction handleCyclicRef(type: ts.Type, ctx: SchemaCtx): JsonSchema {\n let refName = ctx.typeToRef.get(type);\n if (!refName) {\n const name = getTypeName(type) ?? 'RecursiveType';\n refName = ensureUniqueName(name, ctx.schemas);\n ctx.typeToRef.set(type, refName);\n ctx.schemas[refName] = {}; // placeholder — filled by the outer call\n }\n return schemaRef(refName);\n}\n\n// ---------------------------------------------------------------------------\n// Primitive & literal type conversion\n// ---------------------------------------------------------------------------\n\nfunction convertPrimitiveOrLiteral(\n type: ts.Type,\n flags: ts.TypeFlags,\n checker: ts.TypeChecker,\n): JsonSchema | null {\n if (flags & ts.TypeFlags.String) {\n return { type: 'string' };\n }\n if (flags & ts.TypeFlags.Number) {\n return { type: 'number' };\n }\n if (flags & ts.TypeFlags.Boolean) {\n return { type: 'boolean' };\n }\n if (flags & ts.TypeFlags.Null) {\n return { type: 'null' };\n }\n if (flags & ts.TypeFlags.Undefined) {\n return {};\n }\n if (flags & ts.TypeFlags.Void) {\n return {};\n }\n if (flags & ts.TypeFlags.Any || flags & ts.TypeFlags.Unknown) {\n return {};\n }\n if (flags & ts.TypeFlags.Never) {\n return { not: {} };\n }\n if (flags & ts.TypeFlags.BigInt || flags & ts.TypeFlags.BigIntLiteral) {\n return { type: 'integer', format: 'bigint' };\n }\n\n if (flags & ts.TypeFlags.StringLiteral) {\n return { type: 'string', const: (type as ts.StringLiteralType).value };\n }\n if (flags & ts.TypeFlags.NumberLiteral) {\n return { type: 'number', const: (type as ts.NumberLiteralType).value };\n }\n if (flags & ts.TypeFlags.BooleanLiteral) {\n const isTrue = checker.typeToString(type) === 'true';\n return { type: 'boolean', const: isTrue };\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Union type conversion\n// ---------------------------------------------------------------------------\n\nfunction convertUnionType(\n type: ts.UnionType,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n const members = type.types;\n\n // Strip undefined / void members (they make the field optional, not typed)\n const defined = members.filter(\n (m) => !hasFlag(m, ts.TypeFlags.Undefined | ts.TypeFlags.Void),\n );\n if (defined.length === 0) {\n return {};\n }\n\n const hasNull = defined.some((m) => hasFlag(m, ts.TypeFlags.Null));\n const nonNull = defined.filter((m) => !hasFlag(m, ts.TypeFlags.Null));\n\n // TypeScript represents `boolean` as `true | false`. Collapse boolean\n // literal pairs back into a single boolean, even when mixed with other types.\n // e.g. `string | true | false` → treat as `string | boolean`\n const boolLiterals = nonNull.filter((m) =>\n hasFlag(unwrapBrand(m), ts.TypeFlags.BooleanLiteral),\n );\n const hasBoolPair =\n boolLiterals.length === 2 &&\n boolLiterals.some(\n (m) => ctx.checker.typeToString(unwrapBrand(m)) === 'true',\n ) &&\n boolLiterals.some(\n (m) => ctx.checker.typeToString(unwrapBrand(m)) === 'false',\n );\n\n // Build the effective non-null members, collapsing boolean literal pairs\n const effective = hasBoolPair\n ? nonNull.filter(\n (m) => !hasFlag(unwrapBrand(m), ts.TypeFlags.BooleanLiteral),\n )\n : nonNull;\n\n // Pure boolean (or boolean | null) — no other types\n if (hasBoolPair && effective.length === 0) {\n return hasNull ? { type: ['boolean', 'null'] } : { type: 'boolean' };\n }\n\n // Collapse unions of same-type literals into a single `enum` array.\n // e.g. \"FOO\" | \"BAR\" → { type: \"string\", enum: [\"FOO\", \"BAR\"] }\n const collapsedEnum = tryCollapseLiteralUnion(effective, hasNull);\n if (collapsedEnum) {\n return collapsedEnum;\n }\n\n const schemas = effective\n .map((m) => typeToJsonSchema(m, ctx, depth + 1))\n .filter(isNonEmptySchema);\n\n // Re-inject the collapsed boolean\n if (hasBoolPair) {\n schemas.push({ type: 'boolean' });\n }\n\n if (hasNull) {\n schemas.push({ type: 'null' });\n }\n\n if (schemas.length === 0) {\n return {};\n }\n\n const [firstSchema] = schemas;\n if (schemas.length === 1 && firstSchema !== undefined) {\n return firstSchema;\n }\n\n // When all schemas are simple type-only schemas (no other properties),\n // collapse into a single `type` array. e.g. string | null → type: [\"string\", \"null\"]\n if (schemas.every(isSimpleTypeSchema)) {\n return { type: schemas.map((s) => s.type as string) };\n }\n\n // Detect discriminated unions: all oneOf members are objects sharing a common\n // required property whose value is a `const`. If found, add a `discriminator`.\n const discriminatorProp = detectDiscriminatorProperty(schemas);\n if (discriminatorProp) {\n return {\n oneOf: schemas,\n discriminator: { propertyName: discriminatorProp },\n };\n }\n\n return { oneOf: schemas };\n}\n\n/**\n * If every schema in a oneOf is an object with a common required property\n * whose value is a `const`, return that property name. Otherwise return null.\n */\nfunction detectDiscriminatorProperty(schemas: JsonSchema[]): string | null {\n if (schemas.length < 2) {\n return null;\n }\n\n // All schemas must be object types with properties\n if (!schemas.every((s) => s.type === 'object' && s.properties)) {\n return null;\n }\n\n // Find properties that exist in every schema, are required, and have a `const` value\n const first = schemas[0];\n if (!first?.properties) {\n return null;\n }\n const firstProps = Object.keys(first.properties);\n for (const prop of firstProps) {\n const allHaveConst = schemas.every((s) => {\n const propSchema = s.properties?.[prop];\n return (\n propSchema !== undefined &&\n propSchema.const !== undefined &&\n s.required?.includes(prop)\n );\n });\n if (allHaveConst) {\n return prop;\n }\n }\n\n return null;\n}\n\n/** A schema that is just `{ type: \"somePrimitive\" }` with no other keys. */\nfunction isSimpleTypeSchema(s: JsonSchema): boolean {\n const keys = Object.keys(s);\n return keys.length === 1 && keys[0] === 'type' && typeof s.type === 'string';\n}\n\n/**\n * If every non-null member is a string or number literal of the same kind,\n * collapse them into a single `{ type, enum }` schema.\n */\nfunction tryCollapseLiteralUnion(\n nonNull: ts.Type[],\n hasNull: boolean,\n): JsonSchema | null {\n if (nonNull.length <= 1) {\n return null;\n }\n\n const allLiterals = nonNull.every((m) =>\n hasFlag(m, ts.TypeFlags.StringLiteral | ts.TypeFlags.NumberLiteral),\n );\n if (!allLiterals) {\n return null;\n }\n\n const [first] = nonNull;\n if (!first) {\n return null;\n }\n\n const isString = hasFlag(first, ts.TypeFlags.StringLiteral);\n const targetFlag = isString\n ? ts.TypeFlags.StringLiteral\n : ts.TypeFlags.NumberLiteral;\n const allSameKind = nonNull.every((m) => hasFlag(m, targetFlag));\n if (!allSameKind) {\n return null;\n }\n\n const values = nonNull.map((m) =>\n isString\n ? (m as ts.StringLiteralType).value\n : (m as ts.NumberLiteralType).value,\n );\n const baseType = isString ? 'string' : 'number';\n return {\n type: hasNull ? [baseType, 'null'] : baseType,\n enum: values,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Intersection type conversion\n// ---------------------------------------------------------------------------\n\nfunction convertIntersectionType(\n type: ts.IntersectionType,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n // Branded types (e.g. z.string().brand<'X'>()) appear as an intersection of\n // a primitive with a phantom object. Strip the object members — they are\n // always brand metadata.\n const hasPrimitiveMember = type.types.some(isPrimitive);\n const nonBrand = hasPrimitiveMember\n ? type.types.filter((m) => !isObjectType(m))\n : type.types;\n\n const schemas = nonBrand\n .map((m) => typeToJsonSchema(m, ctx, depth + 1))\n .filter(isNonEmptySchema);\n\n if (schemas.length === 0) {\n return {};\n }\n const [onlySchema] = schemas;\n if (schemas.length === 1 && onlySchema !== undefined) {\n return onlySchema;\n }\n\n // When all members are plain inline object schemas (no $ref), merge them\n // into a single object instead of wrapping in allOf.\n if (schemas.every(isInlineObjectSchema)) {\n return mergeObjectSchemas(schemas);\n }\n\n return { allOf: schemas };\n}\n\n/** True when the schema is an inline `{ type: \"object\", ... }` (not a $ref). */\nfunction isInlineObjectSchema(s: JsonSchema): boolean {\n return s.type === 'object' && !s.$ref;\n}\n\n/**\n * Merge multiple `{ type: \"object\" }` schemas into one.\n * Falls back to `allOf` if any property names conflict across schemas.\n */\nfunction mergeObjectSchemas(schemas: JsonSchema[]): JsonSchema {\n // Check for property name conflicts before merging.\n const seen = new Set<string>();\n for (const s of schemas) {\n if (s.properties) {\n for (const prop of Object.keys(s.properties)) {\n if (seen.has(prop)) {\n // Conflicting property — fall back to allOf to preserve both definitions.\n return { allOf: schemas };\n }\n seen.add(prop);\n }\n }\n }\n\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n let additionalProperties: JsonSchema | boolean | undefined;\n\n for (const s of schemas) {\n if (s.properties) {\n Object.assign(properties, s.properties);\n }\n if (s.required) {\n required.push(...s.required);\n }\n if (s.additionalProperties !== undefined) {\n additionalProperties = s.additionalProperties;\n }\n }\n\n const result: JsonSchema = { type: 'object' };\n if (Object.keys(properties).length > 0) {\n result.properties = properties;\n }\n if (required.length > 0) {\n result.required = required;\n }\n if (additionalProperties !== undefined) {\n result.additionalProperties = additionalProperties;\n }\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Object type conversion\n// ---------------------------------------------------------------------------\n\nfunction convertWellKnownType(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema | null {\n const symName = type.getSymbol()?.getName();\n if (symName === 'Date') {\n return { type: 'string', format: 'date-time' };\n }\n if (symName === 'Uint8Array' || symName === 'Buffer') {\n return { type: 'string', format: 'binary' };\n }\n\n // Unwrap Promise<T>\n if (symName === 'Promise') {\n const [inner] = ctx.checker.getTypeArguments(type as ts.TypeReference);\n return inner ? typeToJsonSchema(inner, ctx, depth + 1) : {};\n }\n\n return null;\n}\n\nfunction convertArrayType(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n const [elem] = ctx.checker.getTypeArguments(type as ts.TypeReference);\n const schema: JsonSchema = { type: 'array' };\n if (elem) {\n schema.items = typeToJsonSchema(elem, ctx, depth + 1);\n }\n return schema;\n}\n\nfunction convertTupleType(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n const args = ctx.checker.getTypeArguments(type as ts.TypeReference);\n const schemas = args.map((a) => typeToJsonSchema(a, ctx, depth + 1));\n return {\n type: 'array',\n prefixItems: schemas,\n items: false,\n minItems: args.length,\n maxItems: args.length,\n };\n}\n\nfunction convertPlainObject(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n const { checker } = ctx;\n const stringIndexType = type.getStringIndexType();\n const typeProps = type.getProperties();\n\n // Pure index-signature Record type (no named props)\n if (typeProps.length === 0 && stringIndexType) {\n return {\n type: 'object',\n additionalProperties: typeToJsonSchema(stringIndexType, ctx, depth + 1),\n };\n }\n\n // Auto-register types with a meaningful TS name BEFORE converting\n // properties, so that circular or shared refs discovered during recursion\n // resolve to a $ref via the `typeToJsonSchema` wrapper.\n let autoRegName: string | null = null;\n const tsName = getTypeName(type);\n const isNamedUnregisteredType =\n tsName !== null && typeProps.length > 0 && !ctx.typeToRef.has(type);\n if (isNamedUnregisteredType) {\n autoRegName = ensureUniqueName(tsName, ctx.schemas);\n ctx.typeToRef.set(type, autoRegName);\n ctx.schemas[autoRegName] = {}; // placeholder for circular ref guard\n }\n\n ctx.visited.add(type);\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n\n for (const prop of typeProps) {\n const propType = checker.getTypeOfSymbol(prop);\n const propSchema = typeToJsonSchema(propType, ctx, depth + 1);\n\n // Extract JSDoc comment from the property symbol as a description\n const jsDoc = getJsDocComment(prop, checker);\n if (jsDoc && !propSchema.description && !propSchema.$ref) {\n propSchema.description = jsDoc;\n }\n\n properties[prop.name] = propSchema;\n if (!isOptionalSymbol(prop)) {\n required.push(prop.name);\n }\n }\n\n ctx.visited.delete(type);\n\n const result: JsonSchema = { type: 'object' };\n if (Object.keys(properties).length > 0) {\n result.properties = properties;\n }\n if (required.length > 0) {\n result.required = required;\n }\n if (stringIndexType) {\n result.additionalProperties = typeToJsonSchema(\n stringIndexType,\n ctx,\n depth + 1,\n );\n } else if (Object.keys(properties).length > 0) {\n result.additionalProperties = false;\n }\n\n // autoRegName covers named types (early-registered). For anonymous\n // recursive types, a recursive call may have registered this type during\n // property conversion — check typeToRef as a fallback.\n const registeredName = autoRegName ?? ctx.typeToRef.get(type);\n if (registeredName) {\n ctx.schemas[registeredName] = result;\n return schemaRef(registeredName);\n }\n\n return result;\n}\n\nfunction convertObjectType(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n const wellKnown = convertWellKnownType(type, ctx, depth);\n if (wellKnown) {\n return wellKnown;\n }\n\n if (ctx.checker.isArrayType(type)) {\n return convertArrayType(type, ctx, depth);\n }\n if (ctx.checker.isTupleType(type)) {\n return convertTupleType(type, ctx, depth);\n }\n\n return convertPlainObject(type, ctx, depth);\n}\n\n// ---------------------------------------------------------------------------\n// Core dispatcher\n// ---------------------------------------------------------------------------\n\n/** Core type-to-schema conversion (no ref handling). */\nfunction convertTypeToSchema(\n type: ts.Type,\n ctx: SchemaCtx,\n depth: number,\n): JsonSchema {\n if (ctx.visited.has(type)) {\n return handleCyclicRef(type, ctx);\n }\n\n const flags = type.getFlags();\n\n const primitive = convertPrimitiveOrLiteral(type, flags, ctx.checker);\n if (primitive) {\n return primitive;\n }\n\n if (type.isUnion()) {\n return convertUnionType(type, ctx, depth);\n }\n if (type.isIntersection()) {\n return convertIntersectionType(type, ctx, depth);\n }\n if (isObjectType(type)) {\n return convertObjectType(type, ctx, depth);\n }\n\n return {};\n}\n\n// ---------------------------------------------------------------------------\n// Router / procedure type walker\n// ---------------------------------------------------------------------------\n\n/** State shared across the router-walk recursion. */\ninterface WalkCtx {\n procedures: ProcedureInfo[];\n seen: Set<ts.Type>;\n schemaCtx: SchemaCtx;\n /** Runtime descriptions keyed by procedure path (when a router instance is available). */\n runtimeDescriptions: Map<string, RuntimeDescriptions>;\n}\n\n/**\n * Inspect `_def.type` and return the procedure type string, or null if this is\n * not a procedure (e.g. a nested router).\n */\nfunction getProcedureTypeName(\n defType: ts.Type,\n checker: ts.TypeChecker,\n): string | null {\n const typeSym = defType.getProperty('type');\n if (!typeSym) {\n return null;\n }\n const typeType = checker.getTypeOfSymbol(typeSym);\n const raw = checker.typeToString(typeType).replace(/['\"]/g, '');\n if (raw === 'query' || raw === 'mutation' || raw === 'subscription') {\n return raw;\n }\n return null;\n}\n\nfunction isVoidLikeInput(inputType: ts.Type | null): boolean {\n if (!inputType) {\n return true;\n }\n\n const isVoidOrUndefinedOrNever = hasFlag(\n inputType,\n ts.TypeFlags.Void | ts.TypeFlags.Undefined | ts.TypeFlags.Never,\n );\n if (isVoidOrUndefinedOrNever) {\n return true;\n }\n\n const isUnionOfVoids =\n inputType.isUnion() &&\n inputType.types.every((t) =>\n hasFlag(t, ts.TypeFlags.Void | ts.TypeFlags.Undefined),\n );\n return isUnionOfVoids;\n}\n\ninterface ProcedureDef {\n defType: ts.Type;\n typeName: string;\n path: string;\n description?: string;\n}\n\nfunction extractProcedure(def: ProcedureDef, ctx: WalkCtx): void {\n const { schemaCtx } = ctx;\n const { checker } = schemaCtx;\n\n const $typesSym = def.defType.getProperty('$types');\n if (!$typesSym) {\n return;\n }\n const $typesType = checker.getTypeOfSymbol($typesSym);\n\n const inputSym = $typesType.getProperty('input');\n const outputSym = $typesType.getProperty('output');\n\n const inputType = inputSym ? checker.getTypeOfSymbol(inputSym) : null;\n const outputType = outputSym ? checker.getTypeOfSymbol(outputSym) : null;\n\n const inputSchema =\n !inputType || isVoidLikeInput(inputType)\n ? null\n : typeToJsonSchema(inputType, schemaCtx);\n\n const outputSchema: JsonSchema | null = outputType\n ? typeToJsonSchema(outputType, schemaCtx)\n : null;\n\n // Overlay extracted schema descriptions onto the type-checker-generated schemas.\n const runtimeDescs = ctx.runtimeDescriptions.get(def.path);\n if (runtimeDescs) {\n if (inputSchema && runtimeDescs.input) {\n applyDescriptions(inputSchema, runtimeDescs.input);\n }\n if (outputSchema && runtimeDescs.output) {\n applyDescriptions(outputSchema, runtimeDescs.output);\n }\n }\n\n ctx.procedures.push({\n path: def.path,\n type: def.typeName as 'query' | 'mutation' | 'subscription',\n inputSchema,\n outputSchema,\n description: def.description,\n });\n}\n\n/** Extract the JSDoc comment text from a symbol, if any. */\nfunction getJsDocComment(\n sym: ts.Symbol,\n checker: ts.TypeChecker,\n): string | undefined {\n const parts = sym.getDocumentationComment(checker);\n if (parts.length === 0) {\n return undefined;\n }\n const text = parts.map((p) => p.text).join('');\n return text || undefined;\n}\n\ninterface WalkTypeOpts {\n type: ts.Type;\n ctx: WalkCtx;\n currentPath: string;\n description?: string;\n}\n\nfunction walkType(opts: WalkTypeOpts): void {\n const { type, ctx, currentPath, description } = opts;\n if (ctx.seen.has(type)) {\n return;\n }\n\n const defSym = type.getProperty('_def');\n\n if (!defSym) {\n // No `_def` — this is a plain RouterRecord or an unrecognised type.\n // Walk its own properties so nested procedures are found.\n if (isObjectType(type)) {\n ctx.seen.add(type);\n walkRecord(type, ctx, currentPath);\n ctx.seen.delete(type);\n }\n return;\n }\n\n const { checker } = ctx.schemaCtx;\n const defType = checker.getTypeOfSymbol(defSym);\n\n const procedureTypeName = getProcedureTypeName(defType, checker);\n if (procedureTypeName) {\n extractProcedure(\n { defType, typeName: procedureTypeName, path: currentPath, description },\n ctx,\n );\n return;\n }\n\n // Router? (_def.router === true)\n const routerSym = defType.getProperty('router');\n if (!routerSym) {\n return;\n }\n\n const isRouter =\n checker.typeToString(checker.getTypeOfSymbol(routerSym)) === 'true';\n if (!isRouter) {\n return;\n }\n\n const recordSym = defType.getProperty('record');\n if (!recordSym) {\n return;\n }\n\n ctx.seen.add(type);\n const recordType = checker.getTypeOfSymbol(recordSym);\n walkRecord(recordType, ctx, currentPath);\n ctx.seen.delete(type);\n}\n\nfunction walkRecord(recordType: ts.Type, ctx: WalkCtx, prefix: string): void {\n for (const prop of recordType.getProperties()) {\n const propType = ctx.schemaCtx.checker.getTypeOfSymbol(prop);\n const fullPath = prefix ? `${prefix}.${prop.name}` : prop.name;\n const description = getJsDocComment(prop, ctx.schemaCtx.checker);\n walkType({ type: propType, ctx, currentPath: fullPath, description });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript program helpers\n// ---------------------------------------------------------------------------\n\nfunction loadCompilerOptions(startDir: string): ts.CompilerOptions {\n const configPath = ts.findConfigFile(\n startDir,\n (f) => ts.sys.fileExists(f),\n 'tsconfig.json',\n );\n if (!configPath) {\n return {\n target: ts.ScriptTarget.ES2020,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n skipLibCheck: true,\n noEmit: true,\n };\n }\n\n const configFile = ts.readConfigFile(configPath, (f) => ts.sys.readFile(f));\n const parsed = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n path.dirname(configPath),\n );\n const options: ts.CompilerOptions = { ...parsed.options, noEmit: true };\n\n // `parseJsonConfigFileContent` only returns explicitly-set values. TypeScript\n // itself infers moduleResolution from `module` at compile time, but we have to\n // do it manually here for the compiler host to resolve imports correctly.\n if (options.moduleResolution === undefined) {\n const mod = options.module;\n if (mod === ts.ModuleKind.Node16 || mod === ts.ModuleKind.NodeNext) {\n options.moduleResolution = ts.ModuleResolutionKind.NodeNext;\n } else if (\n mod === ts.ModuleKind.Preserve ||\n mod === ts.ModuleKind.ES2022 ||\n mod === ts.ModuleKind.ESNext\n ) {\n options.moduleResolution = ts.ModuleResolutionKind.Bundler;\n } else {\n options.moduleResolution = ts.ModuleResolutionKind.Node10;\n }\n }\n\n return options;\n}\n\n// ---------------------------------------------------------------------------\n// Error shape extraction\n// ---------------------------------------------------------------------------\n\n/**\n * Walk `_def._config.$types.errorShape` on the router type and convert\n * it to a JSON Schema. Returns `null` when the path cannot be resolved\n * (e.g. older tRPC versions or missing type info).\n */\nfunction extractErrorSchema(\n routerType: ts.Type,\n checker: ts.TypeChecker,\n schemaCtx: SchemaCtx,\n): JsonSchema | null {\n const walk = (type: ts.Type, keys: string[]): ts.Type | null => {\n const [head, ...rest] = keys;\n if (!head) {\n return type;\n }\n const sym = type.getProperty(head);\n if (!sym) {\n return null;\n }\n return walk(checker.getTypeOfSymbol(sym), rest);\n };\n\n const errorShapeType = walk(routerType, [\n '_def',\n '_config',\n '$types',\n 'errorShape',\n ]);\n if (!errorShapeType) {\n return null;\n }\n\n if (hasFlag(errorShapeType, ts.TypeFlags.Any)) {\n return null;\n }\n\n return typeToJsonSchema(errorShapeType, schemaCtx);\n}\n\n// ---------------------------------------------------------------------------\n// OpenAPI document builder\n// ---------------------------------------------------------------------------\n\n/** Fallback error schema when the router type doesn't expose an error shape. */\nconst DEFAULT_ERROR_SCHEMA: JsonSchema = {\n type: 'object',\n properties: {\n message: { type: 'string' },\n code: { type: 'string' },\n data: { type: 'object' },\n },\n required: ['message', 'code'],\n};\n\n/**\n * Wrap a procedure's output schema in the tRPC success envelope.\n *\n * tRPC HTTP responses are always serialised as:\n * `{ result: { data: T } }`\n *\n * When the procedure has no output the envelope is still present but\n * the `data` property is omitted.\n */\nfunction wrapInSuccessEnvelope(outputSchema: JsonSchema | null): JsonSchema {\n const hasOutput = outputSchema !== null && isNonEmptySchema(outputSchema);\n const resultSchema: JsonSchema = {\n type: 'object',\n properties: {\n ...(hasOutput ? { data: outputSchema } : {}),\n },\n ...(hasOutput ? { required: ['data' as const] } : {}),\n };\n return {\n type: 'object',\n properties: {\n result: resultSchema,\n },\n required: ['result'],\n };\n}\n\nfunction buildProcedureOperation(\n proc: ProcedureInfo,\n method: 'get' | 'post',\n): Record<string, unknown> {\n const operation: Record<string, unknown> = {\n operationId: proc.path,\n ...(proc.description ? { description: proc.description } : {}),\n tags: [proc.path.split('.')[0]],\n responses: {\n '200': {\n description: 'Successful response',\n content: {\n 'application/json': {\n schema: wrapInSuccessEnvelope(proc.outputSchema),\n },\n },\n },\n default: { $ref: '#/components/responses/Error' },\n },\n };\n\n if (proc.inputSchema === null) {\n return operation;\n }\n\n if (method === 'get') {\n operation['parameters'] = [\n {\n name: 'input',\n in: 'query',\n required: true,\n // FIXME: OAS 3.1.1 says a parameter MUST use either schema+style OR content, not both.\n // style should be removed here, but hey-api requires it to generate a correct query serializer.\n style: 'deepObject',\n content: { 'application/json': { schema: proc.inputSchema } },\n },\n ];\n } else {\n operation['requestBody'] = {\n required: true,\n content: { 'application/json': { schema: proc.inputSchema } },\n };\n }\n\n return operation;\n}\n\nfunction buildOpenAPIDocument(\n procedures: ProcedureInfo[],\n options: GenerateOptions,\n meta: RouterMeta = { errorSchema: null },\n): OpenAPIDocument {\n const paths: Record<string, Record<string, unknown>> = {};\n\n for (const proc of procedures) {\n if (proc.type === 'subscription') {\n continue;\n }\n\n const opPath = `/${proc.path}`;\n const method = proc.type === 'query' ? 'get' : 'post';\n\n const pathItem: Record<string, unknown> = paths[opPath] ?? {};\n paths[opPath] = pathItem;\n pathItem[method] = buildProcedureOperation(proc, method);\n }\n\n const hasNamedSchemas =\n meta.schemas !== undefined && Object.keys(meta.schemas).length > 0;\n\n return {\n openapi: '3.1.1',\n jsonSchemaDialect: 'https://spec.openapis.org/oas/3.1/dialect/base',\n info: {\n title: options.title ?? 'tRPC API',\n version: options.version ?? '0.0.0',\n },\n paths,\n components: {\n ...(hasNamedSchemas ? { schemas: meta.schemas } : {}),\n responses: {\n Error: {\n description: 'Error response',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n error: meta.errorSchema ?? DEFAULT_ERROR_SCHEMA,\n },\n required: ['error'],\n },\n },\n },\n },\n },\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Analyse the given TypeScript router file using the TypeScript compiler and\n * return an OpenAPI 3.1 document describing all query and mutation procedures.\n *\n * @param routerFilePath - Absolute or relative path to the file that exports\n * the AppRouter.\n * @param options - Optional generation settings (export name, title, version).\n */\nexport async function generateOpenAPIDocument(\n routerFilePath: string,\n options: GenerateOptions = {},\n): Promise<OpenAPIDocument> {\n const resolvedPath = path.resolve(routerFilePath);\n const exportName = options.exportName ?? 'AppRouter';\n\n const compilerOptions = loadCompilerOptions(path.dirname(resolvedPath));\n const program = ts.createProgram([resolvedPath], compilerOptions);\n const checker = program.getTypeChecker();\n const sourceFile = program.getSourceFile(resolvedPath);\n\n if (!sourceFile) {\n throw new Error(`Could not load TypeScript file: ${resolvedPath}`);\n }\n\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n if (!moduleSymbol) {\n throw new Error(`No module exports found in: ${resolvedPath}`);\n }\n\n const tsExports = checker.getExportsOfModule(moduleSymbol);\n const routerSymbol = tsExports.find((sym) => sym.getName() === exportName);\n\n if (!routerSymbol) {\n const available = tsExports.map((e) => e.getName()).join(', ');\n throw new Error(\n `No export named '${exportName}' found in: ${resolvedPath}\\n` +\n `Available exports: ${available || '(none)'}`,\n );\n }\n\n // Prefer the value declaration for value exports; fall back to the declared\n // type for `export type AppRouter = …` aliases.\n let routerType: ts.Type;\n if (routerSymbol.valueDeclaration) {\n routerType = checker.getTypeOfSymbolAtLocation(\n routerSymbol,\n routerSymbol.valueDeclaration,\n );\n } else {\n routerType = checker.getDeclaredTypeOfSymbol(routerSymbol);\n }\n\n const schemaCtx: SchemaCtx = {\n checker,\n visited: new Set(),\n schemas: {},\n typeToRef: new Map(),\n };\n\n // Try to dynamically import the router to extract schema descriptions\n const runtimeDescriptions = new Map<string, RuntimeDescriptions>();\n const router = await tryImportRouter(resolvedPath, exportName);\n if (router) {\n collectRuntimeDescriptions(router, '', runtimeDescriptions);\n }\n\n const walkCtx: WalkCtx = {\n procedures: [],\n seen: new Set(),\n schemaCtx,\n runtimeDescriptions,\n };\n walkType({ type: routerType, ctx: walkCtx, currentPath: '' });\n\n const errorSchema = extractErrorSchema(routerType, checker, schemaCtx);\n return buildOpenAPIDocument(walkCtx.procedures, options, {\n errorSchema,\n schemas: schemaCtx.schemas,\n });\n}\n"],"mappings":";;;;;;;;;;;AAuCA,SAAS,uBAAwD;CAC/D,MAAM,MACJ,WACA;AACF,QAAO,cAAc,IAAI,QAAQ,aAAa,MAAM;AACrD;;AAGD,SAAS,YAAYA,OAAmC;AACtD,KAAI,SAAS,eAAe,UAAU,SAAU,QAAO;CACvD,MAAM,MAAO,MAA6B;AAC1C,QAAO,OAAO,eAAe,QAAQ,YAAY,SAAS;AAC3D;;AAGD,SAAS,eAAeC,QAAoC;CAC1D,MAAM,MAAM,OAAO,KAAK;AACxB,KAAI,IAAI,SAAS,YAAY,WAAW,IACtC,QAAQ,IAAsB;AAEhC,QAAO;AACR;;AAGD,SAAS,gBAAgBA,QAAmC;CAC1D,MAAM,MAAM,OAAO,KAAK;AACxB,KAAI,IAAI,SAAS,WAAW,aAAa,IACvC,QAAQ,IAAqB;AAE/B,QAAO;AACR;;AAGD,MAAMC,kBAAoD,IAAI,IAAI;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAMD,SAAS,gBAAgBC,KAAmC;AAC1D,KAAI,eAAe,IAAK,QAAQ,IAAgC;AAChE,KAAI,QAAQ,IAAK,QAAQ,IAAyB;AAClD,QAAO;AACR;;AAGD,SAAS,gBAA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;CACD;AACD,UAAS;EAAE,MAAM;EAAY,KAAK;EAAS,aAAa;CAAI,EAAC;CAE7D,MAAM,cAAc,mBAAmB,YAAY,SAAS,UAAU;AACtE,QAAO,qBAAqB,QAAQ,YAAY,SAAS;EACvD;EACA,SAAS,UAAU;CACpB,EAAC;AACH"}
@@ -0,0 +1,131 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+
26
+ //#endregion
27
+
28
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js
29
+ var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
30
+ function _typeof$2(o) {
31
+ "@babel/helpers - typeof";
32
+ return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
33
+ return typeof o$1;
34
+ } : function(o$1) {
35
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
36
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
37
+ }
38
+ module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
39
+ } });
40
+
41
+ //#endregion
42
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js
43
+ var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
44
+ var _typeof$1 = require_typeof()["default"];
45
+ function toPrimitive$1(t, r) {
46
+ if ("object" != _typeof$1(t) || !t) return t;
47
+ var e = t[Symbol.toPrimitive];
48
+ if (void 0 !== e) {
49
+ var i = e.call(t, r || "default");
50
+ if ("object" != _typeof$1(i)) return i;
51
+ throw new TypeError("@@toPrimitive must return a primitive value.");
52
+ }
53
+ return ("string" === r ? String : Number)(t);
54
+ }
55
+ module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
56
+ } });
57
+
58
+ //#endregion
59
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js
60
+ var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
61
+ var _typeof = require_typeof()["default"];
62
+ var toPrimitive = require_toPrimitive();
63
+ function toPropertyKey$1(t) {
64
+ var i = toPrimitive(t, "string");
65
+ return "symbol" == _typeof(i) ? i : i + "";
66
+ }
67
+ module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
68
+ } });
69
+
70
+ //#endregion
71
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js
72
+ var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
73
+ var toPropertyKey = require_toPropertyKey();
74
+ function _defineProperty(e, r, t) {
75
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
76
+ value: t,
77
+ enumerable: !0,
78
+ configurable: !0,
79
+ writable: !0
80
+ }) : e[r] = t, e;
81
+ }
82
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
83
+ } });
84
+
85
+ //#endregion
86
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js
87
+ var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
88
+ var defineProperty = require_defineProperty();
89
+ function ownKeys(e, r) {
90
+ var t = Object.keys(e);
91
+ if (Object.getOwnPropertySymbols) {
92
+ var o = Object.getOwnPropertySymbols(e);
93
+ r && (o = o.filter(function(r$1) {
94
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
95
+ })), t.push.apply(t, o);
96
+ }
97
+ return t;
98
+ }
99
+ function _objectSpread2(e) {
100
+ for (var r = 1; r < arguments.length; r++) {
101
+ var t = null != arguments[r] ? arguments[r] : {};
102
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
103
+ defineProperty(e, r$1, t[r$1]);
104
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
105
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
106
+ });
107
+ }
108
+ return e;
109
+ }
110
+ module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
111
+ } });
112
+
113
+ //#endregion
114
+ Object.defineProperty(exports, '__commonJS', {
115
+ enumerable: true,
116
+ get: function () {
117
+ return __commonJS;
118
+ }
119
+ });
120
+ Object.defineProperty(exports, '__toESM', {
121
+ enumerable: true,
122
+ get: function () {
123
+ return __toESM;
124
+ }
125
+ });
126
+ Object.defineProperty(exports, 'require_objectSpread2', {
127
+ enumerable: true,
128
+ get: function () {
129
+ return require_objectSpread2;
130
+ }
131
+ });
@@ -0,0 +1,114 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+
26
+ //#endregion
27
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js
28
+ var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
29
+ function _typeof$2(o) {
30
+ "@babel/helpers - typeof";
31
+ return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
32
+ return typeof o$1;
33
+ } : function(o$1) {
34
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
35
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
36
+ }
37
+ module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
38
+ } });
39
+
40
+ //#endregion
41
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js
42
+ var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
43
+ var _typeof$1 = require_typeof()["default"];
44
+ function toPrimitive$1(t, r) {
45
+ if ("object" != _typeof$1(t) || !t) return t;
46
+ var e = t[Symbol.toPrimitive];
47
+ if (void 0 !== e) {
48
+ var i = e.call(t, r || "default");
49
+ if ("object" != _typeof$1(i)) return i;
50
+ throw new TypeError("@@toPrimitive must return a primitive value.");
51
+ }
52
+ return ("string" === r ? String : Number)(t);
53
+ }
54
+ module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
55
+ } });
56
+
57
+ //#endregion
58
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js
59
+ var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
60
+ var _typeof = require_typeof()["default"];
61
+ var toPrimitive = require_toPrimitive();
62
+ function toPropertyKey$1(t) {
63
+ var i = toPrimitive(t, "string");
64
+ return "symbol" == _typeof(i) ? i : i + "";
65
+ }
66
+ module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
67
+ } });
68
+
69
+ //#endregion
70
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js
71
+ var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
72
+ var toPropertyKey = require_toPropertyKey();
73
+ function _defineProperty(e, r, t) {
74
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
75
+ value: t,
76
+ enumerable: !0,
77
+ configurable: !0,
78
+ writable: !0
79
+ }) : e[r] = t, e;
80
+ }
81
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
82
+ } });
83
+
84
+ //#endregion
85
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js
86
+ var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
87
+ var defineProperty = require_defineProperty();
88
+ function ownKeys(e, r) {
89
+ var t = Object.keys(e);
90
+ if (Object.getOwnPropertySymbols) {
91
+ var o = Object.getOwnPropertySymbols(e);
92
+ r && (o = o.filter(function(r$1) {
93
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
94
+ })), t.push.apply(t, o);
95
+ }
96
+ return t;
97
+ }
98
+ function _objectSpread2(e) {
99
+ for (var r = 1; r < arguments.length; r++) {
100
+ var t = null != arguments[r] ? arguments[r] : {};
101
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
102
+ defineProperty(e, r$1, t[r$1]);
103
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
104
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
105
+ });
106
+ }
107
+ return e;
108
+ }
109
+ module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
110
+ } });
111
+
112
+ //#endregion
113
+ export { __commonJS, __toESM, require_objectSpread2 };
114
+ //# sourceMappingURL=objectSpread2-UxrN8MPM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectSpread2-UxrN8MPM.mjs","names":["_typeof","o","_typeof","toPrimitive","toPropertyKey","r"],"sources":["../../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var defineProperty = require(\"./defineProperty.js\");\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nmodule.exports = _objectSpread2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,SAASA,UAAQ,GAAG;AAClB;AAEA,SAAO,OAAO,UAAUA,YAAU,qBAAqB,UAAU,mBAAmB,OAAO,WAAW,SAAUC,KAAG;AACjH,iBAAcA;EACf,IAAG,SAAUA,KAAG;AACf,U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IAAI,IAAI,OAAO,KAAK,EAAE;AACtB,MAAI,OAAO,uBAAuB;GAChC,IAAI,IAAI,OAAO,sBAAsB,EAAE;AACvC,SAAM,IAAI,EAAE,OAAO,SAAUC,KAAG;AAC9B,WAAO,OAAO,yBAAyB,GAAGA,IAAE,CAAC;GAC9C,EAAC,GAAG,EAAE,KAAK,MAAM,GAAG,EAAE;EACxB;AACD,SAAO;CACR;CACD,SAAS,eAAe,GAAG;AACzB,OAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;GACzC,IAAI,IAAI,QAAQ,UAAU,KAAK,UAAU,KAAK,CAAE;AAChD,OAAI,IAAI,QAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,SAAUA,KAAG;AAClD,mBAAe,GAAGA,KAAG,EAAEA,KAAG;GAC3B,EAAC,GAAG,OAAO,4BAA4B,OAAO,iBAAiB,GAAG,OAAO,0BAA0B,EAAE,CAAC,GAAG,QAAQ,OAAO,EAAE,CAAC,CAAC,QAAQ,SAAUA,KAAG;AAChJ,WAAO,eAAe,GAAGA,KAAG,OAAO,yBAAyB,GAAGA,IAAE,CAAC;GACnE,EAAC;EACH;AACD,SAAO;CACR;AACD,QAAO,UAAU,gBAAgB,OAAO,QAAQ,aAAa,MAAM,OAAO,QAAQ,aAAa,OAAO"}
package/package.json CHANGED
@@ -1,4 +1,105 @@
1
1
  {
2
2
  "name": "@trpc/openapi",
3
- "version": "0.0.0-alpha.0"
3
+ "type": "module",
4
+ "sideEffects": false,
5
+ "version": "11.13.1-alpha",
6
+ "description": "OpenAPI document generator for tRPC routers",
7
+ "author": "KATT",
8
+ "license": "MIT",
9
+ "bin": {
10
+ "trpc-openapi": "./dist/cli.js"
11
+ },
12
+ "homepage": "https://trpc.io",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/trpc/trpc.git",
16
+ "directory": "packages/openapi"
17
+ },
18
+ "eslintConfig": {
19
+ "rules": {
20
+ "no-restricted-imports": [
21
+ "error",
22
+ "@trpc/openapi"
23
+ ]
24
+ }
25
+ },
26
+ "scripts": {
27
+ "build": "tsdown",
28
+ "dev": "tsdown --watch",
29
+ "lint": "eslint --cache src",
30
+ "codegen": "tsx test/scripts/codegen.run.ts",
31
+ "typecheck": "tsc --noEmit --preserveWatchOutput --pretty"
32
+ },
33
+ "exports": {
34
+ "./package.json": "./package.json",
35
+ ".": {
36
+ "import": {
37
+ "types": "./dist/index.d.mts",
38
+ "default": "./dist/index.mjs"
39
+ },
40
+ "require": {
41
+ "types": "./dist/index.d.cts",
42
+ "default": "./dist/index.cjs"
43
+ }
44
+ },
45
+ "./heyapi": {
46
+ "import": {
47
+ "types": "./dist/heyapi/index.d.mts",
48
+ "default": "./dist/heyapi/index.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/heyapi/index.d.cts",
52
+ "default": "./dist/heyapi/index.cjs"
53
+ }
54
+ }
55
+ },
56
+ "main": "./dist/index.cjs",
57
+ "module": "./dist/index.mjs",
58
+ "types": "./dist/index.d.cts",
59
+ "files": [
60
+ "dist",
61
+ "src",
62
+ "README.md",
63
+ "package.json",
64
+ "!**/*.test.*",
65
+ "!**/__tests__",
66
+ "!test",
67
+ "heyapi"
68
+ ],
69
+ "publishConfig": {
70
+ "access": "public",
71
+ "tag": "alpha"
72
+ },
73
+ "devDependencies": {
74
+ "@hey-api/openapi-ts": "^0.94.1",
75
+ "@swagger-api/apidom-ls": "^1.6.0",
76
+ "@trpc/server": "11.13.1",
77
+ "@types/node": "^22.13.5",
78
+ "bson": "^7.2.0",
79
+ "eslint": "^9.26.0",
80
+ "ion-js": "^5.2.1",
81
+ "superjson": "^1.12.4",
82
+ "tsdown": "0.12.7",
83
+ "typescript": "^5.9.2",
84
+ "vscode-languageserver-textdocument": "^1.0.12",
85
+ "zod": "^4.2.1"
86
+ },
87
+ "peerDependencies": {
88
+ "@hey-api/openapi-ts": ">=0.13.0",
89
+ "@trpc/server": "11.13.1",
90
+ "typescript": ">=5.7.2",
91
+ "zod": ">=4.0.0"
92
+ },
93
+ "peerDependenciesMeta": {
94
+ "@hey-api/openapi-ts": {
95
+ "optional": true
96
+ },
97
+ "zod": {
98
+ "optional": true
99
+ }
100
+ },
101
+ "funding": [
102
+ "https://trpc.io/sponsor"
103
+ ],
104
+ "gitHead": "e56aa8c02bc2c338899d73f4f3899db778db5418"
4
105
  }