Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsoa/runtime

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsoa/runtime - npm Package Compare versions

Comparing version 6.4.0 to 6.5.0

5

dist/config.d.ts

@@ -42,2 +42,7 @@ import { Swagger } from './swagger/swagger';

* } Allow multer to write to file instead of using Memory's buffer
* @deprecated
* since v6.4.0 instroduces RegisterRoutes can pass multerOptions,
* we will quickly remove this options soon at future version.
* (https://github.com/lukeautry/tsoa/issues/1587#issuecomment-2391291433)
* (https://github.com/lukeautry/tsoa/pull/1638)
*/

@@ -44,0 +49,0 @@ multerOpts?: MulterOpts;

2

dist/decorators/customAttribute.d.ts

@@ -1,1 +0,1 @@

export declare function CustomAttribute(_name: string, _value: string): Function;
export declare function CustomAttribute(_name: string, _value: string): PropertyDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomAttribute = void 0;
exports.CustomAttribute = CustomAttribute;
function CustomAttribute(_name, _value) {

@@ -9,3 +9,2 @@ return () => {

}
exports.CustomAttribute = CustomAttribute;
//# sourceMappingURL=customAttribute.js.map
/**
* used to show a method as deprecated on swagger documentation
*/
export declare function Deprecated(): Function;
export declare function Deprecated(): PropertyDecorator & ClassDecorator & ParameterDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Deprecated = void 0;
exports.Deprecated = Deprecated;
/**

@@ -12,3 +12,2 @@ * used to show a method as deprecated on swagger documentation

}
exports.Deprecated = Deprecated;
//# sourceMappingURL=deprecated.js.map

@@ -1,1 +0,1 @@

export declare function Example<T>(exampleModel: T, exampleLabel?: string): Function;
export declare function Example<T>(exampleModel: T, exampleLabel?: string): PropertyDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Example = void 0;
exports.Example = Example;
function Example(exampleModel, exampleLabel) {

@@ -9,3 +9,2 @@ return () => {

}
exports.Example = Example;
//# sourceMappingURL=example.js.map

@@ -1,4 +0,4 @@

export declare function Extension(_name: string, _value: ExtensionType | ExtensionType[]): Function;
export declare function Extension(_name: string, _value: ExtensionType | ExtensionType[]): PropertyDecorator;
export type ExtensionType = string | number | boolean | null | ExtensionType[] | {
[name: string]: ExtensionType | ExtensionType[];
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Extension = void 0;
exports.Extension = Extension;
function Extension(_name, _value) {

@@ -9,3 +9,2 @@ return () => {

}
exports.Extension = Extension;
//# sourceMappingURL=extension.js.map

@@ -1,7 +0,7 @@

export declare function Options(value?: string): Function;
export declare function Get(value?: string): Function;
export declare function Post(value?: string): Function;
export declare function Put(value?: string): Function;
export declare function Patch(value?: string): Function;
export declare function Delete(value?: string): Function;
export declare function Head(value?: string): Function;
export declare function Options(value?: string): MethodDecorator;
export declare function Get(value?: string): MethodDecorator;
export declare function Post(value?: string): MethodDecorator;
export declare function Put(value?: string): MethodDecorator;
export declare function Patch(value?: string): MethodDecorator;
export declare function Delete(value?: string): MethodDecorator;
export declare function Head(value?: string): MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Head = exports.Delete = exports.Patch = exports.Put = exports.Post = exports.Get = exports.Options = void 0;
exports.Options = Options;
exports.Get = Get;
exports.Post = Post;
exports.Put = Put;
exports.Patch = Patch;
exports.Delete = Delete;
exports.Head = Head;
function Options(value) {

@@ -9,3 +15,2 @@ return () => {

}
exports.Options = Options;
function Get(value) {

@@ -16,3 +21,2 @@ return () => {

}
exports.Get = Get;
function Post(value) {

@@ -23,3 +27,2 @@ return () => {

}
exports.Post = Post;
function Put(value) {

@@ -30,3 +33,2 @@ return () => {

}
exports.Put = Put;
function Patch(value) {

@@ -37,3 +39,2 @@ return () => {

}
exports.Patch = Patch;
function Delete(value) {

@@ -44,3 +45,2 @@ return () => {

}
exports.Delete = Delete;
function Head(value) {

@@ -51,3 +51,2 @@ return () => {

}
exports.Head = Head;
//# sourceMappingURL=methods.js.map

@@ -1,2 +0,2 @@

type Middleware<T extends Function | Object> = T;
type Middleware<T extends CallableFunction | object> = T;
/**

@@ -7,3 +7,3 @@ * Install middlewares to the Controller or a specific method.

*/
export declare function Middlewares<T extends Function | Object>(...mws: Array<Middleware<T>>): ClassDecorator & MethodDecorator;
export declare function Middlewares<T extends CallableFunction | object>(...mws: Array<Middleware<T>>): ClassDecorator & MethodDecorator;
/**

@@ -15,3 +15,3 @@ * Internal function used to retrieve installed middlewares

*/
export declare function fetchMiddlewares<T extends Function | Object>(target: any): Array<Middleware<T>>;
export declare function fetchMiddlewares<T extends CallableFunction | object>(target: any): Array<Middleware<T>>;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchMiddlewares = exports.Middlewares = void 0;
exports.Middlewares = Middlewares;
exports.fetchMiddlewares = fetchMiddlewares;
const TSOA_MIDDLEWARES = Symbol('@tsoa:middlewares');

@@ -43,3 +44,2 @@ /**

}
exports.Middlewares = Middlewares;
/**

@@ -54,3 +54,2 @@ * Internal function used to retrieve installed middlewares

}
exports.fetchMiddlewares = fetchMiddlewares;
//# sourceMappingURL=middlewares.js.map

@@ -1,1 +0,1 @@

export declare function OperationId(value: string): Function;
export declare function OperationId(value: string): MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperationId = void 0;
exports.OperationId = OperationId;
function OperationId(value) {

@@ -9,3 +9,2 @@ return () => {

}
exports.OperationId = OperationId;
//# sourceMappingURL=operationid.js.map

@@ -5,3 +5,3 @@ /**

*/
export declare function Body(): Function;
export declare function Body(): ParameterDecorator;
/**

@@ -12,7 +12,7 @@ * Inject value from body

*/
export declare function BodyProp(name?: string): Function;
export declare function BodyProp(name?: string): ParameterDecorator;
/**
* Inject http request
*/
export declare function Request(): Function;
export declare function Request(): ParameterDecorator;
/**

@@ -23,3 +23,3 @@ * Inject value from request

*/
export declare function RequestProp(name?: string): Function;
export declare function RequestProp(name?: string): ParameterDecorator;
/**

@@ -30,3 +30,3 @@ * Inject value from Path

*/
export declare function Path(name?: string): Function;
export declare function Path(name?: string): ParameterDecorator;
/**

@@ -37,7 +37,7 @@ * Inject value from query string

*/
export declare function Query(name?: string): Function;
export declare function Query(name?: string): ParameterDecorator;
/**
* Inject all query values in a single object
*/
export declare function Queries(): Function;
export declare function Queries(): ParameterDecorator;
/**

@@ -48,7 +48,7 @@ * Inject value from Http header

*/
export declare function Header(name?: string): Function;
export declare function Header(name?: string): ParameterDecorator;
/**
* Mark parameter as manually injected, which will not be generated
*/
export declare function Inject(): Function;
export declare function Inject(): ParameterDecorator;
/**

@@ -59,3 +59,3 @@ * Inject uploaded file

*/
export declare function UploadedFile(name?: string): Function;
export declare function UploadedFile(name?: string): ParameterDecorator;
/**

@@ -66,3 +66,3 @@ * Inject uploaded files

*/
export declare function UploadedFiles(name?: string): Function;
export declare function UploadedFiles(name?: string): ParameterDecorator;
/**

@@ -73,3 +73,3 @@ * Inject uploaded files

*/
export declare function FormField(name?: string): Function;
export declare function FormField(name?: string): ParameterDecorator;
/**

@@ -82,2 +82,2 @@ * Overrides the default media type of request body.

*/
export declare function Consumes(value: string): Function;
export declare function Consumes(value: string): MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Consumes = exports.FormField = exports.UploadedFiles = exports.UploadedFile = exports.Inject = exports.Header = exports.Queries = exports.Query = exports.Path = exports.RequestProp = exports.Request = exports.BodyProp = exports.Body = void 0;
exports.Body = Body;
exports.BodyProp = BodyProp;
exports.Request = Request;
exports.RequestProp = RequestProp;
exports.Path = Path;
exports.Query = Query;
exports.Queries = Queries;
exports.Header = Header;
exports.Inject = Inject;
exports.UploadedFile = UploadedFile;
exports.UploadedFiles = UploadedFiles;
exports.FormField = FormField;
exports.Consumes = Consumes;
/**

@@ -13,3 +25,2 @@ * Inject http Body

}
exports.Body = Body;
/**

@@ -25,3 +36,2 @@ * Inject value from body

}
exports.BodyProp = BodyProp;
/**

@@ -35,3 +45,2 @@ * Inject http request

}
exports.Request = Request;
/**

@@ -47,3 +56,2 @@ * Inject value from request

}
exports.RequestProp = RequestProp;
/**

@@ -59,3 +67,2 @@ * Inject value from Path

}
exports.Path = Path;
/**

@@ -71,3 +78,2 @@ * Inject value from query string

}
exports.Query = Query;
/**

@@ -81,3 +87,2 @@ * Inject all query values in a single object

}
exports.Queries = Queries;
/**

@@ -93,3 +98,2 @@ * Inject value from Http header

}
exports.Header = Header;
/**

@@ -103,3 +107,2 @@ * Mark parameter as manually injected, which will not be generated

}
exports.Inject = Inject;
/**

@@ -115,3 +118,2 @@ * Inject uploaded file

}
exports.UploadedFile = UploadedFile;
/**

@@ -127,3 +129,2 @@ * Inject uploaded files

}
exports.UploadedFiles = UploadedFiles;
/**

@@ -139,3 +140,2 @@ * Inject uploaded files

}
exports.FormField = FormField;
/**

@@ -153,3 +153,2 @@ * Overrides the default media type of request body.

}
exports.Consumes = Consumes;
//# 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, produces?: string | string[]): Function;
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = {}>(name: HttpStatusCodeLiteral | HttpStatusCodeStringLiteral | OtherValidOpenApiHttpStatusCode, description?: string, example?: ExampleType, produces?: string | string[]): Function;
export declare function SuccessResponse<HeaderType extends IsValidHeader<HeaderType> = object>(name: string | number, description?: string, produces?: string | string[]): MethodDecorator;
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = object>(name: HttpStatusCodeLiteral | HttpStatusCodeStringLiteral | OtherValidOpenApiHttpStatusCode, description?: string, example?: ExampleType, produces?: string | string[]): MethodDecorator & ClassDecorator;
/**

@@ -10,3 +10,3 @@ * Inject a library-agnostic responder function that can be used to construct type-checked (usually error-) responses.

*/
export declare function Res(): Function;
export declare function Res(): ParameterDecorator;
/**

@@ -18,2 +18,2 @@ * Overrides the default media type of response.

*/
export declare function Produces(value: string): Function;
export declare function Produces(value: string): MethodDecorator & ClassDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Produces = exports.Res = exports.Response = exports.SuccessResponse = void 0;
exports.SuccessResponse = SuccessResponse;
exports.Response = Response;
exports.Res = Res;
exports.Produces = Produces;
function SuccessResponse(name, description, produces) {

@@ -9,3 +12,2 @@ return () => {

}
exports.SuccessResponse = SuccessResponse;
function Response(name, description, example, produces) {

@@ -16,3 +18,2 @@ return () => {

}
exports.Response = Response;
/**

@@ -28,3 +29,2 @@ * Inject a library-agnostic responder function that can be used to construct type-checked (usually error-) responses.

}
exports.Res = Res;
/**

@@ -41,3 +41,2 @@ * Overrides the default media type of response.

}
exports.Produces = Produces;
//# sourceMappingURL=response.js.map

@@ -1,5 +0,5 @@

export declare function Route(name?: string): Function;
export declare function Route(name?: string): ClassDecorator;
/**
* can be used to entirely hide an method from documentation
*/
export declare function Hidden(): Function;
export declare function Hidden(): ClassDecorator & MethodDecorator & ParameterDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hidden = exports.Route = void 0;
exports.Route = Route;
exports.Hidden = Hidden;
function Route(name) {

@@ -9,3 +10,2 @@ return () => {

}
exports.Route = Route;
/**

@@ -19,3 +19,2 @@ * can be used to entirely hide an method from documentation

}
exports.Hidden = Hidden;
//# sourceMappingURL=route.js.map
/**
* Can be used to indicate that a method requires no security.
*/
export declare function NoSecurity(): Function;
export declare function NoSecurity(): ClassDecorator & MethodDecorator;
/**

@@ -10,2 +10,2 @@ * @param {name} security name from securityDefinitions

[name: string]: string[];
}, scopes?: string[]): Function;
}, scopes?: string[]): ClassDecorator & MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Security = exports.NoSecurity = void 0;
exports.NoSecurity = NoSecurity;
exports.Security = Security;
/**

@@ -12,3 +13,2 @@ * Can be used to indicate that a method requires no security.

}
exports.NoSecurity = NoSecurity;
/**

@@ -22,3 +22,2 @@ * @param {name} security name from securityDefinitions

}
exports.Security = Security;
//# sourceMappingURL=security.js.map

@@ -1,1 +0,1 @@

export declare function Tags(...values: string[]): Function;
export declare function Tags(...values: string[]): MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tags = void 0;
exports.Tags = Tags;
function Tags(...values) {

@@ -9,3 +9,2 @@ return () => {

}
exports.Tags = Tags;
//# sourceMappingURL=tags.js.map

@@ -1,2 +0,1 @@

/// <reference types="node" />
import type { OutgoingHttpHeaders } from 'node:http';

@@ -3,0 +2,0 @@ type HeaderNames = keyof OutgoingHttpHeaders;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { Readable } from 'stream';

@@ -4,0 +2,0 @@ /** Object containing file metadata and access information. */

@@ -5,2 +5,2 @@ import { IsValidHeader } from '../utils/isHeaderType';

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;
export type TsoaResponse<T extends HttpStatusCodeLiteral, BodyType, HeaderType extends IsValidHeader<HeaderType> = object> = (status: T, data: BodyType, headers?: HeaderType) => any;

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { AdditionalProps } from './additionalProps';

@@ -3,0 +2,0 @@ import { TsoaRoute } from './tsoa-route';

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidateError = exports.ValidationService = exports.ValidateParam = void 0;
exports.ValidateError = exports.ValidationService = void 0;
exports.ValidateParam = ValidateParam;
const validator_1 = __importDefault(require("validator"));

@@ -15,3 +16,2 @@ const assertNever_1 = require("../utils/assertNever");

}
exports.ValidateParam = ValidateParam;
class ValidationService {

@@ -18,0 +18,0 @@ constructor(models, config) {

@@ -7,3 +7,3 @@ import { Request as ExRequest, Response as ExResponse, NextFunction as ExNext } from 'express';

methodName: string;
controller: Controller | Object;
controller: Controller | object;
response: ExResponse;

@@ -10,0 +10,0 @@ next: ExNext;

@@ -8,3 +8,3 @@ import { Request as HRequest, ResponseToolkit as HResponse } from '@hapi/hapi';

methodName: string;
controller: Controller | Object;
controller: Controller | object;
h: HResponse;

@@ -30,4 +30,4 @@ validatedArgs: any[];

constructor(models: TsoaRoute.Models, config: AdditionalProps, hapi: {
boomify: Function;
isBoom: Function;
boomify: CallableFunction;
isBoom: CallableFunction;
});

@@ -34,0 +34,0 @@ apiHandler(params: HapiApiHandlerParameters): Promise<any>;

@@ -7,3 +7,3 @@ import type { Context, Next } from 'koa';

methodName: string;
controller: Controller | Object;
controller: Controller | object;
context: Context;

@@ -10,0 +10,0 @@ validatedArgs: any[];

@@ -13,4 +13,4 @@ import { Controller } from '../../interfaces/controller';

protected abstract returnHandler(params: ReturnHandlerParameters): any;
protected isController(object: Controller | Object): object is Controller;
protected buildPromise(methodName: string, controller: Controller | Object, validatedArgs: any): any;
protected isController(object: Controller | object): object is Controller;
protected buildPromise(methodName: string, controller: Controller | object, validatedArgs: any): Promise<PropertyDescriptor>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDefaultForAdditionalPropertiesAllowed = void 0;
exports.isDefaultForAdditionalPropertiesAllowed = isDefaultForAdditionalPropertiesAllowed;
/**

@@ -11,3 +11,2 @@ * For Swagger, additionalProperties is implicitly allowed. So use this function to clarify that undefined should be associated with allowing additional properties

}
exports.isDefaultForAdditionalPropertiesAllowed = isDefaultForAdditionalPropertiesAllowed;
//# sourceMappingURL=tsoa-route.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertNever = void 0;
exports.assertNever = assertNever;
/**

@@ -10,3 +10,2 @@ * This function does exhaustiveness checking to ensure that you have discriminated a union so that no type remains. Use this to get the typescript compiler to help discover cases that were not considered.

}
exports.assertNever = assertNever;
//# sourceMappingURL=assertNever.js.map

@@ -5,2 +5,2 @@ /**

*/
export type IsValidHeader<Header> = keyof Header extends string | number ? Header[keyof Header] extends string | string[] | undefined ? {} : 'Header values must be string or string[]' : 'Header names must be of type string';
export type IsValidHeader<Header> = keyof Header extends string | number ? Header[keyof Header] extends string | string[] | undefined ? object : 'Header values must be string or string[]' : 'Header names must be of type string';
{
"name": "@tsoa/runtime",
"description": "Build swagger-compliant REST APIs using TypeScript and Node",
"version": "6.4.0",
"version": "6.5.0",
"main": "./dist/index.js",

@@ -32,13 +32,13 @@ "typings": "./dist/index.d.ts",

"@hapi/boom": "^10.0.1",
"@hapi/hapi": "^21.3.3",
"@hapi/hapi": "^21.3.10",
"@types/koa": "^2.15.0",
"@types/multer": "^1.4.11",
"express": "^4.18.3",
"reflect-metadata": "^0.2.1",
"validator": "^13.11.0"
"@types/multer": "^1.4.12",
"express": "^4.21.0",
"reflect-metadata": "^0.2.2",
"validator": "^13.12.0"
},
"devDependencies": {
"@types/node": "^18.0.0",
"@types/validator": "^13.11.7",
"typescript": "^5.3.3"
"@types/validator": "^13.12.2",
"typescript": "^5.6.2"
},

@@ -57,3 +57,3 @@ "repository": {

},
"gitHead": "d573d6fa4303b5c4236e06fac722bf3934b85359"
"gitHead": "4abc6eeca0f1c7541900b88916612df926aab638"
}

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc