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

routing-controllers

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routing-controllers - npm Package Compare versions

Comparing version 0.7.7 to 0.8.0

decorator/SessionParam.d.ts

3

Action.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Action.js.map
//# sourceMappingURL=Action.js.map

@@ -21,4 +21,8 @@ import { Action } from "./Action";

*/
protected normalizeParamValue(value: any, param: ParamMetadata): Promise<any> | any;
protected normalizeParamValue(value: any, param: ParamMetadata): Promise<any>;
/**
* Normalizes string value to number or boolean.
*/
protected normalizeStringValue(value: string, parameterName: string, parameterType: string): string | number | boolean | Date;
/**
* Parses string value into a JSON object.

@@ -25,0 +29,0 @@ */

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,2 +58,3 @@ var class_transformer_1 = require("class-transformer");

var isPromiseLike_1 = require("./util/isPromiseLike");
var ParamNormalizationError_1 = require("./error/ParamNormalizationError");
/**

@@ -61,7 +109,7 @@ * Handles action parameter.

var isValueEmpty = value === null || value === undefined || value === "";
var isValueEmptyObject = value instanceof Object && Object.keys(value).length === 0;
if (param.type === "body" && !param.name && (isValueEmpty || isValueEmptyObject)) {
var isValueEmptyObject = typeof value === "object" && Object.keys(value).length === 0;
if (param.type === "body" && !param.name && (isValueEmpty || isValueEmptyObject)) { // body has a special check and error message
return Promise.reject(new ParamRequiredError_1.ParamRequiredError(action, param));
}
else if (param.type === "current-user") {
else if (param.type === "current-user") { // current user has a special check as well
if (isPromiseLike_1.isPromiseLike(value)) {

@@ -79,3 +127,3 @@ return value.then(function (currentUser) {

}
else if (param.name && isValueEmpty) {
else if (param.name && isValueEmpty) { // regular check for all other parameters // todo: figure out something with param.name usage and multiple things params (query params, upload files etc.)
return Promise.reject(new ParamRequiredError_1.ParamRequiredError(action, param));

@@ -90,13 +138,74 @@ }

ActionParameterHandler.prototype.normalizeParamValue = function (value, param) {
if (value === null || value === undefined)
return value;
switch (param.targetName) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (value === null || value === undefined)
return [2 /*return*/, value];
if (!(typeof value === "object" && ["queries", "headers", "params", "cookies"].some(function (paramType) { return paramType === param.type; }))) return [3 /*break*/, 2];
return [4 /*yield*/, Promise.all(Object.keys(value).map(function (key) { return __awaiter(_this, void 0, void 0, function () {
var keyValue, ParamType, typeString, _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
keyValue = value[key];
if (!(typeof keyValue === "string")) return [3 /*break*/, 2];
ParamType = Reflect.getMetadata("design:type", param.targetType.prototype, key);
if (!ParamType) return [3 /*break*/, 2];
typeString = ParamType.name.toLowerCase();
_a = value;
_b = key;
return [4 /*yield*/, this.normalizeParamValue(keyValue, __assign(__assign({}, param), { name: key, targetType: ParamType, targetName: typeString }))];
case 1:
_a[_b] = _c.sent();
_c.label = 2;
case 2: return [2 /*return*/];
}
});
}); }))];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
if (typeof value === "string") {
switch (param.targetName) {
case "number":
case "string":
case "boolean":
case "date":
return [2 /*return*/, this.normalizeStringValue(value, param.name, param.targetName)];
}
}
_a.label = 3;
case 3:
if (!((["number", "string", "boolean"].indexOf(param.targetName) === -1)
&& (param.parse || param.isTargetObject))) return [3 /*break*/, 5];
value = this.parseValue(value, param);
value = this.transformValue(value, param);
return [4 /*yield*/, this.validateValue(value, param)];
case 4:
value = _a.sent();
_a.label = 5;
case 5: return [2 /*return*/, value];
}
});
});
};
/**
* Normalizes string value to number or boolean.
*/
ActionParameterHandler.prototype.normalizeStringValue = function (value, parameterName, parameterType) {
switch (parameterType) {
case "number":
if (value === "")
return undefined;
return +value;
case "string":
return value;
if (value === "") {
throw new ParamNormalizationError_1.InvalidParamError(value, parameterName, parameterType);
}
var valueNumber = +value;
if (valueNumber === NaN) {
throw new ParamNormalizationError_1.InvalidParamError(value, parameterName, parameterType);
}
return valueNumber;
case "boolean":
if (value === "true" || value === "1") {
if (value === "true" || value === "1" || value === "") {
return true;

@@ -107,17 +216,15 @@ }

}
return !!value;
else {
throw new ParamNormalizationError_1.InvalidParamError(value, parameterName, parameterType);
}
case "date":
var parsedDate = new Date(value);
if (isNaN(parsedDate.getTime())) {
return Promise.reject(new BadRequestError_1.BadRequestError(param.name + " is invalid! It can't be parsed to date."));
if (Number.isNaN(parsedDate.getTime())) {
throw new ParamNormalizationError_1.InvalidParamError(value, parameterName, parameterType);
}
return parsedDate;
case "string":
default:
if (value && (param.parse || param.isTargetObject)) {
value = this.parseValue(value, param);
value = this.transformValue(value, param);
value = this.validateValue(value, param); // note this one can return promise
}
return value;
}
return value;
};

@@ -176,3 +283,2 @@ /**

exports.ActionParameterHandler = ActionParameterHandler;
//# sourceMappingURL=ActionParameterHandler.js.map
//# sourceMappingURL=ActionParameterHandler.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=AuthorizationChecker.js.map
//# sourceMappingURL=AuthorizationChecker.js.map

@@ -51,3 +51,2 @@ "use strict";

exports.getFromContainer = getFromContainer;
//# sourceMappingURL=container.js.map
//# sourceMappingURL=container.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CurrentUserChecker.js.map
//# sourceMappingURL=CurrentUserChecker.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CustomParameterDecorator.js.map
//# sourceMappingURL=CustomParameterDecorator.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=BodyOptions.js.map
//# sourceMappingURL=BodyOptions.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ParamOptions.js.map
//# sourceMappingURL=ParamOptions.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=UploadOptions.js.map
//# sourceMappingURL=UploadOptions.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Authorized = Authorized;
//# sourceMappingURL=Authorized.js.map
//# sourceMappingURL=Authorized.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.Body = Body;
//# sourceMappingURL=Body.js.map
//# sourceMappingURL=Body.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.BodyParam = BodyParam;
//# sourceMappingURL=BodyParam.js.map
//# sourceMappingURL=BodyParam.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.ContentType = ContentType;
//# sourceMappingURL=ContentType.js.map
//# sourceMappingURL=ContentType.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.Controller = Controller;
//# sourceMappingURL=Controller.js.map
//# sourceMappingURL=Controller.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.CookieParam = CookieParam;
//# sourceMappingURL=CookieParam.js.map
//# sourceMappingURL=CookieParam.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.CookieParams = CookieParams;
//# sourceMappingURL=CookieParams.js.map
//# sourceMappingURL=CookieParams.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.Ctx = Ctx;
//# sourceMappingURL=Ctx.js.map
//# sourceMappingURL=Ctx.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.CurrentUser = CurrentUser;
//# sourceMappingURL=CurrentUser.js.map
//# sourceMappingURL=CurrentUser.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Delete = Delete;
//# sourceMappingURL=Delete.js.map
//# sourceMappingURL=Delete.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Get = Get;
//# sourceMappingURL=Get.js.map
//# sourceMappingURL=Get.js.map

@@ -19,3 +19,2 @@ "use strict";

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

@@ -20,3 +20,2 @@ "use strict";

exports.Header = Header;
//# sourceMappingURL=Header.js.map
//# sourceMappingURL=Header.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.HeaderParam = HeaderParam;
//# sourceMappingURL=HeaderParam.js.map
//# sourceMappingURL=HeaderParam.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.HeaderParams = HeaderParams;
//# sourceMappingURL=HeaderParams.js.map
//# sourceMappingURL=HeaderParams.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.HttpCode = HttpCode;
//# sourceMappingURL=HttpCode.js.map
//# sourceMappingURL=HttpCode.js.map

@@ -17,3 +17,2 @@ "use strict";

exports.Interceptor = Interceptor;
//# sourceMappingURL=Interceptor.js.map
//# sourceMappingURL=Interceptor.js.map

@@ -20,3 +20,2 @@ "use strict";

exports.JsonController = JsonController;
//# sourceMappingURL=JsonController.js.map
//# sourceMappingURL=JsonController.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Location = Location;
//# sourceMappingURL=Location.js.map
//# sourceMappingURL=Location.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Method = Method;
//# sourceMappingURL=Method.js.map
//# sourceMappingURL=Method.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Middleware = Middleware;
//# sourceMappingURL=Middleware.js.map
//# sourceMappingURL=Middleware.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.OnNull = OnNull;
//# sourceMappingURL=OnNull.js.map
//# sourceMappingURL=OnNull.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.OnUndefined = OnUndefined;
//# sourceMappingURL=OnUndefined.js.map
//# sourceMappingURL=OnUndefined.js.map

@@ -23,3 +23,2 @@ "use strict";

exports.Param = Param;
//# sourceMappingURL=Param.js.map
//# sourceMappingURL=Param.js.map

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

import { ParamOptions } from "../decorator-options/ParamOptions";
/**

@@ -5,2 +6,2 @@ * Injects all request's route parameters to the controller action parameter.

*/
export declare function Params(): Function;
export declare function Params(options?: ParamOptions): Function;

@@ -8,3 +8,3 @@ "use strict";

*/
function Params() {
function Params(options) {
return function (object, methodName, index) {

@@ -16,5 +16,7 @@ index_1.getMetadataArgsStorage().params.push({

index: index,
parse: false,
required: false,
classTransform: undefined
parse: options ? options.parse : false,
required: options ? options.required : undefined,
classTransform: options ? options.transform : undefined,
explicitType: options ? options.type : undefined,
validate: options ? options.validate : undefined,
});

@@ -24,3 +26,2 @@ };

exports.Params = Params;
//# sourceMappingURL=Params.js.map
//# sourceMappingURL=Params.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Patch = Patch;
//# sourceMappingURL=Patch.js.map
//# sourceMappingURL=Patch.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Post = Post;
//# sourceMappingURL=Post.js.map
//# sourceMappingURL=Post.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Put = Put;
//# sourceMappingURL=Put.js.map
//# sourceMappingURL=Put.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.QueryParam = QueryParam;
//# sourceMappingURL=QueryParam.js.map
//# sourceMappingURL=QueryParam.js.map

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

import { ParamOptions } from "../decorator-options/ParamOptions";
/**

@@ -5,2 +6,2 @@ * Injects all request's query parameters to the controller action parameter.

*/
export declare function QueryParams(): Function;
export declare function QueryParams(options?: ParamOptions): Function;

@@ -8,3 +8,3 @@ "use strict";

*/
function QueryParams() {
function QueryParams(options) {
return function (object, methodName, index) {

@@ -16,4 +16,8 @@ index_1.getMetadataArgsStorage().params.push({

index: index,
parse: false,
required: false
name: "",
parse: options ? options.parse : false,
required: options ? options.required : undefined,
classTransform: options ? options.transform : undefined,
explicitType: options ? options.type : undefined,
validate: options ? options.validate : undefined,
});

@@ -23,3 +27,2 @@ };

exports.QueryParams = QueryParams;
//# sourceMappingURL=QueryParams.js.map
//# sourceMappingURL=QueryParams.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Redirect = Redirect;
//# sourceMappingURL=Redirect.js.map
//# sourceMappingURL=Redirect.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.Render = Render;
//# sourceMappingURL=Render.js.map
//# sourceMappingURL=Render.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.Req = Req;
//# sourceMappingURL=Req.js.map
//# sourceMappingURL=Req.js.map

@@ -21,3 +21,2 @@ "use strict";

exports.Res = Res;
//# sourceMappingURL=Res.js.map
//# sourceMappingURL=Res.js.map

@@ -18,3 +18,2 @@ "use strict";

exports.ResponseClassTransformOptions = ResponseClassTransformOptions;
//# sourceMappingURL=ResponseClassTransformOptions.js.map
//# sourceMappingURL=ResponseClassTransformOptions.js.map

@@ -7,6 +7,1 @@ import { ParamOptions } from "../decorator-options/ParamOptions";

export declare function Session(options?: ParamOptions): ParameterDecorator;
/**
* Injects a Session object to the controller action parameter.
* Must be applied on a controller action parameter.
*/
export declare function Session(propertyName: string, options?: ParamOptions): ParameterDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_1 = require("../index");
function Session(optionsOrObjectName, paramOptions) {
var propertyName;
var options;
if (typeof optionsOrObjectName === "string") {
propertyName = optionsOrObjectName;
options = paramOptions || {};
}
else {
options = optionsOrObjectName || {};
}
/**
* Injects a Session object to the controller action parameter.
* Must be applied on a controller action parameter.
*/
function Session(options) {
return function (object, methodName, index) {

@@ -20,7 +15,6 @@ index_1.getMetadataArgsStorage().params.push({

index: index,
name: propertyName,
parse: false,
required: options.required !== undefined ? options.required : true,
classTransform: options.transform,
validate: options.validate !== undefined ? options.validate : false,
required: options && options.required !== undefined ? options.required : true,
classTransform: options && options.transform,
validate: options && options.validate !== undefined ? options.validate : false,
});

@@ -30,3 +24,2 @@ };

exports.Session = Session;
//# sourceMappingURL=Session.js.map
//# sourceMappingURL=Session.js.map

@@ -23,3 +23,2 @@ "use strict";

exports.State = State;
//# sourceMappingURL=State.js.map
//# sourceMappingURL=State.js.map

@@ -23,3 +23,2 @@ "use strict";

exports.UploadedFile = UploadedFile;
//# sourceMappingURL=UploadedFile.js.map
//# sourceMappingURL=UploadedFile.js.map

@@ -23,3 +23,2 @@ "use strict";

exports.UploadedFiles = UploadedFiles;
//# sourceMappingURL=UploadedFiles.js.map
//# sourceMappingURL=UploadedFiles.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.UseAfter = UseAfter;
//# sourceMappingURL=UseAfter.js.map
//# sourceMappingURL=UseAfter.js.map

@@ -25,3 +25,2 @@ "use strict";

exports.UseBefore = UseBefore;
//# sourceMappingURL=UseBefore.js.map
//# sourceMappingURL=UseBefore.js.map

@@ -24,3 +24,2 @@ "use strict";

exports.UseInterceptor = UseInterceptor;
//# sourceMappingURL=UseInterceptor.js.map
//# sourceMappingURL=UseInterceptor.js.map

@@ -93,3 +93,2 @@ "use strict";

exports.BaseDriver = BaseDriver;
//# sourceMappingURL=BaseDriver.js.map
//# sourceMappingURL=BaseDriver.js.map

@@ -11,3 +11,3 @@ import { UseMetadata } from "../../metadata/UseMetadata";

export declare class ExpressDriver extends BaseDriver {
express: any;
express?: any;
constructor(express?: any);

@@ -14,0 +14,0 @@ /**

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -12,2 +15,9 @@ extendStatics(d, b);

})();
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -90,2 +100,3 @@ var ActionMetadata_1 = require("../../metadata/ActionMetadata");

ExpressDriver.prototype.registerAction = function (actionMetadata, executeCallback) {
var _a;
var _this = this;

@@ -146,3 +157,3 @@ // middlewares required for this action

// user used middlewares
var uses = actionMetadata.controllerMetadata.uses.concat(actionMetadata.uses);
var uses = __spreadArrays(actionMetadata.controllerMetadata.uses, actionMetadata.uses);
var beforeMiddlewares = this.prepareMiddlewares(uses.filter(function (use) { return !use.afterAction; }));

@@ -163,8 +174,7 @@ var afterMiddlewares = this.prepareMiddlewares(uses.filter(function (use) { return use.afterAction; }));

// finally register action in express
(_a = this.express)[actionMetadata.type.toLowerCase()].apply(_a, [
(_a = this.express)[actionMetadata.type.toLowerCase()].apply(_a, __spreadArrays([
route
].concat(beforeMiddlewares, defaultMiddlewares, [
], beforeMiddlewares, defaultMiddlewares, [
routeHandler
], afterMiddlewares));
var _a;
};

@@ -190,5 +200,5 @@ /**

return request.params;
case "session-param":
return request.session[param.name];
case "session":
if (param.name)
return request.session[param.name];
return request.session;

@@ -256,3 +266,3 @@ case "state":

});
if (action.redirect) {
if (action.redirect) { // if redirect is set then do it
if (typeof result === "string") {

@@ -269,3 +279,3 @@ options.response.redirect(result);

}
else if (action.renderedTemplate) {
else if (action.renderedTemplate) { // if template is set then render it
var renderOptions = result && result instanceof Object ? result : {};

@@ -285,3 +295,3 @@ options.response.render(action.renderedTemplate, renderOptions, function (err, html) {

}
else if (result === undefined) {
else if (result === undefined) { // throw NotFoundError on undefined response
if (action.undefinedResultCode) {

@@ -300,3 +310,3 @@ if (action.isJsonTyped) {

}
else if (result === null) {
else if (result === null) { // send null response
if (action.isJsonTyped) {

@@ -310,6 +320,6 @@ options.response.json(null);

}
else if (result instanceof Buffer) {
else if (result instanceof Buffer) { // check if it's binary data (Buffer)
options.response.end(result, "binary");
}
else if (result instanceof Uint8Array) {
else if (result instanceof Uint8Array) { // check if it's binary data (typed array)
options.response.end(Buffer.from(result), "binary");

@@ -320,3 +330,3 @@ }

}
else {
else { // send regular result
if (action.isJsonTyped) {

@@ -371,3 +381,3 @@ options.response.json(result);

uses.forEach(function (use) {
if (use.middleware.prototype && use.middleware.prototype.use) {
if (use.middleware.prototype && use.middleware.prototype.use) { // if this is function instance of MiddlewareInterface
middlewareFunctions.push(function (request, response, next) {

@@ -389,3 +399,3 @@ try {

}
else if (use.middleware.prototype && use.middleware.prototype.error) {
else if (use.middleware.prototype && use.middleware.prototype.error) { // if this is function instance of ErrorMiddlewareInterface
middlewareFunctions.push(function (error, request, response, next) {

@@ -444,3 +454,2 @@ return container_1.getFromContainer(use.middleware).error(error, request, response, next);

exports.ExpressDriver = ExpressDriver;
//# sourceMappingURL=ExpressDriver.js.map
//# sourceMappingURL=ExpressDriver.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ExpressErrorMiddlewareInterface.js.map
//# sourceMappingURL=ExpressErrorMiddlewareInterface.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ExpressMiddlewareInterface.js.map
//# sourceMappingURL=ExpressMiddlewareInterface.js.map

@@ -11,4 +11,4 @@ import { Action } from "../../Action";

export declare class KoaDriver extends BaseDriver {
koa: any;
router: any;
koa?: any;
router?: any;
constructor(koa?: any, router?: any);

@@ -42,3 +42,3 @@ /**

*/
handleError(error: any, action: ActionMetadata | undefined, options: Action): Promise<{}>;
handleError(error: any, action: ActionMetadata | undefined, options: Action): Promise<unknown>;
/**

@@ -55,7 +55,7 @@ * Creates middlewares from the given "use"-s.

*/
private loadRouter();
private loadRouter;
/**
* Dynamically loads koa-multer module.
*/
private loadMulter();
private loadMulter;
/**

@@ -66,3 +66,3 @@ * This middleware fixes a bug on koa-multer implementation.

*/
private fixMulterRequestAssignment(ctx, next);
private fixMulterRequestAssignment;
}
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -13,6 +16,7 @@ extendStatics(d, b);

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -28,4 +32,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -49,2 +53,9 @@ case 0: case 1: t = op; break;

};
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -111,2 +122,3 @@ var ActionMetadata_1 = require("../../metadata/ActionMetadata");

KoaDriver.prototype.registerAction = function (actionMetadata, executeCallback) {
var _a;
var _this = this;

@@ -172,8 +184,7 @@ // middlewares required for this action

// finally register action in koa
(_a = this.router)[actionMetadata.type.toLowerCase()].apply(_a, [
(_a = this.router)[actionMetadata.type.toLowerCase()].apply(_a, __spreadArrays([
route
].concat(beforeMiddlewares, defaultMiddlewares, [
], beforeMiddlewares, defaultMiddlewares, [
routeHandler
], afterMiddlewares));
var _a;
};

@@ -203,5 +214,5 @@ /**

case "session":
if (param.name)
return context.session[param.name];
return context.session;
case "session-param":
return context.session[param.name];
case "state":

@@ -244,3 +255,3 @@ if (param.name)

result = this.transformResult(result, action, options);
if (action.redirect) {
if (action.redirect) { // if redirect is set then do it
if (typeof result === "string") {

@@ -256,3 +267,3 @@ options.response.redirect(result);

}
else if (action.renderedTemplate) {
else if (action.renderedTemplate) { // if template is set then render it // TODO: not working in koa
var renderOptions_1 = result && result instanceof Object ? result : {};

@@ -272,3 +283,3 @@ this.koa.use(function (ctx, next) {

}
else if (result === undefined) {
else if (result === undefined) { // throw NotFoundError on undefined response
if (action.undefinedResultCode instanceof Function) {

@@ -281,3 +292,3 @@ throw new action.undefinedResultCode(options);

}
else if (result === null) {
else if (result === null) { // send null response
if (action.nullResultCode instanceof Function)

@@ -287,6 +298,6 @@ throw new action.nullResultCode(options);

}
else if (result instanceof Uint8Array) {
else if (result instanceof Uint8Array) { // check if it's binary data (typed array)
options.response.body = Buffer.from(result);
}
else {
else { // send regular result
if (result instanceof Object) {

@@ -360,3 +371,3 @@ options.response.body = result;

uses.forEach(function (use) {
if (use.middleware.prototype && use.middleware.prototype.use) {
if (use.middleware.prototype && use.middleware.prototype.use) { // if this is function instance of MiddlewareInterface
middlewareFunctions.push(function (context, next) {

@@ -470,3 +481,2 @@ try {

exports.KoaDriver = KoaDriver;
//# sourceMappingURL=KoaDriver.js.map
//# sourceMappingURL=KoaDriver.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=KoaMiddlewareInterface.js.map
//# sourceMappingURL=KoaMiddlewareInterface.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.AccessDeniedError = AccessDeniedError;
//# sourceMappingURL=AccessDeniedError.js.map
//# sourceMappingURL=AccessDeniedError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -28,3 +31,2 @@ extendStatics(d, b);

exports.AuthorizationCheckerNotDefinedError = AuthorizationCheckerNotDefinedError;
//# sourceMappingURL=AuthorizationCheckerNotDefinedError.js.map
//# sourceMappingURL=AuthorizationCheckerNotDefinedError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.AuthorizationRequiredError = AuthorizationRequiredError;
//# sourceMappingURL=AuthorizationRequiredError.js.map
//# sourceMappingURL=AuthorizationRequiredError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -28,3 +31,2 @@ extendStatics(d, b);

exports.CurrentUserCheckerNotDefinedError = CurrentUserCheckerNotDefinedError;
//# sourceMappingURL=CurrentUserCheckerNotDefinedError.js.map
//# sourceMappingURL=CurrentUserCheckerNotDefinedError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -28,3 +31,2 @@ extendStatics(d, b);

exports.ParameterParseJsonError = ParameterParseJsonError;
//# sourceMappingURL=ParameterParseJsonError.js.map
//# sourceMappingURL=ParameterParseJsonError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -62,3 +65,2 @@ extendStatics(d, b);

exports.ParamRequiredError = ParamRequiredError;
//# sourceMappingURL=ParamRequiredError.js.map
//# sourceMappingURL=ParamRequiredError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.BadRequestError = BadRequestError;
//# sourceMappingURL=BadRequestError.js.map
//# sourceMappingURL=BadRequestError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.ForbiddenError = ForbiddenError;
//# sourceMappingURL=ForbiddenError.js.map
//# sourceMappingURL=ForbiddenError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -33,3 +36,2 @@ extendStatics(d, b);

exports.HttpError = HttpError;
//# sourceMappingURL=HttpError.js.map
//# sourceMappingURL=HttpError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.InternalServerError = InternalServerError;
//# sourceMappingURL=InternalServerError.js.map
//# sourceMappingURL=InternalServerError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.MethodNotAllowedError = MethodNotAllowedError;
//# sourceMappingURL=MethodNotAllowedError.js.map
//# sourceMappingURL=MethodNotAllowedError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.NotAcceptableError = NotAcceptableError;
//# sourceMappingURL=NotAcceptableError.js.map
//# sourceMappingURL=NotAcceptableError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.NotFoundError = NotFoundError;
//# sourceMappingURL=NotFoundError.js.map
//# sourceMappingURL=NotFoundError.js.map
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -30,3 +33,2 @@ extendStatics(d, b);

exports.UnauthorizedError = UnauthorizedError;
//# sourceMappingURL=UnauthorizedError.js.map
//# sourceMappingURL=UnauthorizedError.js.map

@@ -216,3 +216,2 @@ "use strict";

exports.createParamDecorator = createParamDecorator;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=InterceptorInterface.js.map
//# sourceMappingURL=InterceptorInterface.js.map

@@ -134,3 +134,2 @@ "use strict";

exports.MetadataArgsStorage = MetadataArgsStorage;
//# sourceMappingURL=MetadataArgsStorage.js.map
//# sourceMappingURL=MetadataArgsStorage.js.map

@@ -50,3 +50,3 @@ import { ActionMetadata } from "../metadata/ActionMetadata";

*/
private decorateDefaultParamOptions(paramArgs);
private decorateDefaultParamOptions;
/**

@@ -53,0 +53,0 @@ * Creates response handler metadatas for action.

@@ -162,3 +162,2 @@ "use strict";

exports.MetadataBuilder = MetadataBuilder;
//# sourceMappingURL=MetadataBuilder.js.map
//# sourceMappingURL=MetadataBuilder.js.map

@@ -128,7 +128,7 @@ import { Action } from "../Action";

*/
private buildFullRoute();
private buildFullRoute;
/**
* Builds action response headers.
*/
private buildHeaders(responseHandlers);
private buildHeaders;
/**

@@ -135,0 +135,0 @@ * Calls action method.

@@ -128,3 +128,2 @@ "use strict";

exports.ActionMetadata = ActionMetadata;
//# sourceMappingURL=ActionMetadata.js.map
//# sourceMappingURL=ActionMetadata.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ActionMetadataArgs.js.map
//# sourceMappingURL=ActionMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ControllerMetadataArgs.js.map
//# sourceMappingURL=ControllerMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ErrorHandlerMetadataArgs.js.map
//# sourceMappingURL=ErrorHandlerMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=InterceptorMetadataArgs.js.map
//# sourceMappingURL=InterceptorMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=MiddlewareMetadataArgs.js.map
//# sourceMappingURL=MiddlewareMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ParamMetadataArgs.js.map
//# sourceMappingURL=ParamMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ResponseHandleMetadataArgs.js.map
//# sourceMappingURL=ResponseHandleMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=UseInterceptorMetadataArgs.js.map
//# sourceMappingURL=UseInterceptorMetadataArgs.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=UseMetadataArgs.js.map
//# sourceMappingURL=UseMetadataArgs.js.map

@@ -44,3 +44,2 @@ "use strict";

exports.ControllerMetadata = ControllerMetadata;
//# sourceMappingURL=ControllerMetadata.js.map
//# sourceMappingURL=ControllerMetadata.js.map

@@ -20,3 +20,2 @@ "use strict";

exports.InterceptorMetadata = InterceptorMetadata;
//# sourceMappingURL=InterceptorMetadata.js.map
//# sourceMappingURL=InterceptorMetadata.js.map

@@ -33,3 +33,2 @@ "use strict";

exports.MiddlewareMetadata = MiddlewareMetadata;
//# sourceMappingURL=MiddlewareMetadata.js.map
//# sourceMappingURL=MiddlewareMetadata.js.map

@@ -53,3 +53,2 @@ "use strict";

exports.ParamMetadata = ParamMetadata;
//# sourceMappingURL=ParamMetadata.js.map
//# sourceMappingURL=ParamMetadata.js.map

@@ -20,3 +20,2 @@ "use strict";

exports.ResponseHandlerMetadata = ResponseHandlerMetadata;
//# sourceMappingURL=ResponseHandleMetadata.js.map
//# sourceMappingURL=ResponseHandleMetadata.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ActionType.js.map
//# sourceMappingURL=ActionType.js.map
/**
* Controller action's parameter type.
*/
export declare type ParamType = "body" | "body-param" | "query" | "queries" | "header" | "headers" | "file" | "files" | "param" | "params" | "session" | "state" | "cookie" | "cookies" | "request" | "response" | "context" | "current-user" | "custom-converter";
export declare type ParamType = "body" | "body-param" | "query" | "queries" | "header" | "headers" | "file" | "files" | "param" | "params" | "session" | "session-param" | "state" | "cookie" | "cookies" | "request" | "response" | "context" | "current-user" | "custom-converter";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ParamType.js.map
//# sourceMappingURL=ParamType.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ResponseHandlerType.js.map
//# sourceMappingURL=ResponseHandlerType.js.map

@@ -19,3 +19,2 @@ "use strict";

exports.UseMetadata = UseMetadata;
//# sourceMappingURL=UseMetadata.js.map
//# sourceMappingURL=UseMetadata.js.map
{
"name": "routing-controllers",
"private": false,
"version": "0.7.7",
"version": "0.8.0",
"description": "Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.",

@@ -36,62 +36,65 @@ "license": "MIT",

"dependencies": {
"class-transformer": "^0.1.9",
"class-validator": "^0.8.1",
"cookie": "^0.3.1",
"glob": "^7.0.5",
"reflect-metadata": "^0.1.12",
"cookie": "^0.4.0",
"glob": "^7.1.4",
"reflect-metadata": "^0.1.13",
"template-url": "^1.0.0"
},
"devDependencies": {
"@types/chai": "^3.4.35",
"@types/chai-as-promised": "0.0.30",
"@types/express": "^4.0.35",
"@types/express-session": "0.0.32",
"@types/koa": "^2.0.39",
"@types/mocha": "^2.2.40",
"@types/node": "^7.0.12",
"@types/sinon": "^2.1.2",
"body-parser": "^1.17.1",
"chai": "^3.4.1",
"chai-as-promised": "^6.0.0",
"chakram": "^1.4.0",
"cors": "^2.8.3",
"cross-env": "5.0.5",
"del": "^2.2.1",
"express": "^4.15.2",
"express-session": "^1.15.2",
"gulp": "^3.9.1",
"gulp-istanbul": "^1.0.0",
"gulp-mocha": "^3.0.1",
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.6.3",
"gulp-sourcemaps": "^2.5.1",
"gulp-tslint": "^7.1.0",
"gulp-typescript": "^3.1.6",
"gulpclass": "^0.1.2",
"handlebars": "^4.0.6",
"kcors": "^1.3.2",
"koa": "^2.0.0",
"koa-bodyparser": "^4.2.0",
"@types/chai": "^4.2.3",
"@types/chai-as-promised": "7.1.2",
"@types/express": "^4.17.1",
"@types/express-session": "1.15.14",
"@types/koa": "^2.0.50",
"@types/mocha": "^5.2.7",
"@types/node": "^12.7.8",
"@types/sinon": "^7.0.13",
"body-parser": "^1.19.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chakram": "^1.5.0",
"class-transformer": "^0.2.3",
"class-validator": "0.10.1",
"copyfiles": "^2.1.1",
"cors": "^2.8.5",
"cross-env": "6.0.0",
"express": "^4.17.1",
"express-session": "^1.16.2",
"handlebars": "^4.4.0",
"json": "^9.0.6",
"kcors": "^2.2.2",
"koa": "^2.8.2",
"koa-bodyparser": "^4.2.1",
"koa-convert": "^1.2.0",
"koa-multer": "^1.0.1",
"koa-router": "^7.1.1",
"koa-session": "^5.0.0",
"koa-views": "^6.0.1",
"mocha": "^3.0.0",
"multer": "^1.3.0",
"mustache-express": "^1.2.2",
"remap-istanbul": "^0.9.5",
"request": "^2.81.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0",
"ts-node": "^3.0.2",
"tslint": "^5.0.0",
"tslint-stylish": "^2.1.0",
"typedi": "~0.7.1",
"typescript": "~2.7.2"
"koa-multer": "^1.0.2",
"koa-router": "^7.4.0",
"koa-session": "^5.12.3",
"koa-views": "^6.2.1",
"mocha": "^6.2.1",
"multer": "^1.4.2",
"mustache-express": "^1.3.0",
"nyc": "^14.1.1",
"request": "^2.88.0",
"rimraf": "^3.0.0",
"sinon": "^7.5.0",
"sinon-chai": "^3.3.0",
"source-map-support": "^0.5.13",
"ts-node": "^8.4.1",
"tslint": "^5.20.0",
"typedi": "~0.8.0",
"typescript": "~3.6.3"
},
"peerDependencies": {
"class-transformer": "^0.2.3",
"class-validator": "0.10.1"
},
"scripts": {
"test": "cross-env NODE_ENV=test gulp tests"
},
"typings": "index.d.ts"
"build": "rimraf build && echo Using TypeScript && tsc --version && tsc --pretty",
"clean": "rimraf build coverage",
"copy": "copyfiles -u 3 \"build/compiled/src/**/*\" build/package && copyfiles package.json README.md build/package",
"lint": "tslint --fix --format verbose --project tsconfig.json",
"package": "npm run build && npm run copy && npm run public && rimraf build/compiled",
"pretest": "npm run lint",
"public": "json -I -f build/package/package.json -e 'this.private=false'",
"test": "rimraf coverage && cross-env NODE_ENV=test nyc mocha test/**/*.ts"
}
}

@@ -76,11 +76,11 @@ # routing-controllers

`npm install routing-controllers --save`
`npm install routing-controllers`
2. `reflect-metadata` shim is required:
`npm install reflect-metadata --save`
`npm install reflect-metadata`
and make sure to import it before you use routing-controllers:
```javascript
```typescript
import "reflect-metadata";

@@ -93,18 +93,24 @@ ```

`npm install express body-parser multer --save`
`npm install express body-parser multer`
Optionally you can also install their typings:
`npm install @types/express @types/body-parser @types/multer --save`
`npm install -D @types/express @types/body-parser @types/multer`
**b. If you want to use routing-controllers with *koa 2*, then install it and all required dependencies:**
`npm install koa koa-router koa-bodyparser koa-multer --save`
`npm install koa koa-router koa-bodyparser koa-multer`
Optionally you can also install their typings:
`npm install @types/koa @types/koa-router @types/koa-bodyparser --save`
`npm install -D @types/koa @types/koa-router @types/koa-bodyparser`
4. Its important to set these options in `tsconfig.json` file of your project:
4. Install peer dependencies:
`npm install class-transformer class-validator`
In prior versions, these were direct dependencies, but now they are peer dependencies so you can choose when to upgrade and accept breaking changes.
5. Its important to set these options in `tsconfig.json` file of your project:
```json

@@ -121,3 +127,3 @@ {

```javascript
```typescript
import {Controller, Param, Body, Get, Post, Put, Delete} from "routing-controllers";

@@ -160,3 +166,3 @@

```javascript
```typescript
import "reflect-metadata"; // this shim is required

@@ -190,3 +196,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import {JsonController, Param, Body, Get, Post, Put, Delete} from "routing-controllers";

@@ -218,3 +224,3 @@

```javascript
```typescript
import {JsonController, Param, Body, Get, Post, Put, Delete} from "routing-controllers";

@@ -258,3 +264,3 @@

```javascript
```typescript
import {Controller, Req, Res, Get} from "routing-controllers";

@@ -276,3 +282,3 @@

```javascript
```typescript
import {Request, Response} from "express";

@@ -299,3 +305,3 @@ import {Controller, Req, Res, Get} from "routing-controllers";

```javascript
```typescript
import "reflect-metadata";

@@ -320,3 +326,3 @@ import {useExpressServer} from "routing-controllers";

```javascript
```typescript
import "reflect-metadata";

@@ -336,3 +342,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import "reflect-metadata";

@@ -354,3 +360,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
@Controller("/users")

@@ -366,3 +372,3 @@ export class UserController {

```javascript
```typescript
@Get("/users/:id")

@@ -379,3 +385,3 @@ getOne(@Param("id") id: number) { // id will be automatically casted to "number" because it has type number

```javascript
```typescript
@Get("/users")

@@ -387,3 +393,34 @@ getUsers(@QueryParam("limit") limit: number) {

If you want to inject all query parameters use `@QueryParams()` decorator.
The bigest benefit of this approach is that you can perform validation of the params.
```typescript
enum Roles {
Admin = "admin",
User = "user",
Guest = "guest",
}
class GetUsersQuery {
@IsPositive()
limit: number;
@IsAlpha()
city: string;
@IsEnum(Roles)
role: Roles;
@IsBoolean()
isActive: boolean;
}
@Get("/users")
getUsers(@QueryParams() query: GetUsersQuery) {
// here you can access query.role, query.limit
// and others valid query parameters
}
```
#### Inject request body

@@ -393,3 +430,3 @@

```javascript
```typescript
@Post("/users")

@@ -408,3 +445,3 @@ saveUser(@Body() user: User) {

```javascript
```typescript
@Post("/users")

@@ -419,3 +456,3 @@ saveUser(@BodyParam("name") userName: string) {

```javascript
```typescript
@Post("/users")

@@ -432,3 +469,3 @@ saveUser(@HeaderParam("authorization") token: string) {

```javascript
```typescript
@Get("/users")

@@ -443,14 +480,16 @@ getUsers(@CookieParam("username") username: string) {

To inject a session value, use `@Session` decorator:
To inject a session value, use `@SessionParam` decorator:
```javascript
@Get("/login/")
savePost(@Session("user") user: User, @Body() post: Post) {
}
```typescript
@Get("/login")
savePost(@SessionParam("user") user: User, @Body() post: Post) {}
```
If you want to inject the main session object, use `@Session()` without any parameters.
```typescript
@Get("/login")
savePost(@Session() session: any, @Body() post: Post) {}
```
The parameter marked with `@Session` decorator is required by default. If your action param is optional, you have to mark it as not required:
```ts
action(@Session("user", { required: false }) user: User)
action(@Session("user", { required: false }) user: User) {}
```

@@ -464,3 +503,3 @@

```javascript
```typescript
@Get("/login/")

@@ -478,3 +517,3 @@ savePost(@State("user") user: User, @Body() post: Post) {

```javascript
```typescript
@Post("/files")

@@ -487,3 +526,3 @@ saveFile(@UploadedFile("fileName") file: any) {

```javascript
```typescript
// to keep code clean better to extract this function into separate file

@@ -519,3 +558,3 @@ export const fileUploadOptions = () => {

```javascript
```typescript
@Post("/users")

@@ -540,3 +579,3 @@ save(@Body({ required: true }) user: any) {

```javascript
```typescript
@Get("/users")

@@ -552,3 +591,3 @@ @ContentType("text/cvs")

```javascript
```typescript
@Get("/users")

@@ -565,3 +604,3 @@ @Location("http://github.com")

```javascript
```typescript
@Get("/users")

@@ -601,3 +640,3 @@ @Redirect("http://github.com")

```javascript
```typescript
@HttpCode(201)

@@ -615,3 +654,3 @@ @Post("/users")

```javascript
```typescript
@Delete("/users/:id")

@@ -628,3 +667,3 @@ @OnUndefined(204)

```javascript
```typescript
@Get("/users/:id")

@@ -639,3 +678,3 @@ @OnUndefined(404)

```javascript
```typescript
import {HttpError} from "routing-controllers";

@@ -650,3 +689,3 @@

```javascript
```typescript
@Get("/users/:id")

@@ -665,3 +704,3 @@ @OnUndefined(UserNotFoundError)

```javascript
```typescript
@Get("/users/:id")

@@ -678,3 +717,3 @@ @Header("Cache-Control", "none")

```javascript
```typescript
@Get("/users/:id")

@@ -698,3 +737,3 @@ @Render("index.html")

```javascript
```typescript
@Get("/users/:id")

@@ -735,3 +774,3 @@ getOne(@Param("id") id: number) {

```javascript
```typescript
class DbError extends HttpError {

@@ -762,3 +801,3 @@ public operationName: string;

```javascript
```typescript
import "reflect-metadata";

@@ -780,3 +819,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import "reflect-metadata";

@@ -800,3 +839,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import "reflect-metadata";

@@ -839,3 +878,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import {Controller, Get, UseBefore} from "routing-controllers";

@@ -859,3 +898,3 @@ let compression = require("compression");

```javascript
```typescript
import {Controller, UseBefore} from "routing-controllers";

@@ -876,3 +915,3 @@ let compression = require("compression");

```javascript
```typescript
import "reflect-metadata";

@@ -899,3 +938,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
export function loggingMiddleware(request: any, response: any, next?: (err?: any) => any): any {

@@ -909,3 +948,3 @@ console.log("do something...");

```javascript
```typescript
import {ExpressMiddlewareInterface} from "routing-controllers";

@@ -925,3 +964,3 @@

```javascript
```typescript
import {Controller, UseBefore} from "routing-controllers";

@@ -941,3 +980,3 @@ import {MyMiddleware} from "./MyMiddleware";

```javascript
```typescript
@Get("/users/:id")

@@ -962,3 +1001,3 @@ @UseBefore(MyMiddleware)

```javascript
```typescript
export function use(context: any, next: (err?: any) => Promise<any>): Promise<any> {

@@ -976,3 +1015,3 @@ console.log("do something before execution...");

```javascript
```typescript
import {KoaMiddlewareInterface} from "routing-controllers";

@@ -996,3 +1035,3 @@

```javascript
```typescript
import {Controller, UseBefore} from "routing-controllers";

@@ -1012,3 +1051,3 @@ import {MyMiddleware} from "./MyMiddleware";

```javascript
```typescript
@Get("/users/:id")

@@ -1030,3 +1069,3 @@ @UseBefore(MyMiddleware)

```javascript
```typescript
import {Middleware, ExpressMiddlewareInterface} from "routing-controllers";

@@ -1047,3 +1086,3 @@

```javascript
```typescript
import "reflect-metadata";

@@ -1067,3 +1106,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import {Middleware, ExpressErrorMiddlewareInterface} from "routing-controllers";

@@ -1085,3 +1124,3 @@

```javascript
```typescript
createExpressServer({

@@ -1096,3 +1135,3 @@ defaultErrorHandler: false // disable default error handler, only if you have your own error handler

```javascript
```typescript
import "reflect-metadata";

@@ -1117,3 +1156,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
import {Get, Param, UseInterceptor} from "routing-controllers";

@@ -1141,3 +1180,3 @@

```javascript
```typescript
import {Interceptor, InterceptorInterface, Action} from "routing-controllers";

@@ -1156,3 +1195,3 @@

```javascript
```typescript
import {Get, Param, UseInterceptor} from "routing-controllers";

@@ -1175,3 +1214,3 @@ import {NameCorrectionInterceptor} from "./NameCorrectionInterceptor";

```javascript
```typescript
import {Interceptor, InterceptorInterface, Action} from "routing-controllers";

@@ -1195,3 +1234,3 @@

```javascript
```typescript
import "reflect-metadata";

@@ -1208,3 +1247,3 @@ import {createExpressServer} from "routing-controllers";

```javascript
```typescript
export class User {

@@ -1243,3 +1282,3 @@ firstName: string;

It can be done easily thanks to integration with [class-validator][9]. This behaviour is **enabled** by default. If you want to disable it, you need to do it explicitly e.g. by passing `validation: false` option on application bootstrap:
```javascript
```typescript
import "reflect-metadata";

@@ -1255,3 +1294,3 @@ import { createExpressServer } from "routing-controllers";

```javascript
```typescript
@Post("/login/")

@@ -1263,3 +1302,3 @@ login(@Body({ validate: true }) user: User) {

Decorate the properties with appropriate validation decorators.
```javascript
```typescript
export class User {

@@ -1279,3 +1318,3 @@

```javascript
```typescript
@Controller()

@@ -1307,3 +1346,3 @@ export class UserController {

```javascript
```typescript
import "reflect-metadata";

@@ -1335,3 +1374,3 @@ import {createExpressServer, Action} from "routing-controllers";

```javascript
```typescript
@JsonController()

@@ -1357,3 +1396,3 @@ export class SomeController {

```javascript
```typescript
import "reflect-metadata";

@@ -1375,3 +1414,3 @@ import {createExpressServer, Action} from "routing-controllers";

```javascript
```typescript
@JsonController()

@@ -1400,3 +1439,3 @@ export class QuestionController {

```javascript
```typescript
import "reflect-metadata";

@@ -1420,3 +1459,3 @@ import {createExpressServer, useContainer} from "routing-controllers";

```javascript
```typescript
@Controller()

@@ -1438,3 +1477,3 @@ export class UsersController {

```javascript
```typescript
import {createParamDecorator} from "routing-controllers";

@@ -1455,3 +1494,3 @@

```javascript
```typescript
@JsonController()

@@ -1500,3 +1539,3 @@ export class QuestionController {

| `@Param(name: string, options?: ParamOptions)` | `get(@Param("id") id: number)` | Injects a router parameter. | `request.params.id` |
| `@Params()` | `get(@Params() params: any)` | Injects all request parameters. | `request.params` |
| `@Params()` | `get(@Params() params: any)` | Injects all router parameters. | `request.params` |
| `@QueryParam(name: string, options?: ParamOptions)` | `get(@QueryParam("id") id: number)` | Injects a query string parameter. | `request.query.id` |

@@ -1507,4 +1546,5 @@ | `@QueryParams()` | `get(@QueryParams() params: any)` | Injects all query parameters. | `request.query` |

| `@CookieParam(name: string, options?: ParamOptions)` | `get(@CookieParam("username") username: string)` | Injects a cookie parameter. | `request.cookie("username")` |
| `@CookieParams()` | `get(@CookieParams() params: any)` | Injects all cookies. | `request.cookies |
| `@Session(name?: string)` | `get(@Session("user") user: User)` | Injects an object from session (or the whole session). | `request.session.user` |
| `@CookieParams()` | `get(@CookieParams() params: any)` | Injects all cookies. | `request.cookies` |
| `@Session()` | `get(@Session() session: any)` | Injects the whole session object. | `request.session` |
| `@SessionParam(name: string)` | `get(@SessionParam("user") user: User)` | Injects an object from session property. | `request.session.user` |
| `@State(name?: string)` | `get(@State() session: StateType)` | Injects an object from the state (or the whole state). | `ctx.state` (koa-analogue) |

@@ -1511,0 +1551,0 @@ | `@Body(options?: BodyOptions)` | `post(@Body() body: any)` | Injects a body. In parameter options you can specify body parser middleware options. | `request.body` |

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=RoleChecker.js.map
//# sourceMappingURL=RoleChecker.js.map
"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -39,2 +46,3 @@ var ActionParameterHandler_1 = require("./ActionParameterHandler");

RoutingControllers.prototype.registerInterceptors = function (classes) {
var _a;
var interceptors = this.metadataBuilder

@@ -46,3 +54,2 @@ .buildInterceptorMetadata(classes)

return this;
var _a;
};

@@ -57,3 +64,3 @@ /**

controller.actions.forEach(function (actionMetadata) {
var interceptorFns = _this.prepareInterceptors(_this.interceptors.concat(actionMetadata.controllerMetadata.interceptors, actionMetadata.interceptors));
var interceptorFns = _this.prepareInterceptors(__spreadArrays(_this.interceptors, actionMetadata.controllerMetadata.interceptors, actionMetadata.interceptors));
_this.driver.registerAction(actionMetadata, function (action) {

@@ -144,3 +151,3 @@ return _this.executeAction(actionMetadata, action, interceptorFns);

return uses.map(function (use) {
if (use.interceptor.prototype && use.interceptor.prototype.intercept) {
if (use.interceptor.prototype && use.interceptor.prototype.intercept) { // if this is function instance of InterceptorInterface
return function (action, result) {

@@ -156,3 +163,2 @@ return container_1.getFromContainer(use.interceptor).intercept(action, result);

exports.RoutingControllers = RoutingControllers;
//# sourceMappingURL=RoutingControllers.js.map
//# sourceMappingURL=RoutingControllers.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=RoutingControllersOptions.js.map
//# sourceMappingURL=RoutingControllersOptions.js.map

@@ -35,3 +35,2 @@ "use strict";

exports.importClassesFromDirectories = importClassesFromDirectories;
//# sourceMappingURL=importClassesFromDirectories.js.map
//# sourceMappingURL=importClassesFromDirectories.js.map

@@ -10,3 +10,2 @@ "use strict";

exports.isPromiseLike = isPromiseLike;
//# sourceMappingURL=isPromiseLike.js.map
//# sourceMappingURL=isPromiseLike.js.map

@@ -20,3 +20,2 @@ "use strict";

exports.runInSequence = runInSequence;
//# sourceMappingURL=runInSequence.js.map
//# sourceMappingURL=runInSequence.js.map

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

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

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

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

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

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