Comparing version 6.2.1 to 6.3.0
@@ -66,2 +66,4 @@ #!/usr/bin/env node | ||
const authorInformation = getPackageJsonValue('author', 'unknown'); | ||
const isYamlExtension = (extension) => extension === '.yaml' || extension === '.yml'; | ||
const isJsExtension = (extension) => extension === '.js' || extension === '.cjs'; | ||
const getConfig = async (configPath = 'tsoa.json') => { | ||
@@ -71,7 +73,7 @@ let config; | ||
try { | ||
if (ext === '.yaml' || ext === '.yml') { | ||
if (isYamlExtension(ext)) { | ||
const configRaw = await (0, fs_1.fsReadFile)(`${workingDir}/${configPath}`); | ||
config = yaml_1.default.parse(configRaw.toString('utf8')); | ||
} | ||
else if (ext === '.js') { | ||
else if (isJsExtension(ext)) { | ||
config = await Promise.resolve(`${`${workingDir}/${configPath}`}`).then(s => __importStar(require(s))); | ||
@@ -94,3 +96,3 @@ } | ||
console.error(err); | ||
const errorType = ext === '.js' ? 'JS' : 'JSON'; | ||
const errorType = isJsExtension(ext) ? 'JS' : 'JSON'; | ||
throw Error(`Invalid ${errorType} syntax in config at '${configPath}': ${err.message}`); | ||
@@ -97,0 +99,0 @@ } |
@@ -30,5 +30,5 @@ /// <reference types="node" /> | ||
name: string; | ||
maxCount: number | undefined; | ||
multiple: boolean; | ||
}[]; | ||
uploadFiles: boolean; | ||
uploadFilesName: string | undefined; | ||
security: Tsoa.Security[]; | ||
@@ -35,0 +35,0 @@ successStatus: string | number; |
@@ -111,4 +111,3 @@ "use strict"; | ||
const normalisedFullPath = (0, pathUtils_1.normalisePath)(`${normalisedBasePath}${normalisedControllerPath}${normalisedMethodPath}`, '/', '', false); | ||
const uploadFilesWithDifferentFieldParameter = method.parameters.filter(parameter => parameter.type.dataType === 'file'); | ||
const uploadFilesParameter = method.parameters.find(parameter => parameter.type.dataType === 'array' && parameter.type.elementType.dataType === 'file'); | ||
const uploadFilesWithDifferentFieldParameter = method.parameters.filter(parameter => parameter.type.dataType === 'file' || (parameter.type.dataType === 'array' && parameter.type.elementType.dataType === 'file')); | ||
return { | ||
@@ -123,5 +122,5 @@ fullPath: normalisedFullPath, | ||
name: parameter.name, | ||
maxCount: parameter.type.dataType === 'file' ? 1 : undefined, | ||
multiple: parameter.type.dataType === 'array' && parameter.type.elementType.dataType === 'file', | ||
})), | ||
uploadFiles: !!uploadFilesParameter, | ||
uploadFilesName: uploadFilesParameter?.name, | ||
security: method.security, | ||
@@ -128,0 +127,0 @@ successStatus: method.successStatus ? method.successStatus : 'undefined', |
{ | ||
"name": "@tsoa/cli", | ||
"description": "Build swagger-compliant REST APIs using TypeScript and Node", | ||
"version": "6.2.1", | ||
"version": "6.3.0", | ||
"main": "./dist/index.js", | ||
@@ -33,3 +33,3 @@ "typings": "./dist/index.d.ts", | ||
"dependencies": { | ||
"@tsoa/runtime": "^6.2.1", | ||
"@tsoa/runtime": "^6.3.0", | ||
"@types/multer": "^1.4.11", | ||
@@ -71,3 +71,3 @@ "fs-extra": "^11.2.0", | ||
}, | ||
"gitHead": "1c4dfbf4e7dd8c3df716989d83c43caa9ff50559" | ||
"gitHead": "fea5eefe845dc5a496fba0a7a18f24a49d9fb50a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
540870
6446
Updated@tsoa/runtime@^6.3.0