@tsoa-next/runtime 8.0.4 → 8.0.5-dev.58.3748c499
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/config.d.ts +50 -45
- package/dist/decorators/customAttribute.d.ts +6 -0
- package/dist/decorators/customAttribute.js +6 -0
- package/dist/decorators/customAttribute.js.map +1 -1
- package/dist/decorators/deprecated.d.ts +1 -1
- package/dist/decorators/deprecated.js +1 -1
- package/dist/decorators/example.d.ts +6 -0
- package/dist/decorators/example.js +6 -0
- package/dist/decorators/example.js.map +1 -1
- package/dist/decorators/extension.d.ts +7 -0
- package/dist/decorators/extension.js +6 -0
- package/dist/decorators/extension.js.map +1 -1
- package/dist/decorators/methods.d.ts +7 -0
- package/dist/decorators/methods.js +7 -0
- package/dist/decorators/methods.js.map +1 -1
- package/dist/decorators/middlewares.d.ts +6 -7
- package/dist/decorators/middlewares.js +6 -7
- package/dist/decorators/middlewares.js.map +1 -1
- package/dist/decorators/operationid.d.ts +5 -0
- package/dist/decorators/operationid.js +5 -0
- package/dist/decorators/operationid.js.map +1 -1
- package/dist/decorators/parameter.d.ts +22 -24
- package/dist/decorators/parameter.js +22 -24
- package/dist/decorators/parameter.js.map +1 -1
- package/dist/decorators/response.d.ts +18 -3
- package/dist/decorators/response.js +18 -3
- package/dist/decorators/response.js.map +1 -1
- package/dist/decorators/route.d.ts +6 -1
- package/dist/decorators/route.js +6 -1
- package/dist/decorators/route.js.map +1 -1
- package/dist/decorators/security.d.ts +5 -2
- package/dist/decorators/security.js +5 -2
- package/dist/decorators/security.js.map +1 -1
- package/dist/decorators/specPath.d.ts +66 -0
- package/dist/decorators/specPath.js +68 -0
- package/dist/decorators/specPath.js.map +1 -0
- package/dist/decorators/tags.d.ts +5 -0
- package/dist/decorators/tags.js +5 -0
- package/dist/decorators/tags.js.map +1 -1
- package/dist/decorators/validate.d.ts +5 -0
- package/dist/decorators/validate.js +5 -0
- package/dist/decorators/validate.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/controller.d.ts +7 -0
- package/dist/interfaces/controller.js +8 -0
- package/dist/interfaces/controller.js.map +1 -1
- package/dist/interfaces/iocModule.d.ts +4 -0
- package/dist/interfaces/response.d.ts +8 -0
- package/dist/metadataGeneration/tsoa.d.ts +1 -0
- package/dist/routeGeneration/additionalProps.d.ts +1 -0
- package/dist/routeGeneration/externalValidation.d.ts +3 -0
- package/dist/routeGeneration/externalValidation.js +1 -0
- package/dist/routeGeneration/externalValidation.js.map +1 -1
- package/dist/routeGeneration/specPathSupport.d.ts +32 -0
- package/dist/routeGeneration/specPathSupport.js +408 -0
- package/dist/routeGeneration/specPathSupport.js.map +1 -0
- package/dist/routeGeneration/templateHelpers.d.ts +14 -0
- package/dist/routeGeneration/templateHelpers.js +2 -0
- package/dist/routeGeneration/templateHelpers.js.map +1 -1
- package/dist/routeGeneration/templates/express/expressTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js +1 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js +1 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/koa/koaTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js +1 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/templateService.d.ts +6 -0
- package/dist/routeGeneration/templates/templateService.js +3 -0
- package/dist/routeGeneration/templates/templateService.js.map +1 -1
- package/dist/routeGeneration/tsoa-route.d.ts +12 -2
- package/dist/routeGeneration/tsoa-route.js +1 -2
- package/dist/routeGeneration/tsoa-route.js.map +1 -1
- package/dist/swagger/swagger.d.ts +1 -0
- package/dist/swagger/swagger.js +1 -0
- package/dist/swagger/swagger.js.map +1 -1
- package/dist/utils/pathUtils.d.ts +4 -0
- package/dist/utils/pathUtils.js +49 -0
- package/dist/utils/pathUtils.js.map +1 -0
- package/package.json +22 -2
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
/**
|
|
35
|
+
* Normalizes slash usage in a route path and optionally applies a prefix and suffix.
|
|
36
|
+
*/
|
|
37
|
+
function normalisePath(path, withPrefix, withSuffix, skipPrefixAndSuffixIfEmpty = true) {
|
|
38
|
+
if ((!path || path === '/') && skipPrefixAndSuffixIfEmpty) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
if (!path || typeof path !== 'string') {
|
|
42
|
+
path = '' + path;
|
|
43
|
+
}
|
|
44
|
+
let normalized = trimPathDelimiters(path);
|
|
45
|
+
normalized = withPrefix ? withPrefix + normalized : normalized;
|
|
46
|
+
normalized = withSuffix ? normalized + withSuffix : normalized;
|
|
47
|
+
return collapsePathDelimiters(normalized);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=pathUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../src/utils/pathUtils.ts"],"names":[],"mappings":";;AA0CA,sCAcC;AAxDD,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;;GAEG;AACH,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.58.3748c499",
|
|
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
|
},
|