@tsoa-next/runtime 8.0.4 → 8.0.5-dev.57.84bb4a63
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/dist/decorators/specPath.d.ts +45 -0
- package/dist/decorators/specPath.js +59 -0
- package/dist/decorators/specPath.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/routeGeneration/specPathSupport.d.ts +27 -0
- package/dist/routeGeneration/specPathSupport.js +405 -0
- package/dist/routeGeneration/specPathSupport.js.map +1 -0
- package/dist/utils/pathUtils.d.ts +1 -0
- package/dist/utils/pathUtils.js +46 -0
- package/dist/utils/pathUtils.js.map +1 -0
- package/package.json +22 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
import { Swagger } from '../swagger/swagger';
|
|
3
|
+
export type SpecRuntime = 'express' | 'koa' | 'hapi';
|
|
4
|
+
export type BuiltinSpecPathTarget = 'json' | 'yaml' | 'swagger' | 'redoc' | 'rapidoc';
|
|
5
|
+
export type SpecDocumentFormat = 'json' | 'yaml';
|
|
6
|
+
export type SpecResponseValue = string | Readable;
|
|
7
|
+
export interface SpecGenerator {
|
|
8
|
+
getSpecObject(): Promise<Swagger.Spec>;
|
|
9
|
+
getSpecString(format: SpecDocumentFormat): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export interface SpecCacheContext {
|
|
12
|
+
cacheKey: string;
|
|
13
|
+
controllerClass: object;
|
|
14
|
+
fullPath: string;
|
|
15
|
+
path: string;
|
|
16
|
+
runtime: SpecRuntime;
|
|
17
|
+
target: BuiltinSpecPathTarget | 'custom';
|
|
18
|
+
format?: SpecDocumentFormat | 'html';
|
|
19
|
+
}
|
|
20
|
+
export interface SpecRequestContext extends SpecCacheContext {
|
|
21
|
+
request?: unknown;
|
|
22
|
+
response?: unknown;
|
|
23
|
+
getSpecObject(): Promise<Swagger.Spec>;
|
|
24
|
+
getSpecString(format: SpecDocumentFormat): Promise<string>;
|
|
25
|
+
}
|
|
26
|
+
export type SpecResponseHandler = (context: SpecRequestContext) => SpecResponseValue | Promise<SpecResponseValue>;
|
|
27
|
+
export interface SpecCacheHandler {
|
|
28
|
+
get(context: SpecCacheContext): SpecResponseValue | Promise<SpecResponseValue | undefined> | undefined;
|
|
29
|
+
set(context: SpecCacheContext, value: string): void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type SpecPathTarget = BuiltinSpecPathTarget | SpecResponseHandler;
|
|
32
|
+
export type SpecPathCache = 'none' | 'memory' | SpecCacheHandler;
|
|
33
|
+
export interface SpecPathDefinition {
|
|
34
|
+
path: string;
|
|
35
|
+
normalizedPath: string;
|
|
36
|
+
target: SpecPathTarget;
|
|
37
|
+
cache: SpecPathCache;
|
|
38
|
+
}
|
|
39
|
+
export declare function SpecPath(path?: string, target?: SpecPathTarget, cache?: SpecPathCache): ClassDecorator;
|
|
40
|
+
export declare function fetchSpecPaths(target: object): readonly SpecPathDefinition[];
|
|
41
|
+
export declare function describeSpecPath(specPath: SpecPathDefinition): {
|
|
42
|
+
cache: string;
|
|
43
|
+
path: string;
|
|
44
|
+
target: string;
|
|
45
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpecPath = SpecPath;
|
|
4
|
+
exports.fetchSpecPaths = fetchSpecPaths;
|
|
5
|
+
exports.describeSpecPath = describeSpecPath;
|
|
6
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
|
+
const SPEC_PATHS_SYMBOL = Symbol.for('@tsoa-next/spec-paths');
|
|
8
|
+
function isBuiltinSpecTarget(target) {
|
|
9
|
+
return typeof target === 'string';
|
|
10
|
+
}
|
|
11
|
+
function getTargetDescription(target) {
|
|
12
|
+
return isBuiltinSpecTarget(target) ? target : 'custom handler';
|
|
13
|
+
}
|
|
14
|
+
function getCacheDescription(cache) {
|
|
15
|
+
return typeof cache === 'string' ? cache : 'custom cache';
|
|
16
|
+
}
|
|
17
|
+
function getExistingSpecPaths(target) {
|
|
18
|
+
const existing = Reflect.get(target, SPEC_PATHS_SYMBOL);
|
|
19
|
+
return existing ? [...existing] : [];
|
|
20
|
+
}
|
|
21
|
+
function defineSpecPaths(target, specPaths) {
|
|
22
|
+
Reflect.defineProperty(target, SPEC_PATHS_SYMBOL, {
|
|
23
|
+
configurable: true,
|
|
24
|
+
enumerable: false,
|
|
25
|
+
value: specPaths,
|
|
26
|
+
writable: true,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function normalizeSpecPath(path) {
|
|
30
|
+
return (0, pathUtils_1.normalisePath)(path ?? 'spec', '/');
|
|
31
|
+
}
|
|
32
|
+
function SpecPath(path = 'spec', target = 'json', cache = 'memory') {
|
|
33
|
+
return classTarget => {
|
|
34
|
+
const normalizedPath = normalizeSpecPath(path);
|
|
35
|
+
const existing = getExistingSpecPaths(classTarget);
|
|
36
|
+
if (existing.some(specPath => specPath.normalizedPath === normalizedPath)) {
|
|
37
|
+
const className = typeof classTarget === 'function' && classTarget.name ? classTarget.name : 'anonymous controller';
|
|
38
|
+
throw new Error(`Duplicate @SpecPath('${path}') found on '${className}'. Multiple SpecPath decorators must resolve to unique paths.`);
|
|
39
|
+
}
|
|
40
|
+
existing.push({
|
|
41
|
+
cache,
|
|
42
|
+
normalizedPath,
|
|
43
|
+
path,
|
|
44
|
+
target,
|
|
45
|
+
});
|
|
46
|
+
defineSpecPaths(classTarget, existing);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function fetchSpecPaths(target) {
|
|
50
|
+
return getExistingSpecPaths(target);
|
|
51
|
+
}
|
|
52
|
+
function describeSpecPath(specPath) {
|
|
53
|
+
return {
|
|
54
|
+
cache: getCacheDescription(specPath.cache),
|
|
55
|
+
path: specPath.path,
|
|
56
|
+
target: getTargetDescription(specPath.target),
|
|
57
|
+
};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AQ,CAAC,IAAI,GAAG,MAAM,EAAE,SAAyB,MAAM,EAAE,QAAuB,QAAQ;IACtG,OAAO,WAAW,CAAC,EAAE;QACnB,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAA;QAElD,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAc,KAAK,cAAc,CAAC,EAAE,CAAC;YAC1E,MAAM,SAAS,GAAG,OAAO,WAAW,KAAK,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAA;YACnH,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,gBAAgB,SAAS,+DAA+D,CAAC,CAAA;QACvI,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC;YACZ,KAAK;YACL,cAAc;YACd,IAAI;YACJ,MAAM;SACP,CAAC,CAAA;QAEF,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;IACxC,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,MAAc;IAC3C,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AACrC,CAAC;AAED,SAAgB,gBAAgB,CAAC,QAA4B;IAC3D,OAAO;QACL,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC1C,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC9C,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './decorators/parameter';
|
|
|
10
10
|
export * from './decorators/response';
|
|
11
11
|
export * from './decorators/route';
|
|
12
12
|
export * from './decorators/security';
|
|
13
|
+
export * from './decorators/specPath';
|
|
13
14
|
export * from './decorators/tags';
|
|
14
15
|
export * from './decorators/validate';
|
|
15
16
|
export * from './interfaces/controller';
|
|
@@ -19,8 +20,10 @@ export * from './interfaces/response';
|
|
|
19
20
|
export * from './metadataGeneration/tsoa';
|
|
20
21
|
export * from './routeGeneration/additionalProps';
|
|
21
22
|
export * from './routeGeneration/externalValidation';
|
|
23
|
+
export * from './routeGeneration/specPathSupport';
|
|
22
24
|
export * from './routeGeneration/templateHelpers';
|
|
23
25
|
export * from './routeGeneration/templates';
|
|
24
26
|
export * from './routeGeneration/tsoa-route';
|
|
25
27
|
export * from './swagger/swagger';
|
|
26
28
|
export * from './utils/assertNever';
|
|
29
|
+
export * from './utils/pathUtils';
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./decorators/parameter"), exports);
|
|
|
26
26
|
__exportStar(require("./decorators/response"), exports);
|
|
27
27
|
__exportStar(require("./decorators/route"), exports);
|
|
28
28
|
__exportStar(require("./decorators/security"), exports);
|
|
29
|
+
__exportStar(require("./decorators/specPath"), exports);
|
|
29
30
|
__exportStar(require("./decorators/tags"), exports);
|
|
30
31
|
__exportStar(require("./decorators/validate"), exports);
|
|
31
32
|
__exportStar(require("./interfaces/controller"), exports);
|
|
@@ -35,9 +36,11 @@ __exportStar(require("./interfaces/response"), exports);
|
|
|
35
36
|
__exportStar(require("./metadataGeneration/tsoa"), exports);
|
|
36
37
|
__exportStar(require("./routeGeneration/additionalProps"), exports);
|
|
37
38
|
__exportStar(require("./routeGeneration/externalValidation"), exports);
|
|
39
|
+
__exportStar(require("./routeGeneration/specPathSupport"), exports);
|
|
38
40
|
__exportStar(require("./routeGeneration/templateHelpers"), exports);
|
|
39
41
|
__exportStar(require("./routeGeneration/templates"), exports);
|
|
40
42
|
__exportStar(require("./routeGeneration/tsoa-route"), exports);
|
|
41
43
|
__exportStar(require("./swagger/swagger"), exports);
|
|
42
44
|
__exportStar(require("./utils/assertNever"), exports);
|
|
45
|
+
__exportStar(require("./utils/pathUtils"), exports);
|
|
43
46
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAAyB;AACzB,2CAAwB;AACxB,0DAAuC;AACvC,uDAAoC;AACpC,yDAAsC;AACtC,uDAAoC;AACpC,2DAAwC;AACxC,2DAAwC;AACxC,yDAAsC;AACtC,wDAAqC;AACrC,qDAAkC;AAClC,wDAAqC;AACrC,oDAAiC;AACjC,wDAAqC;AACrC,0DAAuC;AACvC,oDAAiC;AACjC,yDAAsC;AACtC,wDAAqC;AACrC,4DAAyC;AACzC,oEAAiD;AACjD,uEAAoD;AACpD,oEAAiD;AACjD,8DAA2C;AAC3C,+DAA4C;AAC5C,oDAAiC;AACjC,sDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAAyB;AACzB,2CAAwB;AACxB,0DAAuC;AACvC,uDAAoC;AACpC,yDAAsC;AACtC,uDAAoC;AACpC,2DAAwC;AACxC,2DAAwC;AACxC,yDAAsC;AACtC,wDAAqC;AACrC,qDAAkC;AAClC,wDAAqC;AACrC,wDAAqC;AACrC,oDAAiC;AACjC,wDAAqC;AACrC,0DAAuC;AACvC,oDAAiC;AACjC,yDAAsC;AACtC,wDAAqC;AACrC,4DAAyC;AACzC,oEAAiD;AACjD,uEAAoD;AACpD,oEAAiD;AACjD,oEAAiD;AACjD,8DAA2C;AAC3C,+DAA4C;AAC5C,oDAAiC;AACjC,sDAAmC;AACnC,oDAAiC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SpecGenerator, SpecPathDefinition, SpecResponseValue, SpecRuntime } from '../decorators/specPath';
|
|
2
|
+
import { Config, SpecConfig } from '../config';
|
|
3
|
+
export interface RuntimeSpecConfigSnapshot {
|
|
4
|
+
compilerOptions?: Record<string, unknown>;
|
|
5
|
+
defaultNumberType?: Config['defaultNumberType'];
|
|
6
|
+
ignore?: string[];
|
|
7
|
+
spec: SpecConfig & {
|
|
8
|
+
entryFile: Config['entryFile'];
|
|
9
|
+
controllerPathGlobs?: Config['controllerPathGlobs'];
|
|
10
|
+
noImplicitAdditionalProperties: Exclude<Config['noImplicitAdditionalProperties'], undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ResolvedSpecResponse {
|
|
14
|
+
body: SpecResponseValue;
|
|
15
|
+
contentType?: string;
|
|
16
|
+
}
|
|
17
|
+
type SpecContextArgs = {
|
|
18
|
+
controllerClass: object;
|
|
19
|
+
fullPath: string;
|
|
20
|
+
request?: unknown;
|
|
21
|
+
response?: unknown;
|
|
22
|
+
runtime: SpecRuntime;
|
|
23
|
+
specGenerator: SpecGenerator;
|
|
24
|
+
specPath: SpecPathDefinition;
|
|
25
|
+
};
|
|
26
|
+
export declare function resolveSpecPathResponse(args: SpecContextArgs): Promise<ResolvedSpecResponse>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveSpecPathResponse = resolveSpecPathResponse;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_module_1 = require("node:module");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const node_stream_1 = require("node:stream");
|
|
9
|
+
const memoryCache = new WeakMap();
|
|
10
|
+
const assetCache = new Map();
|
|
11
|
+
const controllerCacheScopes = new WeakMap();
|
|
12
|
+
const specGeneratorCacheScopes = new WeakMap();
|
|
13
|
+
let controllerCacheScopeId = 0;
|
|
14
|
+
let specGeneratorCacheScopeId = 0;
|
|
15
|
+
function isAsyncIterable(value) {
|
|
16
|
+
return value != null && typeof value[Symbol.asyncIterator] === 'function';
|
|
17
|
+
}
|
|
18
|
+
function isReadableStream(value) {
|
|
19
|
+
return (isAsyncIterable(value) ||
|
|
20
|
+
value instanceof node_stream_1.Readable ||
|
|
21
|
+
(typeof value === 'object' &&
|
|
22
|
+
value !== null &&
|
|
23
|
+
'pipe' in value &&
|
|
24
|
+
typeof value.pipe === 'function' &&
|
|
25
|
+
'on' in value &&
|
|
26
|
+
typeof value.on === 'function'));
|
|
27
|
+
}
|
|
28
|
+
function getMemoryCache(specGenerator) {
|
|
29
|
+
const cached = memoryCache.get(specGenerator);
|
|
30
|
+
if (cached) {
|
|
31
|
+
return cached;
|
|
32
|
+
}
|
|
33
|
+
const created = new Map();
|
|
34
|
+
memoryCache.set(specGenerator, created);
|
|
35
|
+
return created;
|
|
36
|
+
}
|
|
37
|
+
function getControllerCacheScope(controllerClass) {
|
|
38
|
+
const cached = controllerCacheScopes.get(controllerClass);
|
|
39
|
+
if (cached) {
|
|
40
|
+
return cached;
|
|
41
|
+
}
|
|
42
|
+
const created = `controller:${controllerCacheScopeId++}`;
|
|
43
|
+
controllerCacheScopes.set(controllerClass, created);
|
|
44
|
+
return created;
|
|
45
|
+
}
|
|
46
|
+
function getSpecGeneratorCacheScope(specGenerator) {
|
|
47
|
+
const cached = specGeneratorCacheScopes.get(specGenerator);
|
|
48
|
+
if (cached) {
|
|
49
|
+
return cached;
|
|
50
|
+
}
|
|
51
|
+
const created = `spec-generator:${specGeneratorCacheScopeId++}`;
|
|
52
|
+
specGeneratorCacheScopes.set(specGenerator, created);
|
|
53
|
+
return created;
|
|
54
|
+
}
|
|
55
|
+
function getContentType(target) {
|
|
56
|
+
switch (target) {
|
|
57
|
+
case 'json':
|
|
58
|
+
return 'application/json; charset=utf-8';
|
|
59
|
+
case 'yaml':
|
|
60
|
+
return 'application/yaml; charset=utf-8';
|
|
61
|
+
default:
|
|
62
|
+
return 'text/html; charset=utf-8';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function getFormat(target) {
|
|
66
|
+
switch (target) {
|
|
67
|
+
case 'json':
|
|
68
|
+
return 'json';
|
|
69
|
+
case 'yaml':
|
|
70
|
+
return 'yaml';
|
|
71
|
+
case 'swagger':
|
|
72
|
+
case 'redoc':
|
|
73
|
+
case 'rapidoc':
|
|
74
|
+
return 'html';
|
|
75
|
+
default:
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function getCacheHandler({ specGenerator, specPath }) {
|
|
80
|
+
const { cache } = specPath;
|
|
81
|
+
if (cache === 'none') {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (cache === 'memory') {
|
|
85
|
+
const scopedMemoryCache = getMemoryCache(specGenerator);
|
|
86
|
+
return {
|
|
87
|
+
get(context) {
|
|
88
|
+
return scopedMemoryCache.get(context.cacheKey);
|
|
89
|
+
},
|
|
90
|
+
set(context, value) {
|
|
91
|
+
scopedMemoryCache.set(context.cacheKey, value);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return cache;
|
|
96
|
+
}
|
|
97
|
+
function getCacheKey({ controllerClass, fullPath, runtime, specGenerator, specPath }) {
|
|
98
|
+
const format = typeof specPath.target === 'string' ? specPath.target : 'custom';
|
|
99
|
+
let cacheMode;
|
|
100
|
+
if (specPath.cache === 'none') {
|
|
101
|
+
cacheMode = 'none';
|
|
102
|
+
}
|
|
103
|
+
else if (specPath.cache === 'memory') {
|
|
104
|
+
cacheMode = 'memory';
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
cacheMode = 'custom';
|
|
108
|
+
}
|
|
109
|
+
const cacheInput = JSON.stringify({
|
|
110
|
+
cache: cacheMode,
|
|
111
|
+
controller: getControllerCacheScope(controllerClass),
|
|
112
|
+
fullPath,
|
|
113
|
+
format,
|
|
114
|
+
runtime,
|
|
115
|
+
specGenerator: getSpecGeneratorCacheScope(specGenerator),
|
|
116
|
+
});
|
|
117
|
+
return (0, node_crypto_1.createHash)('sha256').update(cacheInput).digest('hex');
|
|
118
|
+
}
|
|
119
|
+
function createSpecRequestContext(args) {
|
|
120
|
+
const target = typeof args.specPath.target === 'string' ? args.specPath.target : 'custom';
|
|
121
|
+
const cacheContext = {
|
|
122
|
+
cacheKey: getCacheKey(args),
|
|
123
|
+
controllerClass: args.controllerClass,
|
|
124
|
+
format: getFormat(target),
|
|
125
|
+
fullPath: args.fullPath,
|
|
126
|
+
path: args.specPath.path,
|
|
127
|
+
runtime: args.runtime,
|
|
128
|
+
target,
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
...cacheContext,
|
|
132
|
+
getSpecObject: () => args.specGenerator.getSpecObject(),
|
|
133
|
+
getSpecString: format => args.specGenerator.getSpecString(format),
|
|
134
|
+
request: args.request,
|
|
135
|
+
response: args.response,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function readResponseValue(value) {
|
|
139
|
+
if (!isReadableStream(value)) {
|
|
140
|
+
return value;
|
|
141
|
+
}
|
|
142
|
+
if (isAsyncIterable(value)) {
|
|
143
|
+
const chunks = [];
|
|
144
|
+
for await (const chunk of value) {
|
|
145
|
+
chunks.push(toResponseChunkBuffer(chunk));
|
|
146
|
+
}
|
|
147
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
148
|
+
}
|
|
149
|
+
return readReadableStreamFromEvents(value);
|
|
150
|
+
}
|
|
151
|
+
function toResponseChunkBuffer(chunk) {
|
|
152
|
+
if (typeof chunk === 'string') {
|
|
153
|
+
return Buffer.from(chunk);
|
|
154
|
+
}
|
|
155
|
+
if (chunk instanceof Uint8Array) {
|
|
156
|
+
return chunk;
|
|
157
|
+
}
|
|
158
|
+
return Buffer.from(String(chunk));
|
|
159
|
+
}
|
|
160
|
+
function readReadableStreamFromEvents(value) {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const chunks = [];
|
|
163
|
+
value.on('data', (chunk) => {
|
|
164
|
+
chunks.push(toResponseChunkBuffer(chunk));
|
|
165
|
+
});
|
|
166
|
+
value.once('end', () => {
|
|
167
|
+
resolve(Buffer.concat(chunks).toString('utf8'));
|
|
168
|
+
});
|
|
169
|
+
value.once('error', reject);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function serializeSpecForHtml(spec) {
|
|
173
|
+
return JSON.stringify(spec)
|
|
174
|
+
.replaceAll('<', String.raw `\u003c`)
|
|
175
|
+
.replaceAll('>', String.raw `\u003e`)
|
|
176
|
+
.replaceAll('&', String.raw `\u0026`);
|
|
177
|
+
}
|
|
178
|
+
function escapeHtmlText(value) {
|
|
179
|
+
return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>');
|
|
180
|
+
}
|
|
181
|
+
async function readPeerFile(packageName, candidates) {
|
|
182
|
+
const cacheKey = `${packageName}:${candidates.join('|')}`;
|
|
183
|
+
const cached = assetCache.get(cacheKey);
|
|
184
|
+
if (cached) {
|
|
185
|
+
return cached;
|
|
186
|
+
}
|
|
187
|
+
const loadPromise = (async () => {
|
|
188
|
+
let packageJsonPath;
|
|
189
|
+
try {
|
|
190
|
+
packageJsonPath = require.resolve(`${packageName}/package.json`);
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
throw new Error(`SpecPath target requires optional peer dependency '${packageName}'. Install it to serve this documentation target.`);
|
|
194
|
+
}
|
|
195
|
+
const packageRoot = (0, node_path_1.dirname)(packageJsonPath);
|
|
196
|
+
for (const candidate of candidates) {
|
|
197
|
+
try {
|
|
198
|
+
return await (0, promises_1.readFile)((0, node_path_1.join)(packageRoot, candidate), 'utf8');
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
throw new Error(`Unable to locate runtime asset for optional peer dependency '${packageName}'. Checked: ${candidates.join(', ')}`);
|
|
205
|
+
})();
|
|
206
|
+
assetCache.set(cacheKey, loadPromise);
|
|
207
|
+
return loadPromise;
|
|
208
|
+
}
|
|
209
|
+
async function readSwaggerDistAsset(runtime, assetName) {
|
|
210
|
+
let packageName;
|
|
211
|
+
if (runtime === 'express') {
|
|
212
|
+
packageName = 'swagger-ui-express';
|
|
213
|
+
}
|
|
214
|
+
else if (runtime === 'koa') {
|
|
215
|
+
packageName = 'swagger-ui-koa';
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
packageName = 'hapi-swagger';
|
|
219
|
+
}
|
|
220
|
+
let packageJsonPath;
|
|
221
|
+
try {
|
|
222
|
+
packageJsonPath = require.resolve(`${packageName}/package.json`);
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
throw new Error(`SpecPath target 'swagger' requires optional peer dependency '${packageName}' for the '${runtime}' runtime.`);
|
|
226
|
+
}
|
|
227
|
+
const directPackageRoot = (0, node_path_1.dirname)(packageJsonPath);
|
|
228
|
+
const directCandidates = runtime === 'koa' ? [(0, node_path_1.join)('static', assetName)] : [];
|
|
229
|
+
for (const candidate of directCandidates) {
|
|
230
|
+
try {
|
|
231
|
+
return await (0, promises_1.readFile)((0, node_path_1.join)(directPackageRoot, candidate), 'utf8');
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const requireFromPackage = (0, node_module_1.createRequire)(packageJsonPath);
|
|
238
|
+
let swaggerUiDistPackagePath;
|
|
239
|
+
try {
|
|
240
|
+
swaggerUiDistPackagePath = requireFromPackage.resolve('swagger-ui-dist/package.json');
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
throw new Error(`SpecPath target 'swagger' requires '${packageName}' to provide 'swagger-ui-dist'. Install or re-install '${packageName}'.`);
|
|
244
|
+
}
|
|
245
|
+
return (0, promises_1.readFile)((0, node_path_1.join)((0, node_path_1.dirname)(swaggerUiDistPackagePath), assetName), 'utf8');
|
|
246
|
+
}
|
|
247
|
+
async function loadSwaggerAssets(runtime) {
|
|
248
|
+
const [script, preset, style] = await Promise.all([
|
|
249
|
+
readSwaggerDistAsset(runtime, 'swagger-ui-bundle.js'),
|
|
250
|
+
readSwaggerDistAsset(runtime, 'swagger-ui-standalone-preset.js'),
|
|
251
|
+
readSwaggerDistAsset(runtime, 'swagger-ui.css'),
|
|
252
|
+
]);
|
|
253
|
+
return { preset, script, style };
|
|
254
|
+
}
|
|
255
|
+
async function loadRedocAssets() {
|
|
256
|
+
return {
|
|
257
|
+
script: await readPeerFile('redoc', ['bundles/redoc.standalone.js']),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
async function loadRapiDocAssets() {
|
|
261
|
+
return {
|
|
262
|
+
script: await readPeerFile('rapidoc', ['dist/rapidoc-min.js']),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
async function renderSwaggerHtml(spec, runtime) {
|
|
266
|
+
const assets = await loadSwaggerAssets(runtime);
|
|
267
|
+
const title = escapeHtmlText(spec.info.title || 'API documentation');
|
|
268
|
+
const serializedSpec = serializeSpecForHtml(spec);
|
|
269
|
+
return `<!DOCTYPE html>
|
|
270
|
+
<html lang="en">
|
|
271
|
+
<head>
|
|
272
|
+
<meta charset="utf-8" />
|
|
273
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
274
|
+
<title>${title}</title>
|
|
275
|
+
<style>
|
|
276
|
+
html { box-sizing: border-box; overflow-y: scroll; }
|
|
277
|
+
*, *:before, *:after { box-sizing: inherit; }
|
|
278
|
+
body { margin: 0; background: #fafafa; }
|
|
279
|
+
${assets.style ?? ''}
|
|
280
|
+
</style>
|
|
281
|
+
</head>
|
|
282
|
+
<body>
|
|
283
|
+
<div id="swagger-ui"></div>
|
|
284
|
+
<script>${assets.script}</script>
|
|
285
|
+
<script>${assets.preset ?? ''}</script>
|
|
286
|
+
<script>
|
|
287
|
+
window.ui = SwaggerUIBundle({
|
|
288
|
+
spec: ${serializedSpec},
|
|
289
|
+
dom_id: '#swagger-ui',
|
|
290
|
+
deepLinking: true,
|
|
291
|
+
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
|
292
|
+
layout: 'BaseLayout'
|
|
293
|
+
});
|
|
294
|
+
</script>
|
|
295
|
+
</body>
|
|
296
|
+
</html>`;
|
|
297
|
+
}
|
|
298
|
+
async function renderRedocHtml(spec) {
|
|
299
|
+
const assets = await loadRedocAssets();
|
|
300
|
+
const title = escapeHtmlText(spec.info.title || 'API documentation');
|
|
301
|
+
const serializedSpec = serializeSpecForHtml(spec);
|
|
302
|
+
return `<!DOCTYPE html>
|
|
303
|
+
<html lang="en">
|
|
304
|
+
<head>
|
|
305
|
+
<meta charset="utf-8" />
|
|
306
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
307
|
+
<title>${title}</title>
|
|
308
|
+
<style>
|
|
309
|
+
body { margin: 0; padding: 0; }
|
|
310
|
+
</style>
|
|
311
|
+
</head>
|
|
312
|
+
<body>
|
|
313
|
+
<div id="redoc-container"></div>
|
|
314
|
+
<script>${assets.script}</script>
|
|
315
|
+
<script>
|
|
316
|
+
Redoc.init(${serializedSpec}, {}, document.getElementById('redoc-container'));
|
|
317
|
+
</script>
|
|
318
|
+
</body>
|
|
319
|
+
</html>`;
|
|
320
|
+
}
|
|
321
|
+
async function renderRapiDocHtml(spec) {
|
|
322
|
+
const assets = await loadRapiDocAssets();
|
|
323
|
+
const title = escapeHtmlText(spec.info.title || 'API documentation');
|
|
324
|
+
const serializedSpec = serializeSpecForHtml(spec);
|
|
325
|
+
return `<!DOCTYPE html>
|
|
326
|
+
<html lang="en">
|
|
327
|
+
<head>
|
|
328
|
+
<meta charset="utf-8" />
|
|
329
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
330
|
+
<title>${title}</title>
|
|
331
|
+
<style>
|
|
332
|
+
body { margin: 0; padding: 0; }
|
|
333
|
+
rapi-doc { width: 100vw; height: 100vh; display: block; }
|
|
334
|
+
</style>
|
|
335
|
+
</head>
|
|
336
|
+
<body>
|
|
337
|
+
<rapi-doc id="rapidoc" render-style="read" show-header="false"></rapi-doc>
|
|
338
|
+
<script>${assets.script}</script>
|
|
339
|
+
<script>
|
|
340
|
+
document.getElementById('rapidoc').loadSpec(${serializedSpec});
|
|
341
|
+
</script>
|
|
342
|
+
</body>
|
|
343
|
+
</html>`;
|
|
344
|
+
}
|
|
345
|
+
async function buildBuiltinResponse(target, context) {
|
|
346
|
+
switch (target) {
|
|
347
|
+
case 'json':
|
|
348
|
+
return {
|
|
349
|
+
body: await context.getSpecString('json'),
|
|
350
|
+
contentType: getContentType(target),
|
|
351
|
+
};
|
|
352
|
+
case 'yaml':
|
|
353
|
+
return {
|
|
354
|
+
body: await context.getSpecString('yaml'),
|
|
355
|
+
contentType: getContentType(target),
|
|
356
|
+
};
|
|
357
|
+
case 'swagger':
|
|
358
|
+
return {
|
|
359
|
+
body: await renderSwaggerHtml(await context.getSpecObject(), context.runtime),
|
|
360
|
+
contentType: getContentType(target),
|
|
361
|
+
};
|
|
362
|
+
case 'redoc':
|
|
363
|
+
return {
|
|
364
|
+
body: await renderRedocHtml(await context.getSpecObject()),
|
|
365
|
+
contentType: getContentType(target),
|
|
366
|
+
};
|
|
367
|
+
case 'rapidoc':
|
|
368
|
+
return {
|
|
369
|
+
body: await renderRapiDocHtml(await context.getSpecObject()),
|
|
370
|
+
contentType: getContentType(target),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
async function resolveHandlerResponse(specPath, context) {
|
|
375
|
+
if (typeof specPath.target === 'string') {
|
|
376
|
+
return buildBuiltinResponse(specPath.target, context);
|
|
377
|
+
}
|
|
378
|
+
const body = await specPath.target(context);
|
|
379
|
+
return { body };
|
|
380
|
+
}
|
|
381
|
+
async function resolveSpecPathResponse(args) {
|
|
382
|
+
const context = createSpecRequestContext(args);
|
|
383
|
+
const cacheHandler = getCacheHandler(args);
|
|
384
|
+
if (cacheHandler) {
|
|
385
|
+
const cached = await cacheHandler.get(context);
|
|
386
|
+
if (cached !== undefined) {
|
|
387
|
+
return {
|
|
388
|
+
body: cached,
|
|
389
|
+
contentType: typeof args.specPath.target === 'string' ? getContentType(args.specPath.target) : undefined,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
const resolved = await resolveHandlerResponse(args.specPath, context);
|
|
394
|
+
if (!cacheHandler) {
|
|
395
|
+
return resolved;
|
|
396
|
+
}
|
|
397
|
+
if (typeof resolved.body === 'string') {
|
|
398
|
+
await cacheHandler.set(context, resolved.body);
|
|
399
|
+
return resolved;
|
|
400
|
+
}
|
|
401
|
+
const serialized = await readResponseValue(resolved.body);
|
|
402
|
+
await cacheHandler.set(context, serialized);
|
|
403
|
+
return { ...resolved, body: serialized };
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=specPathSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specPathSupport.js","sourceRoot":"","sources":["../../src/routeGeneration/specPathSupport.ts"],"names":[],"mappings":";;AA4cA,0DA0BC;AAteD,6CAAwC;AACxC,+CAA2C;AAC3C,6CAA2C;AAC3C,yCAAyC;AACzC,6CAAsC;AAqCtC,MAAM,WAAW,GAAG,IAAI,OAAO,EAAsC,CAAA;AACrE,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAA;AACrD,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAkB,CAAA;AAC3D,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAyB,CAAA;AACrE,IAAI,sBAAsB,GAAG,CAAC,CAAA;AAC9B,IAAI,yBAAyB,GAAG,CAAC,CAAA;AAEjC,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAQ,KAAgC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CAAA;AACvG,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,CACL,eAAe,CAAC,KAAK,CAAC;QACtB,KAAK,YAAY,sBAAQ;QACzB,CAAC,OAAO,KAAK,KAAK,QAAQ;YAC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?: string, skipPrefixAndSuffixIfEmpty?: boolean): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalisePath = normalisePath;
|
|
4
|
+
function isPathDelimiter(character) {
|
|
5
|
+
return character === '/' || character === '\\' || character.trim() === '';
|
|
6
|
+
}
|
|
7
|
+
function trimPathDelimiters(path) {
|
|
8
|
+
let start = 0;
|
|
9
|
+
let end = path.length;
|
|
10
|
+
while (start < end && isPathDelimiter(path[start])) {
|
|
11
|
+
start += 1;
|
|
12
|
+
}
|
|
13
|
+
while (end > start && isPathDelimiter(path[end - 1])) {
|
|
14
|
+
end -= 1;
|
|
15
|
+
}
|
|
16
|
+
return path.slice(start, end);
|
|
17
|
+
}
|
|
18
|
+
function collapsePathDelimiters(path) {
|
|
19
|
+
const normalizedChars = [];
|
|
20
|
+
let previousWasDelimiter = false;
|
|
21
|
+
for (const character of path) {
|
|
22
|
+
if (isPathDelimiter(character)) {
|
|
23
|
+
if (!previousWasDelimiter) {
|
|
24
|
+
normalizedChars.push('/');
|
|
25
|
+
previousWasDelimiter = true;
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
normalizedChars.push(character);
|
|
30
|
+
previousWasDelimiter = false;
|
|
31
|
+
}
|
|
32
|
+
return normalizedChars.join('');
|
|
33
|
+
}
|
|
34
|
+
function normalisePath(path, withPrefix, withSuffix, skipPrefixAndSuffixIfEmpty = true) {
|
|
35
|
+
if ((!path || path === '/') && skipPrefixAndSuffixIfEmpty) {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
if (!path || typeof path !== 'string') {
|
|
39
|
+
path = '' + path;
|
|
40
|
+
}
|
|
41
|
+
let normalized = trimPathDelimiters(path);
|
|
42
|
+
normalized = withPrefix ? withPrefix + normalized : normalized;
|
|
43
|
+
normalized = withSuffix ? normalized + withSuffix : normalized;
|
|
44
|
+
return collapsePathDelimiters(normalized);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=pathUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../src/utils/pathUtils.ts"],"names":[],"mappings":";;AAuCA,sCAcC;AArDD,SAAS,eAAe,CAAC,SAAiB;IACxC,OAAO,SAAS,KAAK,GAAG,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;AAC3E,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAA;IAErB,OAAO,KAAK,GAAG,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACnD,KAAK,IAAI,CAAC,CAAA;IACZ,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,IAAI,CAAC,CAAA;IACV,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAC/B,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY;IAC1C,MAAM,eAAe,GAAa,EAAE,CAAA;IACpC,IAAI,oBAAoB,GAAG,KAAK,CAAA;IAEhC,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC1B,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACzB,oBAAoB,GAAG,IAAI,CAAA;YAC7B,CAAC;YACD,SAAQ;QACV,CAAC;QAED,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC/B,oBAAoB,GAAG,KAAK,CAAA;IAC9B,CAAC;IAED,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,UAAmB,EAAE,UAAmB,EAAE,0BAA0B,GAAG,IAAI;IACrH,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,0BAA0B,EAAE,CAAC;QAC1D,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACzC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAA;IAC9D,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAA;IAE9D,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAA;AAC3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsoa-next/runtime",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5-dev.57.84bb4a63",
|
|
4
4
|
"description": "Build swagger-compliant REST APIs using TypeScript and Node",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@hapi/boom": "^10.0.1",
|
|
32
|
-
"@hapi/hapi": "^21.4.
|
|
32
|
+
"@hapi/hapi": "^21.4.8",
|
|
33
33
|
"@types/koa": "^2.15.0",
|
|
34
34
|
"@types/multer": "^2.1.0",
|
|
35
35
|
"reflect-metadata": "^0.2.2",
|
|
@@ -44,10 +44,15 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"express": "^4.21.0 || ^5.0.0",
|
|
46
46
|
"fp-ts": "^2.16.11",
|
|
47
|
+
"hapi-swagger": "^17.3.2",
|
|
47
48
|
"io-ts": "^2.2.21",
|
|
48
49
|
"io-ts-types": "^0.5.19",
|
|
49
50
|
"joi": "^17.13.3",
|
|
51
|
+
"rapidoc": "^9.3.8",
|
|
52
|
+
"redoc": "^2.5.2",
|
|
50
53
|
"superstruct": "^2.0.2",
|
|
54
|
+
"swagger-ui-express": "^5.0.1",
|
|
55
|
+
"swagger-ui-koa": "^0.0.1",
|
|
51
56
|
"yup": "^1.7.1",
|
|
52
57
|
"zod": "^4.1.11"
|
|
53
58
|
},
|
|
@@ -58,6 +63,9 @@
|
|
|
58
63
|
"fp-ts": {
|
|
59
64
|
"optional": true
|
|
60
65
|
},
|
|
66
|
+
"hapi-swagger": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
61
69
|
"io-ts": {
|
|
62
70
|
"optional": true
|
|
63
71
|
},
|
|
@@ -67,9 +75,21 @@
|
|
|
67
75
|
"joi": {
|
|
68
76
|
"optional": true
|
|
69
77
|
},
|
|
78
|
+
"rapidoc": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
81
|
+
"redoc": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
70
84
|
"superstruct": {
|
|
71
85
|
"optional": true
|
|
72
86
|
},
|
|
87
|
+
"swagger-ui-express": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
90
|
+
"swagger-ui-koa": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
73
93
|
"yup": {
|
|
74
94
|
"optional": true
|
|
75
95
|
},
|