mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
chore(build) remove bundle directory
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@@ -6,16 +6,16 @@ node_modules/
|
|||||||
/.awcache
|
/.awcache
|
||||||
/.vscode
|
/.vscode
|
||||||
|
|
||||||
|
# bundle
|
||||||
|
packages/**/*.d.ts
|
||||||
|
packages/**/*.js
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
lerna-debug.log
|
lerna-debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
/src/common/npm-debug.log
|
/**/npm-debug.log
|
||||||
/src/core/npm-debug.log
|
|
||||||
/src/testing/npm-debug.log
|
|
||||||
/src/microservices/npm-debug.log
|
|
||||||
/src/websockets/npm-debug.log
|
|
||||||
|
|
||||||
# example
|
# example
|
||||||
/quick-start
|
/quick-start
|
||||||
|
|||||||
3
bundle/common/cache/cache.constants.d.ts
vendored
3
bundle/common/cache/cache.constants.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare const CACHE_MANAGER = "CACHE_MANAGER";
|
|
||||||
export declare const CACHE_MODULE_OPTIONS = "CACHE_MODULE_OPTIONS";
|
|
||||||
export declare const CACHE_KEY_METADATA = "cache_module:cache_key";
|
|
||||||
5
bundle/common/cache/cache.constants.js
vendored
5
bundle/common/cache/cache.constants.js
vendored
@@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.CACHE_MANAGER = 'CACHE_MANAGER';
|
|
||||||
exports.CACHE_MODULE_OPTIONS = 'CACHE_MODULE_OPTIONS';
|
|
||||||
exports.CACHE_KEY_METADATA = 'cache_module:cache_key';
|
|
||||||
8
bundle/common/cache/cache.module.d.ts
vendored
8
bundle/common/cache/cache.module.d.ts
vendored
@@ -1,8 +0,0 @@
|
|||||||
import { DynamicModule } from '../interfaces';
|
|
||||||
import { CacheModuleAsyncOptions, CacheModuleOptions } from './interfaces/cache-module.interface';
|
|
||||||
export declare class CacheModule {
|
|
||||||
static register(options?: CacheModuleOptions): DynamicModule;
|
|
||||||
static registerAsync(options: CacheModuleAsyncOptions): DynamicModule;
|
|
||||||
private static createAsyncProviders(options);
|
|
||||||
private static createAsyncOptionsProvider(options);
|
|
||||||
}
|
|
||||||
60
bundle/common/cache/cache.module.js
vendored
60
bundle/common/cache/cache.module.js
vendored
@@ -1,60 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const decorators_1 = require("../decorators");
|
|
||||||
const cache_constants_1 = require("./cache.constants");
|
|
||||||
const cache_providers_1 = require("./cache.providers");
|
|
||||||
let CacheModule = CacheModule_1 = class CacheModule {
|
|
||||||
static register(options = {}) {
|
|
||||||
return {
|
|
||||||
module: CacheModule_1,
|
|
||||||
providers: [{ provide: cache_constants_1.CACHE_MODULE_OPTIONS, useValue: options }],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
static registerAsync(options) {
|
|
||||||
return {
|
|
||||||
module: CacheModule_1,
|
|
||||||
imports: options.imports,
|
|
||||||
providers: this.createAsyncProviders(options),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
static createAsyncProviders(options) {
|
|
||||||
if (options.useExisting || options.useFactory) {
|
|
||||||
return [this.createAsyncOptionsProvider(options)];
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
this.createAsyncOptionsProvider(options),
|
|
||||||
{
|
|
||||||
provide: options.useClass,
|
|
||||||
useClass: options.useClass,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
static createAsyncOptionsProvider(options) {
|
|
||||||
if (options.useFactory) {
|
|
||||||
return {
|
|
||||||
provide: cache_constants_1.CACHE_MODULE_OPTIONS,
|
|
||||||
useFactory: options.useFactory,
|
|
||||||
inject: options.inject || [],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
provide: cache_constants_1.CACHE_MODULE_OPTIONS,
|
|
||||||
useFactory: async (optionsFactory) => optionsFactory.createCacheOptions(),
|
|
||||||
inject: [options.useExisting || options.useClass],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
CacheModule = CacheModule_1 = __decorate([
|
|
||||||
decorators_1.Module({
|
|
||||||
providers: [cache_providers_1.createCacheManager()],
|
|
||||||
exports: [cache_constants_1.CACHE_MANAGER],
|
|
||||||
})
|
|
||||||
], CacheModule);
|
|
||||||
exports.CacheModule = CacheModule;
|
|
||||||
var CacheModule_1;
|
|
||||||
2
bundle/common/cache/cache.providers.d.ts
vendored
2
bundle/common/cache/cache.providers.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
import { Provider } from '../interfaces';
|
|
||||||
export declare function createCacheManager(): Provider;
|
|
||||||
17
bundle/common/cache/cache.providers.js
vendored
17
bundle/common/cache/cache.providers.js
vendored
@@ -1,17 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const load_package_util_1 = require("../utils/load-package.util");
|
|
||||||
const cache_constants_1 = require("./cache.constants");
|
|
||||||
const default_options_1 = require("./default-options");
|
|
||||||
function createCacheManager() {
|
|
||||||
return {
|
|
||||||
provide: cache_constants_1.CACHE_MANAGER,
|
|
||||||
useFactory: (options) => {
|
|
||||||
const cacheManager = load_package_util_1.loadPackage('cache-manager', 'CacheModule');
|
|
||||||
const memoryCache = cacheManager.caching(Object.assign({}, default_options_1.defaultCacheOptions, (options || {})));
|
|
||||||
return memoryCache;
|
|
||||||
},
|
|
||||||
inject: [cache_constants_1.CACHE_MODULE_OPTIONS],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.createCacheManager = createCacheManager;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export declare const CacheKey: (key: string) => (target: object, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const decorators_1 = require("../../decorators");
|
|
||||||
const cache_constants_1 = require("../cache.constants");
|
|
||||||
exports.CacheKey = (key) => decorators_1.ReflectMetadata(cache_constants_1.CACHE_KEY_METADATA, key);
|
|
||||||
1
bundle/common/cache/decorators/index.d.ts
vendored
1
bundle/common/cache/decorators/index.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
export * from './cache-key.decorator';
|
|
||||||
6
bundle/common/cache/decorators/index.js
vendored
6
bundle/common/cache/decorators/index.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./cache-key.decorator"));
|
|
||||||
5
bundle/common/cache/default-options.d.ts
vendored
5
bundle/common/cache/default-options.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
export declare const defaultCacheOptions: {
|
|
||||||
ttl: number;
|
|
||||||
max: number;
|
|
||||||
store: string;
|
|
||||||
};
|
|
||||||
7
bundle/common/cache/default-options.js
vendored
7
bundle/common/cache/default-options.js
vendored
@@ -1,7 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.defaultCacheOptions = {
|
|
||||||
ttl: 5,
|
|
||||||
max: 100,
|
|
||||||
store: 'memory',
|
|
||||||
};
|
|
||||||
5
bundle/common/cache/index.d.ts
vendored
5
bundle/common/cache/index.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
export { CACHE_MANAGER } from './cache.constants';
|
|
||||||
export * from './cache.module';
|
|
||||||
export * from './decorators';
|
|
||||||
export * from './interceptors';
|
|
||||||
export * from './interfaces';
|
|
||||||
10
bundle/common/cache/index.js
vendored
10
bundle/common/cache/index.js
vendored
@@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var cache_constants_1 = require("./cache.constants");
|
|
||||||
exports.CACHE_MANAGER = cache_constants_1.CACHE_MANAGER;
|
|
||||||
__export(require("./cache.module"));
|
|
||||||
__export(require("./decorators"));
|
|
||||||
__export(require("./interceptors"));
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Observable } from 'rxjs';
|
|
||||||
import { ExecutionContext, HttpServer, NestInterceptor } from '../../interfaces';
|
|
||||||
export declare class CacheInterceptor implements NestInterceptor {
|
|
||||||
protected readonly httpServer: HttpServer;
|
|
||||||
protected readonly cacheManager: any;
|
|
||||||
protected readonly reflector: any;
|
|
||||||
protected readonly isHttpApp: boolean;
|
|
||||||
constructor(httpServer: HttpServer, cacheManager: any, reflector: any);
|
|
||||||
intercept(context: ExecutionContext, call$: Observable<any>): Promise<Observable<any>>;
|
|
||||||
trackBy(context: ExecutionContext): string | undefined;
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
||||||
};
|
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
||||||
};
|
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
||||||
return function (target, key) { decorator(target, key, paramIndex); }
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const rxjs_1 = require("rxjs");
|
|
||||||
const operators_1 = require("rxjs/operators");
|
|
||||||
const decorators_1 = require("../../decorators");
|
|
||||||
const cache_constants_1 = require("../cache.constants");
|
|
||||||
// NOTE (external)
|
|
||||||
// We need to deduplicate them here due to the circular dependency
|
|
||||||
// between core and common packages
|
|
||||||
const HTTP_SERVER_REF = 'HTTP_SERVER_REF';
|
|
||||||
const REFLECTOR = 'Reflector';
|
|
||||||
let CacheInterceptor = class CacheInterceptor {
|
|
||||||
constructor(httpServer, cacheManager, reflector) {
|
|
||||||
this.httpServer = httpServer;
|
|
||||||
this.cacheManager = cacheManager;
|
|
||||||
this.reflector = reflector;
|
|
||||||
this.isHttpApp = httpServer && !!httpServer.getRequestMethod;
|
|
||||||
}
|
|
||||||
async intercept(context, call$) {
|
|
||||||
const key = this.trackBy(context);
|
|
||||||
if (!key) {
|
|
||||||
return call$;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const value = await this.cacheManager.get(key);
|
|
||||||
if (value) {
|
|
||||||
return rxjs_1.of(value);
|
|
||||||
}
|
|
||||||
return call$.pipe(operators_1.tap(response => this.cacheManager.set(key, response)));
|
|
||||||
}
|
|
||||||
catch (_a) {
|
|
||||||
return call$;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
trackBy(context) {
|
|
||||||
if (!this.isHttpApp) {
|
|
||||||
return this.reflector.get(cache_constants_1.CACHE_KEY_METADATA, context.getHandler());
|
|
||||||
}
|
|
||||||
const request = context.getArgByIndex(0);
|
|
||||||
if (this.httpServer.getRequestMethod(request) !== 'GET') {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return this.httpServer.getRequestUrl(request);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
CacheInterceptor = __decorate([
|
|
||||||
decorators_1.Injectable(),
|
|
||||||
__param(0, decorators_1.Optional()),
|
|
||||||
__param(0, decorators_1.Inject(HTTP_SERVER_REF)),
|
|
||||||
__param(1, decorators_1.Inject(cache_constants_1.CACHE_MANAGER)),
|
|
||||||
__param(2, decorators_1.Inject(REFLECTOR)),
|
|
||||||
__metadata("design:paramtypes", [Object, Object, Object])
|
|
||||||
], CacheInterceptor);
|
|
||||||
exports.CacheInterceptor = CacheInterceptor;
|
|
||||||
1
bundle/common/cache/interceptors/index.d.ts
vendored
1
bundle/common/cache/interceptors/index.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
export * from './cache.interceptor';
|
|
||||||
6
bundle/common/cache/interceptors/index.js
vendored
6
bundle/common/cache/interceptors/index.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./cache.interceptor"));
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
export interface LiteralObject {
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
export interface CacheStore {
|
|
||||||
set<T>(key: string, value: T): Promise<void> | void;
|
|
||||||
get<T>(key: string): Promise<void> | void;
|
|
||||||
del(key: string): void | Promise<void>;
|
|
||||||
}
|
|
||||||
export interface CacheStoreFactory {
|
|
||||||
create(args: LiteralObject): CacheStore;
|
|
||||||
}
|
|
||||||
export interface CacheManagerOptions {
|
|
||||||
store?: string | CacheStoreFactory;
|
|
||||||
ttl?: number;
|
|
||||||
max?: number;
|
|
||||||
isCacheableValue?: (value: any) => boolean;
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { ModuleMetadata, Type } from '../../interfaces';
|
|
||||||
import { CacheManagerOptions } from './cache-manager.interface';
|
|
||||||
export interface CacheModuleOptions extends CacheManagerOptions {
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
export interface CacheOptionsFactory {
|
|
||||||
createCacheOptions(): Promise<CacheModuleOptions> | CacheModuleOptions;
|
|
||||||
}
|
|
||||||
export interface CacheModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
||||||
useExisting?: Type<CacheOptionsFactory>;
|
|
||||||
useClass?: Type<CacheOptionsFactory>;
|
|
||||||
useFactory?: (...args: any[]) => Promise<CacheModuleOptions> | CacheModuleOptions;
|
|
||||||
inject?: any[];
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
2
bundle/common/cache/interfaces/index.d.ts
vendored
2
bundle/common/cache/interfaces/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
export * from './cache-manager.interface';
|
|
||||||
export * from './cache-module.interface';
|
|
||||||
2
bundle/common/cache/interfaces/index.js
vendored
2
bundle/common/cache/interfaces/index.js
vendored
@@ -1,2 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
28
bundle/common/constants.d.ts
vendored
28
bundle/common/constants.d.ts
vendored
@@ -1,28 +0,0 @@
|
|||||||
export declare const METADATA: {
|
|
||||||
MODULES: string;
|
|
||||||
IMPORTS: string;
|
|
||||||
COMPONENTS: string;
|
|
||||||
PROVIDERS: string;
|
|
||||||
CONTROLLERS: string;
|
|
||||||
EXPORTS: string;
|
|
||||||
};
|
|
||||||
export declare const SHARED_MODULE_METADATA = "__sharedModule__";
|
|
||||||
export declare const GLOBAL_MODULE_METADATA = "__globalModule__";
|
|
||||||
export declare const PATH_METADATA = "path";
|
|
||||||
export declare const PARAMTYPES_METADATA = "design:paramtypes";
|
|
||||||
export declare const SELF_DECLARED_DEPS_METADATA = "self:paramtypes";
|
|
||||||
export declare const OPTIONAL_DEPS_METADATA = "optional:paramtypes";
|
|
||||||
export declare const METHOD_METADATA = "method";
|
|
||||||
export declare const ROUTE_ARGS_METADATA = "__routeArguments__";
|
|
||||||
export declare const CUSTOM_ROUTE_AGRS_METADATA = "__customRouteArgs__";
|
|
||||||
export declare const EXCEPTION_FILTERS_METADATA = "__exceptionFilters__";
|
|
||||||
export declare const FILTER_CATCH_EXCEPTIONS = "__filterCatchExceptions__";
|
|
||||||
export declare const PIPES_METADATA = "__pipes__";
|
|
||||||
export declare const GUARDS_METADATA = "__guards__";
|
|
||||||
export declare const RENDER_METADATA = "__renderTemplate__";
|
|
||||||
export declare const INTERCEPTORS_METADATA = "__interceptors__";
|
|
||||||
export declare const HTTP_CODE_METADATA = "__httpCode__";
|
|
||||||
export declare const GATEWAY_MIDDLEWARES = "__gatewayMiddleware";
|
|
||||||
export declare const MODULE_PATH = "__module_path__";
|
|
||||||
export declare const HEADERS_METADATA = "__headers__";
|
|
||||||
export declare const REDIRECT_METADATA = "__redirect__";
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.METADATA = {
|
|
||||||
MODULES: 'modules',
|
|
||||||
IMPORTS: 'imports',
|
|
||||||
COMPONENTS: 'components',
|
|
||||||
PROVIDERS: 'providers',
|
|
||||||
CONTROLLERS: 'controllers',
|
|
||||||
EXPORTS: 'exports',
|
|
||||||
};
|
|
||||||
exports.SHARED_MODULE_METADATA = '__sharedModule__';
|
|
||||||
exports.GLOBAL_MODULE_METADATA = '__globalModule__';
|
|
||||||
exports.PATH_METADATA = 'path';
|
|
||||||
exports.PARAMTYPES_METADATA = 'design:paramtypes';
|
|
||||||
exports.SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
|
|
||||||
exports.OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
|
|
||||||
exports.METHOD_METADATA = 'method';
|
|
||||||
exports.ROUTE_ARGS_METADATA = '__routeArguments__';
|
|
||||||
exports.CUSTOM_ROUTE_AGRS_METADATA = '__customRouteArgs__';
|
|
||||||
exports.EXCEPTION_FILTERS_METADATA = '__exceptionFilters__';
|
|
||||||
exports.FILTER_CATCH_EXCEPTIONS = '__filterCatchExceptions__';
|
|
||||||
exports.PIPES_METADATA = '__pipes__';
|
|
||||||
exports.GUARDS_METADATA = '__guards__';
|
|
||||||
exports.RENDER_METADATA = '__renderTemplate__';
|
|
||||||
exports.INTERCEPTORS_METADATA = '__interceptors__';
|
|
||||||
exports.HTTP_CODE_METADATA = '__httpCode__';
|
|
||||||
exports.GATEWAY_MIDDLEWARES = '__gatewayMiddleware';
|
|
||||||
exports.MODULE_PATH = '__module_path__';
|
|
||||||
exports.HEADERS_METADATA = '__headers__';
|
|
||||||
exports.REDIRECT_METADATA = '__redirect__';
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* Binds parameters decorators to the particular method
|
|
||||||
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
|
|
||||||
* @param {} ...decorators
|
|
||||||
*/
|
|
||||||
export declare function Bind(...decorators: any[]): (target: object, key: any, descriptor: any) => any;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
/**
|
|
||||||
* Binds parameters decorators to the particular method
|
|
||||||
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
|
|
||||||
* @param {} ...decorators
|
|
||||||
*/
|
|
||||||
function Bind(...decorators) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
decorators.forEach((fn, index) => fn(target, key, index));
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Bind = Bind;
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
import { Type } from '../../interfaces';
|
|
||||||
/**
|
|
||||||
* Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
|
|
||||||
* The class should implement the `ExceptionFilter` interface.
|
|
||||||
*/
|
|
||||||
export declare function Catch(...exceptions: Type<any>[]): ClassDecorator;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
|
|
||||||
* The class should implement the `ExceptionFilter` interface.
|
|
||||||
*/
|
|
||||||
function Catch(...exceptions) {
|
|
||||||
return (target) => {
|
|
||||||
Reflect.defineMetadata(constants_1.FILTER_CATCH_EXCEPTIONS, exceptions, target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Catch = Catch;
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* Defines the injectable class. This class can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
export declare function Injectable(): ClassDecorator;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Component. The component can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
export declare function Component(): ClassDecorator;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Pipe. The Pipe should implement the `PipeTransform` interface.
|
|
||||||
*/
|
|
||||||
export declare function Pipe(): ClassDecorator;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Guard. The Guard should implement the `CanActivate` interface.
|
|
||||||
*/
|
|
||||||
export declare function Guard(): ClassDecorator;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Middleware. The Middleware should implement the `NestMiddleware` interface.
|
|
||||||
*/
|
|
||||||
export declare function Middleware(): ClassDecorator;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Interceptor. The Interceptor should implement `HttpInterceptor`, `RpcInterceptor` or `WsInterceptor` interface.
|
|
||||||
*/
|
|
||||||
export declare function Interceptor(): ClassDecorator;
|
|
||||||
export declare function mixin(mixinClass: any): any;
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const deprecate = require("deprecate");
|
|
||||||
const uuid = require("uuid/v4");
|
|
||||||
/**
|
|
||||||
* Defines the injectable class. This class can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
function Injectable() {
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Injectable = Injectable;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Component. The component can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
function Component() {
|
|
||||||
deprecate('The @Component() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.');
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Component = Component;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Pipe. The Pipe should implement the `PipeTransform` interface.
|
|
||||||
*/
|
|
||||||
function Pipe() {
|
|
||||||
deprecate('The @Pipe() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.');
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Pipe = Pipe;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Guard. The Guard should implement the `CanActivate` interface.
|
|
||||||
*/
|
|
||||||
function Guard() {
|
|
||||||
deprecate('The @Guard() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.');
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Guard = Guard;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Middleware. The Middleware should implement the `NestMiddleware` interface.
|
|
||||||
*/
|
|
||||||
function Middleware() {
|
|
||||||
deprecate('The @Middleware() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.');
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Middleware = Middleware;
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Defines the Interceptor. The Interceptor should implement `HttpInterceptor`, `RpcInterceptor` or `WsInterceptor` interface.
|
|
||||||
*/
|
|
||||||
function Interceptor() {
|
|
||||||
deprecate('The @Interceptor() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.');
|
|
||||||
return (target) => { };
|
|
||||||
}
|
|
||||||
exports.Interceptor = Interceptor;
|
|
||||||
function mixin(mixinClass) {
|
|
||||||
Object.defineProperty(mixinClass, 'name', {
|
|
||||||
value: uuid(),
|
|
||||||
});
|
|
||||||
Injectable()(mixinClass);
|
|
||||||
return mixinClass;
|
|
||||||
}
|
|
||||||
exports.mixin = mixin;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Defines the Controller. The controller can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
export declare function Controller(prefix?: string): ClassDecorator;
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Defines the Controller. The controller can inject dependencies through constructor.
|
|
||||||
* Those dependencies have to belong to the same module.
|
|
||||||
*/
|
|
||||||
function Controller(prefix) {
|
|
||||||
const path = shared_utils_1.isUndefined(prefix) ? '/' : prefix;
|
|
||||||
return (target) => {
|
|
||||||
Reflect.defineMetadata(constants_1.PATH_METADATA, path, target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Controller = Controller;
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
export declare function flatten(arr: any[]): any;
|
|
||||||
export declare const Dependencies: (...dependencies: any[]) => ClassDecorator;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
function flatten(arr) {
|
|
||||||
const flat = [].concat(...arr);
|
|
||||||
return flat.some(Array.isArray) ? flatten(flat) : flat;
|
|
||||||
}
|
|
||||||
exports.flatten = flatten;
|
|
||||||
exports.Dependencies = (...dependencies) => {
|
|
||||||
const flattenDeps = flatten(dependencies);
|
|
||||||
return (target) => {
|
|
||||||
Reflect.defineMetadata(constants_1.PARAMTYPES_METADATA, flattenDeps, target);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
import { ExceptionFilter } from '../../index';
|
|
||||||
/**
|
|
||||||
* Setups exception filters to the chosen context.
|
|
||||||
* When the `@UseFilters()` is used on the controller level:
|
|
||||||
* - Exception Filter will be set up to every handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseFilters()` is used on the handle level:
|
|
||||||
* - Exception Filter will be set up only to specified method
|
|
||||||
*
|
|
||||||
* @param {ExceptionFilter[]} ...filters
|
|
||||||
*/
|
|
||||||
export declare const UseFilters: (...filters: (Function | ExceptionFilter<any>)[]) => (target: any, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
const validate_each_util_1 = require("../../utils/validate-each.util");
|
|
||||||
const defineFiltersMetadata = (...filters) => {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
const isFilterValid = filter => filter && (shared_utils_1.isFunction(filter) || shared_utils_1.isFunction(filter.catch));
|
|
||||||
if (descriptor) {
|
|
||||||
validate_each_util_1.validateEach(target.constructor, filters, isFilterValid, '@UseFilters', 'filter');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.EXCEPTION_FILTERS_METADATA, filters, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
}
|
|
||||||
validate_each_util_1.validateEach(target, filters, isFilterValid, '@UseFilters', 'filter');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.EXCEPTION_FILTERS_METADATA, filters, target);
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Setups exception filters to the chosen context.
|
|
||||||
* When the `@UseFilters()` is used on the controller level:
|
|
||||||
* - Exception Filter will be set up to every handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseFilters()` is used on the handle level:
|
|
||||||
* - Exception Filter will be set up only to specified method
|
|
||||||
*
|
|
||||||
* @param {ExceptionFilter[]} ...filters
|
|
||||||
*/
|
|
||||||
exports.UseFilters = (...filters) => defineFiltersMetadata(...filters);
|
|
||||||
12
bundle/common/decorators/core/index.d.ts
vendored
12
bundle/common/decorators/core/index.d.ts
vendored
@@ -1,12 +0,0 @@
|
|||||||
export * from './bind.decorator';
|
|
||||||
export * from './catch.decorator';
|
|
||||||
export * from './component.decorator';
|
|
||||||
export * from './controller.decorator';
|
|
||||||
export * from './dependencies.decorator';
|
|
||||||
export * from './exception-filters.decorator';
|
|
||||||
export * from './inject.decorator';
|
|
||||||
export * from './optional.decorator';
|
|
||||||
export * from './reflect-metadata.decorator';
|
|
||||||
export * from './use-guards.decorator';
|
|
||||||
export * from './use-interceptors.decorator';
|
|
||||||
export * from './use-pipes.decorator';
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./bind.decorator"));
|
|
||||||
__export(require("./catch.decorator"));
|
|
||||||
__export(require("./component.decorator"));
|
|
||||||
__export(require("./controller.decorator"));
|
|
||||||
__export(require("./dependencies.decorator"));
|
|
||||||
__export(require("./exception-filters.decorator"));
|
|
||||||
__export(require("./inject.decorator"));
|
|
||||||
__export(require("./optional.decorator"));
|
|
||||||
__export(require("./reflect-metadata.decorator"));
|
|
||||||
__export(require("./use-guards.decorator"));
|
|
||||||
__export(require("./use-interceptors.decorator"));
|
|
||||||
__export(require("./use-pipes.decorator"));
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Injects provider which has to be available in the current injector (module) scope.
|
|
||||||
* Providers are recognized by types or tokens.
|
|
||||||
*/
|
|
||||||
export declare function Inject<T = any>(token: T): ParameterDecorator;
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
/**
|
|
||||||
* Injects provider which has to be available in the current injector (module) scope.
|
|
||||||
* Providers are recognized by types or tokens.
|
|
||||||
*/
|
|
||||||
function Inject(token) {
|
|
||||||
return (target, key, index) => {
|
|
||||||
const args = Reflect.getMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, target) || [];
|
|
||||||
const type = shared_utils_1.isFunction(token) ? token.name : token;
|
|
||||||
args.push({ index, param: type });
|
|
||||||
Reflect.defineMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, args, target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Inject = Inject;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Sets dependency as an optional one.
|
|
||||||
*/
|
|
||||||
export declare function Optional(): ParameterDecorator;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Sets dependency as an optional one.
|
|
||||||
*/
|
|
||||||
function Optional() {
|
|
||||||
return (target, key, index) => {
|
|
||||||
const args = Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, target) || [];
|
|
||||||
Reflect.defineMetadata(constants_1.OPTIONAL_DEPS_METADATA, [...args, index], target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Optional = Optional;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/**
|
|
||||||
* Assigns the metadata to the class/function under specified `key`.
|
|
||||||
* This metadata can be reflected using `Reflector` class.
|
|
||||||
*/
|
|
||||||
export declare const ReflectMetadata: <K = any, V = any>(metadataKey: K, metadataValue: V) => (target: object, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
/**
|
|
||||||
* Assigns the metadata to the class/function under specified `key`.
|
|
||||||
* This metadata can be reflected using `Reflector` class.
|
|
||||||
*/
|
|
||||||
exports.ReflectMetadata = (metadataKey, metadataValue) => (target, key, descriptor) => {
|
|
||||||
if (descriptor) {
|
|
||||||
Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
}
|
|
||||||
Reflect.defineMetadata(metadataKey, metadataValue, target);
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { CanActivate } from '../../interfaces';
|
|
||||||
/**
|
|
||||||
* Binds guards to the particular context.
|
|
||||||
* When the `@UseGuards()` is used on the controller level:
|
|
||||||
* - Guard will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseGuards()` is used on the handler level:
|
|
||||||
* - Guard will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {} ...guards
|
|
||||||
*/
|
|
||||||
export declare function UseGuards(...guards: (CanActivate | Function)[]): (target: any, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
|
|
||||||
const validate_each_util_1 = require("../../utils/validate-each.util");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
/**
|
|
||||||
* Binds guards to the particular context.
|
|
||||||
* When the `@UseGuards()` is used on the controller level:
|
|
||||||
* - Guard will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseGuards()` is used on the handler level:
|
|
||||||
* - Guard will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {} ...guards
|
|
||||||
*/
|
|
||||||
function UseGuards(...guards) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
const isValidGuard = guard => guard && (shared_utils_1.isFunction(guard) || shared_utils_1.isFunction(guard.canActivate));
|
|
||||||
if (descriptor) {
|
|
||||||
validate_each_util_1.validateEach(target.constructor, guards, isValidGuard, '@UseGuards', 'guard');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.GUARDS_METADATA, guards, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
}
|
|
||||||
validate_each_util_1.validateEach(target, guards, isValidGuard, '@UseGuards', 'guard');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.GUARDS_METADATA, guards, target);
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.UseGuards = UseGuards;
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { NestInterceptor } from '../../interfaces';
|
|
||||||
/**
|
|
||||||
* Binds interceptors to the particular context.
|
|
||||||
* When the `@UseInterceptors()` is used on the controller level:
|
|
||||||
* - Interceptor will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseInterceptors()` is used on the handle level:
|
|
||||||
* - Interceptor will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {} ...interceptors
|
|
||||||
*/
|
|
||||||
export declare function UseInterceptors(...interceptors: (NestInterceptor | Function)[]): (target: any, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
const validate_each_util_1 = require("../../utils/validate-each.util");
|
|
||||||
/**
|
|
||||||
* Binds interceptors to the particular context.
|
|
||||||
* When the `@UseInterceptors()` is used on the controller level:
|
|
||||||
* - Interceptor will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UseInterceptors()` is used on the handle level:
|
|
||||||
* - Interceptor will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {} ...interceptors
|
|
||||||
*/
|
|
||||||
function UseInterceptors(...interceptors) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
const isValidInterceptor = interceptor => interceptor &&
|
|
||||||
(shared_utils_1.isFunction(interceptor) || shared_utils_1.isFunction(interceptor.intercept));
|
|
||||||
if (descriptor) {
|
|
||||||
validate_each_util_1.validateEach(target.constructor, interceptors, isValidInterceptor, '@UseInterceptors', 'interceptor');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.INTERCEPTORS_METADATA, interceptors, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
}
|
|
||||||
validate_each_util_1.validateEach(target, interceptors, isValidInterceptor, '@UseInterceptors', 'interceptor');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.INTERCEPTORS_METADATA, interceptors, target);
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.UseInterceptors = UseInterceptors;
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { PipeTransform } from '../../interfaces/index';
|
|
||||||
/**
|
|
||||||
* Binds pipes to the particular context.
|
|
||||||
* When the `@UsePipes()` is used on the controller level:
|
|
||||||
* - Pipe will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UsePipes()` is used on the handle level:
|
|
||||||
* - Pipe will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {PipeTransform[]} ...pipes
|
|
||||||
*/
|
|
||||||
export declare function UsePipes(...pipes: (PipeTransform | Function)[]): (target: any, key?: any, descriptor?: any) => any;
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
|
|
||||||
const validate_each_util_1 = require("../../utils/validate-each.util");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
/**
|
|
||||||
* Binds pipes to the particular context.
|
|
||||||
* When the `@UsePipes()` is used on the controller level:
|
|
||||||
* - Pipe will be register to each handler (every method)
|
|
||||||
*
|
|
||||||
* When the `@UsePipes()` is used on the handle level:
|
|
||||||
* - Pipe will be registered only to specified method
|
|
||||||
*
|
|
||||||
* @param {PipeTransform[]} ...pipes
|
|
||||||
*/
|
|
||||||
function UsePipes(...pipes) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
const isPipeValid = pipe => pipe && (shared_utils_1.isFunction(pipe) || shared_utils_1.isFunction(pipe.transform));
|
|
||||||
if (descriptor) {
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.PIPES_METADATA, pipes, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
}
|
|
||||||
validate_each_util_1.validateEach(target, pipes, isPipeValid, '@UsePipes', 'pipe');
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.PIPES_METADATA, pipes, target);
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.UsePipes = UsePipes;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { PipeTransform } from '../../index';
|
|
||||||
import { Type } from '../../interfaces';
|
|
||||||
import { CustomParamFactory } from '../../interfaces/features/custom-route-param-factory.interface';
|
|
||||||
export declare type ParamDecoratorEnhancer = ParameterDecorator;
|
|
||||||
/**
|
|
||||||
* Defines HTTP route param decorator
|
|
||||||
* @param factory
|
|
||||||
*/
|
|
||||||
export declare function createParamDecorator(factory: CustomParamFactory, enhancers?: ParamDecoratorEnhancer[]): (...dataOrPipes: (Type<PipeTransform> | PipeTransform | any)[]) => ParameterDecorator;
|
|
||||||
/**
|
|
||||||
* Defines HTTP route param decorator
|
|
||||||
* @deprecated
|
|
||||||
* @param factory
|
|
||||||
*/
|
|
||||||
export declare function createRouteParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const deprecate = require("deprecate");
|
|
||||||
const uuid = require("uuid/v4");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
const assignCustomMetadata = (args, paramtype, index, factory, data, ...pipes) => (Object.assign({}, args, { [`${paramtype}${constants_1.CUSTOM_ROUTE_AGRS_METADATA}:${index}`]: {
|
|
||||||
index,
|
|
||||||
factory,
|
|
||||||
data,
|
|
||||||
pipes,
|
|
||||||
} }));
|
|
||||||
/**
|
|
||||||
* Defines HTTP route param decorator
|
|
||||||
* @param factory
|
|
||||||
*/
|
|
||||||
function createParamDecorator(factory, enhancers = []) {
|
|
||||||
const paramtype = uuid();
|
|
||||||
return (data, ...pipes) => (target, key, index) => {
|
|
||||||
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
|
||||||
const isPipe = pipe => pipe &&
|
|
||||||
((shared_utils_1.isFunction(pipe) && pipe.prototype) || shared_utils_1.isFunction(pipe.transform));
|
|
||||||
const hasParamData = shared_utils_1.isNil(data) || !isPipe(data);
|
|
||||||
const paramData = hasParamData ? data : undefined;
|
|
||||||
const paramPipes = hasParamData ? pipes : [data, ...pipes];
|
|
||||||
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignCustomMetadata(args, paramtype, index, factory, paramData, ...paramPipes), target.constructor, key);
|
|
||||||
enhancers.forEach(fn => fn(target, key, index));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.createParamDecorator = createParamDecorator;
|
|
||||||
/**
|
|
||||||
* Defines HTTP route param decorator
|
|
||||||
* @deprecated
|
|
||||||
* @param factory
|
|
||||||
*/
|
|
||||||
function createRouteParamDecorator(factory) {
|
|
||||||
deprecate('The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.');
|
|
||||||
return createParamDecorator(factory);
|
|
||||||
}
|
|
||||||
exports.createRouteParamDecorator = createRouteParamDecorator;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Sets a response header.
|
|
||||||
*/
|
|
||||||
export declare function Header(name: string, value: string): MethodDecorator;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
|
|
||||||
/**
|
|
||||||
* Sets a response header.
|
|
||||||
*/
|
|
||||||
function Header(name, value) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
extend_metadata_util_1.extendArrayMetadata(constants_1.HEADERS_METADATA, [{ name, value }], descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Header = Header;
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
/**
|
|
||||||
* Defines the HTTP response status code.
|
|
||||||
* It overrides default status code for the given request method.
|
|
||||||
*
|
|
||||||
* @param {number} statusCode
|
|
||||||
*/
|
|
||||||
export declare function HttpCode(statusCode: number): MethodDecorator;
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Defines the HTTP response status code.
|
|
||||||
* It overrides default status code for the given request method.
|
|
||||||
*
|
|
||||||
* @param {number} statusCode
|
|
||||||
*/
|
|
||||||
function HttpCode(statusCode) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
Reflect.defineMetadata(constants_1.HTTP_CODE_METADATA, statusCode, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.HttpCode = HttpCode;
|
|
||||||
6
bundle/common/decorators/http/index.d.ts
vendored
6
bundle/common/decorators/http/index.d.ts
vendored
@@ -1,6 +0,0 @@
|
|||||||
export * from './request-mapping.decorator';
|
|
||||||
export * from './route-params.decorator';
|
|
||||||
export * from './http-code.decorator';
|
|
||||||
export * from './create-route-param-metadata.decorator';
|
|
||||||
export * from './render.decorator';
|
|
||||||
export * from './header.decorator';
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./request-mapping.decorator"));
|
|
||||||
__export(require("./route-params.decorator"));
|
|
||||||
__export(require("./http-code.decorator"));
|
|
||||||
__export(require("./create-route-param-metadata.decorator"));
|
|
||||||
__export(require("./render.decorator"));
|
|
||||||
__export(require("./header.decorator"));
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Redirects request.
|
|
||||||
*/
|
|
||||||
export declare function Redirect(url: string): MethodDecorator;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Redirects request.
|
|
||||||
*/
|
|
||||||
function Redirect(url) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
Reflect.defineMetadata(constants_1.REDIRECT_METADATA, url, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Redirect = Redirect;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Defines a template to be rendered by the controller.
|
|
||||||
*/
|
|
||||||
export declare function Render(template: string): MethodDecorator;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Defines a template to be rendered by the controller.
|
|
||||||
*/
|
|
||||||
function Render(template) {
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
Reflect.defineMetadata(constants_1.RENDER_METADATA, template, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Render = Render;
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
import { RequestMappingMetadata } from '../../interfaces/request-mapping-metadata.interface';
|
|
||||||
export declare const RequestMapping: (metadata?: RequestMappingMetadata) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP POST requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Post: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP GET requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Get: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP DELETE requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Delete: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP PUT requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Put: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP PATCH requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Patch: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP OPTIONS requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Options: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes HTTP HEAD requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const Head: (path?: string) => MethodDecorator;
|
|
||||||
/**
|
|
||||||
* Routes all HTTP requests to the specified path.
|
|
||||||
*/
|
|
||||||
export declare const All: (path?: string) => MethodDecorator;
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const request_method_enum_1 = require("../../enums/request-method.enum");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const defaultMetadata = {
|
|
||||||
[constants_1.PATH_METADATA]: '/',
|
|
||||||
[constants_1.METHOD_METADATA]: request_method_enum_1.RequestMethod.GET,
|
|
||||||
};
|
|
||||||
exports.RequestMapping = (metadata = defaultMetadata) => {
|
|
||||||
const path = metadata[constants_1.PATH_METADATA] || '/';
|
|
||||||
const requestMethod = metadata[constants_1.METHOD_METADATA] || request_method_enum_1.RequestMethod.GET;
|
|
||||||
return (target, key, descriptor) => {
|
|
||||||
Reflect.defineMetadata(constants_1.PATH_METADATA, path, descriptor.value);
|
|
||||||
Reflect.defineMetadata(constants_1.METHOD_METADATA, requestMethod, descriptor.value);
|
|
||||||
return descriptor;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const createMappingDecorator = (method) => (path) => {
|
|
||||||
return exports.RequestMapping({
|
|
||||||
[constants_1.PATH_METADATA]: path,
|
|
||||||
[constants_1.METHOD_METADATA]: method,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Routes HTTP POST requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Post = createMappingDecorator(request_method_enum_1.RequestMethod.POST);
|
|
||||||
/**
|
|
||||||
* Routes HTTP GET requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Get = createMappingDecorator(request_method_enum_1.RequestMethod.GET);
|
|
||||||
/**
|
|
||||||
* Routes HTTP DELETE requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Delete = createMappingDecorator(request_method_enum_1.RequestMethod.DELETE);
|
|
||||||
/**
|
|
||||||
* Routes HTTP PUT requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Put = createMappingDecorator(request_method_enum_1.RequestMethod.PUT);
|
|
||||||
/**
|
|
||||||
* Routes HTTP PATCH requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Patch = createMappingDecorator(request_method_enum_1.RequestMethod.PATCH);
|
|
||||||
/**
|
|
||||||
* Routes HTTP OPTIONS requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Options = createMappingDecorator(request_method_enum_1.RequestMethod.OPTIONS);
|
|
||||||
/**
|
|
||||||
* Routes HTTP HEAD requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.Head = createMappingDecorator(request_method_enum_1.RequestMethod.HEAD);
|
|
||||||
/**
|
|
||||||
* Routes all HTTP requests to the specified path.
|
|
||||||
*/
|
|
||||||
exports.All = createMappingDecorator(request_method_enum_1.RequestMethod.ALL);
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
import { PipeTransform } from '../../index';
|
|
||||||
import { Type } from '../../interfaces';
|
|
||||||
export declare type ParamData = object | string | number;
|
|
||||||
export interface RouteParamsMetadata {
|
|
||||||
[prop: number]: {
|
|
||||||
index: number;
|
|
||||||
data?: ParamData;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export declare const Request: () => ParameterDecorator;
|
|
||||||
export declare const Response: () => ParameterDecorator;
|
|
||||||
export declare const Next: () => ParameterDecorator;
|
|
||||||
export declare const Session: () => ParameterDecorator;
|
|
||||||
export declare const UploadedFile: (fileKey?: string) => ParameterDecorator;
|
|
||||||
export declare const UploadedFiles: () => ParameterDecorator;
|
|
||||||
export declare const Headers: (property?: string) => ParameterDecorator;
|
|
||||||
export declare function Query(): any;
|
|
||||||
export declare function Query(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare function Query(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare function Body(): any;
|
|
||||||
export declare function Body(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare function Body(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare function Param(): any;
|
|
||||||
export declare function Param(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare function Param(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
|
|
||||||
export declare const Req: () => ParameterDecorator;
|
|
||||||
export declare const Res: () => ParameterDecorator;
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const route_paramtypes_enum_1 = require("../../enums/route-paramtypes.enum");
|
|
||||||
const shared_utils_1 = require("../../utils/shared.utils");
|
|
||||||
const assignMetadata = (args, paramtype, index, data, ...pipes) => (Object.assign({}, args, { [`${paramtype}:${index}`]: {
|
|
||||||
index,
|
|
||||||
data,
|
|
||||||
pipes,
|
|
||||||
} }));
|
|
||||||
const createRouteParamDecorator = (paramtype) => {
|
|
||||||
return (data) => (target, key, index) => {
|
|
||||||
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
|
||||||
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data), target.constructor, key);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const createPipesRouteParamDecorator = (paramtype) => (data, ...pipes) => (target, key, index) => {
|
|
||||||
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
|
||||||
const hasParamData = shared_utils_1.isNil(data) || shared_utils_1.isString(data);
|
|
||||||
const paramData = hasParamData ? data : undefined;
|
|
||||||
const paramPipes = hasParamData ? pipes : [data, ...pipes];
|
|
||||||
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, paramData, ...paramPipes), target.constructor, key);
|
|
||||||
};
|
|
||||||
exports.Request = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.REQUEST);
|
|
||||||
exports.Response = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.RESPONSE);
|
|
||||||
exports.Next = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.NEXT);
|
|
||||||
exports.Session = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.SESSION);
|
|
||||||
exports.UploadedFile = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.FILE);
|
|
||||||
exports.UploadedFiles = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.FILES);
|
|
||||||
exports.Headers = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.HEADERS);
|
|
||||||
function Query(property, ...pipes) {
|
|
||||||
return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.QUERY)(property, ...pipes);
|
|
||||||
}
|
|
||||||
exports.Query = Query;
|
|
||||||
function Body(property, ...pipes) {
|
|
||||||
return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.BODY)(property, ...pipes);
|
|
||||||
}
|
|
||||||
exports.Body = Body;
|
|
||||||
function Param(property, ...pipes) {
|
|
||||||
return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.PARAM)(property, ...pipes);
|
|
||||||
}
|
|
||||||
exports.Param = Param;
|
|
||||||
exports.Req = exports.Request;
|
|
||||||
exports.Res = exports.Response;
|
|
||||||
3
bundle/common/decorators/index.d.ts
vendored
3
bundle/common/decorators/index.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export * from './core';
|
|
||||||
export * from './modules';
|
|
||||||
export * from './http';
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./core"));
|
|
||||||
__export(require("./modules"));
|
|
||||||
__export(require("./http"));
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export declare const InvalidModuleConfigMessage: (property: string) => string;
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.InvalidModuleConfigMessage = (property) => `Invalid property '${property}' in @Module() decorator.`;
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export declare class InvalidModuleConfigException extends Error {
|
|
||||||
constructor(property: string);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const constants_1 = require("./constants");
|
|
||||||
class InvalidModuleConfigException extends Error {
|
|
||||||
constructor(property) {
|
|
||||||
super(constants_1.InvalidModuleConfigMessage(property));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.InvalidModuleConfigException = InvalidModuleConfigException;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Makes the module global-scoped.
|
|
||||||
* Once imported will be available for all existing modules.
|
|
||||||
*/
|
|
||||||
export declare function Global(): ClassDecorator;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Makes the module global-scoped.
|
|
||||||
* Once imported will be available for all existing modules.
|
|
||||||
*/
|
|
||||||
function Global() {
|
|
||||||
return (target) => {
|
|
||||||
Reflect.defineMetadata(constants_1.GLOBAL_MODULE_METADATA, true, target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Global = Global;
|
|
||||||
3
bundle/common/decorators/modules/index.d.ts
vendored
3
bundle/common/decorators/modules/index.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export * from './module.decorator';
|
|
||||||
export * from './single-scope.decorator';
|
|
||||||
export * from './global.decorator';
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./module.decorator"));
|
|
||||||
__export(require("./single-scope.decorator"));
|
|
||||||
__export(require("./global.decorator"));
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
import { ModuleMetadata } from '../../interfaces/modules/module-metadata.interface';
|
|
||||||
/**
|
|
||||||
* Defines the module
|
|
||||||
* - `imports` - the set of the 'imported' modules
|
|
||||||
* - `controllers` - the list of controllers (e.g. HTTP controllers)
|
|
||||||
* - `providers` - the list of providers that belong to this module. They can be injected between themselves.
|
|
||||||
* - `exports` - the set of components, which should be available for modules, which imports this module
|
|
||||||
* - `components` - @deprecated the list of components that belong to this module. They can be injected between themselves.
|
|
||||||
* @param options {ModuleMetadata} Module metadata
|
|
||||||
*/
|
|
||||||
export declare function Module(metadata: ModuleMetadata): ClassDecorator;
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const deprecate = require("deprecate");
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const invalid_module_config_exception_1 = require("./exceptions/invalid-module-config.exception");
|
|
||||||
const metadataKeys = [
|
|
||||||
constants_1.METADATA.MODULES,
|
|
||||||
constants_1.METADATA.IMPORTS,
|
|
||||||
constants_1.METADATA.EXPORTS,
|
|
||||||
constants_1.METADATA.COMPONENTS,
|
|
||||||
constants_1.METADATA.CONTROLLERS,
|
|
||||||
constants_1.METADATA.PROVIDERS,
|
|
||||||
];
|
|
||||||
const validateKeys = (keys) => {
|
|
||||||
const isKeyInvalid = key => metadataKeys.findIndex(k => k === key) < 0;
|
|
||||||
const validateKey = key => {
|
|
||||||
if (!isKeyInvalid(key)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new invalid_module_config_exception_1.InvalidModuleConfigException(key);
|
|
||||||
};
|
|
||||||
keys.forEach(validateKey);
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Defines the module
|
|
||||||
* - `imports` - the set of the 'imported' modules
|
|
||||||
* - `controllers` - the list of controllers (e.g. HTTP controllers)
|
|
||||||
* - `providers` - the list of providers that belong to this module. They can be injected between themselves.
|
|
||||||
* - `exports` - the set of components, which should be available for modules, which imports this module
|
|
||||||
* - `components` - @deprecated the list of components that belong to this module. They can be injected between themselves.
|
|
||||||
* @param options {ModuleMetadata} Module metadata
|
|
||||||
*/
|
|
||||||
function Module(metadata) {
|
|
||||||
const propsKeys = Object.keys(metadata);
|
|
||||||
validateKeys(propsKeys);
|
|
||||||
showDeprecatedWarnings(metadata);
|
|
||||||
overrideModuleMetadata(metadata);
|
|
||||||
return (target) => {
|
|
||||||
for (const property in metadata) {
|
|
||||||
if (metadata.hasOwnProperty(property)) {
|
|
||||||
Reflect.defineMetadata(property, metadata[property], target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.Module = Module;
|
|
||||||
function overrideModuleMetadata(moduleMetadata) {
|
|
||||||
moduleMetadata.modules = moduleMetadata.imports
|
|
||||||
? moduleMetadata.imports
|
|
||||||
: moduleMetadata.modules;
|
|
||||||
moduleMetadata.components = moduleMetadata.providers
|
|
||||||
? moduleMetadata.providers
|
|
||||||
: moduleMetadata.components;
|
|
||||||
}
|
|
||||||
function showDeprecatedWarnings(moduleMetadata) {
|
|
||||||
const MODULES_DEPRECATED_WARNING = 'The "modules" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "imports" key instead.';
|
|
||||||
const COMPONENTS_DEPRECATED_WARNING = 'The "components" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "providers" key instead.';
|
|
||||||
moduleMetadata.modules && deprecate(MODULES_DEPRECATED_WARNING);
|
|
||||||
moduleMetadata.components && deprecate(COMPONENTS_DEPRECATED_WARNING);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Specifies scope of this module. When module is `@Shared()`, Nest will create only one instance of this
|
|
||||||
* module and share them between all of the modules.
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export declare const Shared: (scope?: string) => (target: any) => any;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
const index_1 = require("../../index");
|
|
||||||
/**
|
|
||||||
* Specifies scope of this module. When module is `@Shared()`, Nest will create only one instance of this
|
|
||||||
* module and share them between all of the modules.
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
exports.Shared = (scope = 'global') => {
|
|
||||||
const logger = new index_1.Logger('Shared');
|
|
||||||
logger.warn('DEPRECATED! Since version 4.0.0 `@Shared()` decorator is deprecated. All modules are singletons now.');
|
|
||||||
return (target) => {
|
|
||||||
const Metatype = target;
|
|
||||||
const Type = class extends Metatype {
|
|
||||||
constructor(...args) {
|
|
||||||
super(...args);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reflect.defineMetadata(constants_1.SHARED_MODULE_METADATA, scope, Type);
|
|
||||||
Object.defineProperty(Type, 'name', { value: target.name });
|
|
||||||
return Type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import 'reflect-metadata';
|
|
||||||
/**
|
|
||||||
* Makes the module single-scoped (not singleton).
|
|
||||||
* In this case, Nest will always create a new instance of this particular module when it's imported by another one.
|
|
||||||
*/
|
|
||||||
export declare function SingleScope(): ClassDecorator;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
require("reflect-metadata");
|
|
||||||
const constants_1 = require("../../constants");
|
|
||||||
/**
|
|
||||||
* Makes the module single-scoped (not singleton).
|
|
||||||
* In this case, Nest will always create a new instance of this particular module when it's imported by another one.
|
|
||||||
*/
|
|
||||||
function SingleScope() {
|
|
||||||
return (target) => {
|
|
||||||
const Metatype = target;
|
|
||||||
const Type = class extends Metatype {
|
|
||||||
constructor(...args) {
|
|
||||||
super(...args);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reflect.defineMetadata(constants_1.SHARED_MODULE_METADATA, true, Type);
|
|
||||||
Object.defineProperty(Type, 'name', { value: target.name });
|
|
||||||
return Type;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.SingleScope = SingleScope;
|
|
||||||
46
bundle/common/enums/http-status.enum.d.ts
vendored
46
bundle/common/enums/http-status.enum.d.ts
vendored
@@ -1,46 +0,0 @@
|
|||||||
export declare enum HttpStatus {
|
|
||||||
CONTINUE = 100,
|
|
||||||
SWITCHING_PROTOCOLS = 101,
|
|
||||||
PROCESSING = 102,
|
|
||||||
OK = 200,
|
|
||||||
CREATED = 201,
|
|
||||||
ACCEPTED = 202,
|
|
||||||
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
||||||
NO_CONTENT = 204,
|
|
||||||
RESET_CONTENT = 205,
|
|
||||||
PARTIAL_CONTENT = 206,
|
|
||||||
AMBIGUOUS = 300,
|
|
||||||
MOVED_PERMANENTLY = 301,
|
|
||||||
FOUND = 302,
|
|
||||||
SEE_OTHER = 303,
|
|
||||||
NOT_MODIFIED = 304,
|
|
||||||
TEMPORARY_REDIRECT = 307,
|
|
||||||
PERMANENT_REDIRECT = 308,
|
|
||||||
BAD_REQUEST = 400,
|
|
||||||
UNAUTHORIZED = 401,
|
|
||||||
PAYMENT_REQUIRED = 402,
|
|
||||||
FORBIDDEN = 403,
|
|
||||||
NOT_FOUND = 404,
|
|
||||||
METHOD_NOT_ALLOWED = 405,
|
|
||||||
NOT_ACCEPTABLE = 406,
|
|
||||||
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
||||||
REQUEST_TIMEOUT = 408,
|
|
||||||
CONFLICT = 409,
|
|
||||||
GONE = 410,
|
|
||||||
LENGTH_REQUIRED = 411,
|
|
||||||
PRECONDITION_FAILED = 412,
|
|
||||||
PAYLOAD_TOO_LARGE = 413,
|
|
||||||
URI_TOO_LONG = 414,
|
|
||||||
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
||||||
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
|
|
||||||
EXPECTATION_FAILED = 417,
|
|
||||||
I_AM_A_TEAPOT = 418,
|
|
||||||
UNPROCESSABLE_ENTITY = 422,
|
|
||||||
TOO_MANY_REQUESTS = 429,
|
|
||||||
INTERNAL_SERVER_ERROR = 500,
|
|
||||||
NOT_IMPLEMENTED = 501,
|
|
||||||
BAD_GATEWAY = 502,
|
|
||||||
SERVICE_UNAVAILABLE = 503,
|
|
||||||
GATEWAY_TIMEOUT = 504,
|
|
||||||
HTTP_VERSION_NOT_SUPPORTED = 505,
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var HttpStatus;
|
|
||||||
(function (HttpStatus) {
|
|
||||||
HttpStatus[HttpStatus["CONTINUE"] = 100] = "CONTINUE";
|
|
||||||
HttpStatus[HttpStatus["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
||||||
HttpStatus[HttpStatus["PROCESSING"] = 102] = "PROCESSING";
|
|
||||||
HttpStatus[HttpStatus["OK"] = 200] = "OK";
|
|
||||||
HttpStatus[HttpStatus["CREATED"] = 201] = "CREATED";
|
|
||||||
HttpStatus[HttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
|
|
||||||
HttpStatus[HttpStatus["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
||||||
HttpStatus[HttpStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
||||||
HttpStatus[HttpStatus["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
||||||
HttpStatus[HttpStatus["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
||||||
HttpStatus[HttpStatus["AMBIGUOUS"] = 300] = "AMBIGUOUS";
|
|
||||||
HttpStatus[HttpStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
||||||
HttpStatus[HttpStatus["FOUND"] = 302] = "FOUND";
|
|
||||||
HttpStatus[HttpStatus["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
||||||
HttpStatus[HttpStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
||||||
HttpStatus[HttpStatus["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
||||||
HttpStatus[HttpStatus["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
||||||
HttpStatus[HttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
||||||
HttpStatus[HttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
||||||
HttpStatus[HttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
||||||
HttpStatus[HttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
||||||
HttpStatus[HttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
||||||
HttpStatus[HttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
||||||
HttpStatus[HttpStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
||||||
HttpStatus[HttpStatus["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
||||||
HttpStatus[HttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
||||||
HttpStatus[HttpStatus["CONFLICT"] = 409] = "CONFLICT";
|
|
||||||
HttpStatus[HttpStatus["GONE"] = 410] = "GONE";
|
|
||||||
HttpStatus[HttpStatus["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
||||||
HttpStatus[HttpStatus["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
||||||
HttpStatus[HttpStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
||||||
HttpStatus[HttpStatus["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
||||||
HttpStatus[HttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
||||||
HttpStatus[HttpStatus["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
|
|
||||||
HttpStatus[HttpStatus["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
||||||
HttpStatus[HttpStatus["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
||||||
HttpStatus[HttpStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
||||||
HttpStatus[HttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
||||||
HttpStatus[HttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
||||||
HttpStatus[HttpStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
||||||
HttpStatus[HttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
||||||
HttpStatus[HttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
||||||
HttpStatus[HttpStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
||||||
HttpStatus[HttpStatus["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
||||||
})(HttpStatus = exports.HttpStatus || (exports.HttpStatus = {}));
|
|
||||||
2
bundle/common/enums/index.d.ts
vendored
2
bundle/common/enums/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
export * from './request-method.enum';
|
|
||||||
export * from './http-status.enum';
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./request-method.enum"));
|
|
||||||
__export(require("./http-status.enum"));
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export declare enum NestEnvironment {
|
|
||||||
RUN = 0,
|
|
||||||
TEST = 1,
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var NestEnvironment;
|
|
||||||
(function (NestEnvironment) {
|
|
||||||
NestEnvironment[NestEnvironment["RUN"] = 0] = "RUN";
|
|
||||||
NestEnvironment[NestEnvironment["TEST"] = 1] = "TEST";
|
|
||||||
})(NestEnvironment = exports.NestEnvironment || (exports.NestEnvironment = {}));
|
|
||||||
10
bundle/common/enums/request-method.enum.d.ts
vendored
10
bundle/common/enums/request-method.enum.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
export declare enum RequestMethod {
|
|
||||||
GET = 0,
|
|
||||||
POST = 1,
|
|
||||||
PUT = 2,
|
|
||||||
DELETE = 3,
|
|
||||||
PATCH = 4,
|
|
||||||
ALL = 5,
|
|
||||||
OPTIONS = 6,
|
|
||||||
HEAD = 7,
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var RequestMethod;
|
|
||||||
(function (RequestMethod) {
|
|
||||||
RequestMethod[RequestMethod["GET"] = 0] = "GET";
|
|
||||||
RequestMethod[RequestMethod["POST"] = 1] = "POST";
|
|
||||||
RequestMethod[RequestMethod["PUT"] = 2] = "PUT";
|
|
||||||
RequestMethod[RequestMethod["DELETE"] = 3] = "DELETE";
|
|
||||||
RequestMethod[RequestMethod["PATCH"] = 4] = "PATCH";
|
|
||||||
RequestMethod[RequestMethod["ALL"] = 5] = "ALL";
|
|
||||||
RequestMethod[RequestMethod["OPTIONS"] = 6] = "OPTIONS";
|
|
||||||
RequestMethod[RequestMethod["HEAD"] = 7] = "HEAD";
|
|
||||||
})(RequestMethod = exports.RequestMethod || (exports.RequestMethod = {}));
|
|
||||||
12
bundle/common/enums/route-paramtypes.enum.d.ts
vendored
12
bundle/common/enums/route-paramtypes.enum.d.ts
vendored
@@ -1,12 +0,0 @@
|
|||||||
export declare enum RouteParamtypes {
|
|
||||||
REQUEST = 0,
|
|
||||||
RESPONSE = 1,
|
|
||||||
NEXT = 2,
|
|
||||||
BODY = 3,
|
|
||||||
QUERY = 4,
|
|
||||||
PARAM = 5,
|
|
||||||
HEADERS = 6,
|
|
||||||
SESSION = 7,
|
|
||||||
FILE = 8,
|
|
||||||
FILES = 9,
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var RouteParamtypes;
|
|
||||||
(function (RouteParamtypes) {
|
|
||||||
RouteParamtypes[RouteParamtypes["REQUEST"] = 0] = "REQUEST";
|
|
||||||
RouteParamtypes[RouteParamtypes["RESPONSE"] = 1] = "RESPONSE";
|
|
||||||
RouteParamtypes[RouteParamtypes["NEXT"] = 2] = "NEXT";
|
|
||||||
RouteParamtypes[RouteParamtypes["BODY"] = 3] = "BODY";
|
|
||||||
RouteParamtypes[RouteParamtypes["QUERY"] = 4] = "QUERY";
|
|
||||||
RouteParamtypes[RouteParamtypes["PARAM"] = 5] = "PARAM";
|
|
||||||
RouteParamtypes[RouteParamtypes["HEADERS"] = 6] = "HEADERS";
|
|
||||||
RouteParamtypes[RouteParamtypes["SESSION"] = 7] = "SESSION";
|
|
||||||
RouteParamtypes[RouteParamtypes["FILE"] = 8] = "FILE";
|
|
||||||
RouteParamtypes[RouteParamtypes["FILES"] = 9] = "FILES";
|
|
||||||
})(RouteParamtypes = exports.RouteParamtypes || (exports.RouteParamtypes = {}));
|
|
||||||
7
bundle/common/enums/transport.enum.d.ts
vendored
7
bundle/common/enums/transport.enum.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
export declare enum Transport {
|
|
||||||
TCP = 0,
|
|
||||||
REDIS = 1,
|
|
||||||
NATS = 2,
|
|
||||||
MQTT = 3,
|
|
||||||
GRPC = 4,
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var Transport;
|
|
||||||
(function (Transport) {
|
|
||||||
Transport[Transport["TCP"] = 0] = "TCP";
|
|
||||||
Transport[Transport["REDIS"] = 1] = "REDIS";
|
|
||||||
Transport[Transport["NATS"] = 2] = "NATS";
|
|
||||||
Transport[Transport["MQTT"] = 3] = "MQTT";
|
|
||||||
Transport[Transport["GRPC"] = 4] = "GRPC";
|
|
||||||
})(Transport = exports.Transport || (exports.Transport = {}));
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { HttpException } from './http.exception';
|
|
||||||
export declare class BadGatewayException extends HttpException {
|
|
||||||
constructor(message?: string | object | any, error?: string);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const http_exception_1 = require("./http.exception");
|
|
||||||
const http_status_enum_1 = require("../enums/http-status.enum");
|
|
||||||
const http_exception_body_util_1 = require("../utils/http-exception-body.util");
|
|
||||||
class BadGatewayException extends http_exception_1.HttpException {
|
|
||||||
constructor(message, error = 'Bad Gateway') {
|
|
||||||
super(http_exception_body_util_1.createHttpExceptionBody(message, error, http_status_enum_1.HttpStatus.BAD_GATEWAY), http_status_enum_1.HttpStatus.BAD_GATEWAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.BadGatewayException = BadGatewayException;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { HttpException } from './http.exception';
|
|
||||||
export declare class BadRequestException extends HttpException {
|
|
||||||
constructor(message?: string | object | any, error?: string);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user