@vfarcic/dot-ai 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +1 -0
  2. package/dist/core/ai-provider.interface.d.ts +12 -8
  3. package/dist/core/ai-provider.interface.d.ts.map +1 -1
  4. package/dist/core/artifacthub.d.ts +1 -1
  5. package/dist/core/artifacthub.d.ts.map +1 -1
  6. package/dist/core/base-vector-service.d.ts +22 -9
  7. package/dist/core/base-vector-service.d.ts.map +1 -1
  8. package/dist/core/base-vector-service.js +106 -37
  9. package/dist/core/capabilities.d.ts.map +1 -1
  10. package/dist/core/capabilities.js +5 -2
  11. package/dist/core/capability-operations.d.ts +55 -7
  12. package/dist/core/capability-operations.d.ts.map +1 -1
  13. package/dist/core/capability-operations.js +1 -3
  14. package/dist/core/capability-scan-workflow.d.ts +64 -8
  15. package/dist/core/capability-scan-workflow.d.ts.map +1 -1
  16. package/dist/core/capability-scan-workflow.js +14 -13
  17. package/dist/core/capability-tools.d.ts +1 -1
  18. package/dist/core/capability-tools.d.ts.map +1 -1
  19. package/dist/core/capability-tools.js +1 -1
  20. package/dist/core/capability-vector-service.d.ts +3 -4
  21. package/dist/core/capability-vector-service.d.ts.map +1 -1
  22. package/dist/core/capability-vector-service.js +2 -2
  23. package/dist/core/command-executor.d.ts +3 -4
  24. package/dist/core/command-executor.d.ts.map +1 -1
  25. package/dist/core/command-executor.js +8 -4
  26. package/dist/core/crd-availability.d.ts +3 -5
  27. package/dist/core/crd-availability.d.ts.map +1 -1
  28. package/dist/core/crd-availability.js +8 -18
  29. package/dist/core/deploy-operation.d.ts +6 -5
  30. package/dist/core/deploy-operation.d.ts.map +1 -1
  31. package/dist/core/deploy-operation.js +16 -10
  32. package/dist/core/discovery.d.ts +6 -14
  33. package/dist/core/discovery.d.ts.map +1 -1
  34. package/dist/core/discovery.js +35 -51
  35. package/dist/core/embedding-service.d.ts.map +1 -1
  36. package/dist/core/embedding-service.js +1 -1
  37. package/dist/core/error-handling.d.ts +13 -13
  38. package/dist/core/error-handling.d.ts.map +1 -1
  39. package/dist/core/error-handling.js +2 -3
  40. package/dist/core/generic-session-manager.d.ts +2 -2
  41. package/dist/core/generic-session-manager.d.ts.map +1 -1
  42. package/dist/core/helm-types.d.ts +5 -5
  43. package/dist/core/helm-types.d.ts.map +1 -1
  44. package/dist/core/index.d.ts +4 -11
  45. package/dist/core/index.d.ts.map +1 -1
  46. package/dist/core/index.js +8 -14
  47. package/dist/core/knowledge-types.d.ts +114 -0
  48. package/dist/core/knowledge-types.d.ts.map +1 -0
  49. package/dist/core/knowledge-types.js +10 -0
  50. package/dist/core/memory.d.ts +12 -12
  51. package/dist/core/memory.d.ts.map +1 -1
  52. package/dist/core/mermaid-tools.d.ts +24 -1
  53. package/dist/core/mermaid-tools.d.ts.map +1 -1
  54. package/dist/core/mermaid-tools.js +10 -8
  55. package/dist/core/packaging.d.ts +23 -1
  56. package/dist/core/packaging.d.ts.map +1 -1
  57. package/dist/core/pattern-operations.d.ts +32 -9
  58. package/dist/core/pattern-operations.d.ts.map +1 -1
  59. package/dist/core/pattern-operations.js +17 -22
  60. package/dist/core/pattern-vector-service.d.ts +3 -4
  61. package/dist/core/pattern-vector-service.d.ts.map +1 -1
  62. package/dist/core/pattern-vector-service.js +2 -2
  63. package/dist/core/platform-utils.d.ts +2 -2
  64. package/dist/core/platform-utils.d.ts.map +1 -1
  65. package/dist/core/plugin-manager.d.ts +6 -2
  66. package/dist/core/plugin-manager.d.ts.map +1 -1
  67. package/dist/core/plugin-manager.js +9 -16
  68. package/dist/core/plugin-registry.d.ts +59 -0
  69. package/dist/core/plugin-registry.d.ts.map +1 -0
  70. package/dist/core/plugin-registry.js +80 -0
  71. package/dist/core/policy-operations.d.ts +101 -21
  72. package/dist/core/policy-operations.d.ts.map +1 -1
  73. package/dist/core/policy-operations.js +45 -47
  74. package/dist/core/policy-vector-service.d.ts +3 -4
  75. package/dist/core/policy-vector-service.d.ts.map +1 -1
  76. package/dist/core/policy-vector-service.js +2 -2
  77. package/dist/core/providers/host-provider.d.ts +1 -1
  78. package/dist/core/providers/host-provider.d.ts.map +1 -1
  79. package/dist/core/providers/host-provider.js +2 -2
  80. package/dist/core/providers/provider-debug-utils.d.ts +2 -2
  81. package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
  82. package/dist/core/providers/tool-utils.d.ts +10 -2
  83. package/dist/core/providers/tool-utils.d.ts.map +1 -1
  84. package/dist/core/providers/tool-utils.js +2 -2
  85. package/dist/core/providers/vercel-provider.d.ts.map +1 -1
  86. package/dist/core/providers/vercel-provider.js +29 -23
  87. package/dist/core/resource-tools.d.ts +29 -1
  88. package/dist/core/resource-tools.d.ts.map +1 -1
  89. package/dist/core/resource-vector-service.d.ts +3 -4
  90. package/dist/core/resource-vector-service.d.ts.map +1 -1
  91. package/dist/core/resource-vector-service.js +2 -2
  92. package/dist/core/schema.d.ts +15 -14
  93. package/dist/core/schema.d.ts.map +1 -1
  94. package/dist/core/schema.js +32 -34
  95. package/dist/core/shared-prompt-loader.d.ts +1 -1
  96. package/dist/core/shared-prompt-loader.d.ts.map +1 -1
  97. package/dist/core/solution-cr.js +1 -1
  98. package/dist/core/solution-utils.d.ts +22 -3
  99. package/dist/core/solution-utils.d.ts.map +1 -1
  100. package/dist/core/solution-utils.js +1 -1
  101. package/dist/core/telemetry/client.d.ts +0 -6
  102. package/dist/core/telemetry/client.d.ts.map +1 -1
  103. package/dist/core/telemetry/client.js +6 -17
  104. package/dist/core/telemetry/config.js +1 -1
  105. package/dist/core/telemetry/index.d.ts +1 -1
  106. package/dist/core/telemetry/index.d.ts.map +1 -1
  107. package/dist/core/telemetry/index.js +1 -2
  108. package/dist/core/tracing/tool-tracing.d.ts +1 -1
  109. package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
  110. package/dist/core/unified-creation-session.d.ts +15 -8
  111. package/dist/core/unified-creation-session.d.ts.map +1 -1
  112. package/dist/core/unified-creation-session.js +19 -19
  113. package/dist/core/unified-creation-types.d.ts +2 -2
  114. package/dist/core/unified-creation-types.d.ts.map +1 -1
  115. package/dist/core/visualization.d.ts +1 -1
  116. package/dist/core/visualization.d.ts.map +1 -1
  117. package/dist/core/workflow.d.ts +8 -5
  118. package/dist/core/workflow.d.ts.map +1 -1
  119. package/dist/evaluation/dataset-analyzer.d.ts +13 -7
  120. package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
  121. package/dist/evaluation/dataset-analyzer.js +1 -1
  122. package/dist/evaluation/datasets/loader.d.ts +2 -2
  123. package/dist/evaluation/datasets/loader.d.ts.map +1 -1
  124. package/dist/evaluation/eval-runner.js +7 -5
  125. package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
  126. package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
  127. package/dist/evaluation/evaluators/base-comparative.js +4 -3
  128. package/dist/evaluation/evaluators/base.d.ts +5 -5
  129. package/dist/evaluation/evaluators/base.d.ts.map +1 -1
  130. package/dist/evaluation/evaluators/capability-comparative.js +1 -1
  131. package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
  132. package/dist/interfaces/mcp.d.ts.map +1 -1
  133. package/dist/interfaces/mcp.js +26 -15
  134. package/dist/interfaces/openapi-generator.d.ts +116 -12
  135. package/dist/interfaces/openapi-generator.d.ts.map +1 -1
  136. package/dist/interfaces/openapi-generator.js +490 -199
  137. package/dist/interfaces/rest-api.d.ts +28 -6
  138. package/dist/interfaces/rest-api.d.ts.map +1 -1
  139. package/dist/interfaces/rest-api.js +436 -245
  140. package/dist/interfaces/rest-registry.d.ts +4 -4
  141. package/dist/interfaces/rest-registry.d.ts.map +1 -1
  142. package/dist/interfaces/rest-registry.js +6 -5
  143. package/dist/interfaces/rest-route-registry.d.ts +165 -0
  144. package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
  145. package/dist/interfaces/rest-route-registry.js +230 -0
  146. package/dist/interfaces/routes/index.d.ts +22 -0
  147. package/dist/interfaces/routes/index.d.ts.map +1 -0
  148. package/dist/interfaces/routes/index.js +347 -0
  149. package/dist/interfaces/schemas/common.d.ts +177 -0
  150. package/dist/interfaces/schemas/common.d.ts.map +1 -0
  151. package/dist/interfaces/schemas/common.js +102 -0
  152. package/dist/interfaces/schemas/events.d.ts +131 -0
  153. package/dist/interfaces/schemas/events.d.ts.map +1 -0
  154. package/dist/interfaces/schemas/events.js +66 -0
  155. package/dist/interfaces/schemas/index.d.ts +21 -0
  156. package/dist/interfaces/schemas/index.d.ts.map +1 -0
  157. package/dist/interfaces/schemas/index.js +138 -0
  158. package/dist/interfaces/schemas/knowledge.d.ts +210 -0
  159. package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
  160. package/dist/interfaces/schemas/knowledge.js +117 -0
  161. package/dist/interfaces/schemas/logs.d.ts +82 -0
  162. package/dist/interfaces/schemas/logs.d.ts.map +1 -0
  163. package/dist/interfaces/schemas/logs.js +46 -0
  164. package/dist/interfaces/schemas/prompts.d.ts +191 -0
  165. package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
  166. package/dist/interfaces/schemas/prompts.js +91 -0
  167. package/dist/interfaces/schemas/resources.d.ts +378 -0
  168. package/dist/interfaces/schemas/resources.d.ts.map +1 -0
  169. package/dist/interfaces/schemas/resources.js +173 -0
  170. package/dist/interfaces/schemas/sessions.d.ts +90 -0
  171. package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
  172. package/dist/interfaces/schemas/sessions.js +56 -0
  173. package/dist/interfaces/schemas/tools.d.ts +194 -0
  174. package/dist/interfaces/schemas/tools.d.ts.map +1 -0
  175. package/dist/interfaces/schemas/tools.js +101 -0
  176. package/dist/interfaces/schemas/visualization.d.ts +373 -0
  177. package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
  178. package/dist/interfaces/schemas/visualization.js +134 -0
  179. package/dist/mcp/server.js +5 -4
  180. package/dist/tools/answer-question.d.ts +1 -1
  181. package/dist/tools/answer-question.d.ts.map +1 -1
  182. package/dist/tools/answer-question.js +9 -8
  183. package/dist/tools/deploy-manifests.d.ts +4 -2
  184. package/dist/tools/deploy-manifests.d.ts.map +1 -1
  185. package/dist/tools/deploy-manifests.js +10 -6
  186. package/dist/tools/generate-manifests.d.ts.map +1 -1
  187. package/dist/tools/generate-manifests.js +28 -20
  188. package/dist/tools/index.d.ts +1 -0
  189. package/dist/tools/index.d.ts.map +1 -1
  190. package/dist/tools/index.js +6 -1
  191. package/dist/tools/manage-knowledge.d.ts +77 -0
  192. package/dist/tools/manage-knowledge.d.ts.map +1 -0
  193. package/dist/tools/manage-knowledge.js +573 -0
  194. package/dist/tools/operate-analysis.d.ts +31 -2
  195. package/dist/tools/operate-analysis.d.ts.map +1 -1
  196. package/dist/tools/operate-execution.d.ts +2 -3
  197. package/dist/tools/operate-execution.d.ts.map +1 -1
  198. package/dist/tools/operate-execution.js +7 -7
  199. package/dist/tools/operate.d.ts +7 -2
  200. package/dist/tools/operate.d.ts.map +1 -1
  201. package/dist/tools/operate.js +2 -2
  202. package/dist/tools/organizational-data.d.ts +30 -4
  203. package/dist/tools/organizational-data.d.ts.map +1 -1
  204. package/dist/tools/organizational-data.js +24 -19
  205. package/dist/tools/project-setup/discovery.d.ts.map +1 -1
  206. package/dist/tools/project-setup/generate-scope.d.ts +1 -1
  207. package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
  208. package/dist/tools/project-setup/types.d.ts +1 -0
  209. package/dist/tools/project-setup/types.d.ts.map +1 -1
  210. package/dist/tools/prompts.d.ts +28 -2
  211. package/dist/tools/prompts.d.ts.map +1 -1
  212. package/dist/tools/query.d.ts +17 -3
  213. package/dist/tools/query.d.ts.map +1 -1
  214. package/dist/tools/query.js +1 -7
  215. package/dist/tools/recommend.d.ts +24 -6
  216. package/dist/tools/recommend.d.ts.map +1 -1
  217. package/dist/tools/recommend.js +18 -15
  218. package/dist/tools/remediate.d.ts +12 -3
  219. package/dist/tools/remediate.d.ts.map +1 -1
  220. package/dist/tools/remediate.js +22 -14
  221. package/dist/tools/version.d.ts +19 -5
  222. package/dist/tools/version.d.ts.map +1 -1
  223. package/dist/tools/version.js +106 -54
  224. package/package.json +11 -5
  225. package/prompts/knowledge-ask.md +29 -0
  226. package/dist/core/vector-db-service.d.ts +0 -108
  227. package/dist/core/vector-db-service.d.ts.map +0 -1
  228. package/dist/core/vector-db-service.js +0 -647
@@ -13,7 +13,7 @@ export interface ToolMetadata {
13
13
  name: string;
14
14
  description: string;
15
15
  inputSchema: Record<string, z.ZodSchema>;
16
- handler: (...args: any[]) => Promise<any>;
16
+ handler: (...args: unknown[]) => Promise<unknown>;
17
17
  category?: string;
18
18
  tags?: string[];
19
19
  }
@@ -22,12 +22,12 @@ export interface ToolMetadata {
22
22
  */
23
23
  export interface JsonSchema {
24
24
  type?: string;
25
- properties?: Record<string, any>;
25
+ properties?: Record<string, unknown>;
26
26
  required?: string[];
27
27
  description?: string;
28
28
  $ref?: string;
29
- definitions?: Record<string, any>;
30
- [key: string]: any;
29
+ definitions?: Record<string, unknown>;
30
+ [key: string]: unknown;
31
31
  }
32
32
  /**
33
33
  * Tool information exposed via discovery endpoint
@@ -1 +1 @@
1
- {"version":3,"file":"rest-registry.d.ts","sourceRoot":"","sources":["../../src/interfaces/rest-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,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KACnB;CAQF"}
@@ -92,20 +92,21 @@ class RestToolRegistry {
92
92
  // Create a Zod object schema from the individual field schemas
93
93
  const zodObjectSchema = zod_1.z.object(zodSchemas);
94
94
  // Convert to JSON Schema using OpenAPI3 conventions, inlining all subschemas
95
- // Type cast needed for Zod v4 compatibility with zod-to-json-schema
95
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Zod type compatibility workaround
96
96
  const jsonSchema = (0, zod_to_json_schema_1.zodToJsonSchema)(zodObjectSchema, {
97
97
  name: `${toolName}Request`,
98
98
  target: 'openApi3',
99
- // Place definitions where OpenAPI expects them
99
+ // Place definitions where OpenAPI expects them
100
100
  definitionPath: 'components.schemas',
101
101
  $refStrategy: 'none' // inline sub-schemas to avoid unresolved refs
102
102
  });
103
103
  let result = jsonSchema;
104
104
  // Extract the actual schema from components.schemas if it's using $ref
105
- if (result.$ref && result['components.schemas']) {
105
+ const jsonSchemaWithComponents = jsonSchema;
106
+ if (result.$ref && jsonSchemaWithComponents['components.schemas']) {
106
107
  const refKey = result.$ref.replace('#/components.schemas/', '');
107
- if (result['components.schemas'][refKey]) {
108
- result = result['components.schemas'][refKey];
108
+ if (jsonSchemaWithComponents['components.schemas'][refKey]) {
109
+ result = jsonSchemaWithComponents['components.schemas'][refKey];
109
110
  }
110
111
  }
111
112
  this.schemaCache.set(toolName, result);
@@ -0,0 +1,165 @@
1
+ /**
2
+ * REST API Route Registry
3
+ *
4
+ * Central registry for all REST API routes with their metadata and schemas.
5
+ * Provides single source of truth for routing, OpenAPI generation, and fixture validation.
6
+ *
7
+ * PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
8
+ */
9
+ import { z } from 'zod';
10
+ import { Logger } from '../core/error-handling';
11
+ /**
12
+ * HTTP methods supported by the REST API
13
+ */
14
+ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
15
+ /**
16
+ * Route handler function type
17
+ */
18
+ export type RouteHandler<TParams, TQuery, TBody, TResponse> = (context: {
19
+ params: TParams;
20
+ query: TQuery;
21
+ body: TBody;
22
+ requestId: string;
23
+ }) => Promise<TResponse>;
24
+ /**
25
+ * Route definition with full metadata for routing, documentation, and validation
26
+ */
27
+ export interface RouteDefinition<TParams = unknown, TQuery = unknown, TBody = unknown, TResponse = unknown> {
28
+ /** Route path with optional parameters (e.g., "/api/v1/visualize/:sessionId") */
29
+ path: string;
30
+ /** HTTP method */
31
+ method: HttpMethod;
32
+ /** Human-readable description for OpenAPI documentation */
33
+ description: string;
34
+ /** OpenAPI tags for grouping endpoints */
35
+ tags: string[];
36
+ /** Zod schema for path parameters */
37
+ params?: z.ZodSchema<TParams>;
38
+ /** Zod schema for query string parameters */
39
+ query?: z.ZodSchema<TQuery>;
40
+ /** Zod schema for request body */
41
+ body?: z.ZodSchema<TBody>;
42
+ /** Zod schema for successful response */
43
+ response: z.ZodSchema<TResponse>;
44
+ /** Zod schemas for error responses by HTTP status code */
45
+ errorResponses?: Record<number, z.ZodSchema<unknown>>;
46
+ /** Route handler function (optional - can be set during migration) */
47
+ handler?: RouteHandler<TParams, TQuery, TBody, TResponse>;
48
+ }
49
+ /**
50
+ * Result of matching a request path against registered routes
51
+ */
52
+ export interface RouteMatch {
53
+ /** The matched route definition */
54
+ route: RouteDefinition<unknown, unknown, unknown, unknown>;
55
+ /** Extracted path parameters */
56
+ params: Record<string, string>;
57
+ }
58
+ /**
59
+ * Registry for managing REST API routes
60
+ *
61
+ * Provides:
62
+ * - Route registration with Zod schemas
63
+ * - Path matching with parameter extraction
64
+ * - Route discovery for OpenAPI generation
65
+ * - Schema access for fixture validation
66
+ */
67
+ export declare class RestRouteRegistry {
68
+ private routes;
69
+ private logger;
70
+ constructor(logger: Logger);
71
+ /**
72
+ * Generate a unique key for a route based on method and path pattern
73
+ */
74
+ private getRouteKey;
75
+ /**
76
+ * Compile a path pattern into a regex for matching
77
+ *
78
+ * Converts path parameters like :sessionId into capture groups
79
+ * Example: "/api/v1/visualize/:sessionId" -> /^\/api\/v1\/visualize\/([^/]+)$/
80
+ */
81
+ private compilePath;
82
+ /**
83
+ * Register a route in the registry
84
+ *
85
+ * @param route - Route definition with path, method, schemas, and metadata
86
+ * @throws Error if route with same method and path is already registered
87
+ */
88
+ register<TParams, TQuery, TBody, TResponse>(route: RouteDefinition<TParams, TQuery, TBody, TResponse>): void;
89
+ /**
90
+ * Find a matching route for the given method and path
91
+ *
92
+ * Checks routes in order:
93
+ * 1. Exact matches (no parameters)
94
+ * 2. Parameterized routes (extracts parameter values)
95
+ *
96
+ * @param method - HTTP method
97
+ * @param path - Request path to match
98
+ * @returns RouteMatch with route and extracted params, or null if no match
99
+ */
100
+ findRoute(method: string, path: string): RouteMatch | null;
101
+ /**
102
+ * Find allowed methods for a path (ignoring method)
103
+ *
104
+ * Used to return METHOD_NOT_ALLOWED with proper Allow header
105
+ * when a path matches but method doesn't.
106
+ *
107
+ * @param path - Request path to match
108
+ * @returns Array of allowed methods, or empty array if path doesn't match any route
109
+ */
110
+ findAllowedMethods(path: string): HttpMethod[];
111
+ /**
112
+ * Get all registered route definitions
113
+ *
114
+ * Used by OpenAPI generator to document all endpoints
115
+ */
116
+ getAllRoutes(): RouteDefinition<unknown, unknown, unknown, unknown>[];
117
+ /**
118
+ * Get the response schema for a specific route
119
+ *
120
+ * Used by fixture validator to validate fixture data
121
+ *
122
+ * @param method - HTTP method
123
+ * @param pathPattern - Route path pattern (e.g., "/api/v1/visualize/:sessionId")
124
+ * @returns Zod schema for the response, or null if route not found
125
+ */
126
+ getResponseSchema(method: string, pathPattern: string): z.ZodSchema<unknown> | null;
127
+ /**
128
+ * Get the error response schema for a specific route and status code
129
+ *
130
+ * @param method - HTTP method
131
+ * @param pathPattern - Route path pattern
132
+ * @param statusCode - HTTP status code
133
+ * @returns Zod schema for the error response, or null if not defined
134
+ */
135
+ getErrorResponseSchema(method: string, pathPattern: string, statusCode: number): z.ZodSchema<unknown> | null;
136
+ /**
137
+ * Check if a route is registered
138
+ */
139
+ hasRoute(method: string, pathPattern: string): boolean;
140
+ /**
141
+ * Get the number of registered routes
142
+ */
143
+ getRouteCount(): number;
144
+ /**
145
+ * Get all unique tags from registered routes
146
+ */
147
+ getTags(): string[];
148
+ /**
149
+ * Get routes filtered by tag
150
+ */
151
+ getRoutesByTag(tag: string): RouteDefinition<unknown, unknown, unknown, unknown>[];
152
+ /**
153
+ * Clear all registered routes
154
+ */
155
+ clear(): void;
156
+ /**
157
+ * Get registry statistics
158
+ */
159
+ getStats(): {
160
+ totalRoutes: number;
161
+ tags: string[];
162
+ routesByMethod: Record<HttpMethod, number>;
163
+ };
164
+ }
165
+ //# sourceMappingURL=rest-route-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest-route-registry.d.ts","sourceRoot":"","sources":["../../src/interfaces/rest-route-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,IAAI,CAAC,OAAO,EAAE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,eAAe,CAC9B,OAAO,GAAG,OAAO,EACjB,MAAM,GAAG,OAAO,EAChB,KAAK,GAAG,OAAO,EACf,SAAS,GAAG,OAAO;IAEnB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,2DAA2D;IAC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;OAUG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAsC1D;;;;;;;;OAQG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE;IAa9C;;;;OAIG;IACH,YAAY,IAAI,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;IAIrE;;;;;;;;OAQG;IACH,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI;IAM9B;;;;;;;OAOG;IACH,sBAAsB,CACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI;IAM9B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAKtD;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,OAAO,IAAI,MAAM,EAAE;IAUnB;;OAEG;IACH,cAAc,CACZ,GAAG,EAAE,MAAM,GACV,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;IAIxD;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,QAAQ,IAAI;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;KAC5C;CAkBF"}
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ /**
3
+ * REST API Route Registry
4
+ *
5
+ * Central registry for all REST API routes with their metadata and schemas.
6
+ * Provides single source of truth for routing, OpenAPI generation, and fixture validation.
7
+ *
8
+ * PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.RestRouteRegistry = void 0;
12
+ /**
13
+ * Registry for managing REST API routes
14
+ *
15
+ * Provides:
16
+ * - Route registration with Zod schemas
17
+ * - Path matching with parameter extraction
18
+ * - Route discovery for OpenAPI generation
19
+ * - Schema access for fixture validation
20
+ */
21
+ class RestRouteRegistry {
22
+ routes = new Map();
23
+ logger;
24
+ constructor(logger) {
25
+ this.logger = logger;
26
+ }
27
+ /**
28
+ * Generate a unique key for a route based on method and path pattern
29
+ */
30
+ getRouteKey(method, path) {
31
+ return `${method}:${path}`;
32
+ }
33
+ /**
34
+ * Compile a path pattern into a regex for matching
35
+ *
36
+ * Converts path parameters like :sessionId into capture groups
37
+ * Example: "/api/v1/visualize/:sessionId" -> /^\/api\/v1\/visualize\/([^/]+)$/
38
+ */
39
+ compilePath(path) {
40
+ const paramNames = [];
41
+ // Escape special regex characters except for parameter placeholders
42
+ const regexPattern = path
43
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // Escape special chars
44
+ .replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, (_match, paramName) => {
45
+ paramNames.push(paramName);
46
+ return '([^/]+)'; // Capture group for parameter value
47
+ });
48
+ const regex = new RegExp(`^${regexPattern}$`);
49
+ return { regex, paramNames };
50
+ }
51
+ /**
52
+ * Register a route in the registry
53
+ *
54
+ * @param route - Route definition with path, method, schemas, and metadata
55
+ * @throws Error if route with same method and path is already registered
56
+ */
57
+ register(route) {
58
+ const key = this.getRouteKey(route.method, route.path);
59
+ if (this.routes.has(key)) {
60
+ throw new Error(`Route already registered: ${route.method} ${route.path}`);
61
+ }
62
+ const { regex, paramNames } = this.compilePath(route.path);
63
+ this.routes.set(key, {
64
+ definition: route,
65
+ regex,
66
+ paramNames,
67
+ });
68
+ this.logger.debug('Route registered in REST route registry', {
69
+ method: route.method,
70
+ path: route.path,
71
+ tags: route.tags,
72
+ paramNames,
73
+ });
74
+ }
75
+ /**
76
+ * Find a matching route for the given method and path
77
+ *
78
+ * Checks routes in order:
79
+ * 1. Exact matches (no parameters)
80
+ * 2. Parameterized routes (extracts parameter values)
81
+ *
82
+ * @param method - HTTP method
83
+ * @param path - Request path to match
84
+ * @returns RouteMatch with route and extracted params, or null if no match
85
+ */
86
+ findRoute(method, path) {
87
+ const upperMethod = method.toUpperCase();
88
+ // First pass: try exact match (more efficient for non-parameterized routes)
89
+ const exactKey = this.getRouteKey(upperMethod, path);
90
+ const exactMatch = this.routes.get(exactKey);
91
+ if (exactMatch) {
92
+ return {
93
+ route: exactMatch.definition,
94
+ params: {},
95
+ };
96
+ }
97
+ // Second pass: try parameterized routes
98
+ for (const [key, compiled] of this.routes) {
99
+ // Skip if method doesn't match
100
+ if (!key.startsWith(`${upperMethod}:`)) {
101
+ continue;
102
+ }
103
+ const match = compiled.regex.exec(path);
104
+ if (match) {
105
+ // Extract parameter values from capture groups
106
+ const params = {};
107
+ compiled.paramNames.forEach((name, index) => {
108
+ params[name] = match[index + 1]; // +1 because match[0] is full match
109
+ });
110
+ return {
111
+ route: compiled.definition,
112
+ params,
113
+ };
114
+ }
115
+ }
116
+ return null;
117
+ }
118
+ /**
119
+ * Find allowed methods for a path (ignoring method)
120
+ *
121
+ * Used to return METHOD_NOT_ALLOWED with proper Allow header
122
+ * when a path matches but method doesn't.
123
+ *
124
+ * @param path - Request path to match
125
+ * @returns Array of allowed methods, or empty array if path doesn't match any route
126
+ */
127
+ findAllowedMethods(path) {
128
+ const methods = [];
129
+ for (const compiled of this.routes.values()) {
130
+ const match = compiled.regex.exec(path);
131
+ if (match) {
132
+ methods.push(compiled.definition.method);
133
+ }
134
+ }
135
+ return methods;
136
+ }
137
+ /**
138
+ * Get all registered route definitions
139
+ *
140
+ * Used by OpenAPI generator to document all endpoints
141
+ */
142
+ getAllRoutes() {
143
+ return Array.from(this.routes.values()).map((r) => r.definition);
144
+ }
145
+ /**
146
+ * Get the response schema for a specific route
147
+ *
148
+ * Used by fixture validator to validate fixture data
149
+ *
150
+ * @param method - HTTP method
151
+ * @param pathPattern - Route path pattern (e.g., "/api/v1/visualize/:sessionId")
152
+ * @returns Zod schema for the response, or null if route not found
153
+ */
154
+ getResponseSchema(method, pathPattern) {
155
+ const key = this.getRouteKey(method.toUpperCase(), pathPattern);
156
+ const route = this.routes.get(key);
157
+ return route?.definition.response ?? null;
158
+ }
159
+ /**
160
+ * Get the error response schema for a specific route and status code
161
+ *
162
+ * @param method - HTTP method
163
+ * @param pathPattern - Route path pattern
164
+ * @param statusCode - HTTP status code
165
+ * @returns Zod schema for the error response, or null if not defined
166
+ */
167
+ getErrorResponseSchema(method, pathPattern, statusCode) {
168
+ const key = this.getRouteKey(method.toUpperCase(), pathPattern);
169
+ const route = this.routes.get(key);
170
+ return route?.definition.errorResponses?.[statusCode] ?? null;
171
+ }
172
+ /**
173
+ * Check if a route is registered
174
+ */
175
+ hasRoute(method, pathPattern) {
176
+ const key = this.getRouteKey(method.toUpperCase(), pathPattern);
177
+ return this.routes.has(key);
178
+ }
179
+ /**
180
+ * Get the number of registered routes
181
+ */
182
+ getRouteCount() {
183
+ return this.routes.size;
184
+ }
185
+ /**
186
+ * Get all unique tags from registered routes
187
+ */
188
+ getTags() {
189
+ const tags = new Set();
190
+ for (const compiled of this.routes.values()) {
191
+ for (const tag of compiled.definition.tags) {
192
+ tags.add(tag);
193
+ }
194
+ }
195
+ return Array.from(tags).sort();
196
+ }
197
+ /**
198
+ * Get routes filtered by tag
199
+ */
200
+ getRoutesByTag(tag) {
201
+ return this.getAllRoutes().filter((route) => route.tags.includes(tag));
202
+ }
203
+ /**
204
+ * Clear all registered routes
205
+ */
206
+ clear() {
207
+ this.routes.clear();
208
+ this.logger.debug('REST route registry cleared');
209
+ }
210
+ /**
211
+ * Get registry statistics
212
+ */
213
+ getStats() {
214
+ const routesByMethod = {
215
+ GET: 0,
216
+ POST: 0,
217
+ PUT: 0,
218
+ DELETE: 0,
219
+ };
220
+ for (const compiled of this.routes.values()) {
221
+ routesByMethod[compiled.definition.method]++;
222
+ }
223
+ return {
224
+ totalRoutes: this.routes.size,
225
+ tags: this.getTags(),
226
+ routesByMethod,
227
+ };
228
+ }
229
+ }
230
+ exports.RestRouteRegistry = RestRouteRegistry;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * REST API Route Definitions
3
+ *
4
+ * Central registration of all REST API routes with their Zod schemas.
5
+ * This is the single source of truth for routing, OpenAPI generation, and fixture validation.
6
+ *
7
+ * PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
8
+ */
9
+ import { RestRouteRegistry, RouteDefinition } from '../rest-route-registry';
10
+ /**
11
+ * All route definitions for the REST API
12
+ */
13
+ export declare const routeDefinitions: RouteDefinition<unknown, unknown, unknown, unknown>[];
14
+ /**
15
+ * Register all routes with the provided registry
16
+ */
17
+ export declare function registerAllRoutes(registry: RestRouteRegistry): void;
18
+ /**
19
+ * Get route count - useful for validation
20
+ */
21
+ export declare function getRouteCount(): number;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/routes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA6I5E;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAsPjF,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAInE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}