adorn-api 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/adapter/express/auth.d.ts +8 -0
  2. package/dist/adapter/express/auth.d.ts.map +1 -1
  3. package/dist/adapter/express/bootstrap.d.ts +14 -1
  4. package/dist/adapter/express/bootstrap.d.ts.map +1 -1
  5. package/dist/adapter/express/coercion.d.ts +81 -1
  6. package/dist/adapter/express/coercion.d.ts.map +1 -1
  7. package/dist/adapter/express/index.d.ts +1 -0
  8. package/dist/adapter/express/index.d.ts.map +1 -1
  9. package/dist/adapter/express/merge.d.ts +17 -0
  10. package/dist/adapter/express/merge.d.ts.map +1 -1
  11. package/dist/adapter/express/openapi.d.ts +55 -0
  12. package/dist/adapter/express/openapi.d.ts.map +1 -1
  13. package/dist/adapter/express/router.d.ts +6 -0
  14. package/dist/adapter/express/router.d.ts.map +1 -1
  15. package/dist/adapter/express/swagger.d.ts +6 -0
  16. package/dist/adapter/express/swagger.d.ts.map +1 -1
  17. package/dist/adapter/express/types.d.ts +39 -0
  18. package/dist/adapter/express/types.d.ts.map +1 -1
  19. package/dist/adapter/express/validation.d.ts +19 -2
  20. package/dist/adapter/express/validation.d.ts.map +1 -1
  21. package/dist/cli.cjs +192 -11
  22. package/dist/cli.cjs.map +1 -1
  23. package/dist/cli.js +192 -11
  24. package/dist/cli.js.map +1 -1
  25. package/dist/compiler/analyze/index.d.ts +5 -0
  26. package/dist/compiler/analyze/index.d.ts.map +1 -0
  27. package/dist/compiler/analyze/scanControllers.d.ts +52 -0
  28. package/dist/compiler/analyze/scanControllers.d.ts.map +1 -1
  29. package/dist/compiler/cache/isStale.d.ts +26 -0
  30. package/dist/compiler/cache/isStale.d.ts.map +1 -1
  31. package/dist/compiler/cache/loadArtifacts.d.ts +36 -0
  32. package/dist/compiler/cache/loadArtifacts.d.ts.map +1 -1
  33. package/dist/compiler/cache/schema.d.ts +14 -0
  34. package/dist/compiler/cache/schema.d.ts.map +1 -1
  35. package/dist/compiler/cache/writeCache.d.ts +6 -0
  36. package/dist/compiler/cache/writeCache.d.ts.map +1 -1
  37. package/dist/compiler/gems.d.ts +75 -0
  38. package/dist/compiler/gems.d.ts.map +1 -0
  39. package/dist/compiler/generator/index.d.ts +7 -0
  40. package/dist/compiler/generator/index.d.ts.map +1 -0
  41. package/dist/compiler/generator/manifest.d.ts +23 -0
  42. package/dist/compiler/generator/manifest.d.ts.map +1 -0
  43. package/dist/compiler/generator/openapi.d.ts +118 -0
  44. package/dist/compiler/generator/openapi.d.ts.map +1 -0
  45. package/dist/compiler/graph/builder.d.ts +24 -0
  46. package/dist/compiler/graph/builder.d.ts.map +1 -0
  47. package/dist/compiler/graph/index.d.ts +7 -0
  48. package/dist/compiler/graph/index.d.ts.map +1 -0
  49. package/dist/compiler/graph/schemaGraph.d.ts +67 -0
  50. package/dist/compiler/graph/schemaGraph.d.ts.map +1 -0
  51. package/dist/compiler/graph/types.d.ts +203 -0
  52. package/dist/compiler/graph/types.d.ts.map +1 -0
  53. package/dist/compiler/index.d.ts +12 -0
  54. package/dist/compiler/index.d.ts.map +1 -0
  55. package/dist/compiler/ir/index.d.ts +7 -0
  56. package/dist/compiler/ir/index.d.ts.map +1 -0
  57. package/dist/compiler/ir/pipeline.d.ts +82 -0
  58. package/dist/compiler/ir/pipeline.d.ts.map +1 -0
  59. package/dist/compiler/ir/stages.d.ts +40 -0
  60. package/dist/compiler/ir/stages.d.ts.map +1 -0
  61. package/dist/compiler/ir/visitor.d.ts +98 -0
  62. package/dist/compiler/ir/visitor.d.ts.map +1 -0
  63. package/dist/compiler/manifest/emit.d.ts +14 -0
  64. package/dist/compiler/manifest/emit.d.ts.map +1 -1
  65. package/dist/compiler/manifest/format.d.ts +42 -0
  66. package/dist/compiler/manifest/format.d.ts.map +1 -1
  67. package/dist/compiler/manifest/index.d.ts +6 -0
  68. package/dist/compiler/manifest/index.d.ts.map +1 -0
  69. package/dist/compiler/runner/createProgram.d.ts +16 -0
  70. package/dist/compiler/runner/createProgram.d.ts.map +1 -1
  71. package/dist/compiler/runner/index.d.ts +5 -0
  72. package/dist/compiler/runner/index.d.ts.map +1 -0
  73. package/dist/compiler/schema/extractAnnotations.d.ts +47 -0
  74. package/dist/compiler/schema/extractAnnotations.d.ts.map +1 -1
  75. package/dist/compiler/schema/index.d.ts +6 -0
  76. package/dist/compiler/schema/index.d.ts.map +1 -0
  77. package/dist/compiler/schema/intersectionHandler.d.ts +37 -0
  78. package/dist/compiler/schema/intersectionHandler.d.ts.map +1 -1
  79. package/dist/compiler/schema/objectHandler.d.ts +86 -0
  80. package/dist/compiler/schema/objectHandler.d.ts.map +1 -1
  81. package/dist/compiler/schema/openapi.d.ts +15 -0
  82. package/dist/compiler/schema/openapi.d.ts.map +1 -1
  83. package/dist/compiler/schema/parameters.d.ts +72 -0
  84. package/dist/compiler/schema/parameters.d.ts.map +1 -1
  85. package/dist/compiler/schema/primitives.d.ts +58 -0
  86. package/dist/compiler/schema/primitives.d.ts.map +1 -1
  87. package/dist/compiler/schema/typeToJsonSchema.d.ts +20 -0
  88. package/dist/compiler/schema/typeToJsonSchema.d.ts.map +1 -1
  89. package/dist/compiler/schema/types.d.ts +15 -0
  90. package/dist/compiler/schema/types.d.ts.map +1 -1
  91. package/dist/compiler/schema/unionHandler.d.ts +60 -0
  92. package/dist/compiler/schema/unionHandler.d.ts.map +1 -1
  93. package/dist/compiler/transform/dedup.d.ts +35 -0
  94. package/dist/compiler/transform/dedup.d.ts.map +1 -0
  95. package/dist/compiler/transform/flatten.d.ts +50 -0
  96. package/dist/compiler/transform/flatten.d.ts.map +1 -0
  97. package/dist/compiler/transform/index.d.ts +7 -0
  98. package/dist/compiler/transform/index.d.ts.map +1 -0
  99. package/dist/compiler/transform/inline.d.ts +46 -0
  100. package/dist/compiler/transform/inline.d.ts.map +1 -0
  101. package/dist/compiler/validation/emitPrecompiledValidators.d.ts +16 -0
  102. package/dist/compiler/validation/emitPrecompiledValidators.d.ts.map +1 -1
  103. package/dist/compiler/validation/index.d.ts +5 -0
  104. package/dist/compiler/validation/index.d.ts.map +1 -0
  105. package/dist/decorators/Auth.d.ts +17 -0
  106. package/dist/decorators/Auth.d.ts.map +1 -1
  107. package/dist/decorators/Controller.d.ts +15 -0
  108. package/dist/decorators/Controller.d.ts.map +1 -1
  109. package/dist/decorators/Public.d.ts +13 -0
  110. package/dist/decorators/Public.d.ts.map +1 -1
  111. package/dist/decorators/Use.d.ts +18 -0
  112. package/dist/decorators/Use.d.ts.map +1 -1
  113. package/dist/decorators/methods.d.ts +20 -0
  114. package/dist/decorators/methods.d.ts.map +1 -1
  115. package/dist/express.cjs +71 -11
  116. package/dist/express.cjs.map +1 -1
  117. package/dist/express.d.ts +1 -0
  118. package/dist/express.d.ts.map +1 -1
  119. package/dist/express.js +71 -11
  120. package/dist/express.js.map +1 -1
  121. package/dist/index.cjs +160 -3
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.ts +2 -0
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +155 -2
  126. package/dist/index.js.map +1 -1
  127. package/dist/metal/applyListQuery.d.ts +73 -0
  128. package/dist/metal/applyListQuery.d.ts.map +1 -1
  129. package/dist/metal/index.cjs.map +1 -1
  130. package/dist/metal/index.d.ts +4 -0
  131. package/dist/metal/index.d.ts.map +1 -1
  132. package/dist/metal/index.js.map +1 -1
  133. package/dist/metal/listQuery.d.ts +19 -0
  134. package/dist/metal/listQuery.d.ts.map +1 -1
  135. package/dist/metal/queryOptions.d.ts +8 -0
  136. package/dist/metal/queryOptions.d.ts.map +1 -1
  137. package/dist/metal/readMetalBag.d.ts +36 -0
  138. package/dist/metal/readMetalBag.d.ts.map +1 -1
  139. package/dist/metal/registerMetalEntities.d.ts +20 -0
  140. package/dist/metal/registerMetalEntities.d.ts.map +1 -1
  141. package/dist/metal/schemaFromEntity.d.ts +30 -0
  142. package/dist/metal/schemaFromEntity.d.ts.map +1 -1
  143. package/dist/metal/searchWhere.d.ts +39 -0
  144. package/dist/metal/searchWhere.d.ts.map +1 -1
  145. package/dist/metal/symbolMetadata.d.ts +6 -0
  146. package/dist/metal/symbolMetadata.d.ts.map +1 -1
  147. package/dist/runtime/auth/runtime.d.ts +155 -6
  148. package/dist/runtime/auth/runtime.d.ts.map +1 -1
  149. package/dist/runtime/metadata/bucket.d.ts +1 -2
  150. package/dist/runtime/metadata/bucket.d.ts.map +1 -1
  151. package/dist/runtime/metadata/key.d.ts +1 -1
  152. package/dist/runtime/metadata/key.d.ts.map +1 -1
  153. package/dist/runtime/metadata/read.d.ts +1 -2
  154. package/dist/runtime/metadata/read.d.ts.map +1 -1
  155. package/dist/runtime/metadata/types.d.ts +74 -0
  156. package/dist/runtime/metadata/types.d.ts.map +1 -1
  157. package/dist/runtime/polyfill.d.ts +1 -1
  158. package/dist/runtime/polyfill.d.ts.map +1 -1
  159. package/dist/runtime/upload.d.ts +37 -0
  160. package/dist/runtime/upload.d.ts.map +1 -1
  161. package/dist/runtime/validation/ajv.d.ts +100 -0
  162. package/dist/runtime/validation/ajv.d.ts.map +1 -1
  163. package/dist/runtime/validation/index.d.ts +9 -0
  164. package/dist/runtime/validation/index.d.ts.map +1 -1
  165. package/dist/scripts/adorn-example.cjs +238 -6
  166. package/dist/scripts/adorn-example.cjs.map +1 -1
  167. package/dist/utils/port.d.ts +9 -0
  168. package/dist/utils/port.d.ts.map +1 -0
  169. package/package.json +3 -1
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Analyze module exports
3
+ */
4
+ export { scanControllers, type ScannedController, type ScannedOperation, type ScannedParameter } from './scanControllers.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/analyze/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC"}
@@ -1,36 +1,88 @@
1
+ /**
2
+ * Scans TypeScript source files for controller classes decorated with @Controller and extracts their operations.
3
+ * This module provides the foundation for API compilation by identifying all HTTP endpoints defined in the codebase.
4
+ */
1
5
  import ts from "typescript";
6
+ /**
7
+ * Represents a scanned controller class with its metadata and operations.
8
+ * Contains information about the controller class, base path, and all HTTP operations it defines.
9
+ */
2
10
  export interface ScannedController {
11
+ /** The name of the controller class */
3
12
  className: string;
13
+ /** The base path prefix for all operations in this controller */
4
14
  basePath: string;
15
+ /** The TypeScript source file containing this controller */
5
16
  sourceFile: ts.SourceFile;
17
+ /** The class declaration node from the TypeScript AST */
6
18
  classDeclaration: ts.ClassDeclaration;
19
+ /** Array of scanned operations (endpoints) in this controller */
7
20
  operations: ScannedOperation[];
21
+ /** Optional list of content types this controller consumes */
8
22
  consumes?: string[];
23
+ /** Optional list of content types this controller produces */
9
24
  produces?: string[];
10
25
  }
26
+ /**
27
+ * Represents a scanned HTTP operation (endpoint) within a controller.
28
+ * Contains all metadata needed to generate API documentation and client code.
29
+ */
11
30
  export interface ScannedOperation {
31
+ /** The name of the method implementing this operation */
12
32
  methodName: string;
33
+ /** The HTTP method (GET, POST, PUT, PATCH, DELETE) */
13
34
  httpMethod: string;
35
+ /** The URL path for this operation, relative to controller base path */
14
36
  path: string;
37
+ /** Unique identifier for this operation, used in OpenAPI specs and client generation */
15
38
  operationId: string;
39
+ /** The method declaration node from the TypeScript AST */
16
40
  methodDeclaration: ts.MethodDeclaration;
41
+ /** The TypeScript return type of this operation */
17
42
  returnType: ts.Type;
43
+ /** Optional TypeScript type node for the return type */
18
44
  returnTypeNode?: ts.TypeNode;
45
+ /** Array of scanned parameters for this operation */
19
46
  parameters: ScannedParameter[];
47
+ /** Indices of parameters that are path parameters */
20
48
  pathParamIndices: number[];
49
+ /** Index of the parameter that is the request body, or null if none */
21
50
  bodyParamIndex: number | null;
51
+ /** Indices of parameters that are query parameters */
22
52
  queryParamIndices: number[];
53
+ /** Index of the parameter that is a query object (all query params as properties), or null if none */
23
54
  queryObjectParamIndex: number | null;
55
+ /** Index of the parameter that is a headers object, or null if none */
24
56
  headerObjectParamIndex: number | null;
57
+ /** Index of the parameter that is a cookies object, or null if none */
25
58
  cookieObjectParamIndex: number | null;
59
+ /** The content type of the request body, if applicable */
26
60
  bodyContentType?: string;
27
61
  }
62
+ /**
63
+ * Represents a scanned parameter of an operation.
64
+ * Contains metadata about the parameter's name, type, and position.
65
+ */
28
66
  export interface ScannedParameter {
67
+ /** The name of the parameter */
29
68
  name: string;
69
+ /** The zero-based index of the parameter in the function signature */
30
70
  index: number;
71
+ /** The TypeScript type of this parameter */
31
72
  type: ts.Type;
73
+ /** Whether this parameter is optional */
32
74
  isOptional: boolean;
75
+ /** Optional parameter declaration node from the TypeScript AST */
33
76
  paramNode?: ts.ParameterDeclaration;
34
77
  }
78
+ /**
79
+ * Scans an array of TypeScript source files for controller classes and extracts their operations.
80
+ * Only classes decorated with @Controller are considered, and only methods with HTTP method decorators
81
+ * (e.g., @Get, @Post) are treated as operations.
82
+ *
83
+ * @param sourceFiles - Array of TypeScript source files to scan
84
+ * @param checker - TypeScript type checker for analyzing types
85
+ * @returns Array of scanned controllers with their operations
86
+ */
35
87
  export declare function scanControllers(sourceFiles: ts.SourceFile[], checker: ts.TypeChecker): ScannedController[];
36
88
  //# sourceMappingURL=scanControllers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scanControllers.d.ts","sourceRoot":"","sources":["../../../src/compiler/analyze/scanControllers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAC1B,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC;IACtC,UAAU,EAAE,gBAAgB,EAAE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AAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IACd,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,SAAS,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,EAC5B,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,iBAAiB,EAAE,CAerB"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Result of a cache staleness check.
3
+ * - stale: false means cache is valid and artifacts can be used as-is
4
+ * - stale: true means cache is invalid and artifacts need to be regenerated
5
+ */
1
6
  export type StaleResult = {
2
7
  stale: false;
3
8
  reason: "up-to-date";
@@ -6,11 +11,32 @@ export type StaleResult = {
6
11
  reason: string;
7
12
  detail?: string;
8
13
  };
14
+ /**
15
+ * Collects all TypeScript config files in the inheritance chain.
16
+ * Follows the "extends" property recursively to build a complete list of config files.
17
+ *
18
+ * @param tsconfigPathAbs - Absolute path to the root tsconfig.json
19
+ * @returns Array of absolute paths to all config files in the chain, in order from root to leaf
20
+ */
9
21
  export declare function collectTsconfigChain(tsconfigPathAbs: string): string[];
22
+ /**
23
+ * Searches for a package lockfile (pnpm-lock.yaml, package-lock.json, or yarn.lock)
24
+ * starting from the given directory and moving up the directory tree.
25
+ *
26
+ * @param startDir - The directory to start searching from
27
+ * @returns Object with path and modification time of the found lockfile, or null if not found
28
+ */
10
29
  export declare function findLockfile(startDir: string): {
11
30
  path: string;
12
31
  mtimeMs: number;
13
32
  } | null;
33
+ /**
34
+ * Determines whether the compiled artifacts are stale and need to be regenerated.
35
+ * Checks the manifest, cache file, TypeScript config files, lockfile, and input files.
36
+ *
37
+ * @param params - Object containing outDir, project path, adorn version, and TypeScript version
38
+ * @returns Promise resolving to a StaleResult indicating whether regeneration is needed
39
+ */
14
40
  export declare function isStale(params: {
15
41
  outDir: string;
16
42
  project: string;
@@ -1 +1 @@
1
- {"version":3,"file":"isStale.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/isStale.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GACnB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACtC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBrD,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCtE;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAevF;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,WAAW,CAAC,CA+CvB"}
1
+ {"version":3,"file":"isStale.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/isStale.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACtC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBrD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCtE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAevF;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,WAAW,CAAC,CA+CvB"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * OpenAPI specification interface as loaded from openapi.json
3
+ */
1
4
  interface OpenApi {
2
5
  openapi: string;
3
6
  components?: {
@@ -7,6 +10,10 @@ interface OpenApi {
7
10
  info?: Record<string, unknown>;
8
11
  security?: Array<Record<string, string[]>>;
9
12
  }
13
+ /**
14
+ * Manifest interface describing the compiled API structure.
15
+ * Contains metadata about the generation process and all controllers/operations.
16
+ */
10
17
  interface Manifest {
11
18
  manifestVersion: number;
12
19
  generatedAt: string;
@@ -81,6 +88,9 @@ interface Manifest {
81
88
  }>;
82
89
  }>;
83
90
  }
91
+ /**
92
+ * Validator module interface for precompiled validation logic.
93
+ */
84
94
  interface ValidatorModule {
85
95
  validators: Record<string, {
86
96
  body?: (data: unknown) => boolean;
@@ -95,16 +105,42 @@ interface ValidatorModule {
95
105
  errors: unknown[] | null;
96
106
  };
97
107
  }
108
+ /**
109
+ * Options for loading artifacts from the output directory.
110
+ */
98
111
  export interface LoadArtifactsOptions {
99
112
  outDir: string;
100
113
  }
114
+ /**
115
+ * Result of loading artifacts from the output directory.
116
+ */
101
117
  export interface LoadedArtifacts {
102
118
  openapi: OpenApi;
103
119
  manifest: Manifest;
104
120
  validators: ValidatorModule | null;
105
121
  }
122
+ /**
123
+ * Loads OpenAPI spec, manifest, and validators from the output directory.
124
+ * Results are cached in memory to avoid repeated file I/O.
125
+ *
126
+ * @param options - Object containing the output directory path
127
+ * @returns Promise resolving to loaded artifacts including OpenAPI spec, manifest, and validators
128
+ */
106
129
  export declare function loadArtifacts(options: LoadArtifactsOptions): Promise<LoadedArtifacts>;
130
+ /**
131
+ * Clears the in-memory artifact cache.
132
+ * If an output directory is specified, only that entry is removed.
133
+ * Otherwise, the entire cache is cleared.
134
+ *
135
+ * @param outDir - Optional specific output directory to clear from cache
136
+ */
107
137
  export declare function clearArtifactCache(outDir?: string): void;
138
+ /**
139
+ * Returns statistics about the current artifact cache state.
140
+ * Useful for debugging and monitoring cache behavior.
141
+ *
142
+ * @returns Object containing cache size and array of cached keys
143
+ */
108
144
  export declare function getArtifactCacheStats(): {
109
145
  size: number;
110
146
  keys: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"loadArtifacts.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/loadArtifacts.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CAC5C;AAED,UAAU,QAAQ;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CA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,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAgE3F;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAOxD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAKxE"}
@@ -1,18 +1,32 @@
1
+ /**
2
+ * Cache schema definition for version 1 of the adorn-api cache format.
3
+ * Stores information about the compilation environment and input files for cache invalidation.
4
+ */
1
5
  export interface AdornCacheV1 {
6
+ /** Cache format version, always 1 */
2
7
  cacheVersion: 1;
8
+ /** Information about the generator that created this cache */
3
9
  generator: {
10
+ /** Generator name, always "adorn-api" */
4
11
  name: "adorn-api";
12
+ /** Version of the adorn-api package */
5
13
  version: string;
14
+ /** Version of TypeScript used during compilation */
6
15
  typescript: string;
7
16
  };
17
+ /** Information about the TypeScript project configuration */
8
18
  project: {
19
+ /** Absolute path to the TypeScript config file */
9
20
  tsconfigPath: string;
21
+ /** Map of config file paths to their modification times */
10
22
  configFiles: Record<string, number>;
23
+ /** Optional package lockfile information for dependency change detection */
11
24
  lockfile?: {
12
25
  path: string;
13
26
  mtimeMs: number;
14
27
  } | null;
15
28
  };
29
+ /** Map of input file paths to their modification times */
16
30
  inputs: Record<string, number>;
17
31
  }
18
32
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,CAAC,CAAC;IAChB,SAAS,EAAE;QACT,IAAI,EAAE,WAAW,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;KACrD,CAAC;IACF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,YAAY,EAAE,CAAC,CAAC;IAChB,8DAA8D;IAC9D,SAAS,EAAE;QACT,yCAAyC;QACzC,IAAI,EAAE,WAAW,CAAC;QAClB,uCAAuC;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,oDAAoD;QACpD,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,6DAA6D;IAC7D,OAAO,EAAE;QACP,kDAAkD;QAClD,YAAY,EAAE,MAAM,CAAC;QACrB,2DAA2D;QAC3D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,4EAA4E;QAC5E,QAAQ,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;KACrD,CAAC;IACF,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC"}
@@ -1,4 +1,10 @@
1
1
  import ts from "typescript";
2
+ /**
3
+ * Writes cache information to the output directory.
4
+ * Captures the current state of the compilation environment for future staleness checks.
5
+ *
6
+ * @param params - Object containing output directory, tsconfig path, TypeScript program, and adorn version
7
+ */
2
8
  export declare function writeCache(params: {
3
9
  outDir: string;
4
10
  tsconfigAbs: string;
@@ -1 +1 @@
1
- {"version":3,"file":"writeCache.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/writeCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,YAAY,CAAC;AAkB5B,wBAAgB,UAAU,CAAC,MAAM,EAAE;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAqCP"}
1
+ {"version":3,"file":"writeCache.d.ts","sourceRoot":"","sources":["../../../src/compiler/cache/writeCache.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,YAAY,CAAC;AAkB5B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAqCP"}
@@ -0,0 +1,75 @@
1
+ import { SchemaGraph } from "./graph/schemaGraph.js";
2
+ import type { Graph } from "./graph/types.js";
3
+ /**
4
+ * GEMS Compiler configuration
5
+ */
6
+ export interface GEMSConfig {
7
+ tsconfigPath: string;
8
+ deduplicate: boolean;
9
+ inline: boolean;
10
+ flatten: boolean;
11
+ verbose: boolean;
12
+ generateOpenAPI: boolean;
13
+ generateManifest: boolean;
14
+ outputPath?: string;
15
+ }
16
+ /**
17
+ * GEMS Compiler result
18
+ */
19
+ export interface GEMSResult {
20
+ graph: Graph;
21
+ schemaGraph: SchemaGraph;
22
+ openapi?: any;
23
+ manifest?: any;
24
+ stages: string[];
25
+ duration: number;
26
+ statistics: {
27
+ totalNodes: number;
28
+ totalEdges: number;
29
+ cyclesDetected: number;
30
+ stronglyConnectedComponents: number;
31
+ duplicatesRemoved: number;
32
+ nodesInlined: number;
33
+ nodesFlattened: number;
34
+ };
35
+ }
36
+ /**
37
+ * Create default GEMS compiler configuration
38
+ */
39
+ export declare function createGEMSConfig(tsconfigPath: string, partial?: Partial<GEMSConfig>): GEMSConfig;
40
+ /**
41
+ * Compile TypeScript sources using GEMS compiler
42
+ */
43
+ export declare function compileWithGEMS(config: GEMSConfig): Promise<GEMSResult>;
44
+ /**
45
+ * Quick compile with default configuration
46
+ */
47
+ export declare function quickCompile(tsconfigPath: string): Promise<GEMSResult>;
48
+ /**
49
+ * Analyze a TypeScript project without full compilation
50
+ */
51
+ export declare function analyzeProject(tsconfigPath: string): Promise<{
52
+ graph: Graph;
53
+ schemaGraph: SchemaGraph;
54
+ analysis: {
55
+ typeCount: number;
56
+ controllerCount: number;
57
+ operationCount: number;
58
+ avgComplexity: number;
59
+ potentialOptimizations: {
60
+ duplicateTypes: number;
61
+ inlineCandidates: number;
62
+ flattenCandidates: number;
63
+ };
64
+ };
65
+ }>;
66
+ /**
67
+ * Export GEMS compiler
68
+ */
69
+ export declare const GEMS: {
70
+ compile: typeof compileWithGEMS;
71
+ quickCompile: typeof quickCompile;
72
+ analyze: typeof analyzeProject;
73
+ createConfig: typeof createGEMSConfig;
74
+ };
75
+ //# sourceMappingURL=gems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gems.d.ts","sourceRoot":"","sources":["../../src/compiler/gems.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAA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AE;YACtB,cAAc,EAAE,MAAM,CAAC;YACvB,gBAAgB,EAAE,MAAM,CAAC;YACzB,iBAAiB,EAAE,MAAM,CAAC;SAC3B,CAAC;KACH,CAAC;CACH,CAAC,CA8CD;AAED;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;CAKhB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Generator module exports
3
+ */
4
+ export { generateOpenAPI, generateOpenAPIFromGraph, type OpenAPI31, type JsonSchema, type OpenAPIGeneratorOptions, DEFAULT_GENERATOR_OPTIONS } from './openapi.js';
5
+ export { generateManifest, generateManifestFromGraph } from './manifest.js';
6
+ export type { OperationObject, ParameterObject, RequestBodyObject, ResponseObject, MediaTypeObject } from './openapi.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/generator/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACnK,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC5E,YAAY,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Manifest generator using GEMS graph-based IR.
3
+ * Generates runtime binding metadata from graph structure.
4
+ */
5
+ import type { Graph } from "../graph/types.js";
6
+ import type { ManifestV1 } from "../manifest/format.js";
7
+ /**
8
+ * Manifest generation options
9
+ */
10
+ export interface ManifestGeneratorOptions {
11
+ validationMode: "none" | "ajv-runtime" | "precompiled";
12
+ version: string;
13
+ typescriptVersion: string;
14
+ }
15
+ /**
16
+ * Generate manifest from GEMS graph
17
+ */
18
+ export declare function generateManifestFromGraph(graph: Graph, options: ManifestGeneratorOptions): ManifestV1;
19
+ /**
20
+ * Generate manifest from GEMS compilation result
21
+ */
22
+ export declare function generateManifest(graph: Graph, validationMode?: "none" | "ajv-runtime" | "precompiled", version?: string, typescriptVersion?: string): ManifestV1;
23
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/compiler/generator/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,KAAK,EAKN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,GAAG,aAAa,GAAG,aAAa,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,wBAAwB,GAChC,UAAU,CA0BZ;AAsRD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,cAAc,GAAE,MAAM,GAAG,aAAa,GAAG,aAA6B,EACtE,OAAO,GAAE,MAAgB,EACzB,iBAAiB,GAAE,MAAgB,GAClC,UAAU,CAMZ"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * OpenAPI 3.1 generator using GEMS graph-based IR.
3
+ * Generates optimized schemas from the graph structure.
4
+ */
5
+ import type { Graph } from "../graph/types.js";
6
+ import type { SchemaGraph } from "../graph/schemaGraph.js";
7
+ /**
8
+ * OpenAPI 3.1 specification
9
+ */
10
+ export interface OpenAPI31 {
11
+ openapi: "3.1.0";
12
+ info: {
13
+ title: string;
14
+ version: string;
15
+ description?: string;
16
+ };
17
+ servers?: Array<{
18
+ url: string;
19
+ description?: string;
20
+ }>;
21
+ components: {
22
+ schemas: Record<string, JsonSchema>;
23
+ };
24
+ paths: Record<string, Record<string, OperationObject>>;
25
+ }
26
+ /**
27
+ * OpenAPI operation object
28
+ */
29
+ export interface OperationObject {
30
+ operationId: string;
31
+ summary?: string;
32
+ description?: string;
33
+ parameters?: ParameterObject[];
34
+ requestBody?: RequestBodyObject;
35
+ responses: Record<string, ResponseObject>;
36
+ tags?: string[];
37
+ }
38
+ /**
39
+ * OpenAPI parameter object
40
+ */
41
+ export interface ParameterObject {
42
+ name: string;
43
+ in: "path" | "query" | "header" | "cookie";
44
+ required: boolean;
45
+ schema: JsonSchema;
46
+ description?: string;
47
+ }
48
+ /**
49
+ * OpenAPI request body object
50
+ */
51
+ export interface RequestBodyObject {
52
+ description?: string;
53
+ required: boolean;
54
+ content: Record<string, MediaTypeObject>;
55
+ }
56
+ /**
57
+ * OpenAPI response object
58
+ */
59
+ export interface ResponseObject {
60
+ description: string;
61
+ content?: Record<string, MediaTypeObject>;
62
+ }
63
+ /**
64
+ * OpenAPI media type object
65
+ */
66
+ export interface MediaTypeObject {
67
+ schema: JsonSchema;
68
+ examples?: Record<string, unknown>;
69
+ }
70
+ /**
71
+ * JSON Schema (subset for OpenAPI 3.1)
72
+ */
73
+ export interface JsonSchema {
74
+ type?: string | string[];
75
+ properties?: Record<string, JsonSchema>;
76
+ required?: string[];
77
+ items?: JsonSchema;
78
+ $ref?: string;
79
+ description?: string;
80
+ enum?: (string | number | boolean)[];
81
+ nullable?: boolean;
82
+ default?: unknown;
83
+ anyOf?: JsonSchema[];
84
+ oneOf?: JsonSchema[];
85
+ allOf?: JsonSchema[];
86
+ additionalProperties?: boolean | JsonSchema;
87
+ format?: string;
88
+ minimum?: number;
89
+ maximum?: number;
90
+ minLength?: number;
91
+ maxLength?: number;
92
+ minItems?: number;
93
+ maxItems?: number;
94
+ }
95
+ /**
96
+ * OpenAPI generator options
97
+ */
98
+ export interface OpenAPIGeneratorOptions {
99
+ title?: string;
100
+ version?: string;
101
+ description?: string;
102
+ servers?: string[];
103
+ inlineAll?: boolean;
104
+ excludeUnusedSchemas?: boolean;
105
+ }
106
+ /**
107
+ * Default generator options
108
+ */
109
+ export declare const DEFAULT_GENERATOR_OPTIONS: OpenAPIGeneratorOptions;
110
+ /**
111
+ * Generate OpenAPI 3.1 specification from GEMS graph
112
+ */
113
+ export declare function generateOpenAPIFromGraph(graph: Graph, schemaGraph: SchemaGraph, options?: Partial<OpenAPIGeneratorOptions>): OpenAPI31;
114
+ /**
115
+ * Generate OpenAPI spec from GEMS compilation result
116
+ */
117
+ export declare function generateOpenAPI(graph: Graph, schemaGraph: SchemaGraph, options?: Partial<OpenAPIGeneratorOptions>): OpenAPI31;
118
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/compiler/generator/openapi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,KAAK,EAON,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;KACrC,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAA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}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Graph builder that converts CST/AST to graph-based IR.
3
+ * Creates typed nodes and establishes relationships between them.
4
+ */
5
+ import ts from "typescript";
6
+ import type { Graph } from "./types.js";
7
+ /**
8
+ * Builder context for constructing the graph
9
+ */
10
+ export interface GraphBuilderContext {
11
+ graph: Graph;
12
+ checker: ts.TypeChecker;
13
+ sourceFiles: ts.SourceFile[];
14
+ nodeMap: Map<ts.Node, string>;
15
+ }
16
+ /**
17
+ * Create a new graph builder context
18
+ */
19
+ export declare function createGraphBuilderContext(checker: ts.TypeChecker, sourceFiles: ts.SourceFile[], tsVersion?: string): GraphBuilderContext;
20
+ /**
21
+ * Build the graph from source files
22
+ */
23
+ export declare function buildGraph(context: GraphBuilderContext): Graph;
24
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/compiler/graph/builder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EACV,KAAK,EAON,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACxB,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC;IAC7B,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,EAC5B,SAAS,CAAC,EAAE,MAAM,GACjB,mBAAmB,CAOrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,KAAK,CAoB9D"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Graph-based IR for compiler
3
+ */
4
+ export * from './types.js';
5
+ export * from './builder.js';
6
+ export * from './schemaGraph.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/graph/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Schema graph operations for advanced schema management.
3
+ * Provides graph algorithms for schema optimization and analysis.
4
+ */
5
+ import type { Graph, NodeId } from "./types.js";
6
+ /**
7
+ * Schema-specific graph with advanced operations
8
+ */
9
+ export declare class SchemaGraph {
10
+ private graph;
11
+ private adjacency;
12
+ private reverseAdjacency;
13
+ constructor(graph: Graph);
14
+ /**
15
+ * Build adjacency lists for faster traversal
16
+ */
17
+ private buildAdjacencyLists;
18
+ /**
19
+ * Find all nodes that use a given type
20
+ */
21
+ findTypeUsages(typeId: NodeId): NodeId[];
22
+ /**
23
+ * Detect cycles in the dependency graph
24
+ */
25
+ detectCycles(): CycleReport;
26
+ /**
27
+ * Depth-first search for cycle detection
28
+ */
29
+ private detectCyclesDFS;
30
+ /**
31
+ * Find strongly connected components using Tarjan's algorithm
32
+ */
33
+ findStronglyConnectedComponents(): NodeId[][];
34
+ /**
35
+ * Topological sort of the graph
36
+ */
37
+ topologicalSort(): NodeId[];
38
+ /**
39
+ * Find nodes reachable from a given start node
40
+ */
41
+ findReachable(startNodeId: NodeId): Set<NodeId>;
42
+ /**
43
+ * Find shortest path between two nodes (BFS)
44
+ */
45
+ findShortestPath(fromId: NodeId, toId: NodeId): NodeId[] | null;
46
+ /**
47
+ * Reconstruct path from previous map
48
+ */
49
+ private reconstructPath;
50
+ /**
51
+ * Get nodes grouped by their depth from roots
52
+ */
53
+ getDepthGroups(): Map<number, NodeId[]>;
54
+ /**
55
+ * Get the underlying graph
56
+ */
57
+ getGraph(): Graph;
58
+ }
59
+ /**
60
+ * Cycle detection report
61
+ */
62
+ export interface CycleReport {
63
+ hasCycles: boolean;
64
+ cycles: NodeId[][];
65
+ cycleCount: number;
66
+ }
67
+ //# sourceMappingURL=schemaGraph.d.ts.map