routing-controllers
Advanced tools
Comparing version 0.7.0-alpha.3 to 0.7.0-alpha.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Marks controller action to have a special access. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "authorized", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Allows to inject a request body value to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "body", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Takes partial data of the request body. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "body-param", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Sets response Content-Type. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "content-type", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -13,3 +13,3 @@ * Defines a class as a controller. | ||
return function (object) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.controllers.push({ | ||
index_1.getMetadataArgsStorage().controllers.push({ | ||
type: "default", | ||
@@ -16,0 +16,0 @@ target: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a request's cookie value to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "cookie", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects all request's cookies to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "cookies", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a Koa's Context object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "context", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects currently authorized user. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "current-user", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers a controller method to be executed when DELETE request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "delete", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when GET request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "get", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when HEAD request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "head", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Sets response header. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "header", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a request's http header value to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "header", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects all request's http headers to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "headers", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -12,3 +12,3 @@ * Sets response HTTP status code. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "success-code", | ||
@@ -15,0 +15,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -12,3 +12,3 @@ * Defines a class as a JSON controller. If JSON controller is used, then all controller actions will return | ||
return function (object) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.controllers.push({ | ||
index_1.getMetadataArgsStorage().controllers.push({ | ||
type: "json", | ||
@@ -15,0 +15,0 @@ target: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Sets Location header with given value to the response. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "location", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when request with specified method comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: method, | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Marks given class as a middleware. | ||
return function (target) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.middlewares.push({ | ||
index_1.getMetadataArgsStorage().middlewares.push({ | ||
target: target, | ||
@@ -13,0 +13,0 @@ type: options && options.type ? options.type : "before", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Used to set specific HTTP status code when result returned by a controller action is equal to null. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "on-null", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Used to set specific HTTP status code when result returned by a controller action is equal to undefined. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "on-undefined", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a request's route parameter value to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "param", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects all request's route parameters to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "params", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when PATCH request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "patch", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when POST request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "post", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Registers an action to be executed when POST request comes on a given route. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.actions.push({ | ||
index_1.getMetadataArgsStorage().actions.push({ | ||
type: "put", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a request's query parameter value to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "query", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects all request's query parameters to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "queries", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Sets Redirect header with given value to the response. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "redirect", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Specifies a template to be rendered by a controller action. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "rendered-template", | ||
@@ -13,0 +13,0 @@ target: object.constructor, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a Request object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "request", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a Response object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "response", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -9,3 +9,3 @@ * Options to be set to class-transformer for the result of the response. | ||
return function (object, methodName) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.responseHandlers.push({ | ||
index_1.getMetadataArgsStorage().responseHandlers.push({ | ||
type: "response-class-transform-options", | ||
@@ -12,0 +12,0 @@ value: options, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a Session object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "session", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects a State object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "state", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects an uploaded file object to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "file", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -10,3 +10,3 @@ * Injects all uploaded files to the controller action parameter. | ||
return function (object, methodName, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
index_1.getMetadataArgsStorage().params.push({ | ||
type: "files", | ||
@@ -13,0 +13,0 @@ object: object, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -15,3 +15,3 @@ * Specifies a given middleware to be used for controller or controller action AFTER the action executes. | ||
middlewares.forEach(function (middleware) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.uses.push({ | ||
index_1.getMetadataArgsStorage().uses.push({ | ||
target: methodName ? objectOrFunction.constructor : objectOrFunction, | ||
@@ -18,0 +18,0 @@ method: methodName, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var MetadataArgsStorage_1 = require("../metadata-builder/MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -15,3 +15,3 @@ * Specifies a given middleware to be used for controller or controller action BEFORE the action executes. | ||
middlewares.forEach(function (middleware) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.uses.push({ | ||
index_1.getMetadataArgsStorage().uses.push({ | ||
target: methodName ? objectOrFunction.constructor : objectOrFunction, | ||
@@ -18,0 +18,0 @@ method: methodName, |
import { RoutingControllersOptions } from "./RoutingControllersOptions"; | ||
import { CustomParameterDecorator } from "./CustomParameterDecorator"; | ||
import { MetadataArgsStorage } from "./metadata-builder/MetadataArgsStorage"; | ||
export * from "./container"; | ||
@@ -57,3 +58,9 @@ export * from "./decorator/Authorized"; | ||
export * from "./CustomParameterDecorator"; | ||
export * from "./RoleChecker"; | ||
/** | ||
* Gets metadata args storage. | ||
* Metadata args storage follows the best practices and stores metadata in a global variable. | ||
*/ | ||
export declare function getMetadataArgsStorage(): MetadataArgsStorage; | ||
/** | ||
* Registers all loaded actions in your express application. | ||
@@ -60,0 +67,0 @@ */ |
12
index.js
@@ -64,2 +64,12 @@ "use strict"; | ||
/** | ||
* Gets metadata args storage. | ||
* Metadata args storage follows the best practices and stores metadata in a global variable. | ||
*/ | ||
function getMetadataArgsStorage() { | ||
if (!global.routingControllersMetadataArgsStorage) | ||
global.routingControllersMetadataArgsStorage = new MetadataArgsStorage_1.MetadataArgsStorage(); | ||
return global.routingControllersMetadataArgsStorage; | ||
} | ||
exports.getMetadataArgsStorage = getMetadataArgsStorage; | ||
/** | ||
* Registers all loaded actions in your express application. | ||
@@ -164,3 +174,3 @@ */ | ||
return function (object, method, index) { | ||
MetadataArgsStorage_1.defaultMetadataArgsStorage.params.push({ | ||
getMetadataArgsStorage().params.push({ | ||
type: "custom-converter", | ||
@@ -167,0 +177,0 @@ object: object, |
@@ -64,5 +64,1 @@ import { ControllerMetadataArgs } from "../metadata/args/ControllerMetadataArgs"; | ||
} | ||
/** | ||
* Default metadata args storage. | ||
*/ | ||
export declare const defaultMetadataArgsStorage: MetadataArgsStorage; |
@@ -99,7 +99,3 @@ "use strict"; | ||
exports.MetadataArgsStorage = MetadataArgsStorage; | ||
/** | ||
* Default metadata args storage. | ||
*/ | ||
exports.defaultMetadataArgsStorage = new MetadataArgsStorage(); | ||
//# sourceMappingURL=MetadataArgsStorage.js.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
var UseMetadata_1 = require("../metadata/UseMetadata"); | ||
var MetadataArgsStorage_1 = require("./MetadataArgsStorage"); | ||
var index_1 = require("../index"); | ||
/** | ||
@@ -39,3 +39,3 @@ * Builds metadata from the given metadata arguments. | ||
MetadataBuilder.prototype.createMiddlewares = function (classes) { | ||
var middlewares = !classes ? MetadataArgsStorage_1.defaultMetadataArgsStorage.middlewares : MetadataArgsStorage_1.defaultMetadataArgsStorage.findMiddlewareMetadatasForClasses(classes); | ||
var middlewares = !classes ? index_1.getMetadataArgsStorage().middlewares : index_1.getMetadataArgsStorage().findMiddlewareMetadatasForClasses(classes); | ||
return middlewares.map(function (middlewareArgs) { return new MiddlewareMetadata_1.MiddlewareMetadata(middlewareArgs); }); | ||
@@ -48,3 +48,3 @@ }; | ||
var _this = this; | ||
var controllers = !classes ? MetadataArgsStorage_1.defaultMetadataArgsStorage.controllers : MetadataArgsStorage_1.defaultMetadataArgsStorage.findControllerMetadatasForClasses(classes); | ||
var controllers = !classes ? index_1.getMetadataArgsStorage().controllers : index_1.getMetadataArgsStorage().findControllerMetadatasForClasses(classes); | ||
return controllers.map(function (controllerArgs) { | ||
@@ -62,3 +62,3 @@ var controller = new ControllerMetadata_1.ControllerMetadata(controllerArgs); | ||
var _this = this; | ||
return MetadataArgsStorage_1.defaultMetadataArgsStorage | ||
return index_1.getMetadataArgsStorage() | ||
.findActionsWithTarget(controller.target) | ||
@@ -78,3 +78,3 @@ .map(function (actionArgs) { | ||
MetadataBuilder.prototype.createParams = function (action) { | ||
return MetadataArgsStorage_1.defaultMetadataArgsStorage | ||
return index_1.getMetadataArgsStorage() | ||
.findParamsWithTargetAndMethod(action.target, action.method) | ||
@@ -87,3 +87,3 @@ .map(function (paramArgs) { return new ParamMetadata_1.ParamMetadata(action, paramArgs); }); | ||
MetadataBuilder.prototype.createResponseHandlers = function (action) { | ||
return MetadataArgsStorage_1.defaultMetadataArgsStorage | ||
return index_1.getMetadataArgsStorage() | ||
.findResponseHandlersWithTargetAndMethod(action.target, action.method) | ||
@@ -96,3 +96,3 @@ .map(function (handlerArgs) { return new ResponseHandleMetadata_1.ResponseHandlerMetadata(action, handlerArgs); }); | ||
MetadataBuilder.prototype.createActionUses = function (action) { | ||
return MetadataArgsStorage_1.defaultMetadataArgsStorage | ||
return index_1.getMetadataArgsStorage() | ||
.findUsesWithTargetAndMethod(action.target, action.method) | ||
@@ -105,3 +105,3 @@ .map(function (useArgs) { return new UseMetadata_1.UseMetadata(useArgs); }); | ||
MetadataBuilder.prototype.createControllerUses = function (controller) { | ||
return MetadataArgsStorage_1.defaultMetadataArgsStorage | ||
return index_1.getMetadataArgsStorage() | ||
.findUsesWithTargetAndMethod(controller.target, undefined) | ||
@@ -108,0 +108,0 @@ .map(function (useArgs) { return new UseMetadata_1.UseMetadata(useArgs); }); |
{ | ||
"name": "routing-controllers", | ||
"private": false, | ||
"version": "0.7.0-alpha.3", | ||
"version": "0.7.0-alpha.4", | ||
"description": "Allows to use class-based controllers with express.js or koa in Typescript", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
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
4911
450478