micro-contracts 0.9.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/LICENSE +22 -0
- package/README.md +351 -0
- package/dist/cli/templates.d.ts +16 -0
- package/dist/cli/templates.d.ts.map +1 -0
- package/dist/cli/templates.js +377 -0
- package/dist/cli/templates.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +978 -0
- package/dist/cli.js.map +1 -0
- package/dist/generator/dependencyGenerator.d.ts +43 -0
- package/dist/generator/dependencyGenerator.d.ts.map +1 -0
- package/dist/generator/dependencyGenerator.js +159 -0
- package/dist/generator/dependencyGenerator.js.map +1 -0
- package/dist/generator/domainGenerator.d.ts +16 -0
- package/dist/generator/domainGenerator.d.ts.map +1 -0
- package/dist/generator/domainGenerator.js +212 -0
- package/dist/generator/domainGenerator.js.map +1 -0
- package/dist/generator/index.d.ts +37 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +747 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/linter.d.ts +24 -0
- package/dist/generator/linter.d.ts.map +1 -0
- package/dist/generator/linter.js +202 -0
- package/dist/generator/linter.js.map +1 -0
- package/dist/generator/overlayProcessor.d.ts +90 -0
- package/dist/generator/overlayProcessor.d.ts.map +1 -0
- package/dist/generator/overlayProcessor.js +532 -0
- package/dist/generator/overlayProcessor.js.map +1 -0
- package/dist/generator/schemaGenerator.d.ts +10 -0
- package/dist/generator/schemaGenerator.d.ts.map +1 -0
- package/dist/generator/schemaGenerator.js +299 -0
- package/dist/generator/schemaGenerator.js.map +1 -0
- package/dist/generator/templateProcessor.d.ts +178 -0
- package/dist/generator/templateProcessor.d.ts.map +1 -0
- package/dist/generator/templateProcessor.js +607 -0
- package/dist/generator/templateProcessor.js.map +1 -0
- package/dist/generator/typeGenerator.d.ts +9 -0
- package/dist/generator/typeGenerator.d.ts.map +1 -0
- package/dist/generator/typeGenerator.js +395 -0
- package/dist/generator/typeGenerator.js.map +1 -0
- package/dist/guardrails/allowlist.d.ts +45 -0
- package/dist/guardrails/allowlist.d.ts.map +1 -0
- package/dist/guardrails/allowlist.js +261 -0
- package/dist/guardrails/allowlist.js.map +1 -0
- package/dist/guardrails/config.d.ts +40 -0
- package/dist/guardrails/config.d.ts.map +1 -0
- package/dist/guardrails/config.js +174 -0
- package/dist/guardrails/config.js.map +1 -0
- package/dist/guardrails/docs.d.ts +24 -0
- package/dist/guardrails/docs.d.ts.map +1 -0
- package/dist/guardrails/docs.js +138 -0
- package/dist/guardrails/docs.js.map +1 -0
- package/dist/guardrails/drift.d.ts +23 -0
- package/dist/guardrails/drift.d.ts.map +1 -0
- package/dist/guardrails/drift.js +127 -0
- package/dist/guardrails/drift.js.map +1 -0
- package/dist/guardrails/index.d.ts +19 -0
- package/dist/guardrails/index.d.ts.map +1 -0
- package/dist/guardrails/index.js +25 -0
- package/dist/guardrails/index.js.map +1 -0
- package/dist/guardrails/lint.d.ts +20 -0
- package/dist/guardrails/lint.d.ts.map +1 -0
- package/dist/guardrails/lint.js +274 -0
- package/dist/guardrails/lint.js.map +1 -0
- package/dist/guardrails/manifest.d.ts +43 -0
- package/dist/guardrails/manifest.d.ts.map +1 -0
- package/dist/guardrails/manifest.js +231 -0
- package/dist/guardrails/manifest.js.map +1 -0
- package/dist/guardrails/runner.d.ts +31 -0
- package/dist/guardrails/runner.d.ts.map +1 -0
- package/dist/guardrails/runner.js +268 -0
- package/dist/guardrails/runner.js.map +1 -0
- package/dist/guardrails/security.d.ts +31 -0
- package/dist/guardrails/security.d.ts.map +1 -0
- package/dist/guardrails/security.js +181 -0
- package/dist/guardrails/security.js.map +1 -0
- package/dist/guardrails/typecheck.d.ts +15 -0
- package/dist/guardrails/typecheck.d.ts.map +1 -0
- package/dist/guardrails/typecheck.js +104 -0
- package/dist/guardrails/typecheck.js.map +1 -0
- package/dist/guardrails/types.d.ts +196 -0
- package/dist/guardrails/types.d.ts.map +1 -0
- package/dist/guardrails/types.js +8 -0
- package/dist/guardrails/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +489 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +297 -0
- package/dist/types.js.map +1 -0
- package/docs/architecture.svg +226 -0
- package/docs/development-guardrails.md +541 -0
- package/docs/guardrails-concept.svg +252 -0
- package/docs/overlays-deep-dive.md +298 -0
- package/package.json +66 -0
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI Overlay Processor
|
|
3
|
+
*
|
|
4
|
+
* Implements OpenAPI Overlay Specification for cross-cutting concerns.
|
|
5
|
+
* Parses overlays and applies transformations to OpenAPI specs.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import yaml from 'js-yaml';
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Overlay Processor
|
|
12
|
+
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Process overlays and apply to OpenAPI spec
|
|
15
|
+
*
|
|
16
|
+
* @param spec - Source OpenAPI spec
|
|
17
|
+
* @param overlayConfig - Overlay configuration
|
|
18
|
+
* @param basePath - Base path for resolving overlay file paths
|
|
19
|
+
* @param specPath - Path to the source spec file (for $ref rebasing)
|
|
20
|
+
*/
|
|
21
|
+
export function processOverlays(spec, overlayConfig, basePath = process.cwd(), specPath) {
|
|
22
|
+
const result = {
|
|
23
|
+
spec: JSON.parse(JSON.stringify(spec)), // Deep clone
|
|
24
|
+
extensionInfo: new Map(),
|
|
25
|
+
appliedOverlays: [],
|
|
26
|
+
log: [],
|
|
27
|
+
};
|
|
28
|
+
const collision = overlayConfig.collision || 'error';
|
|
29
|
+
const injectedKeys = new Map();
|
|
30
|
+
// Target directory for $ref rebasing (where transformed spec will be written)
|
|
31
|
+
const targetDir = specPath ? path.dirname(path.resolve(basePath, specPath)) : undefined;
|
|
32
|
+
for (const overlayFile of overlayConfig.files) {
|
|
33
|
+
const overlayPath = path.resolve(basePath, overlayFile);
|
|
34
|
+
if (!fs.existsSync(overlayPath)) {
|
|
35
|
+
console.warn(`Overlay file not found: ${overlayPath}`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const overlayContent = fs.readFileSync(overlayPath, 'utf-8');
|
|
39
|
+
const overlay = yaml.load(overlayContent);
|
|
40
|
+
const overlayDir = path.dirname(overlayPath);
|
|
41
|
+
result.appliedOverlays.push(overlayFile);
|
|
42
|
+
for (const action of overlay.actions) {
|
|
43
|
+
applyAction(result, overlay, action, overlayFile, collision, injectedKeys, overlayDir, targetDir);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Apply a single overlay action
|
|
50
|
+
*/
|
|
51
|
+
function applyAction(result, overlay, action, overlayFile, collision, injectedKeys, overlayDir, targetDir) {
|
|
52
|
+
const { target, update, remove } = action;
|
|
53
|
+
// Parse the target JSONPath pattern
|
|
54
|
+
const parsed = parseTarget(target);
|
|
55
|
+
if (!parsed) {
|
|
56
|
+
console.warn(`Invalid overlay target: ${target}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// Find matching operations
|
|
60
|
+
const matches = findMatchingOperations(result.spec, parsed);
|
|
61
|
+
for (const match of matches) {
|
|
62
|
+
const { path: apiPath, method, operation } = match;
|
|
63
|
+
const changes = [];
|
|
64
|
+
if (update) {
|
|
65
|
+
// Apply updates (parameters, responses)
|
|
66
|
+
if (update.parameters) {
|
|
67
|
+
const params = update.parameters;
|
|
68
|
+
for (const param of params) {
|
|
69
|
+
// Rebase $ref paths in parameter
|
|
70
|
+
const rebasedParam = rebaseRefs(param, overlayDir, targetDir);
|
|
71
|
+
const key = `${apiPath}:${method}:param:${rebasedParam.name}`;
|
|
72
|
+
checkCollision(key, rebasedParam, overlayFile, collision, injectedKeys);
|
|
73
|
+
if (!operation.parameters) {
|
|
74
|
+
operation.parameters = [];
|
|
75
|
+
}
|
|
76
|
+
// Avoid duplicates
|
|
77
|
+
const existing = operation.parameters.findIndex(p => !('$ref' in p) && p.name === rebasedParam.name && p.in === rebasedParam.in);
|
|
78
|
+
if (existing >= 0) {
|
|
79
|
+
operation.parameters[existing] = rebasedParam;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
operation.parameters.push(rebasedParam);
|
|
83
|
+
}
|
|
84
|
+
changes.push(`+${rebasedParam.name} (${rebasedParam.in})`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (update.responses) {
|
|
88
|
+
const responses = update.responses;
|
|
89
|
+
for (const [statusCode, response] of Object.entries(responses)) {
|
|
90
|
+
// Rebase $ref paths in response
|
|
91
|
+
const rebasedResponse = rebaseRefs(response, overlayDir, targetDir);
|
|
92
|
+
const key = `${apiPath}:${method}:response:${statusCode}`;
|
|
93
|
+
checkCollision(key, rebasedResponse, overlayFile, collision, injectedKeys);
|
|
94
|
+
operation.responses[statusCode] = rebasedResponse;
|
|
95
|
+
changes.push(`+${statusCode}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (remove) {
|
|
100
|
+
// Remove the operation (not commonly used, but supported)
|
|
101
|
+
changes.push('REMOVED');
|
|
102
|
+
}
|
|
103
|
+
// Log the application
|
|
104
|
+
result.log.push({
|
|
105
|
+
overlay: overlayFile,
|
|
106
|
+
target,
|
|
107
|
+
path: apiPath,
|
|
108
|
+
method,
|
|
109
|
+
changes,
|
|
110
|
+
});
|
|
111
|
+
// Extract extension info
|
|
112
|
+
extractExtensionInfo(result.extensionInfo, parsed, action);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function parseTarget(target) {
|
|
116
|
+
// Pattern: $.paths[*][*][?(@.x-ext contains 'value')]
|
|
117
|
+
const containsMatch = target.match(/\$\.paths\[\*\]\[\*\]\[\?\(@\.(x-[a-z-]+)\s+contains\s+'([^']+)'\)\]/);
|
|
118
|
+
if (containsMatch) {
|
|
119
|
+
return {
|
|
120
|
+
extensionMarker: containsMatch[1],
|
|
121
|
+
extensionValue: containsMatch[2],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Pattern: $.paths[*][*][?(@.x-ext)]
|
|
125
|
+
const existsMatch = target.match(/\$\.paths\[\*\]\[\*\]\[\?\(@\.(x-[a-z-]+)\)\]/);
|
|
126
|
+
if (existsMatch) {
|
|
127
|
+
return {
|
|
128
|
+
extensionMarker: existsMatch[1],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// Simple pattern: $.paths[*][*]
|
|
132
|
+
if (target === '$.paths[*][*]') {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
function findMatchingOperations(spec, parsed) {
|
|
138
|
+
const matches = [];
|
|
139
|
+
const methods = ['get', 'post', 'put', 'patch', 'delete'];
|
|
140
|
+
for (const [apiPath, pathItem] of Object.entries(spec.paths)) {
|
|
141
|
+
for (const method of methods) {
|
|
142
|
+
const operation = pathItem[method];
|
|
143
|
+
if (!operation)
|
|
144
|
+
continue;
|
|
145
|
+
// Check if operation matches the target
|
|
146
|
+
if (parsed.extensionMarker) {
|
|
147
|
+
const extValue = operation[parsed.extensionMarker];
|
|
148
|
+
if (!extValue)
|
|
149
|
+
continue;
|
|
150
|
+
if (parsed.extensionValue) {
|
|
151
|
+
// Check if array contains the value
|
|
152
|
+
if (Array.isArray(extValue)) {
|
|
153
|
+
if (!extValue.includes(parsed.extensionValue))
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
else if (extValue !== parsed.extensionValue) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
matches.push({ path: apiPath, method, operation });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return matches;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Rebase $ref paths in an object from source directory to target directory
|
|
168
|
+
*
|
|
169
|
+
* @param obj - Object that may contain $ref properties
|
|
170
|
+
* @param sourceDir - Directory where the source file is located (e.g., overlay or OpenAPI source)
|
|
171
|
+
* @param targetDir - Directory where the output file will be written
|
|
172
|
+
* @returns Object with rebased $ref paths
|
|
173
|
+
*/
|
|
174
|
+
export function rebaseRefs(obj, sourceDir, targetDir) {
|
|
175
|
+
if (!sourceDir || !targetDir) {
|
|
176
|
+
return obj;
|
|
177
|
+
}
|
|
178
|
+
// Deep clone and rebase
|
|
179
|
+
return rebaseRefsRecursive(JSON.parse(JSON.stringify(obj)), sourceDir, targetDir);
|
|
180
|
+
}
|
|
181
|
+
function rebaseRefsRecursive(obj, overlayDir, targetDir) {
|
|
182
|
+
if (obj === null || obj === undefined) {
|
|
183
|
+
return obj;
|
|
184
|
+
}
|
|
185
|
+
if (Array.isArray(obj)) {
|
|
186
|
+
return obj.map(item => rebaseRefsRecursive(item, overlayDir, targetDir));
|
|
187
|
+
}
|
|
188
|
+
if (typeof obj === 'object') {
|
|
189
|
+
const result = {};
|
|
190
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
191
|
+
if (key === '$ref' && typeof value === 'string') {
|
|
192
|
+
// Rebase the $ref path
|
|
193
|
+
result[key] = rebaseRefPath(value, overlayDir, targetDir);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
result[key] = rebaseRefsRecursive(value, overlayDir, targetDir);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
return obj;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Rebase a single $ref path from overlay directory to target directory
|
|
205
|
+
*
|
|
206
|
+
* @param refPath - The $ref value (e.g., '../openapi/problem-details.yaml#/components/schemas/X')
|
|
207
|
+
* @param overlayDir - Directory where the overlay file is located
|
|
208
|
+
* @param targetDir - Directory where the transformed spec will be written
|
|
209
|
+
* @returns Rebased $ref path
|
|
210
|
+
*/
|
|
211
|
+
function rebaseRefPath(refPath, overlayDir, targetDir) {
|
|
212
|
+
// Handle internal references (start with #)
|
|
213
|
+
if (refPath.startsWith('#')) {
|
|
214
|
+
return refPath;
|
|
215
|
+
}
|
|
216
|
+
// Split $ref into file path and JSON pointer
|
|
217
|
+
const [filePath, jsonPointer] = refPath.split('#');
|
|
218
|
+
// If no file path, it's a pure JSON pointer
|
|
219
|
+
if (!filePath) {
|
|
220
|
+
return refPath;
|
|
221
|
+
}
|
|
222
|
+
// Resolve the absolute path of the referenced file
|
|
223
|
+
const absoluteRefPath = path.resolve(overlayDir, filePath);
|
|
224
|
+
// Calculate the relative path from target directory
|
|
225
|
+
const relativePath = path.relative(targetDir, absoluteRefPath);
|
|
226
|
+
// Normalize to forward slashes (for cross-platform compatibility)
|
|
227
|
+
const normalizedPath = relativePath.split(path.sep).join('/');
|
|
228
|
+
// Reconstruct the $ref
|
|
229
|
+
return jsonPointer ? `${normalizedPath}#${jsonPointer}` : normalizedPath;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Check for collision and handle according to policy
|
|
233
|
+
*/
|
|
234
|
+
function checkCollision(key, content, overlayFile, collision, injectedKeys) {
|
|
235
|
+
const existing = injectedKeys.get(key);
|
|
236
|
+
if (existing) {
|
|
237
|
+
const contentStr = JSON.stringify(content);
|
|
238
|
+
const existingStr = JSON.stringify(existing.content);
|
|
239
|
+
if (contentStr === existingStr) {
|
|
240
|
+
// Identical content - idempotent, allow
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const message = `Overlay collision at ${key}: ${existing.overlay} vs ${overlayFile}`;
|
|
244
|
+
switch (collision) {
|
|
245
|
+
case 'error':
|
|
246
|
+
throw new Error(message);
|
|
247
|
+
case 'warn':
|
|
248
|
+
console.warn(`Warning: ${message}`);
|
|
249
|
+
break;
|
|
250
|
+
case 'last-wins':
|
|
251
|
+
// Just overwrite
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
injectedKeys.set(key, { overlay: overlayFile, content });
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Extract extension information from overlay action
|
|
259
|
+
*/
|
|
260
|
+
function extractExtensionInfo(extensionInfo, parsed, action) {
|
|
261
|
+
const { update } = action;
|
|
262
|
+
if (!parsed.extensionMarker || !update)
|
|
263
|
+
return;
|
|
264
|
+
// Use explicit x-micro-contracts-overlay-name if provided, otherwise fall back to parsed value
|
|
265
|
+
const overlayName = action['x-micro-contracts-overlay-name'] || parsed.extensionValue;
|
|
266
|
+
if (!overlayName)
|
|
267
|
+
return;
|
|
268
|
+
const key = `${parsed.extensionMarker}:${overlayName}`;
|
|
269
|
+
if (!extensionInfo.has(key)) {
|
|
270
|
+
extensionInfo.set(key, {
|
|
271
|
+
name: overlayName,
|
|
272
|
+
marker: parsed.extensionMarker,
|
|
273
|
+
injectedParameters: [],
|
|
274
|
+
injectedResponses: {},
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
const info = extensionInfo.get(key);
|
|
278
|
+
if (update.parameters) {
|
|
279
|
+
const params = update.parameters;
|
|
280
|
+
for (const param of params) {
|
|
281
|
+
// Avoid duplicates
|
|
282
|
+
if (!info.injectedParameters.find(p => p.name === param.name)) {
|
|
283
|
+
info.injectedParameters.push(param);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (update.responses) {
|
|
288
|
+
const responses = update.responses;
|
|
289
|
+
Object.assign(info.injectedResponses, responses);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// =============================================================================
|
|
293
|
+
// Overlay Interface Generation
|
|
294
|
+
// =============================================================================
|
|
295
|
+
/**
|
|
296
|
+
* Generate TypeScript interfaces for overlays
|
|
297
|
+
*
|
|
298
|
+
* These interfaces are HTTP-agnostic. The HTTP layer (routes template)
|
|
299
|
+
* extracts parameters from the request and passes them to overlay handlers.
|
|
300
|
+
*/
|
|
301
|
+
export function generateExtensionInterfaces(extensionInfo) {
|
|
302
|
+
const lines = [];
|
|
303
|
+
lines.push('/**');
|
|
304
|
+
lines.push(' * Overlay Interfaces');
|
|
305
|
+
lines.push(' * Auto-generated from overlay specifications');
|
|
306
|
+
lines.push(' * DO NOT EDIT MANUALLY');
|
|
307
|
+
lines.push(' * ');
|
|
308
|
+
lines.push(' * These interfaces are HTTP-agnostic. Overlay handlers receive');
|
|
309
|
+
lines.push(' * extracted parameters and return success/failure with optional context.');
|
|
310
|
+
lines.push(' */');
|
|
311
|
+
lines.push('');
|
|
312
|
+
// Generate common result type
|
|
313
|
+
lines.push('// =============================================================================');
|
|
314
|
+
lines.push('// Common Types');
|
|
315
|
+
lines.push('// =============================================================================');
|
|
316
|
+
lines.push('');
|
|
317
|
+
lines.push('/**');
|
|
318
|
+
lines.push(' * Result returned by overlay handlers');
|
|
319
|
+
lines.push(' * - success: true → continue to next handler/domain');
|
|
320
|
+
lines.push(' * - success: false → return error response');
|
|
321
|
+
lines.push(' */');
|
|
322
|
+
lines.push('export interface OverlayResult<TContext = unknown> {');
|
|
323
|
+
lines.push(' success: boolean;');
|
|
324
|
+
lines.push(' error?: {');
|
|
325
|
+
lines.push(' status: number;');
|
|
326
|
+
lines.push(' message: string;');
|
|
327
|
+
lines.push(' code?: string;');
|
|
328
|
+
lines.push(' };');
|
|
329
|
+
lines.push(' /** Context passed to subsequent handlers and domain */');
|
|
330
|
+
lines.push(' context?: TContext;');
|
|
331
|
+
lines.push('}');
|
|
332
|
+
lines.push('');
|
|
333
|
+
// Group by marker
|
|
334
|
+
const byMarker = new Map();
|
|
335
|
+
for (const info of extensionInfo.values()) {
|
|
336
|
+
if (!byMarker.has(info.marker)) {
|
|
337
|
+
byMarker.set(info.marker, []);
|
|
338
|
+
}
|
|
339
|
+
byMarker.get(info.marker).push(info);
|
|
340
|
+
}
|
|
341
|
+
// Generate interfaces for each marker
|
|
342
|
+
for (const [marker, extensions] of byMarker) {
|
|
343
|
+
const markerName = markerToTypeName(marker);
|
|
344
|
+
lines.push(`// =============================================================================`);
|
|
345
|
+
lines.push(`// ${markerName} Overlays`);
|
|
346
|
+
lines.push(`// =============================================================================`);
|
|
347
|
+
lines.push('');
|
|
348
|
+
// Generate value type
|
|
349
|
+
const values = extensions.map(e => `'${e.name}'`).join(' | ');
|
|
350
|
+
lines.push(`export type ${markerName}Value = ${values};`);
|
|
351
|
+
lines.push('');
|
|
352
|
+
// Generate input and handler types for each extension
|
|
353
|
+
for (const ext of extensions) {
|
|
354
|
+
const inputName = `${capitalize(ext.name)}OverlayInput`;
|
|
355
|
+
const handlerName = `${capitalize(ext.name)}Overlay`;
|
|
356
|
+
// Generate input type from injected parameters
|
|
357
|
+
lines.push(`/**`);
|
|
358
|
+
lines.push(` * Input for ${ext.name} overlay`);
|
|
359
|
+
lines.push(` * Parameters extracted from HTTP request by the routes layer`);
|
|
360
|
+
lines.push(` */`);
|
|
361
|
+
lines.push(`export interface ${inputName} {`);
|
|
362
|
+
if (ext.injectedParameters.length > 0) {
|
|
363
|
+
for (const param of ext.injectedParameters) {
|
|
364
|
+
const optional = param.required ? '' : '?';
|
|
365
|
+
const tsType = parameterToTsType(param);
|
|
366
|
+
if (param.description) {
|
|
367
|
+
lines.push(` /** ${param.description} */`);
|
|
368
|
+
}
|
|
369
|
+
// Use OpenAPI parameter name as-is (quoted for names with special chars)
|
|
370
|
+
lines.push(` '${param.name}'${optional}: ${tsType};`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
// No parameters - empty input
|
|
375
|
+
lines.push(` // No parameters required`);
|
|
376
|
+
}
|
|
377
|
+
lines.push(`}`);
|
|
378
|
+
lines.push('');
|
|
379
|
+
// Generate handler type
|
|
380
|
+
lines.push(`/**`);
|
|
381
|
+
lines.push(` * Handler for ${ext.name} overlay`);
|
|
382
|
+
if (Object.keys(ext.injectedResponses).length > 0) {
|
|
383
|
+
lines.push(` * May return errors: ${Object.keys(ext.injectedResponses).join(', ')}`);
|
|
384
|
+
}
|
|
385
|
+
lines.push(` */`);
|
|
386
|
+
lines.push(`export type ${handlerName} = (input: ${inputName}) => Promise<OverlayResult>;`);
|
|
387
|
+
lines.push('');
|
|
388
|
+
}
|
|
389
|
+
// Generate registry interface
|
|
390
|
+
const registryName = `${markerName}Registry`;
|
|
391
|
+
lines.push(`/**`);
|
|
392
|
+
lines.push(` * Registry interface for ${marker} overlay handlers`);
|
|
393
|
+
lines.push(` */`);
|
|
394
|
+
lines.push(`export interface ${registryName} {`);
|
|
395
|
+
for (const ext of extensions) {
|
|
396
|
+
const handlerName = `${capitalize(ext.name)}Overlay`;
|
|
397
|
+
lines.push(` ${ext.name}: ${handlerName};`);
|
|
398
|
+
}
|
|
399
|
+
lines.push(`}`);
|
|
400
|
+
lines.push('');
|
|
401
|
+
}
|
|
402
|
+
// Generate unified OverlayRegistry (combines all markers)
|
|
403
|
+
lines.push('// =============================================================================');
|
|
404
|
+
lines.push('// Unified Overlay Registry');
|
|
405
|
+
lines.push('// =============================================================================');
|
|
406
|
+
lines.push('');
|
|
407
|
+
lines.push('/**');
|
|
408
|
+
lines.push(' * Combined registry interface for all overlay handlers');
|
|
409
|
+
lines.push(' * Use this when a single handler registry is needed');
|
|
410
|
+
lines.push(' */');
|
|
411
|
+
lines.push('export interface OverlayRegistry {');
|
|
412
|
+
for (const extensions of byMarker.values()) {
|
|
413
|
+
for (const ext of extensions) {
|
|
414
|
+
const handlerName = `${capitalize(ext.name)}Overlay`;
|
|
415
|
+
lines.push(` ${ext.name}: ${handlerName};`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
lines.push('}');
|
|
419
|
+
lines.push('');
|
|
420
|
+
// Generate combined extension info type
|
|
421
|
+
lines.push('// =============================================================================');
|
|
422
|
+
lines.push('// Overlay Info (for templates)');
|
|
423
|
+
lines.push('// =============================================================================');
|
|
424
|
+
lines.push('');
|
|
425
|
+
lines.push('export interface OverlayInfoMap {');
|
|
426
|
+
for (const [key, info] of extensionInfo) {
|
|
427
|
+
lines.push(` '${key}': {`);
|
|
428
|
+
lines.push(` name: '${info.name}';`);
|
|
429
|
+
lines.push(` marker: '${info.marker}';`);
|
|
430
|
+
lines.push(` injectedParameters: ${JSON.stringify(info.injectedParameters.map(p => p.name))};`);
|
|
431
|
+
lines.push(` injectedResponses: ${JSON.stringify(Object.keys(info.injectedResponses))};`);
|
|
432
|
+
lines.push(` };`);
|
|
433
|
+
}
|
|
434
|
+
lines.push('}');
|
|
435
|
+
lines.push('');
|
|
436
|
+
return lines.join('\n');
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Convert parameter to TypeScript type
|
|
440
|
+
*/
|
|
441
|
+
function parameterToTsType(param) {
|
|
442
|
+
if (!param.schema)
|
|
443
|
+
return 'unknown';
|
|
444
|
+
const schema = param.schema;
|
|
445
|
+
switch (schema.type) {
|
|
446
|
+
case 'string':
|
|
447
|
+
return 'string';
|
|
448
|
+
case 'integer':
|
|
449
|
+
case 'number':
|
|
450
|
+
return 'number';
|
|
451
|
+
case 'boolean':
|
|
452
|
+
return 'boolean';
|
|
453
|
+
case 'array':
|
|
454
|
+
return 'unknown[]';
|
|
455
|
+
default:
|
|
456
|
+
return 'unknown';
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Convert string to camelCase
|
|
461
|
+
*/
|
|
462
|
+
function camelCase(str) {
|
|
463
|
+
return str
|
|
464
|
+
.replace(/[-_](.)/g, (_, c) => c.toUpperCase())
|
|
465
|
+
.replace(/^./, c => c.toLowerCase());
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Convert marker like 'x-middleware' to type name like 'Middleware'
|
|
469
|
+
*/
|
|
470
|
+
function markerToTypeName(marker) {
|
|
471
|
+
return marker
|
|
472
|
+
.replace(/^x-/, '')
|
|
473
|
+
.split('-')
|
|
474
|
+
.map(capitalize)
|
|
475
|
+
.join('');
|
|
476
|
+
}
|
|
477
|
+
function capitalize(str) {
|
|
478
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
479
|
+
}
|
|
480
|
+
// =============================================================================
|
|
481
|
+
// Utility Functions
|
|
482
|
+
// =============================================================================
|
|
483
|
+
/**
|
|
484
|
+
* Load overlay configuration from micro-contracts config
|
|
485
|
+
*/
|
|
486
|
+
export function loadOverlayConfig(configPath, moduleName) {
|
|
487
|
+
if (!fs.existsSync(configPath))
|
|
488
|
+
return null;
|
|
489
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
490
|
+
const config = yaml.load(content);
|
|
491
|
+
const files = [];
|
|
492
|
+
// Get shared overlays from defaults
|
|
493
|
+
const defaults = config.defaults;
|
|
494
|
+
if (defaults?.overlays) {
|
|
495
|
+
const overlays = defaults.overlays;
|
|
496
|
+
if (Array.isArray(overlays)) {
|
|
497
|
+
files.push(...overlays);
|
|
498
|
+
}
|
|
499
|
+
else if (overlays.shared) {
|
|
500
|
+
files.push(...overlays.shared);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Get module-specific overlays
|
|
504
|
+
const modules = config.modules;
|
|
505
|
+
const moduleConfig = modules?.[moduleName];
|
|
506
|
+
if (moduleConfig?.overlays) {
|
|
507
|
+
const overlays = moduleConfig.overlays;
|
|
508
|
+
files.push(...overlays);
|
|
509
|
+
}
|
|
510
|
+
if (files.length === 0)
|
|
511
|
+
return null;
|
|
512
|
+
const collision = defaults?.overlays?.collision;
|
|
513
|
+
return {
|
|
514
|
+
collision: collision || 'error',
|
|
515
|
+
files,
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Format overlay application log for console output
|
|
520
|
+
*/
|
|
521
|
+
export function formatOverlayLog(result) {
|
|
522
|
+
const lines = [];
|
|
523
|
+
for (const overlay of result.appliedOverlays) {
|
|
524
|
+
lines.push(`[overlay] Applying ${overlay}`);
|
|
525
|
+
const overlayLogs = result.log.filter(l => l.overlay === overlay);
|
|
526
|
+
for (const log of overlayLogs) {
|
|
527
|
+
lines.push(` → ${log.path} ${log.method.toUpperCase()}: ${log.changes.join(', ')}`);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return lines.join('\n');
|
|
531
|
+
}
|
|
532
|
+
//# sourceMappingURL=overlayProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlayProcessor.js","sourceRoot":"","sources":["../../src/generator/overlayProcessor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,SAAS,CAAC;AA8D3B,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAiB,EACjB,aAA4B,EAC5B,WAAmB,OAAO,CAAC,GAAG,EAAE,EAChC,QAAiB;IAEjB,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAG,aAAa;QACtD,aAAa,EAAE,IAAI,GAAG,EAAE;QACxB,eAAe,EAAE,EAAE;QACnB,GAAG,EAAE,EAAE;KACR,CAAC;IAEF,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,IAAI,OAAO,CAAC;IACrD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAiD,CAAC;IAE9E,8EAA8E;IAC9E,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAExF,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAA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,CAAC;QAC3B,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAoB,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,MAAM,SAAS,GAAI,QAAQ,EAAE,QAAoC,EAAE,SACvB,CAAC;IAE7C,OAAO;QACL,SAAS,EAAE,SAAS,IAAI,OAAO;QAC/B,KAAK;KACN,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;QAE5C,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;QAClE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Schema generator from OpenAPI schemas
|
|
3
|
+
* Generates Fastify-compatible JSON Schema objects
|
|
4
|
+
*/
|
|
5
|
+
import type { OpenAPISpec } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Generate JSON Schema TypeScript file from OpenAPI spec
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateSchemas(spec: OpenAPISpec): string;
|
|
10
|
+
//# sourceMappingURL=schemaGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaGenerator.d.ts","sourceRoot":"","sources":["../../src/generator/schemaGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,aAAa,CAAC;AAsBrB;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CA6DzD"}
|