@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.
- package/README.md +1 -0
- package/dist/core/ai-provider.interface.d.ts +12 -8
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/artifacthub.d.ts +1 -1
- package/dist/core/artifacthub.d.ts.map +1 -1
- package/dist/core/base-vector-service.d.ts +22 -9
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +106 -37
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +5 -2
- package/dist/core/capability-operations.d.ts +55 -7
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +1 -3
- package/dist/core/capability-scan-workflow.d.ts +64 -8
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +14 -13
- package/dist/core/capability-tools.d.ts +1 -1
- package/dist/core/capability-tools.d.ts.map +1 -1
- package/dist/core/capability-tools.js +1 -1
- package/dist/core/capability-vector-service.d.ts +3 -4
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +2 -2
- package/dist/core/command-executor.d.ts +3 -4
- package/dist/core/command-executor.d.ts.map +1 -1
- package/dist/core/command-executor.js +8 -4
- package/dist/core/crd-availability.d.ts +3 -5
- package/dist/core/crd-availability.d.ts.map +1 -1
- package/dist/core/crd-availability.js +8 -18
- package/dist/core/deploy-operation.d.ts +6 -5
- package/dist/core/deploy-operation.d.ts.map +1 -1
- package/dist/core/deploy-operation.js +16 -10
- package/dist/core/discovery.d.ts +6 -14
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +35 -51
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +1 -1
- package/dist/core/error-handling.d.ts +13 -13
- package/dist/core/error-handling.d.ts.map +1 -1
- package/dist/core/error-handling.js +2 -3
- package/dist/core/generic-session-manager.d.ts +2 -2
- package/dist/core/generic-session-manager.d.ts.map +1 -1
- package/dist/core/helm-types.d.ts +5 -5
- package/dist/core/helm-types.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -11
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -14
- package/dist/core/knowledge-types.d.ts +114 -0
- package/dist/core/knowledge-types.d.ts.map +1 -0
- package/dist/core/knowledge-types.js +10 -0
- package/dist/core/memory.d.ts +12 -12
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/mermaid-tools.d.ts +24 -1
- package/dist/core/mermaid-tools.d.ts.map +1 -1
- package/dist/core/mermaid-tools.js +10 -8
- package/dist/core/packaging.d.ts +23 -1
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/pattern-operations.d.ts +32 -9
- package/dist/core/pattern-operations.d.ts.map +1 -1
- package/dist/core/pattern-operations.js +17 -22
- package/dist/core/pattern-vector-service.d.ts +3 -4
- package/dist/core/pattern-vector-service.d.ts.map +1 -1
- package/dist/core/pattern-vector-service.js +2 -2
- package/dist/core/platform-utils.d.ts +2 -2
- package/dist/core/platform-utils.d.ts.map +1 -1
- package/dist/core/plugin-manager.d.ts +6 -2
- package/dist/core/plugin-manager.d.ts.map +1 -1
- package/dist/core/plugin-manager.js +9 -16
- package/dist/core/plugin-registry.d.ts +59 -0
- package/dist/core/plugin-registry.d.ts.map +1 -0
- package/dist/core/plugin-registry.js +80 -0
- package/dist/core/policy-operations.d.ts +101 -21
- package/dist/core/policy-operations.d.ts.map +1 -1
- package/dist/core/policy-operations.js +45 -47
- package/dist/core/policy-vector-service.d.ts +3 -4
- package/dist/core/policy-vector-service.d.ts.map +1 -1
- package/dist/core/policy-vector-service.js +2 -2
- package/dist/core/providers/host-provider.d.ts +1 -1
- package/dist/core/providers/host-provider.d.ts.map +1 -1
- package/dist/core/providers/host-provider.js +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.d.ts +10 -2
- package/dist/core/providers/tool-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.js +2 -2
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +29 -23
- package/dist/core/resource-tools.d.ts +29 -1
- package/dist/core/resource-tools.d.ts.map +1 -1
- package/dist/core/resource-vector-service.d.ts +3 -4
- package/dist/core/resource-vector-service.d.ts.map +1 -1
- package/dist/core/resource-vector-service.js +2 -2
- package/dist/core/schema.d.ts +15 -14
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +32 -34
- package/dist/core/shared-prompt-loader.d.ts +1 -1
- package/dist/core/shared-prompt-loader.d.ts.map +1 -1
- package/dist/core/solution-cr.js +1 -1
- package/dist/core/solution-utils.d.ts +22 -3
- package/dist/core/solution-utils.d.ts.map +1 -1
- package/dist/core/solution-utils.js +1 -1
- package/dist/core/telemetry/client.d.ts +0 -6
- package/dist/core/telemetry/client.d.ts.map +1 -1
- package/dist/core/telemetry/client.js +6 -17
- package/dist/core/telemetry/config.js +1 -1
- package/dist/core/telemetry/index.d.ts +1 -1
- package/dist/core/telemetry/index.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +1 -2
- package/dist/core/tracing/tool-tracing.d.ts +1 -1
- package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
- package/dist/core/unified-creation-session.d.ts +15 -8
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +19 -19
- package/dist/core/unified-creation-types.d.ts +2 -2
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/core/visualization.d.ts +1 -1
- package/dist/core/visualization.d.ts.map +1 -1
- package/dist/core/workflow.d.ts +8 -5
- package/dist/core/workflow.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.d.ts +13 -7
- package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.js +1 -1
- package/dist/evaluation/datasets/loader.d.ts +2 -2
- package/dist/evaluation/datasets/loader.d.ts.map +1 -1
- package/dist/evaluation/eval-runner.js +7 -5
- package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
- package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
- package/dist/evaluation/evaluators/base-comparative.js +4 -3
- package/dist/evaluation/evaluators/base.d.ts +5 -5
- package/dist/evaluation/evaluators/base.d.ts.map +1 -1
- package/dist/evaluation/evaluators/capability-comparative.js +1 -1
- package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +26 -15
- package/dist/interfaces/openapi-generator.d.ts +116 -12
- package/dist/interfaces/openapi-generator.d.ts.map +1 -1
- package/dist/interfaces/openapi-generator.js +490 -199
- package/dist/interfaces/rest-api.d.ts +28 -6
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +436 -245
- package/dist/interfaces/rest-registry.d.ts +4 -4
- package/dist/interfaces/rest-registry.d.ts.map +1 -1
- package/dist/interfaces/rest-registry.js +6 -5
- package/dist/interfaces/rest-route-registry.d.ts +165 -0
- package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
- package/dist/interfaces/rest-route-registry.js +230 -0
- package/dist/interfaces/routes/index.d.ts +22 -0
- package/dist/interfaces/routes/index.d.ts.map +1 -0
- package/dist/interfaces/routes/index.js +347 -0
- package/dist/interfaces/schemas/common.d.ts +177 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -0
- package/dist/interfaces/schemas/common.js +102 -0
- package/dist/interfaces/schemas/events.d.ts +131 -0
- package/dist/interfaces/schemas/events.d.ts.map +1 -0
- package/dist/interfaces/schemas/events.js +66 -0
- package/dist/interfaces/schemas/index.d.ts +21 -0
- package/dist/interfaces/schemas/index.d.ts.map +1 -0
- package/dist/interfaces/schemas/index.js +138 -0
- package/dist/interfaces/schemas/knowledge.d.ts +210 -0
- package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
- package/dist/interfaces/schemas/knowledge.js +117 -0
- package/dist/interfaces/schemas/logs.d.ts +82 -0
- package/dist/interfaces/schemas/logs.d.ts.map +1 -0
- package/dist/interfaces/schemas/logs.js +46 -0
- package/dist/interfaces/schemas/prompts.d.ts +191 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
- package/dist/interfaces/schemas/prompts.js +91 -0
- package/dist/interfaces/schemas/resources.d.ts +378 -0
- package/dist/interfaces/schemas/resources.d.ts.map +1 -0
- package/dist/interfaces/schemas/resources.js +173 -0
- package/dist/interfaces/schemas/sessions.d.ts +90 -0
- package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
- package/dist/interfaces/schemas/sessions.js +56 -0
- package/dist/interfaces/schemas/tools.d.ts +194 -0
- package/dist/interfaces/schemas/tools.d.ts.map +1 -0
- package/dist/interfaces/schemas/tools.js +101 -0
- package/dist/interfaces/schemas/visualization.d.ts +373 -0
- package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
- package/dist/interfaces/schemas/visualization.js +134 -0
- package/dist/mcp/server.js +5 -4
- package/dist/tools/answer-question.d.ts +1 -1
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +9 -8
- package/dist/tools/deploy-manifests.d.ts +4 -2
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +10 -6
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +28 -20
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/manage-knowledge.d.ts +77 -0
- package/dist/tools/manage-knowledge.d.ts.map +1 -0
- package/dist/tools/manage-knowledge.js +573 -0
- package/dist/tools/operate-analysis.d.ts +31 -2
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-execution.d.ts +2 -3
- package/dist/tools/operate-execution.d.ts.map +1 -1
- package/dist/tools/operate-execution.js +7 -7
- package/dist/tools/operate.d.ts +7 -2
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +2 -2
- package/dist/tools/organizational-data.d.ts +30 -4
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +24 -19
- package/dist/tools/project-setup/discovery.d.ts.map +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
- package/dist/tools/project-setup/types.d.ts +1 -0
- package/dist/tools/project-setup/types.d.ts.map +1 -1
- package/dist/tools/prompts.d.ts +28 -2
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/query.d.ts +17 -3
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +1 -7
- package/dist/tools/recommend.d.ts +24 -6
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +18 -15
- package/dist/tools/remediate.d.ts +12 -3
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +22 -14
- package/dist/tools/version.d.ts +19 -5
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +106 -54
- package/package.json +11 -5
- package/prompts/knowledge-ask.md +29 -0
- package/dist/core/vector-db-service.d.ts +0 -108
- package/dist/core/vector-db-service.d.ts.map +0 -1
- 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:
|
|
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,
|
|
25
|
+
properties?: Record<string, unknown>;
|
|
26
26
|
required?: string[];
|
|
27
27
|
description?: string;
|
|
28
28
|
$ref?: string;
|
|
29
|
-
definitions?: Record<string,
|
|
30
|
-
[key: string]:
|
|
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,
|
|
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,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,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MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GAAG,QAAQ,EAAE;IAsBnB;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE;IAUzB;;OAEG;IACH,OAAO,IAAI,MAAM,EAAE;IAUnB;;OAEG;IACH,QAAQ,IAAI;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;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
|
-
//
|
|
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
|
-
|
|
105
|
+
const jsonSchemaWithComponents = jsonSchema;
|
|
106
|
+
if (result.$ref && jsonSchemaWithComponents['components.schemas']) {
|
|
106
107
|
const refKey = result.$ref.replace('#/components.schemas/', '');
|
|
107
|
-
if (
|
|
108
|
-
result =
|
|
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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AM,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"}
|