Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
description: "BadRequest"
}
});
return this;
}
/**
* Create a parameters decorators
* @param token
* @param {Partial>} options
* @returns {Function}
* @deprecated
*/
// istanbul ignore next
@Deprecated("ParamRegistry.decorate are deprecated. Use UseFilter decorator instead")
static decorate(token: string | Type | ParamTypes, options: Partial> = {}): ParameterDecorator {
return (target: Type, propertyKey: string | symbol, parameterIndex: number): any => {
if (typeof parameterIndex === "number") {
const settings = Object.assign(
{
target,
propertyKey,
parameterIndex
},
options
);
ParamRegistry.useFilter(token, settings);
}
};
}
"400": {
description: "BadRequest"
}
});
return this;
}
/**
*
* @param {(propertyMetadata: PropertyMetadata, parameters: DecoratorParameters) => void} fn
* @returns {Function}
* @deprecated
*/
// istanbul ignore next
@Deprecated("PropertyRegistry.decorate is deprecated. Use PropertyFn instead.")
static decorate(fn: (propertyMetadata: PropertyMetadata, parameters: DecoratorParameters) => void): Function {
return (...parameters: any[]): any => {
const propertyMetadata = PropertyRegistry.get(parameters[0], parameters[1]);
const result: any = fn(propertyMetadata, parameters as DecoratorParameters);
if (typeof result === "function") {
result(...parameters);
}
};
}
}
/**
* @deprecated This service will be removed in a future release. Use injectorService directly.
*/
@Service()
export class FilterService extends ProxyMap | any, Provider> {
constructor(private injectorService: InjectorService) {
super(injectorService, {filter: {type: ProviderType.FILTER}});
}
/**
*
* @param target
* @returns {ControllerProvider}
*/
@Deprecated("static FilterService.get(). Removed feature.")
/* istanbul ignore next */
static get(target: Type): Provider | undefined {
return FilterRegistry.get(target);
}
/**
*
* @deprecated
* @param target
* @param provider
*/
@Deprecated("static FilterService.set(). Removed feature.")
/* istanbul ignore next */
static set(target: Type, provider: Provider) {
FilterRegistry.set(target, provider);
* @param target
* @returns {ControllerProvider}
*/
@Deprecated("static FilterService.get(). Removed feature.")
/* istanbul ignore next */
static get(target: Type): Provider | undefined {
return FilterRegistry.get(target);
}
/**
*
* @deprecated
* @param target
* @param provider
*/
@Deprecated("static FilterService.set(). Removed feature.")
/* istanbul ignore next */
static set(target: Type, provider: Provider) {
FilterRegistry.set(target, provider);
return this;
}
/**
* @deprecated
* @param target
*/
@Deprecated("static FilterService.has(). Removed feature.")
/* istanbul ignore next */
static has(target: Type): boolean {
return FilterRegistry.has(target);
}
/**
* @deprecated This service will be removed in a future release. Use injectorService directly.
*/
@Service()
export class MiddlewareService extends ProxyMap | any, Provider> {
constructor(private injectorService: InjectorService) {
super(injectorService, {filter: {type: ProviderType.MIDDLEWARE}});
}
/**
*
* @param target
* @returns {Provider}
* @deprecated
*/
@Deprecated("static MiddlewareService.get(). Removed feature.")
/* istanbul ignore next */
static get(target: Type): Provider | undefined {
return ProviderRegistry.get(target);
}
/**
*
* @param target
* @param provider
*/
@Deprecated("static MiddlewareService.set(). Removed feature.")
/* istanbul ignore next */
static set(target: Type, provider: Provider) {
ProviderRegistry.set(target, provider);
return this;
* @param designParamTypes
* @returns {T}
*/
@Deprecated("FilterService.invoke(). Use injectorService.invoke instead of")
/* istanbul ignore next */
invoke(target: Type, locals: Map = new Map(), designParamTypes?: any[]): T {
return this.injectorService.invoke(target, locals, designParamTypes);
}
/**
* @deprecated
* @param target
* @param args
* @returns {any}
*/
@Deprecated("FilterService.invoke(). Removed feature")
invokeMethod(target: Type, ...args: any[]): any {
const instance = this.injectorService.get(target);
if (!instance || !instance.transform) {
throw new UnknowFilterError(target);
}
const [expression, request, response] = args;
return instance.transform(expression, request, response);
}
}
* @param target
* @param provider
*/
@Deprecated("static FilterService.set(). Removed feature.")
/* istanbul ignore next */
static set(target: Type, provider: Provider) {
FilterRegistry.set(target, provider);
return this;
}
/**
* @deprecated
* @param target
*/
@Deprecated("static FilterService.has(). Removed feature.")
/* istanbul ignore next */
static has(target: Type): boolean {
return FilterRegistry.has(target);
}
/**
* @deprecated
* @param target
* @param locals
* @param designParamTypes
* @returns {T}
*/
@Deprecated("FilterService.invoke(). Use injectorService.invoke instead of")
/* istanbul ignore next */
invoke(target: Type, locals: Map = new Map(), designParamTypes?: any[]): T {
return this.injectorService.invoke(target, locals, designParamTypes);
params[index] = paramMetadata;
Metadata.set(PARAM_METADATA, params, target, propertyKey);
}
/**
*
* @param target
* @param propertyKey
* @param parameterIndex
* @param allowedRequiredValues
* @deprecated
*/
// istanbul ignore next
@Deprecated("ParamRegistry.decorate are deprecated.")
static required(target: Type, propertyKey: string | symbol, parameterIndex: number, allowedRequiredValues: any[] = []) {
const param = ParamRegistry.get(target, propertyKey, parameterIndex);
param.required = true;
param.allowedRequiredValues = allowedRequiredValues;
param.store.merge("responses", {
"400": {
description: "BadRequest"
}
});
return this;
}
/**
* @param provider
*/
@Deprecated("static MiddlewareService.set(). Removed feature.")
/* istanbul ignore next */
static set(target: Type, provider: Provider) {
ProviderRegistry.set(target, provider);
return this;
}
/**
*
* @param target
* @deprecated
*/
@Deprecated("static MiddlewareService.has(). Removed feature.")
/* istanbul ignore next */
static has(target: Type): boolean {
return ProviderRegistry.has(target);
}
/**
*
* @param target
* @param locals
* @param designParamTypes
* @returns {T}
*/
@Deprecated("MiddlewareService.invoke(). Removed feature. Use injectorService.invoke instead of.")
/* istanbul ignore next */
invoke(target: Type, locals: Map = new Map(), designParamTypes?: any[]): T {
return this.injectorService.invoke(target, locals, designParamTypes);
*
* @param target
* @deprecated
*/
@Deprecated("static ControllerService.has(). Removed feature.")
static has(target: Type) {
return ControllerRegistry.has(target);
}
/**
*
* @param target
* @param provider
* @deprecated
*/
@Deprecated("static ControllerService.set(). Removed feature.")
static set(target: Type, provider: ControllerProvider) {
ControllerRegistry.set(target, provider);
return this;
}
/**
* Invoke a controller from his Class.
* @param target
* @param locals
* @param designParamTypes
* @returns {T}
* @deprecated
*/
@Deprecated("ControllerService.invoke(). Removed feature. Use injectorService.invoke instead of.")
public invoke(target: any, locals: Map | any, any> = new Map, any>(), designParamTypes?: any[]): T {