@tsoa/runtime
Advanced tools
Comparing version 3.5.2 to 3.6.0
@@ -1,2 +0,1 @@ | ||
import * as ts from 'typescript'; | ||
import { Swagger } from './swagger/swagger'; | ||
@@ -31,6 +30,6 @@ export interface Config { | ||
* | ||
* @type {ts.CompilerOptions} | ||
* @type {Record<string, unknown>} | ||
* @memberof RoutesConfig | ||
*/ | ||
compilerOptions?: ts.CompilerOptions; | ||
compilerOptions?: Record<string, unknown>; | ||
} | ||
@@ -151,2 +150,6 @@ /** | ||
/** | ||
* Avoid writing the generated route file if the existing file is identical (useful to optimize watch processes); false by default | ||
*/ | ||
noWriteIfUnchanged?: boolean; | ||
/** | ||
* Base API path; e.g. the '/v1' in https://myapi.com/v1 | ||
@@ -153,0 +156,0 @@ */ |
@@ -34,1 +34,23 @@ /** | ||
export declare function Header(name?: string): Function; | ||
/** | ||
* Mark parameter as manually injected, which will not be generated | ||
*/ | ||
export declare function Inject(): Function; | ||
/** | ||
* Inject uploaded file | ||
* | ||
* @param {string} [name] The name of the uploaded file parameter | ||
*/ | ||
export declare function UploadedFile(name?: string): any; | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
export declare function UploadedFiles(name?: string): any; | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
export declare function FormField(name?: string): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Header = exports.Query = exports.Path = exports.Request = exports.BodyProp = exports.Body = void 0; | ||
exports.FormField = exports.UploadedFiles = exports.UploadedFile = exports.Inject = exports.Header = exports.Query = exports.Path = exports.Request = exports.BodyProp = exports.Body = void 0; | ||
/** | ||
@@ -67,2 +67,44 @@ * Inject http Body | ||
exports.Header = Header; | ||
/** | ||
* Mark parameter as manually injected, which will not be generated | ||
*/ | ||
function Inject() { | ||
return function () { | ||
return; | ||
}; | ||
} | ||
exports.Inject = Inject; | ||
/** | ||
* Inject uploaded file | ||
* | ||
* @param {string} [name] The name of the uploaded file parameter | ||
*/ | ||
function UploadedFile(name) { | ||
return function () { | ||
return; | ||
}; | ||
} | ||
exports.UploadedFile = UploadedFile; | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
function UploadedFiles(name) { | ||
return function () { | ||
return; | ||
}; | ||
} | ||
exports.UploadedFiles = UploadedFiles; | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
function FormField(name) { | ||
return function () { | ||
return; | ||
}; | ||
} | ||
exports.FormField = FormField; | ||
//# sourceMappingURL=parameter.js.map |
import { IsValidHeader } from '../utils/isHeaderType'; | ||
import { HttpStatusCodeLiteral, HttpStatusCodeStringLiteral, OtherValidOpenApiHttpStatusCode } from '../interfaces/response'; | ||
export declare function SuccessResponse<HeaderType extends IsValidHeader<HeaderType> = {}>(name: string | number, description?: string): Function; | ||
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = {}>(name: string | number, description?: string, example?: ExampleType): Function; | ||
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = {}>(name: HttpStatusCodeLiteral | HttpStatusCodeStringLiteral | OtherValidOpenApiHttpStatusCode, description?: string, example?: ExampleType): Function; | ||
/** | ||
@@ -5,0 +6,0 @@ * Inject a library-agnostic responder function that can be used to construct type-checked (usually error-) responses. |
@@ -13,2 +13,3 @@ export * from './decorators/deprecated'; | ||
export * from './interfaces/iocModule'; | ||
export * from './interfaces/file'; | ||
export * from './decorators/response'; | ||
@@ -15,0 +16,0 @@ export * from './metadataGeneration/tsoa'; |
@@ -25,2 +25,3 @@ "use strict"; | ||
__exportStar(require("./interfaces/iocModule"), exports); | ||
__exportStar(require("./interfaces/file"), exports); | ||
__exportStar(require("./decorators/response"), exports); | ||
@@ -27,0 +28,0 @@ __exportStar(require("./metadataGeneration/tsoa"), exports); |
import { IsValidHeader } from '../utils/isHeaderType'; | ||
export declare type HttpStatusCodeLiteral = 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511; | ||
export declare type HttpStatusCodeStringLiteral = `${HttpStatusCodeLiteral}`; | ||
export declare type OtherValidOpenApiHttpStatusCode = '1XX' | '2XX' | '3XX' | '4XX' | '5XX' | 'default'; | ||
export declare type TsoaResponse<T extends HttpStatusCodeLiteral, BodyType, HeaderType extends IsValidHeader<HeaderType> = {}> = (status: T, data: BodyType, headers?: HeaderType) => any; |
@@ -79,3 +79,3 @@ import { ExtensionType } from '../decorators/extension'; | ||
} | ||
type TypeStringLiteral = 'string' | 'boolean' | 'double' | 'float' | 'integer' | 'long' | 'enum' | 'array' | 'datetime' | 'date' | 'binary' | 'buffer' | 'byte' | 'void' | 'object' | 'any' | 'refEnum' | 'refObject' | 'refAlias' | 'nestedObjectLiteral' | 'union' | 'intersection'; | ||
type TypeStringLiteral = 'string' | 'boolean' | 'double' | 'float' | 'file' | 'integer' | 'long' | 'enum' | 'array' | 'datetime' | 'date' | 'binary' | 'buffer' | 'byte' | 'void' | 'object' | 'any' | 'refEnum' | 'refObject' | 'refAlias' | 'nestedObjectLiteral' | 'union' | 'intersection'; | ||
type RefTypeLiteral = 'refObject' | 'refEnum' | 'refAlias'; | ||
@@ -90,3 +90,3 @@ type PrimitiveTypeLiteral = Exclude<TypeStringLiteral, RefTypeLiteral | 'enum' | 'array' | 'void' | 'nestedObjectLiteral' | 'union' | 'intersection'>; | ||
*/ | ||
type Type = PrimitiveType | ObjectsNoPropsType | EnumType | ArrayType | DateTimeType | DateType | BinaryType | BufferType | ByteType | AnyType | RefEnumType | RefObjectType | RefAliasType | NestedObjectLiteralType | UnionType | IntersectionType; | ||
type Type = PrimitiveType | ObjectsNoPropsType | EnumType | ArrayType | FileType | DateTimeType | DateType | BinaryType | BufferType | ByteType | AnyType | RefEnumType | RefObjectType | RefAliasType | NestedObjectLiteralType | UnionType | IntersectionType; | ||
interface StringType extends TypeBase { | ||
@@ -130,2 +130,5 @@ dataType: 'string'; | ||
} | ||
interface FileType extends TypeBase { | ||
dataType: 'file'; | ||
} | ||
interface DateTimeType extends TypeBase { | ||
@@ -132,0 +135,0 @@ dataType: 'datetime'; |
export declare namespace Swagger { | ||
export type DataType = 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object'; | ||
export type DataType = 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object' | 'file'; | ||
export type DataFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password'; | ||
@@ -4,0 +4,0 @@ export type Protocol = 'http' | 'https' | 'ws' | 'wss'; |
{ | ||
"name": "@tsoa/runtime", | ||
"description": "Build swagger-compliant REST APIs using TypeScript and Node", | ||
"version": "3.5.2", | ||
"version": "3.6.0", | ||
"main": "./dist/index.js", | ||
@@ -47,3 +47,3 @@ "typings": "./dist/index.d.ts", | ||
}, | ||
"gitHead": "460ba82e3d4b07581bd1337feb38e656bff6d7c2" | ||
"gitHead": "e4769186982e902a099e822fa166d5ab16ce5079" | ||
} |
@@ -1,2 +0,1 @@ | ||
import * as ts from 'typescript'; | ||
import { Swagger } from './swagger/swagger'; | ||
@@ -38,6 +37,6 @@ | ||
* | ||
* @type {ts.CompilerOptions} | ||
* @type {Record<string, unknown>} | ||
* @memberof RoutesConfig | ||
*/ | ||
compilerOptions?: ts.CompilerOptions; | ||
compilerOptions?: Record<string, unknown>; | ||
} | ||
@@ -181,2 +180,7 @@ | ||
/** | ||
* Avoid writing the generated route file if the existing file is identical (useful to optimize watch processes); false by default | ||
*/ | ||
noWriteIfUnchanged?: boolean; | ||
/** | ||
* Base API path; e.g. the '/v1' in https://myapi.com/v1 | ||
@@ -183,0 +187,0 @@ */ |
@@ -63,1 +63,43 @@ /** | ||
} | ||
/** | ||
* Mark parameter as manually injected, which will not be generated | ||
*/ | ||
export function Inject(): Function { | ||
return () => { | ||
return; | ||
}; | ||
} | ||
/** | ||
* Inject uploaded file | ||
* | ||
* @param {string} [name] The name of the uploaded file parameter | ||
*/ | ||
export function UploadedFile(name?: string): any { | ||
return () => { | ||
return; | ||
}; | ||
} | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
export function UploadedFiles(name?: string): any { | ||
return () => { | ||
return; | ||
}; | ||
} | ||
/** | ||
* Inject uploaded files | ||
* | ||
* @param {string} [name] The name of the uploaded files parameter | ||
*/ | ||
export function FormField(name?: string): any { | ||
return () => { | ||
return; | ||
}; | ||
} |
import { IsValidHeader } from '../utils/isHeaderType'; | ||
import { HttpStatusCodeLiteral, HttpStatusCodeStringLiteral, OtherValidOpenApiHttpStatusCode } from '../interfaces/response'; | ||
@@ -9,3 +10,7 @@ export function SuccessResponse<HeaderType extends IsValidHeader<HeaderType> = {}>(name: string | number, description?: string): Function { | ||
export function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = {}>(name: string | number, description?: string, example?: ExampleType): Function { | ||
export function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = {}>( | ||
name: HttpStatusCodeLiteral | HttpStatusCodeStringLiteral | OtherValidOpenApiHttpStatusCode, | ||
description?: string, | ||
example?: ExampleType, | ||
): Function { | ||
return () => { | ||
@@ -12,0 +17,0 @@ return; |
@@ -13,2 +13,3 @@ export * from './decorators/deprecated'; | ||
export * from './interfaces/iocModule'; | ||
export * from './interfaces/file'; | ||
export * from './decorators/response'; | ||
@@ -15,0 +16,0 @@ export * from './metadataGeneration/tsoa'; |
@@ -63,2 +63,6 @@ import { IsValidHeader } from '../utils/isHeaderType'; | ||
export type HttpStatusCodeStringLiteral = `${HttpStatusCodeLiteral}`; | ||
export type OtherValidOpenApiHttpStatusCode = '1XX' | '2XX' | '3XX' | '4XX' | '5XX' | 'default'; | ||
export type TsoaResponse<T extends HttpStatusCodeLiteral, BodyType, HeaderType extends IsValidHeader<HeaderType> = {}> = (status: T, data: BodyType, headers?: HeaderType) => any; |
@@ -93,2 +93,3 @@ import { ExtensionType } from '../decorators/extension'; | ||
| 'float' | ||
| 'file' | ||
| 'integer' | ||
@@ -131,2 +132,3 @@ | 'long' | ||
| ArrayType | ||
| FileType | ||
| DateTimeType | ||
@@ -194,2 +196,6 @@ | DateType | ||
export interface FileType extends TypeBase { | ||
dataType: 'file'; | ||
} | ||
export interface DateTimeType extends TypeBase { | ||
@@ -196,0 +202,0 @@ dataType: 'datetime'; |
export namespace Swagger { | ||
export type DataType = 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object'; | ||
export type DataType = 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object' | 'file'; | ||
@@ -4,0 +4,0 @@ export type DataFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password'; |
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
230551
100
4144