@databehave/server 0.1.4 → 0.2.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/CHANGELOG.md +17 -0
- package/README.md +85 -83
- package/dist/cors.d.ts +1 -1
- package/dist/cors.js +1 -1
- package/dist/cors.js.map +1 -1
- package/dist/http.d.ts +94 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +23 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +10 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -18
- package/dist/index.js.map +1 -1
- package/dist/log.d.ts +9 -49
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +16 -92
- package/dist/log.js.map +1 -1
- package/dist/node-authority.d.ts +12 -0
- package/dist/node-authority.d.ts.map +1 -0
- package/dist/node-authority.js +72 -0
- package/dist/node-authority.js.map +1 -0
- package/dist/node-body.d.ts +11 -0
- package/dist/node-body.d.ts.map +1 -0
- package/dist/node-body.js +61 -0
- package/dist/node-body.js.map +1 -0
- package/dist/node-http.d.ts +19 -0
- package/dist/node-http.d.ts.map +1 -0
- package/dist/node-http.js +210 -0
- package/dist/node-http.js.map +1 -0
- package/dist/plugins/access-log.d.ts +11 -0
- package/dist/plugins/access-log.d.ts.map +1 -0
- package/dist/plugins/access-log.js +27 -0
- package/dist/plugins/access-log.js.map +1 -0
- package/dist/plugins/cors.d.ts +5 -0
- package/dist/plugins/cors.d.ts.map +1 -0
- package/dist/plugins/cors.js +35 -0
- package/dist/plugins/cors.js.map +1 -0
- package/dist/plugins/routes.d.ts +5 -0
- package/dist/plugins/routes.d.ts.map +1 -0
- package/dist/plugins/routes.js +10 -0
- package/dist/plugins/routes.js.map +1 -0
- package/dist/request.d.ts +2 -2
- package/dist/request.d.ts.map +1 -1
- package/dist/request.js +6 -4
- package/dist/request.js.map +1 -1
- package/dist/route-key.d.ts +2 -0
- package/dist/route-key.d.ts.map +1 -1
- package/dist/route-key.js +5 -1
- package/dist/route-key.js.map +1 -1
- package/dist/server.d.ts +7 -59
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +289 -466
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +10 -156
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +9 -22
- package/dist/admin/admin-routes.d.ts +0 -42
- package/dist/admin/admin-routes.d.ts.map +0 -1
- package/dist/admin/admin-routes.js +0 -472
- package/dist/admin/admin-routes.js.map +0 -1
- package/dist/admin/admin-types.d.ts +0 -170
- package/dist/admin/admin-types.d.ts.map +0 -1
- package/dist/admin/admin-types.js +0 -30
- package/dist/admin/admin-types.js.map +0 -1
- package/dist/admin/banner.d.ts +0 -11
- package/dist/admin/banner.d.ts.map +0 -1
- package/dist/admin/banner.js +0 -5
- package/dist/admin/banner.js.map +0 -1
- package/dist/admin/header-parser.d.ts +0 -14
- package/dist/admin/header-parser.d.ts.map +0 -1
- package/dist/admin/header-parser.js +0 -171
- package/dist/admin/header-parser.js.map +0 -1
- package/dist/admin/inject.d.ts +0 -48
- package/dist/admin/inject.d.ts.map +0 -1
- package/dist/admin/inject.js +0 -167
- package/dist/admin/inject.js.map +0 -1
- package/dist/admin/overrides-store.d.ts +0 -18
- package/dist/admin/overrides-store.d.ts.map +0 -1
- package/dist/admin/overrides-store.js +0 -100
- package/dist/admin/overrides-store.js.map +0 -1
- package/dist/admin/resolve-cors.d.ts +0 -22
- package/dist/admin/resolve-cors.d.ts.map +0 -1
- package/dist/admin/resolve-cors.js +0 -28
- package/dist/admin/resolve-cors.js.map +0 -1
- package/dist/admin/scenarios-store.d.ts +0 -15
- package/dist/admin/scenarios-store.d.ts.map +0 -1
- package/dist/admin/scenarios-store.js +0 -109
- package/dist/admin/scenarios-store.js.map +0 -1
- package/dist/admin/ui.css +0 -1
- package/dist/admin/ui.html +0 -13
- package/dist/admin/ui.js +0 -240
- package/dist/bin-helpers.d.ts +0 -46
- package/dist/bin-helpers.d.ts.map +0 -1
- package/dist/bin-helpers.js +0 -61
- package/dist/bin-helpers.js.map +0 -1
- package/dist/bin.d.ts +0 -3
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js +0 -86
- package/dist/bin.js.map +0 -1
- package/dist/define.d.ts +0 -26
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js +0 -55
- package/dist/define.js.map +0 -1
- package/dist/json-config.d.ts +0 -170
- package/dist/json-config.d.ts.map +0 -1
- package/dist/json-config.js +0 -684
- package/dist/json-config.js.map +0 -1
- package/dist/jsonc.d.ts +0 -24
- package/dist/jsonc.d.ts.map +0 -1
- package/dist/jsonc.js +0 -125
- package/dist/jsonc.js.map +0 -1
- package/dist/middleware/request-validation.d.ts +0 -58
- package/dist/middleware/request-validation.d.ts.map +0 -1
- package/dist/middleware/request-validation.js +0 -328
- package/dist/middleware/request-validation.js.map +0 -1
- package/dist/mock-mode.d.ts +0 -95
- package/dist/mock-mode.d.ts.map +0 -1
- package/dist/mock-mode.js +0 -95
- package/dist/mock-mode.js.map +0 -1
- package/dist/openapi/auto-schema.d.ts +0 -83
- package/dist/openapi/auto-schema.d.ts.map +0 -1
- package/dist/openapi/auto-schema.js +0 -232
- package/dist/openapi/auto-schema.js.map +0 -1
- package/dist/openapi/generate.d.ts +0 -20
- package/dist/openapi/generate.d.ts.map +0 -1
- package/dist/openapi/generate.js +0 -121
- package/dist/openapi/generate.js.map +0 -1
- package/dist/openapi/loader.d.ts +0 -18
- package/dist/openapi/loader.d.ts.map +0 -1
- package/dist/openapi/loader.js +0 -25
- package/dist/openapi/loader.js.map +0 -1
- package/dist/openapi/register.d.ts +0 -58
- package/dist/openapi/register.d.ts.map +0 -1
- package/dist/openapi/register.js +0 -166
- package/dist/openapi/register.js.map +0 -1
- package/dist/openapi/seed.d.ts +0 -16
- package/dist/openapi/seed.d.ts.map +0 -1
- package/dist/openapi/seed.js +0 -58
- package/dist/openapi/seed.js.map +0 -1
- package/dist/openapi/translate.d.ts +0 -55
- package/dist/openapi/translate.d.ts.map +0 -1
- package/dist/openapi/translate.js +0 -319
- package/dist/openapi/translate.js.map +0 -1
- package/dist/openapi/walker.d.ts +0 -44
- package/dist/openapi/walker.d.ts.map +0 -1
- package/dist/openapi/walker.js +0 -15
- package/dist/openapi/walker.js.map +0 -1
- package/dist/run.d.ts +0 -27
- package/dist/run.d.ts.map +0 -1
- package/dist/run.js +0 -87
- package/dist/run.js.map +0 -1
- package/dist/validation/validate.d.ts +0 -38
- package/dist/validation/validate.d.ts.map +0 -1
- package/dist/validation/validate.js +0 -372
- package/dist/validation/validate.js.map +0 -1
package/dist/openapi/generate.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const FORMAT_STRINGS = {
|
|
2
|
-
date: '2024-01-01',
|
|
3
|
-
'date-time': '2024-01-01T00:00:00Z',
|
|
4
|
-
email: 'user@example.com',
|
|
5
|
-
uuid: '00000000-0000-4000-8000-000000000000',
|
|
6
|
-
uri: 'https://example.com/',
|
|
7
|
-
};
|
|
8
|
-
const KNOWN_TYPES = new Set([
|
|
9
|
-
'string',
|
|
10
|
-
'integer',
|
|
11
|
-
'number',
|
|
12
|
-
'boolean',
|
|
13
|
-
'array',
|
|
14
|
-
'object',
|
|
15
|
-
'null',
|
|
16
|
-
]);
|
|
17
|
-
const isPlainObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
18
|
-
const resolveRef = (doc, ref) => {
|
|
19
|
-
if (!ref.startsWith('#/')) {
|
|
20
|
-
throw new Error(`@databehave/server/openapi: remote $ref not supported by OAS-only generator: ${ref}`);
|
|
21
|
-
}
|
|
22
|
-
const m = /^#\/components\/schemas\/(.+)$/.exec(ref);
|
|
23
|
-
if (!m) {
|
|
24
|
-
throw new Error(`@databehave/server/openapi: unsupported $ref: ${ref}`);
|
|
25
|
-
}
|
|
26
|
-
const name = decodeURIComponent(m[1]);
|
|
27
|
-
const target = doc.components?.schemas?.[name];
|
|
28
|
-
if (!target) {
|
|
29
|
-
throw new Error(`@databehave/server/openapi: $ref not found: ${ref}`);
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Pick the concrete (non-`null`) type when OAS 3.1 declares
|
|
35
|
-
* `["string","null"]`. OAS 3.0 `nullable: true` is treated the same
|
|
36
|
-
* way: the generator never emits `null` from a nullable widening —
|
|
37
|
-
* callers that want explicit `null` use `examples` or `enum`.
|
|
38
|
-
*/
|
|
39
|
-
const pickType = (node) => {
|
|
40
|
-
if (Array.isArray(node.type)) {
|
|
41
|
-
return node.type.find((t) => t !== 'null');
|
|
42
|
-
}
|
|
43
|
-
return node.type;
|
|
44
|
-
};
|
|
45
|
-
export const generateFromOasSchema = (node, doc = {},
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
-
_opts = {}, seen = new Set()) => {
|
|
48
|
-
const ex = node.example;
|
|
49
|
-
if (ex !== undefined)
|
|
50
|
-
return ex;
|
|
51
|
-
const examples = node.examples;
|
|
52
|
-
if (Array.isArray(examples) && examples.length > 0)
|
|
53
|
-
return examples[0];
|
|
54
|
-
if (Array.isArray(node.enum) && node.enum.length > 0)
|
|
55
|
-
return node.enum[0];
|
|
56
|
-
if (node.const !== undefined)
|
|
57
|
-
return node.const;
|
|
58
|
-
if (node.$ref) {
|
|
59
|
-
if (seen.has(node.$ref))
|
|
60
|
-
return {};
|
|
61
|
-
const next = new Set(seen);
|
|
62
|
-
next.add(node.$ref);
|
|
63
|
-
return generateFromOasSchema(resolveRef(doc, node.$ref), doc, _opts, next);
|
|
64
|
-
}
|
|
65
|
-
if (Array.isArray(node.allOf) && node.allOf.length > 0) {
|
|
66
|
-
let merged = {};
|
|
67
|
-
for (const branch of node.allOf) {
|
|
68
|
-
const v = generateFromOasSchema(branch, doc, _opts, seen);
|
|
69
|
-
if (isPlainObject(v))
|
|
70
|
-
merged = { ...merged, ...v };
|
|
71
|
-
else
|
|
72
|
-
return v;
|
|
73
|
-
}
|
|
74
|
-
return merged;
|
|
75
|
-
}
|
|
76
|
-
if (Array.isArray(node.oneOf) && node.oneOf.length > 0) {
|
|
77
|
-
return generateFromOasSchema(node.oneOf[0], doc, _opts, seen);
|
|
78
|
-
}
|
|
79
|
-
if (Array.isArray(node.anyOf) && node.anyOf.length > 0) {
|
|
80
|
-
return generateFromOasSchema(node.anyOf[0], doc, _opts, seen);
|
|
81
|
-
}
|
|
82
|
-
let t = pickType(node);
|
|
83
|
-
if (!t && node.properties)
|
|
84
|
-
t = 'object';
|
|
85
|
-
if (!t && node.items !== undefined)
|
|
86
|
-
t = 'array';
|
|
87
|
-
if (!t)
|
|
88
|
-
return {};
|
|
89
|
-
if (typeof t === 'string' && !KNOWN_TYPES.has(t)) {
|
|
90
|
-
throw new Error(`@databehave/server/openapi: unsupported OpenAPI node: ${JSON.stringify(node)}`);
|
|
91
|
-
}
|
|
92
|
-
if (t === 'null')
|
|
93
|
-
return null;
|
|
94
|
-
if (t === 'string') {
|
|
95
|
-
if (node.format && FORMAT_STRINGS[node.format]) {
|
|
96
|
-
return FORMAT_STRINGS[node.format];
|
|
97
|
-
}
|
|
98
|
-
return 'string';
|
|
99
|
-
}
|
|
100
|
-
if (t === 'integer' || t === 'number') {
|
|
101
|
-
return typeof node.minimum === 'number' ? node.minimum : 0;
|
|
102
|
-
}
|
|
103
|
-
if (t === 'boolean')
|
|
104
|
-
return false;
|
|
105
|
-
if (t === 'array') {
|
|
106
|
-
const itemNode = node.items ?? {};
|
|
107
|
-
const count = typeof node.minItems === 'number' && node.minItems > 0 ? node.minItems : 1;
|
|
108
|
-
const out = [];
|
|
109
|
-
for (let i = 0; i < count; i += 1) {
|
|
110
|
-
out.push(generateFromOasSchema(itemNode, doc, _opts, seen));
|
|
111
|
-
}
|
|
112
|
-
return out;
|
|
113
|
-
}
|
|
114
|
-
// object
|
|
115
|
-
const out = {};
|
|
116
|
-
for (const [k, v] of Object.entries(node.properties ?? {})) {
|
|
117
|
-
out[k] = generateFromOasSchema(v, doc, _opts, seen);
|
|
118
|
-
}
|
|
119
|
-
return out;
|
|
120
|
-
};
|
|
121
|
-
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/openapi/generate.ts"],"names":[],"mappings":"AAoBA,MAAM,cAAc,GAAqC;IACvD,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,sCAAsC;IAC5C,GAAG,EAAE,sBAAsB;CAC5B,CAAA;AAED,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC/C,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,CAAC,CAAU,EAAgC,EAAE,CACjE,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAE1D,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAW,EAAE;IACvD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,gFAAgF,GAAG,EAAE,CACtF,CAAA;IACH,CAAC;IACD,MAAM,CAAC,GAAG,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpD,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,iDAAiD,GAAG,EAAE,CAAC,CAAA;IACzE,CAAC;IACD,MAAM,IAAI,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;IAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,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AAC,CAAC,CAAC,CAAC,CAAA;QAC5E,MAAM,GAAG,GAAc,EAAE,CAAA;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;QAC7D,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IACD,SAAS;IACT,MAAM,GAAG,GAA4B,EAAE,CAAA;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
package/dist/openapi/loader.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a JSON OpenAPI document.
|
|
3
|
-
*
|
|
4
|
-
* Consumers hand `@databehave/server` the raw text — how they obtained it
|
|
5
|
-
* (`fs.readFile`, `fetch`, bundler `?raw` import) is up to them.
|
|
6
|
-
*
|
|
7
|
-
* `@databehave/server` is JSON-only. Convert YAML up-front
|
|
8
|
-
* (`yq -o=json spec.yaml > spec.json`) and pass the JSON bytes through.
|
|
9
|
-
*/
|
|
10
|
-
import type { OasDoc } from './walker.js';
|
|
11
|
-
/**
|
|
12
|
-
* Parse a JSON OpenAPI document.
|
|
13
|
-
*
|
|
14
|
-
* `sourcePath` is optional metadata used only to enrich error messages
|
|
15
|
-
* and to refuse YAML inputs by extension with an actionable hint.
|
|
16
|
-
*/
|
|
17
|
-
export declare const parseOpenApi: (text: string, sourcePath?: string) => OasDoc;
|
|
18
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/openapi/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,aAAa,MAAM,KAAG,MAoBhE,CAAA"}
|
package/dist/openapi/loader.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a JSON OpenAPI document.
|
|
3
|
-
*
|
|
4
|
-
* `sourcePath` is optional metadata used only to enrich error messages
|
|
5
|
-
* and to refuse YAML inputs by extension with an actionable hint.
|
|
6
|
-
*/
|
|
7
|
-
export const parseOpenApi = (text, sourcePath) => {
|
|
8
|
-
// Strip a leading UTF-8 BOM (U+FEFF) if present — common when the
|
|
9
|
-
// OAS document was authored in Windows tooling or saved as
|
|
10
|
-
// "UTF-8 with BOM". Without this, the very first `JSON.parse`
|
|
11
|
-
// throws "Unexpected token" with no actionable hint.
|
|
12
|
-
const stripped = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
|
|
13
|
-
if (sourcePath !== undefined && /\.ya?ml$/i.test(sourcePath)) {
|
|
14
|
-
throw new Error('JSON-only spec loader. Convert YAML first: yq -o=json <file>.yaml > <file>.json');
|
|
15
|
-
}
|
|
16
|
-
const where = sourcePath !== undefined ? ` at ${sourcePath}` : '';
|
|
17
|
-
try {
|
|
18
|
-
return JSON.parse(stripped);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
22
|
-
throw new Error(`@databehave/server/openapi: failed to parse JSON OpenAPI document${where}: ${msg}`);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/openapi/loader.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,UAAmB,EAAU,EAAE;IACxE,kEAAkE;IAClE,2DAA2D;IAC3D,8DAA8D;IAC9D,qDAAqD;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACrE,IAAI,UAAU,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAA;IACH,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACjE,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAW,CAAA;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC5D,MAAM,IAAI,KAAK,CACb,oEAAoE,KAAK,KAAK,GAAG,EAAE,CACpF,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build a route table of `Handler`s from an OpenAPI document.
|
|
3
|
-
*
|
|
4
|
-
* The walker visits every `paths.*.<method>` entry. For each that
|
|
5
|
-
* has a non-empty 200 response schema, a deterministic mock body is
|
|
6
|
-
* generated once at boot (so OAS gaps surface at boot, not on the
|
|
7
|
-
* first request) and the handler re-serves it per request.
|
|
8
|
-
*
|
|
9
|
-
* Determinism: the OAS-only generator emits structural placeholder
|
|
10
|
-
* values, so same schema → same body. Per-request seeding (path /
|
|
11
|
-
* query params) is reserved for a future seeded mode (brief #11)
|
|
12
|
-
* and currently has no effect on the body.
|
|
13
|
-
*
|
|
14
|
-
* Endpoints without a usable schema get a tiny stub: `{}` for GET,
|
|
15
|
-
* `{ success: true, message: null }` for mutating methods.
|
|
16
|
-
*
|
|
17
|
-
* Pure: this module never reads files or talks to the HTTP layer. It produces
|
|
18
|
-
* plain `Handler` callables that @databehave/server registers like any
|
|
19
|
-
* hand-written route.
|
|
20
|
-
*/
|
|
21
|
-
import type { Handler, Method, RouteKey } from '../types.js';
|
|
22
|
-
import type { OasDoc } from './walker.js';
|
|
23
|
-
export interface OpenApiRoutesOptions {
|
|
24
|
-
/** Route keys (`'METHOD /path'`) the OAS walker must NOT register. */
|
|
25
|
-
readonly skip?: ReadonlySet<RouteKey>;
|
|
26
|
-
/** Optional callback for walker failures. Defaults to silent stub fallback. */
|
|
27
|
-
readonly onWalkError?: (method: Method, routePath: string, err: unknown) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Optional callback fired when the OAS declares a response with an
|
|
30
|
-
* empty / permissive schema (`schema: {}`). Per JSON Schema this
|
|
31
|
-
* matches any value, so we still serve a deterministic stub — but
|
|
32
|
-
* the caller usually wants to surface it so the spec gap is fixed.
|
|
33
|
-
*/
|
|
34
|
-
readonly onEmptySchema?: (method: Method, routePath: string, status: number) => void;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Build a per-route per-status JSON body generator map from the OAS
|
|
38
|
-
* `responses` table. Used by mock-mode to synthesize an error body
|
|
39
|
-
* from the schema declared for that status code.
|
|
40
|
-
*
|
|
41
|
-
* Each generator is deterministic: same `(routeKey, status)` always
|
|
42
|
-
* yields the same body. Routes with `:param` segments are matched
|
|
43
|
-
* by exact path key only — runtime path-param substitution is the
|
|
44
|
-
* caller's responsibility.
|
|
45
|
-
*
|
|
46
|
-
* `onWalkError` mirrors `buildOpenApiRoutes` so spec gaps in error
|
|
47
|
-
* responses surface the same way as gaps in success responses.
|
|
48
|
-
*/
|
|
49
|
-
export declare const buildOpenApiResponseGenerators: (doc: OasDoc, options?: {
|
|
50
|
-
onWalkError?: OpenApiRoutesOptions["onWalkError"];
|
|
51
|
-
}) => Map<RouteKey, Map<number, () => unknown>>;
|
|
52
|
-
/**
|
|
53
|
-
* Produce a `Map<RouteKey, Handler>` covering every OAS
|
|
54
|
-
* `paths.<p>.<m>` not in `skip`. Failing schemas fall back to the
|
|
55
|
-
* stub body and report via `onWalkError` (default: ignore).
|
|
56
|
-
*/
|
|
57
|
-
export declare const buildOpenApiRoutes: (doc: OasDoc, options?: OpenApiRoutesOptions) => Map<RouteKey, Handler>;
|
|
58
|
-
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/openapi/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG5D,OAAO,KAAK,EAAE,MAAM,EAAW,MAAM,aAAa,CAAA;AAwClD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;IACrC,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,OAAO,KACT,IAAI,CAAA;IACT;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CACvB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,KACX,IAAI,CAAA;CACV;AAmBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,8BAA8B,GACzC,KAAK,MAAM,EACX,UAAS;IAAE,WAAW,CAAC,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAA;CAAO,KAClE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,CA+C1C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,KAAK,MAAM,EACX,UAAS,oBAAyB,KACjC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAuDvB,CAAA"}
|
package/dist/openapi/register.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { generateFromOasSchema } from './generate.js';
|
|
2
|
-
const SUPPORTED_METHODS = new Set([
|
|
3
|
-
'get',
|
|
4
|
-
'post',
|
|
5
|
-
'put',
|
|
6
|
-
'delete',
|
|
7
|
-
'patch',
|
|
8
|
-
]);
|
|
9
|
-
/**
|
|
10
|
-
* Convert OAS path syntax (`/users/{id}`) into @databehave/server pattern syntax
|
|
11
|
-
* (`/users/:id`). Other `{x}` placeholders not isolated to a single
|
|
12
|
-
* segment are left as-is — the matcher will then reject them at
|
|
13
|
-
* registration time.
|
|
14
|
-
*/
|
|
15
|
-
const oasPathToInternal = (oasPath) => oasPath
|
|
16
|
-
.split('/')
|
|
17
|
-
.map((seg) => (seg.startsWith('{') && seg.endsWith('}') ? `:${seg.slice(1, -1)}` : seg))
|
|
18
|
-
.join('/');
|
|
19
|
-
const stubBody = (method) => Object.freeze(method === 'get' ? {} : { success: true, message: null });
|
|
20
|
-
const buildHandler = (body) => {
|
|
21
|
-
// The OAS-only generator is structurally deterministic — same
|
|
22
|
-
// schema → same value — so the body is materialised once at boot
|
|
23
|
-
// and re-served per request.
|
|
24
|
-
return () => ({ json: body });
|
|
25
|
-
};
|
|
26
|
-
const buildStubHandler = (_routePath, method) => {
|
|
27
|
-
const body = stubBody(method);
|
|
28
|
-
return () => ({ json: body });
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* `true` when an OAS schema node is empty / permissive (`{}`) —
|
|
32
|
-
* i.e. carries no shape information (no `$ref`, `type`, `enum`,
|
|
33
|
-
* `const`, `properties`, `items`, `allOf`, `oneOf`, `anyOf`).
|
|
34
|
-
* Per JSON Schema this matches any JSON value.
|
|
35
|
-
*/
|
|
36
|
-
const isEmptyOasSchema = (node) => !node.$ref &&
|
|
37
|
-
!node.type &&
|
|
38
|
-
!node.enum &&
|
|
39
|
-
node.const === undefined &&
|
|
40
|
-
!node.properties &&
|
|
41
|
-
!node.items &&
|
|
42
|
-
!node.allOf &&
|
|
43
|
-
!node.oneOf &&
|
|
44
|
-
!node.anyOf;
|
|
45
|
-
/**
|
|
46
|
-
* Build a per-route per-status JSON body generator map from the OAS
|
|
47
|
-
* `responses` table. Used by mock-mode to synthesize an error body
|
|
48
|
-
* from the schema declared for that status code.
|
|
49
|
-
*
|
|
50
|
-
* Each generator is deterministic: same `(routeKey, status)` always
|
|
51
|
-
* yields the same body. Routes with `:param` segments are matched
|
|
52
|
-
* by exact path key only — runtime path-param substitution is the
|
|
53
|
-
* caller's responsibility.
|
|
54
|
-
*
|
|
55
|
-
* `onWalkError` mirrors `buildOpenApiRoutes` so spec gaps in error
|
|
56
|
-
* responses surface the same way as gaps in success responses.
|
|
57
|
-
*/
|
|
58
|
-
export const buildOpenApiResponseGenerators = (doc, options = {}) => {
|
|
59
|
-
const out = new Map();
|
|
60
|
-
const paths = doc.paths;
|
|
61
|
-
if (!paths)
|
|
62
|
-
return out;
|
|
63
|
-
for (const [oasPath, methods] of Object.entries(paths)) {
|
|
64
|
-
if (oasPath === '/')
|
|
65
|
-
continue;
|
|
66
|
-
const kitPath = oasPathToInternal(oasPath);
|
|
67
|
-
for (const [methodName, op] of Object.entries(methods)) {
|
|
68
|
-
const method = methodName.toLowerCase();
|
|
69
|
-
if (!SUPPORTED_METHODS.has(method))
|
|
70
|
-
continue;
|
|
71
|
-
const key = `${method.toUpperCase()} ${kitPath}`;
|
|
72
|
-
const responses = op.responses;
|
|
73
|
-
if (!responses)
|
|
74
|
-
continue;
|
|
75
|
-
const perStatus = new Map();
|
|
76
|
-
for (const [statusStr, resp] of Object.entries(responses)) {
|
|
77
|
-
const status = Number.parseInt(statusStr, 10);
|
|
78
|
-
if (!Number.isFinite(status))
|
|
79
|
-
continue;
|
|
80
|
-
const schemaNode = resp?.content?.['application/json']?.schema;
|
|
81
|
-
if (!schemaNode || typeof schemaNode !== 'object')
|
|
82
|
-
continue;
|
|
83
|
-
if (isEmptyOasSchema(schemaNode)) {
|
|
84
|
-
// Permissive — let mock-mode fall back to its envelope.
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
// Pre-generate at boot — the OAS-only generator is
|
|
89
|
-
// structurally deterministic so the body is constant per
|
|
90
|
-
// (route, status).
|
|
91
|
-
const body = generateFromOasSchema(schemaNode, doc);
|
|
92
|
-
perStatus.set(status, () => body);
|
|
93
|
-
}
|
|
94
|
-
catch (err) {
|
|
95
|
-
// Caller's mock-mode fallback envelope will be used; surface
|
|
96
|
-
// the spec gap so it can be fixed.
|
|
97
|
-
options.onWalkError?.(method, kitPath, err);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (perStatus.size > 0)
|
|
101
|
-
out.set(key, perStatus);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return out;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Produce a `Map<RouteKey, Handler>` covering every OAS
|
|
108
|
-
* `paths.<p>.<m>` not in `skip`. Failing schemas fall back to the
|
|
109
|
-
* stub body and report via `onWalkError` (default: ignore).
|
|
110
|
-
*/
|
|
111
|
-
export const buildOpenApiRoutes = (doc, options = {}) => {
|
|
112
|
-
const out = new Map();
|
|
113
|
-
const skip = options.skip ?? new Set();
|
|
114
|
-
const paths = doc.paths;
|
|
115
|
-
if (!paths)
|
|
116
|
-
return out;
|
|
117
|
-
for (const [oasPath, methods] of Object.entries(paths)) {
|
|
118
|
-
if (oasPath === '/')
|
|
119
|
-
continue;
|
|
120
|
-
const kitPath = oasPathToInternal(oasPath);
|
|
121
|
-
for (const [methodName, op] of Object.entries(methods)) {
|
|
122
|
-
const method = methodName.toLowerCase();
|
|
123
|
-
if (!SUPPORTED_METHODS.has(method))
|
|
124
|
-
continue;
|
|
125
|
-
const key = `${method.toUpperCase()} ${kitPath}`;
|
|
126
|
-
if (skip.has(key))
|
|
127
|
-
continue;
|
|
128
|
-
// Prefer 200, then the smallest declared 2xx response \u2014 OAS
|
|
129
|
-
// documents for mutating endpoints often only declare 201 / 202
|
|
130
|
-
// / 204, so falling back to those keeps the synthesised handler
|
|
131
|
-
// honest. 204 explicitly means \"no body\" and is handled below.
|
|
132
|
-
const responses = op.responses ?? {};
|
|
133
|
-
const twoXx = Object.keys(responses)
|
|
134
|
-
.map((s) => Number.parseInt(s, 10))
|
|
135
|
-
.filter((n) => Number.isFinite(n) && n >= 200 && n < 300)
|
|
136
|
-
.sort((a, b) => (a === 200 ? -1 : b === 200 ? 1 : a - b));
|
|
137
|
-
const pickedStatus = twoXx[0];
|
|
138
|
-
const pickedKey = pickedStatus !== undefined ? String(pickedStatus) : '200';
|
|
139
|
-
const responseSchema = responses[pickedKey]?.content?.['application/json']?.schema;
|
|
140
|
-
try {
|
|
141
|
-
if (pickedStatus === 204) {
|
|
142
|
-
out.set(key, buildStubHandler(kitPath, method));
|
|
143
|
-
}
|
|
144
|
-
else if (responseSchema && typeof responseSchema === 'object') {
|
|
145
|
-
if (isEmptyOasSchema(responseSchema)) {
|
|
146
|
-
options.onEmptySchema?.(method, kitPath, pickedStatus ?? 200);
|
|
147
|
-
out.set(key, buildStubHandler(kitPath, method));
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
const body = generateFromOasSchema(responseSchema, doc);
|
|
151
|
-
out.set(key, buildHandler(body));
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
out.set(key, buildStubHandler(kitPath, method));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
catch (err) {
|
|
159
|
-
options.onWalkError?.(method, kitPath, err);
|
|
160
|
-
out.set(key, buildStubHandler(kitPath, method));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return out;
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=register.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/openapi/register.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAGrD,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAS;IAC7D,KAAK;IACL,MAAM;IACN,KAAK;IACL,QAAQ;IACR,OAAO;CACR,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAU,EAAE,CACpD,OAAO;KACJ,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACvF,IAAI,CAAC,GAAG,CAAC,CAAA;AAEd,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAU,EAAE,CAC1C,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;AAEzE,MAAM,YAAY,GAAG,CAAC,IAAa,EAAW,EAAE;IAC9C,8DAA8D;IAC9D,iEAAiE;IACjE,6BAA6B;IAC7B,OAAO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M,CAAC;wBACN,MAAM,IAAI,GAAG,qBAAqB,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;wBACvD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;oBAClC,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;gBACjD,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC3C,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;YACjD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
package/dist/openapi/seed.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure helper for building deterministic databehave seed strings.
|
|
3
|
-
*
|
|
4
|
-
* Seed format: `<endpoint>|<sortedKey>=<val>|...|date=<YYYY-MM-DD>|day=<n>`.
|
|
5
|
-
* Same input → same string → databehave yields byte-identical JSON. Re-exported
|
|
6
|
-
* from `@databehave/server` so consumers can derive their own seeds without
|
|
7
|
-
* reimplementing the format.
|
|
8
|
-
*/
|
|
9
|
-
export type SeedInput = {
|
|
10
|
-
endpoint: string;
|
|
11
|
-
from?: string;
|
|
12
|
-
dayOffset?: number;
|
|
13
|
-
extra?: Record<string, unknown>;
|
|
14
|
-
};
|
|
15
|
-
export declare const seedFor: (i: SeedInput) => string;
|
|
16
|
-
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/openapi/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC,CAAA;AAmCD,eAAO,MAAM,OAAO,GAAI,GAAG,SAAS,KAAG,MAWtC,CAAA"}
|
package/dist/openapi/seed.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure helper for building deterministic databehave seed strings.
|
|
3
|
-
*
|
|
4
|
-
* Seed format: `<endpoint>|<sortedKey>=<val>|...|date=<YYYY-MM-DD>|day=<n>`.
|
|
5
|
-
* Same input → same string → databehave yields byte-identical JSON. Re-exported
|
|
6
|
-
* from `@databehave/server` so consumers can derive their own seeds without
|
|
7
|
-
* reimplementing the format.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Recursively rebuild `v` with object keys sorted so two structurally
|
|
11
|
-
* identical objects with different insertion orders serialise to the
|
|
12
|
-
* same string. Arrays preserve order (semantic), plain objects are
|
|
13
|
-
* key-sorted, primitives are returned as-is.
|
|
14
|
-
*/
|
|
15
|
-
const sortKeys = (v) => {
|
|
16
|
-
if (v === null || typeof v !== 'object')
|
|
17
|
-
return v;
|
|
18
|
-
if (Array.isArray(v))
|
|
19
|
-
return v.map(sortKeys);
|
|
20
|
-
const out = {};
|
|
21
|
-
for (const k of Object.keys(v).sort()) {
|
|
22
|
-
out[k] = sortKeys(v[k]);
|
|
23
|
-
}
|
|
24
|
-
return out;
|
|
25
|
-
};
|
|
26
|
-
const stringifyExtra = (v) => {
|
|
27
|
-
if (v === null || v === undefined)
|
|
28
|
-
return String(v);
|
|
29
|
-
const t = typeof v;
|
|
30
|
-
if (t === 'string' || t === 'number' || t === 'boolean' || t === 'bigint') {
|
|
31
|
-
return String(v);
|
|
32
|
-
}
|
|
33
|
-
// Objects / arrays — use JSON so distinct shapes produce distinct
|
|
34
|
-
// seeds. Keys are sorted recursively so insertion-order doesn't
|
|
35
|
-
// perturb the seed. Falls back to `String()` if stringify fails
|
|
36
|
-
// (cycles).
|
|
37
|
-
try {
|
|
38
|
-
return JSON.stringify(sortKeys(v));
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return String(v);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
export const seedFor = (i) => {
|
|
45
|
-
const parts = [i.endpoint];
|
|
46
|
-
if (i.extra) {
|
|
47
|
-
const keys = Object.keys(i.extra).sort();
|
|
48
|
-
if (keys.length > 0) {
|
|
49
|
-
parts.push(keys.map((k) => `${k}=${stringifyExtra(i.extra[k])}`).join('|'));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (i.from !== undefined)
|
|
53
|
-
parts.push(`date=${i.from}`);
|
|
54
|
-
if (i.dayOffset !== undefined)
|
|
55
|
-
parts.push(`day=${i.dayOffset}`);
|
|
56
|
-
return parts.join('|');
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=seed.js.map
|
package/dist/openapi/seed.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/openapi/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAW,EAAE;IACvC,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAA;IACjD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC5C,MAAM,GAAG,GAA4B,EAAE,CAAA;IACvC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAA4B,CAAC,CAAC,IAAI,EAAE,E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AAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QAC9E,CAAC;IACH,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IACtD,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAA;IAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAPI-node → @databehave/schema IR translator.
|
|
3
|
-
*
|
|
4
|
-
* Phase 2C step 2C.a: pure translator + unit tests. NOT yet wired into
|
|
5
|
-
* the OAS dispatch — `register.ts` and `generate.ts` still drive the
|
|
6
|
-
* default OAS-only mock path; this module is staged for the upcoming
|
|
7
|
-
* auto-schema mode where, when the consumer opts in via the JSONC
|
|
8
|
-
* `schema:` field, the server translates each response schema to the
|
|
9
|
-
* databehave IR and hands it to `mock()` for richer fixtures.
|
|
10
|
-
*
|
|
11
|
-
* Genuine-separation invariant: this file MUST NOT statically value-
|
|
12
|
-
* import `@databehave/schema`. The runtime DSL constructors are only
|
|
13
|
-
* loaded via `await import('@databehave/schema')` inside the function
|
|
14
|
-
* body, so OAS-only consumers who never opt in do not pay for the
|
|
15
|
-
* schema package at all. Type-only imports (`import type`) are erased
|
|
16
|
-
* at compile time and are fine.
|
|
17
|
-
*
|
|
18
|
-
* Supported OAS keywords (mirror `validation/validate.ts`):
|
|
19
|
-
* type / enum / required / properties / items / nullable + ["X","null"] /
|
|
20
|
-
* minLength / maxLength / pattern / minimum / maximum /
|
|
21
|
-
* exclusiveMinimum / exclusiveMaximum / minItems / maxItems /
|
|
22
|
-
* format (date | date-time | email | uuid | uri) /
|
|
23
|
-
* $ref (intra-document only) / oneOf / anyOf / allOf (shallow merge) /
|
|
24
|
-
* discriminator (propertyName + mapping) / example / examples / const /
|
|
25
|
-
* additionalProperties (no-op for generation; nested schema is
|
|
26
|
-
* recursively validated so unsupported inner keywords still FAIL LOUD).
|
|
27
|
-
*
|
|
28
|
-
* UNSUPPORTED keywords (FAIL LOUD at translate time, mirroring the
|
|
29
|
-
* validator): if / then / else / dependentSchemas / dependentRequired /
|
|
30
|
-
* unevaluatedProperties / unevaluatedItems / propertyNames /
|
|
31
|
-
* patternProperties / contentEncoding / contentMediaType /
|
|
32
|
-
* remote `http(s)://` $ref.
|
|
33
|
-
*
|
|
34
|
-
* Security guarantees mirror the validator:
|
|
35
|
-
* - Pattern length capped at 1024 chars (ReDoS guard).
|
|
36
|
-
* - `pattern` requires an own-node `maxLength` (ReDoS footgun).
|
|
37
|
-
* - Recursion depth capped at 64 levels.
|
|
38
|
-
* - $ref cycle detection via a build-time visited-pointer set.
|
|
39
|
-
*
|
|
40
|
-
* Precedence (mirrors `generate.ts` ordering, expressed via IR):
|
|
41
|
-
* example > examples[0] > enum[0]/enum > const > $ref >
|
|
42
|
-
* allOf (shallow merge of object branches) > oneOf[0]/union >
|
|
43
|
-
* anyOf[0]/union > type-fallback.
|
|
44
|
-
*/
|
|
45
|
-
import type { Schema } from '@databehave/schema';
|
|
46
|
-
import type { OasDoc as OasDocument, OasNode as OasSchemaNode } from './walker.js';
|
|
47
|
-
/**
|
|
48
|
-
* Translate an OpenAPI schema node into a `@databehave/schema` IR
|
|
49
|
-
* Schema instance. Throws at translate time on unsupported keywords,
|
|
50
|
-
* malformed `$ref`s, `$ref` cycles, ReDoS-vulnerable patterns, and
|
|
51
|
-
* schemas that exceed the depth cap. See the file header for the
|
|
52
|
-
* full keyword matrix and security guarantees.
|
|
53
|
-
*/
|
|
54
|
-
export declare function translateOasToIR(node: OasSchemaNode, doc: OasDocument): Promise<Schema<unknown>>;
|
|
55
|
-
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/openapi/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AAgVlF;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAO1B"}
|