Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rootDir = process.cwd();
/**
* @deprecated
*/
export let globalServerSettings: ServerSettingsService;
/**
* @deprecated
*/
// tslint:disable-next-line: variable-name
export let GlobalServerSettings: ServerSettingsService;
/**
* `ServerSettingsService` contains all information about [ServerLoader](/api/common/server/components/ServerLoader.md) configuration.
*/
@Injectable({
scope: ProviderScope.SINGLETON,
global: true
})
export class ServerSettingsService implements IServerSettings, IDISettings {
protected map = new Map();
constructor() {
this.rootDir = rootDir;
this.env = (process.env.NODE_ENV as Env) || Env.DEV;
this.port = 8080;
this.httpsPort = 8000;
this.version = "1.0.0";
this.uploadDir = "${rootDir}/uploads";
this.controllerScope = ProviderScope.SINGLETON;
this.logger = {
debug: false,
import {Deprecated, ProxyMap, Type} from "@tsed/core";
import {Configuration, Injectable, InjectorService, ProviderScope, ProviderType} from "@tsed/di";
import {ControllerProvider} from "../models/ControllerProvider";
import {ControllerRegistry} from "../registries/ControllerRegistry";
import {IRouteController, RouteService} from "./RouteService";
/**
* @private
* @deprecated
*/
@Injectable({
scope: ProviderScope.SINGLETON,
global: true
})
export class ControllerService extends ProxyMap | any, ControllerProvider> {
constructor(
private injectorService: InjectorService,
@Configuration() private settings: Configuration,
private routeService: RouteService
) {
super(injectorService as any, {filter: {type: ProviderType.CONTROLLER}});
}
/**
* @deprecated
*/
import {getClass, isArrayOrArrayClass, isEmpty, isPrimitiveOrPrimitiveClass, Metadata, Store, Type} from "@tsed/core";
import {Configuration, Injectable, InjectorService} from "@tsed/di";
import {BadRequest} from "ts-httpexceptions";
import {PropertyMetadata} from "../../jsonschema/class/PropertyMetadata";
import {PropertyRegistry} from "../../jsonschema/registries/PropertyRegistry";
import {CONVERTER} from "../constants/index";
import {ConverterDeserializationError} from "../errors/ConverterDeserializationError";
import {ConverterSerializationError} from "../errors/ConverterSerializationError";
import {RequiredPropertyError} from "../errors/RequiredPropertyError";
import {UnknownPropertyError} from "../errors/UnknownPropertyError";
import {IConverter, IConverterOptions, IDeserializer, ISerializer} from "../interfaces/index";
@Injectable()
export class ConverterService {
private validationModelStrict = true;
constructor(private injectorService: InjectorService, @Configuration() configuration: Configuration) {
this.validationModelStrict = configuration.get("validationModelStrict");
}
/**
* Return a JsonMetadata for a properties.
* @param properties
* @param propertyKey
* @returns {undefined|V|string|any|T|IDBRequest}
*/
static getPropertyMetadata(
properties: Map,
propertyKey: string | symbol