@trpc/openapi 11.18.1-canary.9 → 11.19.0-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.
package/dist/index.cjs CHANGED
@@ -1,9 +1,43 @@
1
- const require_objectSpread2$1 = require('./objectSpread2-Cw30I7tb.cjs');
2
- const node_fs = require_objectSpread2$1.__toESM(require("node:fs"));
3
- const node_path = require_objectSpread2$1.__toESM(require("node:path"));
4
- const typescript = require_objectSpread2$1.__toESM(require("typescript"));
5
- const node_url = require_objectSpread2$1.__toESM(require("node:url"));
6
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ //#endregion
33
+ const require_objectSpread2 = require("./objectSpread2-C2ceYbQe.cjs");
34
+ let node_fs = require("node:fs");
35
+ node_fs = __toESM(node_fs, 1);
36
+ let node_path = require("node:path");
37
+ node_path = __toESM(node_path, 1);
38
+ let typescript = require("typescript");
39
+ typescript = __toESM(typescript, 1);
40
+ let node_url = require("node:url");
7
41
  //#region src/schemaExtraction.ts
8
42
  /**
9
43
  * Zod v4 stores `.describe()` strings in `globalThis.__zod_globalRegistry`,
@@ -33,7 +67,7 @@ function zodArrayElement(schema) {
33
67
  return null;
34
68
  }
35
69
  /** Wrapper def types whose inner schema is accessible via `innerType` or `in`. */
36
- const wrapperDefTypes = new Set([
70
+ const wrapperDefTypes = /* @__PURE__ */ new Set([
37
71
  "optional",
38
72
  "nullable",
39
73
  "nonoptional",
@@ -157,8 +191,7 @@ function findRouterExport(mod, exportName) {
157
191
  */
158
192
  async function tryImportRouter(resolvedPath, exportName) {
159
193
  try {
160
- const mod = await import((0, node_url.pathToFileURL)(resolvedPath).href);
161
- return findRouterExport(mod, exportName);
194
+ return findRouterExport(await import((0, node_url.pathToFileURL)(resolvedPath).href), exportName);
162
195
  } catch (_unused) {
163
196
  return null;
164
197
  }
@@ -246,9 +279,8 @@ function setNestedDescription({ schema, pathParts, description, schemas }) {
246
279
  if (rest.length === 0) setLeafDescription(items, description);
247
280
  else {
248
281
  var _resolveSchemaRef;
249
- const target = (_resolveSchemaRef = resolveSchemaRef(items, schemas)) !== null && _resolveSchemaRef !== void 0 ? _resolveSchemaRef : items;
250
282
  setNestedDescription({
251
- schema: target,
283
+ schema: (_resolveSchemaRef = resolveSchemaRef(items, schemas)) !== null && _resolveSchemaRef !== void 0 ? _resolveSchemaRef : items,
252
284
  pathParts: rest,
253
285
  description,
254
286
  schemas
@@ -262,19 +294,16 @@ function setNestedDescription({ schema, pathParts, description, schemas }) {
262
294
  else {
263
295
  var _getArrayItemsSchema, _resolveSchemaRef2;
264
296
  const target = (_getArrayItemsSchema = getArrayItemsSchema(propSchema)) !== null && _getArrayItemsSchema !== void 0 ? _getArrayItemsSchema : propSchema;
265
- const resolvedTarget = (_resolveSchemaRef2 = resolveSchemaRef(target, schemas)) !== null && _resolveSchemaRef2 !== void 0 ? _resolveSchemaRef2 : target;
266
297
  setNestedDescription({
267
- schema: resolvedTarget,
298
+ schema: (_resolveSchemaRef2 = resolveSchemaRef(target, schemas)) !== null && _resolveSchemaRef2 !== void 0 ? _resolveSchemaRef2 : target,
268
299
  pathParts: rest,
269
300
  description,
270
301
  schemas
271
302
  });
272
303
  }
273
304
  }
274
-
275
305
  //#endregion
276
306
  //#region src/generate.ts
277
- var import_objectSpread2 = require_objectSpread2$1.__toESM(require_objectSpread2$1.require_objectSpread2(), 1);
278
307
  const PRIMITIVE_FLAGS = typescript.TypeFlags.String | typescript.TypeFlags.Number | typescript.TypeFlags.Boolean | typescript.TypeFlags.StringLiteral | typescript.TypeFlags.NumberLiteral | typescript.TypeFlags.BooleanLiteral;
279
308
  function hasFlag(type, flag) {
280
309
  return (type.getFlags() & flag) !== 0;
@@ -285,6 +314,30 @@ function isPrimitive(type) {
285
314
  function isObjectType(type) {
286
315
  return hasFlag(type, typescript.TypeFlags.Object);
287
316
  }
317
+ const STANDARD_FUNCTION_INTERFACES = /* @__PURE__ */ new Set([
318
+ "Function",
319
+ "CallableFunction",
320
+ "NewableFunction"
321
+ ]);
322
+ function isStandardFunctionInterface(type) {
323
+ var _symbol$declarations$, _symbol$declarations;
324
+ const symbol = type.getSymbol();
325
+ const name = symbol === null || symbol === void 0 ? void 0 : symbol.getName();
326
+ if (!name || !STANDARD_FUNCTION_INTERFACES.has(name)) return false;
327
+ return (_symbol$declarations$ = symbol === null || symbol === void 0 || (_symbol$declarations = symbol.declarations) === null || _symbol$declarations === void 0 ? void 0 : _symbol$declarations.some((d) => /(^|[\\/])lib\.[^\\/]*\.d\.ts$/.test(d.getSourceFile().fileName))) !== null && _symbol$declarations$ !== void 0 ? _symbol$declarations$ : false;
328
+ }
329
+ function isFunctionType(type) {
330
+ return type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0 || isStandardFunctionInterface(type);
331
+ }
332
+ function hasFunctionMember(type) {
333
+ if (isFunctionType(type)) return true;
334
+ return type.isUnion() && type.types.some(isFunctionType);
335
+ }
336
+ function isUnserialisableType(type) {
337
+ if (isFunctionType(type)) return true;
338
+ if (!type.isUnion() || !type.types.some(isFunctionType)) return false;
339
+ return !type.types.some((m) => !isFunctionType(m) && !hasFlag(m, typescript.TypeFlags.Undefined | typescript.TypeFlags.Void | typescript.TypeFlags.Null));
340
+ }
288
341
  function isOptionalSymbol(sym) {
289
342
  return (sym.flags & typescript.SymbolFlags.Optional) !== 0;
290
343
  }
@@ -300,7 +353,7 @@ function unwrapBrand(type) {
300
353
  if (first && hasObject) return first;
301
354
  return type;
302
355
  }
303
- const ANONYMOUS_NAMES = new Set([
356
+ const ANONYMOUS_NAMES = /* @__PURE__ */ new Set([
304
357
  "__type",
305
358
  "__object",
306
359
  "Object",
@@ -362,8 +415,8 @@ function typeToJsonSchema(type, ctx, depth = 0) {
362
415
  const storedSchema = ctx.schemas[existingRef];
363
416
  if (storedSchema && (isNonEmptySchema(storedSchema) || ctx.visited.has(type))) return schemaRef(existingRef);
364
417
  ctx.schemas[existingRef] = storedSchema !== null && storedSchema !== void 0 ? storedSchema : {};
365
- const schema$1 = convertTypeToSchema(type, ctx, depth);
366
- if (!isSelfSchemaRef(schema$1, existingRef)) ctx.schemas[existingRef] = schema$1;
418
+ const schema = convertTypeToSchema(type, ctx, depth);
419
+ if (!isSelfSchemaRef(schema, existingRef)) ctx.schemas[existingRef] = schema;
367
420
  return schemaRef(existingRef);
368
421
  }
369
422
  const schema = convertTypeToSchema(type, ctx, depth);
@@ -387,8 +440,7 @@ function handleCyclicRef(type, ctx) {
387
440
  let refName = ctx.typeToRef.get(type);
388
441
  if (!refName) {
389
442
  var _getTypeName;
390
- const name = (_getTypeName = getTypeName(type)) !== null && _getTypeName !== void 0 ? _getTypeName : "RecursiveType";
391
- refName = ensureUniqueName(name, ctx.schemas);
443
+ refName = ensureUniqueName((_getTypeName = getTypeName(type)) !== null && _getTypeName !== void 0 ? _getTypeName : "RecursiveType", ctx.schemas);
392
444
  ctx.typeToRef.set(type, refName);
393
445
  ctx.schemas[refName] = {};
394
446
  }
@@ -415,18 +467,14 @@ function convertPrimitiveOrLiteral(type, flags, checker) {
415
467
  type: "number",
416
468
  const: type.value
417
469
  };
418
- if (flags & typescript.TypeFlags.BooleanLiteral) {
419
- const isTrue = checker.typeToString(type) === "true";
420
- return {
421
- type: "boolean",
422
- const: isTrue
423
- };
424
- }
470
+ if (flags & typescript.TypeFlags.BooleanLiteral) return {
471
+ type: "boolean",
472
+ const: checker.typeToString(type) === "true"
473
+ };
425
474
  return null;
426
475
  }
427
476
  function convertUnionType(type, ctx, depth) {
428
- const members = type.types;
429
- const defined = members.filter((m) => !hasFlag(m, typescript.TypeFlags.Undefined | typescript.TypeFlags.Void));
477
+ const defined = type.types.filter((m) => !hasFlag(m, typescript.TypeFlags.Undefined | typescript.TypeFlags.Void) && !isFunctionType(m));
430
478
  if (defined.length === 0) return {};
431
479
  const hasNull = defined.some((m) => hasFlag(m, typescript.TypeFlags.Null));
432
480
  const nonNull = defined.filter((m) => !hasFlag(m, typescript.TypeFlags.Null));
@@ -460,14 +508,11 @@ function detectDiscriminatorProperty(schemas) {
460
508
  const first = schemas[0];
461
509
  if (!(first === null || first === void 0 ? void 0 : first.properties)) return null;
462
510
  const firstProps = Object.keys(first.properties);
463
- for (const prop of firstProps) {
464
- const allHaveConst = schemas.every((s) => {
465
- var _s$properties, _s$required;
466
- const propSchema = (_s$properties = s.properties) === null || _s$properties === void 0 ? void 0 : _s$properties[prop];
467
- return propSchema !== void 0 && propSchema.const !== void 0 && ((_s$required = s.required) === null || _s$required === void 0 ? void 0 : _s$required.includes(prop));
468
- });
469
- if (allHaveConst) return prop;
470
- }
511
+ for (const prop of firstProps) if (schemas.every((s) => {
512
+ var _s$properties, _s$required;
513
+ const propSchema = (_s$properties = s.properties) === null || _s$properties === void 0 ? void 0 : _s$properties[prop];
514
+ return (propSchema === null || propSchema === void 0 ? void 0 : propSchema.const) !== void 0 && ((_s$required = s.required) === null || _s$required === void 0 ? void 0 : _s$required.includes(prop));
515
+ })) return prop;
471
516
  return null;
472
517
  }
473
518
  /** A schema that is just `{ type: "somePrimitive" }` with no other keys. */
@@ -481,14 +526,12 @@ function isSimpleTypeSchema(s) {
481
526
  */
482
527
  function tryCollapseLiteralUnion(nonNull, hasNull) {
483
528
  if (nonNull.length <= 1) return null;
484
- const allLiterals = nonNull.every((m) => hasFlag(m, typescript.TypeFlags.StringLiteral | typescript.TypeFlags.NumberLiteral));
485
- if (!allLiterals) return null;
529
+ if (!nonNull.every((m) => hasFlag(m, typescript.TypeFlags.StringLiteral | typescript.TypeFlags.NumberLiteral))) return null;
486
530
  const [first] = nonNull;
487
531
  if (!first) return null;
488
532
  const isString = hasFlag(first, typescript.TypeFlags.StringLiteral);
489
533
  const targetFlag = isString ? typescript.TypeFlags.StringLiteral : typescript.TypeFlags.NumberLiteral;
490
- const allSameKind = nonNull.every((m) => hasFlag(m, targetFlag));
491
- if (!allSameKind) return null;
534
+ if (!nonNull.every((m) => hasFlag(m, targetFlag))) return null;
492
535
  const values = nonNull.map((m) => isString ? m.value : m.value);
493
536
  const baseType = isString ? "string" : "number";
494
537
  return {
@@ -497,9 +540,7 @@ function tryCollapseLiteralUnion(nonNull, hasNull) {
497
540
  };
498
541
  }
499
542
  function convertIntersectionType(type, ctx, depth) {
500
- const hasPrimitiveMember = type.types.some(isPrimitive);
501
- const nonBrand = hasPrimitiveMember ? type.types.filter((m) => !isObjectType(m)) : type.types;
502
- const schemas = nonBrand.map((m) => typeToJsonSchema(m, ctx, depth + 1)).filter(isNonEmptySchema);
543
+ const schemas = (type.types.some(isPrimitive) ? type.types.filter((m) => !isObjectType(m)) : type.types).map((m) => typeToJsonSchema(m, ctx, depth + 1)).filter(isNonEmptySchema);
503
544
  if (schemas.length === 0) return {};
504
545
  const [onlySchema] = schemas;
505
546
  if (schemas.length === 1 && onlySchema !== void 0) return onlySchema;
@@ -559,10 +600,9 @@ function convertArrayType(type, ctx, depth) {
559
600
  }
560
601
  function convertTupleType(type, ctx, depth) {
561
602
  const args = ctx.checker.getTypeArguments(type);
562
- const schemas = args.map((a) => typeToJsonSchema(a, ctx, depth + 1));
563
603
  return {
564
604
  type: "array",
565
- prefixItems: schemas,
605
+ prefixItems: args.map((a) => typeToJsonSchema(a, ctx, depth + 1)),
566
606
  items: false,
567
607
  minItems: args.length,
568
608
  maxItems: args.length
@@ -579,8 +619,7 @@ function convertPlainObject(type, ctx, depth) {
579
619
  };
580
620
  let autoRegName = null;
581
621
  const tsName = getTypeName(type);
582
- const isNamedUnregisteredType = tsName !== null && typeProps.length > 0 && !ctx.typeToRef.has(type);
583
- if (isNamedUnregisteredType) {
622
+ if (tsName !== null && typeProps.length > 0 && !ctx.typeToRef.has(type)) {
584
623
  autoRegName = ensureUniqueName(tsName, ctx.schemas);
585
624
  ctx.typeToRef.set(type, autoRegName);
586
625
  ctx.schemas[autoRegName] = {};
@@ -591,18 +630,19 @@ function convertPlainObject(type, ctx, depth) {
591
630
  for (const prop of typeProps) {
592
631
  if (shouldSkipPropertySymbol(prop)) continue;
593
632
  const propType = checker.getTypeOfSymbol(prop);
633
+ if (isUnserialisableType(propType)) continue;
594
634
  const propSchema = typeToJsonSchema(propType, ctx, depth + 1);
595
635
  const jsDoc = getJsDocComment(prop, checker);
596
636
  if (jsDoc && !propSchema.description && !propSchema.$ref) propSchema.description = jsDoc;
597
637
  properties[prop.name] = propSchema;
598
- if (!isOptionalSymbol(prop)) required.push(prop.name);
638
+ if (!isOptionalSymbol(prop) && !hasFunctionMember(propType)) required.push(prop.name);
599
639
  }
600
640
  ctx.visited.delete(type);
601
641
  const result = { type: "object" };
602
642
  if (Object.keys(properties).length > 0) result.properties = properties;
603
643
  if (required.length > 0) result.required = required;
604
644
  if (stringIndexType) result.additionalProperties = typeToJsonSchema(stringIndexType, ctx, depth + 1);
605
- else if (Object.keys(properties).length > 0) result.additionalProperties = false;
645
+ else if (typeProps.length > 0) result.additionalProperties = false;
606
646
  const registeredName = (_autoRegName = autoRegName) !== null && _autoRegName !== void 0 ? _autoRegName : ctx.typeToRef.get(type);
607
647
  if (registeredName) {
608
648
  ctx.schemas[registeredName] = result;
@@ -620,8 +660,7 @@ function convertObjectType(type, ctx, depth) {
620
660
  /** Core type-to-schema conversion (no ref handling). */
621
661
  function convertTypeToSchema(type, ctx, depth) {
622
662
  if (ctx.visited.has(type)) return handleCyclicRef(type, ctx);
623
- const flags = type.getFlags();
624
- const primitive = convertPrimitiveOrLiteral(type, flags, ctx.checker);
663
+ const primitive = convertPrimitiveOrLiteral(type, type.getFlags(), ctx.checker);
625
664
  if (primitive) return primitive;
626
665
  if (type.isUnion()) {
627
666
  ctx.visited.add(type);
@@ -635,6 +674,7 @@ function convertTypeToSchema(type, ctx, depth) {
635
674
  ctx.visited.delete(type);
636
675
  return result;
637
676
  }
677
+ if (isFunctionType(type)) return {};
638
678
  if (isObjectType(type)) return convertObjectType(type, ctx, depth);
639
679
  return {};
640
680
  }
@@ -652,10 +692,8 @@ function getProcedureTypeName(defType, checker) {
652
692
  }
653
693
  function isVoidLikeInput(inputType) {
654
694
  if (!inputType) return true;
655
- const isVoidOrUndefinedOrNever = hasFlag(inputType, typescript.TypeFlags.Void | typescript.TypeFlags.Undefined | typescript.TypeFlags.Never);
656
- if (isVoidOrUndefinedOrNever) return true;
657
- const isUnionOfVoids = inputType.isUnion() && inputType.types.every((t) => hasFlag(t, typescript.TypeFlags.Void | typescript.TypeFlags.Undefined));
658
- return isUnionOfVoids;
695
+ if (hasFlag(inputType, typescript.TypeFlags.Void | typescript.TypeFlags.Undefined | typescript.TypeFlags.Never)) return true;
696
+ return inputType.isUnion() && inputType.types.every((t) => hasFlag(t, typescript.TypeFlags.Void | typescript.TypeFlags.Undefined));
659
697
  }
660
698
  function shouldIncludeProcedureInOpenAPI(type) {
661
699
  return type !== "subscription";
@@ -671,8 +709,7 @@ function getProcedureInputTypeName(type, path) {
671
709
  if (declarationName && !ANONYMOUS_NAMES.has(declarationName) && !declarationName.startsWith("__")) return declarationName;
672
710
  }
673
711
  }
674
- const fallbackName = path.split(".").filter(Boolean).map((segment) => segment.split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")).join("");
675
- return `${fallbackName || "Procedure"}Input`;
712
+ return `${path.split(".").filter(Boolean).map((segment) => segment.split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")).join("") || "Procedure"}Input`;
676
713
  }
677
714
  function isUnknownLikeType(type) {
678
715
  return hasFlag(type, typescript.TypeFlags.Unknown | typescript.TypeFlags.Any);
@@ -703,14 +740,11 @@ function recoverProcedureInputType(def, checker) {
703
740
  if (callee.name.text !== "input") return;
704
741
  const [parserExpr] = expr.arguments;
705
742
  if (!parserExpr) return;
706
- const parserType = checker.getTypeAtLocation(parserExpr);
707
- const standardSym = parserType.getProperty("~standard");
743
+ const standardSym = checker.getTypeAtLocation(parserExpr).getProperty("~standard");
708
744
  if (!standardSym) return;
709
- const standardType = checker.getTypeOfSymbolAtLocation(standardSym, parserExpr);
710
- const typesSym = standardType.getProperty("types");
745
+ const typesSym = checker.getTypeOfSymbolAtLocation(standardSym, parserExpr).getProperty("types");
711
746
  if (!typesSym) return;
712
- const typesType = checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(typesSym, parserExpr));
713
- const outputSym = typesType.getProperty("output");
747
+ const outputSym = checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(typesSym, parserExpr)).getProperty("output");
714
748
  if (!outputSym) return;
715
749
  const outputType = checker.getTypeOfSymbolAtLocation(outputSym, parserExpr);
716
750
  if (!isUnknownLikeType(outputType)) recovered = outputType;
@@ -766,22 +800,18 @@ function getJsDocComment(sym, checker) {
766
800
  var _sym$declarations2;
767
801
  const normalize = (filePath) => filePath.replace(/\\/g, "/");
768
802
  const declarations = (_sym$declarations2 = sym.declarations) !== null && _sym$declarations2 !== void 0 ? _sym$declarations2 : [];
769
- const isExternalNodeModulesDeclaration = declarations.length > 0 && declarations.every((declaration) => {
803
+ if (declarations.length > 0 && declarations.every((declaration) => {
770
804
  const sourceFile = declaration.getSourceFile();
771
805
  if (!sourceFile.isDeclarationFile) return false;
772
- const declarationPath = normalize(sourceFile.fileName);
773
- if (!declarationPath.includes("/node_modules/")) return false;
806
+ if (!normalize(sourceFile.fileName).includes("/node_modules/")) return false;
774
807
  try {
775
- const realPath = normalize(node_fs.realpathSync.native(sourceFile.fileName));
776
- if (!realPath.includes("/node_modules/")) return false;
808
+ if (!normalize(node_fs.realpathSync.native(sourceFile.fileName)).includes("/node_modules/")) return false;
777
809
  } catch (_unused) {}
778
810
  return true;
779
- });
780
- if (isExternalNodeModulesDeclaration) return void 0;
811
+ })) return;
781
812
  const parts = sym.getDocumentationComment(checker);
782
- if (parts.length === 0) return void 0;
783
- const text = parts.map((p) => p.text).join("");
784
- return text || void 0;
813
+ if (parts.length === 0) return;
814
+ return parts.map((p) => p.text).join("") || void 0;
785
815
  }
786
816
  function walkType(opts) {
787
817
  const { type, ctx, currentPath, description, symbol } = opts;
@@ -812,28 +842,21 @@ function walkType(opts) {
812
842
  }
813
843
  const routerSym = defType.getProperty("router");
814
844
  if (!routerSym) return;
815
- const isRouter = checker.typeToString(checker.getTypeOfSymbol(routerSym)) === "true";
816
- if (!isRouter) return;
845
+ if (!(checker.typeToString(checker.getTypeOfSymbol(routerSym)) === "true")) return;
817
846
  const recordSym = defType.getProperty("record");
818
847
  if (!recordSym) return;
819
848
  ctx.seen.add(type);
820
- const recordType = checker.getTypeOfSymbol(recordSym);
821
- walkRecord(recordType, ctx, currentPath);
849
+ walkRecord(checker.getTypeOfSymbol(recordSym), ctx, currentPath);
822
850
  ctx.seen.delete(type);
823
851
  }
824
852
  function walkRecord(recordType, ctx, prefix) {
825
- for (const prop of recordType.getProperties()) {
826
- const propType = ctx.schemaCtx.checker.getTypeOfSymbol(prop);
827
- const fullPath = prefix ? `${prefix}.${prop.name}` : prop.name;
828
- const description = getJsDocComment(prop, ctx.schemaCtx.checker);
829
- walkType({
830
- type: propType,
831
- ctx,
832
- currentPath: fullPath,
833
- description,
834
- symbol: prop
835
- });
836
- }
853
+ for (const prop of recordType.getProperties()) walkType({
854
+ type: ctx.schemaCtx.checker.getTypeOfSymbol(prop),
855
+ ctx,
856
+ currentPath: prefix ? `${prefix}.${prop.name}` : prop.name,
857
+ description: getJsDocComment(prop, ctx.schemaCtx.checker),
858
+ symbol: prop
859
+ });
837
860
  }
838
861
  function loadCompilerOptions(startDir) {
839
862
  const configPath = typescript.findConfigFile(startDir, (f) => typescript.sys.fileExists(f), "tsconfig.json");
@@ -845,7 +868,7 @@ function loadCompilerOptions(startDir) {
845
868
  };
846
869
  const configFile = typescript.readConfigFile(configPath, (f) => typescript.sys.readFile(f));
847
870
  const parsed = typescript.parseJsonConfigFileContent(configFile.config, typescript.sys, node_path.dirname(configPath));
848
- const options = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, parsed.options), {}, { noEmit: true });
871
+ const options = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, parsed.options), {}, { noEmit: true });
849
872
  if (options.moduleResolution === void 0) {
850
873
  const mod = options.module;
851
874
  if (mod === typescript.ModuleKind.Node16 || mod === typescript.ModuleKind.NodeNext) options.moduleResolution = typescript.ModuleResolutionKind.NodeNext;
@@ -898,19 +921,18 @@ const DEFAULT_ERROR_SCHEMA = {
898
921
  */
899
922
  function wrapInSuccessEnvelope(outputSchema) {
900
923
  const hasOutput = outputSchema !== null && isNonEmptySchema(outputSchema);
901
- const resultSchema = (0, import_objectSpread2.default)({
902
- type: "object",
903
- properties: (0, import_objectSpread2.default)({}, hasOutput ? { data: outputSchema } : {})
904
- }, hasOutput ? { required: ["data"] } : {});
905
924
  return {
906
925
  type: "object",
907
- properties: { result: resultSchema },
926
+ properties: { result: require_objectSpread2._objectSpread2({
927
+ type: "object",
928
+ properties: require_objectSpread2._objectSpread2({}, hasOutput ? { data: outputSchema } : {})
929
+ }, hasOutput ? { required: ["data"] } : {}) },
908
930
  required: ["result"]
909
931
  };
910
932
  }
911
933
  function buildProcedureOperation(proc, method) {
912
934
  const [tag = proc.path] = proc.path.split(".");
913
- const operation = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({ operationId: proc.path }, proc.description ? { description: proc.description } : {}), {}, {
935
+ const operation = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ operationId: proc.path }, proc.description ? { description: proc.description } : {}), {}, {
914
936
  tags: [tag],
915
937
  responses: {
916
938
  "200": {
@@ -947,7 +969,7 @@ function buildOpenAPIDocument(procedures, options, meta = { errorSchema: null })
947
969
  pathItem[method] = buildProcedureOperation(proc, method);
948
970
  }
949
971
  const hasNamedSchemas = meta.schemas !== void 0 && Object.keys(meta.schemas).length > 0;
950
- return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({
972
+ return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
951
973
  openapi: "3.1.1",
952
974
  jsonSchemaDialect: "https://spec.openapis.org/oas/3.1/dialect/base",
953
975
  info: {
@@ -956,7 +978,7 @@ function buildOpenAPIDocument(procedures, options, meta = { errorSchema: null })
956
978
  }
957
979
  }, ((_options$servers = options.servers) === null || _options$servers === void 0 ? void 0 : _options$servers.length) ? { servers: options.servers } : {}), {}, {
958
980
  paths,
959
- components: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, hasNamedSchemas && meta.schemas ? { schemas: meta.schemas } : {}), {}, { responses: { Error: {
981
+ components: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, hasNamedSchemas && meta.schemas ? { schemas: meta.schemas } : {}), {}, { responses: { Error: {
960
982
  description: "Error response",
961
983
  content: { "application/json": { schema: {
962
984
  type: "object",
@@ -1020,16 +1042,14 @@ async function generateOpenAPIDocument(routerFilePath, options = {}) {
1020
1042
  schemas: schemaCtx.schemas
1021
1043
  });
1022
1044
  }
1023
-
1024
1045
  //#endregion
1025
1046
  //#region src/types.ts
1026
- var types_exports = {};
1027
-
1047
+ var types_exports = /* @__PURE__ */ __exportAll({});
1028
1048
  //#endregion
1029
- Object.defineProperty(exports, 'OpenAPIV3_1', {
1030
- enumerable: true,
1031
- get: function () {
1032
- return types_exports;
1033
- }
1049
+ Object.defineProperty(exports, "OpenAPIV3_1", {
1050
+ enumerable: true,
1051
+ get: function() {
1052
+ return types_exports;
1053
+ }
1034
1054
  });
1035
- exports.generateOpenAPIDocument = generateOpenAPIDocument;
1055
+ exports.generateOpenAPIDocument = generateOpenAPIDocument;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { OpenAPIV3_1 } from "openapi-types";
2
-
3
- //#region rolldown:runtime
4
2
  declare namespace types_d_exports {
5
3
  export { ArraySchemaObject, CallbackObject, ComponentsObject, DiscriminatorObject, Document, ExampleObject, ExternalDocumentationObject, HeaderObject, HttpMethods, LinkObject, MediaTypeObject, OperationObject, ParameterBaseObject, ParameterObject, PathItemObject, PathsObject, PrimitiveSchemaType, ReferenceObject, Replace, RequestBodyObject, ResponseObject, ResponsesObject, SchemaLike, SchemaObject, SchemaType, SecuritySchemeObject, ServerObject, XMLObject };
6
4
  }
@@ -75,7 +73,7 @@ type OperationObject<T extends {} = {}> = Replace<OpenAPIV3_1.OperationObject<T>
75
73
  }> & T;
76
74
  type PathItemObject<T extends {} = {}> = Replace<OpenAPIV3_1.PathItemObject<T>, {
77
75
  parameters?: (ReferenceObject | ParameterObject)[];
78
- }> & { [method in HttpMethods]?: OperationObject<T> };
76
+ }> & { [method in HttpMethods]?: OperationObject<T>; };
79
77
  type PathsObject<T extends {} = {}, TPath extends {} = {}> = Record<string, (PathItemObject<T> & TPath) | undefined>;
80
78
  type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
81
79
  type ComponentsObject = Replace<OpenAPIV3_1.ComponentsObject, {
@@ -92,7 +90,6 @@ type Document<T extends {} = {}> = Replace<OpenAPIV3_1.Document<T>, {
92
90
  paths?: PathsObject<T>;
93
91
  components?: ComponentsObject;
94
92
  }>;
95
- //# sourceMappingURL=types.d.ts.map
96
93
  //#endregion
97
94
  //#region src/generate.d.ts
98
95
  interface GenerateOptions {
@@ -121,9 +118,7 @@ interface GenerateOptions {
121
118
  * the AppRouter.
122
119
  * @param options - Optional generation settings (export name, title, version).
123
120
  */
124
- declare function generateOpenAPIDocument(routerFilePath: string, options?: GenerateOptions): Promise<Document>;
125
- //# sourceMappingURL=generate.d.ts.map
126
-
121
+ export declare function generateOpenAPIDocument(routerFilePath: string, options?: GenerateOptions): Promise<Document>;
127
122
  //#endregion
128
- export { GenerateOptions, types_d_exports as OpenAPIV3_1, generateOpenAPIDocument };
123
+ export { type GenerateOptions, types_d_exports as OpenAPIV3_1 };
129
124
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/generate.ts"],"sourcesContent":[],"mappings":";;;;;;KAEY,iCAAiC,KAAK,eAAe,gBAC/D;KAEU,UAAA;KASA,mBAAA,GAAsB;KAEtB,WAAA,GAAc,WAAA,CAAgB;KAC9B,eAAA,GAAkB,WAAA,CAAgB;KAClC,aAAA,GAAgB,WAAA,CAAgB;KAChC,mBAAA,GAAsB,WAAA,CAAgB;KACtC,2BAAA,GACV,WAAA,CAAgB;KACN,SAAA,GAAY,WAAA,CAAgB;KAC5B,UAAA,GAAa,WAAA,CAAgB;KAC7B,oBAAA,GAAuB,WAAA,CAAgB;KACvC,YAAA,GAAe,WAAA,CAAgB;KAE/B,YAAA,GAAe,QACzB,WAAA,CAAgB;;UAGN,eAAe;;;eAGV,eAAe;;UAEpB;gBACM;;;UAGN;UACA;UACA;QACF;mCAC2B;kBACjB;iBACD;QACT;;;;;KAOE,UAAA,GAAa;U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-CJ2cON1m.mjs";
2
1
  import { OpenAPIV3_1 } from "openapi-types";
3
-
4
- //#region src/types.d.ts
5
2
  declare namespace types_d_exports {
6
3
  export { ArraySchemaObject, CallbackObject, ComponentsObject, DiscriminatorObject, Document, ExampleObject, ExternalDocumentationObject, HeaderObject, HttpMethods, LinkObject, MediaTypeObject, OperationObject, ParameterBaseObject, ParameterObject, PathItemObject, PathsObject, PrimitiveSchemaType, ReferenceObject, Replace, RequestBodyObject, ResponseObject, ResponsesObject, SchemaLike, SchemaObject, SchemaType, SecuritySchemeObject, ServerObject, XMLObject };
7
4
  }
@@ -76,7 +73,7 @@ type OperationObject<T extends {} = {}> = Replace<OpenAPIV3_1.OperationObject<T>
76
73
  }> & T;
77
74
  type PathItemObject<T extends {} = {}> = Replace<OpenAPIV3_1.PathItemObject<T>, {
78
75
  parameters?: (ReferenceObject | ParameterObject)[];
79
- }> & { [method in HttpMethods]?: OperationObject<T> };
76
+ }> & { [method in HttpMethods]?: OperationObject<T>; };
80
77
  type PathsObject<T extends {} = {}, TPath extends {} = {}> = Record<string, (PathItemObject<T> & TPath) | undefined>;
81
78
  type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
82
79
  type ComponentsObject = Replace<OpenAPIV3_1.ComponentsObject, {
@@ -93,7 +90,6 @@ type Document<T extends {} = {}> = Replace<OpenAPIV3_1.Document<T>, {
93
90
  paths?: PathsObject<T>;
94
91
  components?: ComponentsObject;
95
92
  }>;
96
- //# sourceMappingURL=types.d.ts.map
97
93
  //#endregion
98
94
  //#region src/generate.d.ts
99
95
  interface GenerateOptions {
@@ -122,9 +118,7 @@ interface GenerateOptions {
122
118
  * the AppRouter.
123
119
  * @param options - Optional generation settings (export name, title, version).
124
120
  */
125
- declare function generateOpenAPIDocument(routerFilePath: string, options?: GenerateOptions): Promise<Document>;
126
- //# sourceMappingURL=generate.d.ts.map
127
-
121
+ export declare function generateOpenAPIDocument(routerFilePath: string, options?: GenerateOptions): Promise<Document>;
128
122
  //#endregion
129
- export { GenerateOptions, types_d_exports as OpenAPIV3_1, generateOpenAPIDocument };
123
+ export { type GenerateOptions, types_d_exports as OpenAPIV3_1 };
130
124
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/generate.ts"],"sourcesContent":[],"mappings":";;;;;;;KAEY,iCAAiC,KAAK,eAAe,gBAC/D;KAEU,UAAA;KASA,mBAAA,GAAsB;KAEtB,WAAA,GAAc,WAAA,CAAgB;KAC9B,eAAA,GAAkB,WAAA,CAAgB;KAClC,aAAA,GAAgB,WAAA,CAAgB;KAChC,mBAAA,GAAsB,WAAA,CAAgB;KACtC,2BAAA,GACV,WAAA,CAAgB;KACN,SAAA,GAAY,WAAA,CAAgB;KAC5B,UAAA,GAAa,WAAA,CAAgB;KAC7B,oBAAA,GAAuB,WAAA,CAAgB;KACvC,YAAA,GAAe,WAAA,CAAgB;KAE/B,YAAA,GAAe,QACzB,WAAA,CAAgB;;UAGN,eAAe;;;eAGV,eAAe;;UAEpB;gBACM;;;UAGN;UACA;UACA;QACF;mCAC2B;kBACjB;iBACD;QACT;;;;AA7CV,CAAA,CAAA;AAAmB,KAoDP,UAAA,GAAa,YApDN;AAA+B,UAsDjC,iBAAA,SAA0B,YAtDO,CAAA;EAAO,IAAQ,EAAA,OAAA;EAAY,KAAhC,EAwDpC,YAxDoC,GAAA,KAAA;;AAC/B,KA0DF,eAAA,GAAkB,OA1DhB,CA2DZ,WAAA,CAAgB,eA3DJ,EAAA;EAEF,MAAA,CAAA,EA2DC,YA3DS,GA2DM,eA3DN;EASV,QAAA,CAAA,EAmDG,MAnDH,CAAA,MAAmB,EAmDD,eAnDI,GAmDc,aAnDJ,CAAA;AAE5C,CAAA,CAAA;AACY,UAoDK,mBAAA,SACP,OArDoC,CAsD1C,WAAA,CAAgB,mBAtDyC,EAAA;EACjD,MAAA,CAAA,EAuDG,YAvDU,GAuDK,eAvDc;EAChC,QAAA,CAAA,E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