@innv/nest-initializer 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/app-initializer.d.ts +79 -0
- package/dist/cjs/core/app-initializer.js +16 -162
- package/dist/cjs/core/app-initializer.js.map +1 -0
- package/dist/cjs/core/auto-discovery.helper.d.ts +10 -0
- package/dist/cjs/core/auto-discovery.helper.js +7 -9
- package/dist/cjs/core/auto-discovery.helper.js.map +1 -0
- package/dist/cjs/core/config-validator.helper.d.ts +2 -0
- package/dist/cjs/core/config-validator.helper.js +1 -7
- package/dist/cjs/core/config-validator.helper.js.map +1 -0
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +3 -15
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/features/health.controller.d.ts +11 -0
- package/dist/cjs/features/health.controller.js +11 -54
- package/dist/cjs/features/health.controller.js.map +1 -0
- package/dist/cjs/features/index.d.ts +2 -0
- package/dist/cjs/features/index.js +4 -16
- package/dist/cjs/features/index.js.map +1 -0
- package/dist/cjs/features/metrics/metrics.controller.d.ts +6 -0
- package/dist/cjs/features/metrics/metrics.controller.js +10 -20
- package/dist/cjs/features/metrics/metrics.controller.js.map +1 -0
- package/dist/cjs/features/metrics/metrics.interceptor.d.ts +8 -0
- package/dist/cjs/features/metrics/metrics.interceptor.js +5 -15
- package/dist/cjs/features/metrics/metrics.interceptor.js.map +1 -0
- package/dist/cjs/features/metrics/metrics.module.d.ts +4 -0
- package/dist/cjs/features/metrics/metrics.module.js +3 -7
- package/dist/cjs/features/metrics/metrics.module.js.map +1 -0
- package/dist/cjs/features/metrics/metrics.provider.d.ts +2 -0
- package/dist/cjs/features/metrics/metrics.provider.js +2 -1
- package/dist/cjs/features/metrics/metrics.provider.js.map +1 -0
- package/dist/cjs/features/metrics/metrics.tokens.d.ts +2 -0
- package/dist/cjs/features/metrics/metrics.tokens.js +1 -0
- package/dist/cjs/features/metrics/metrics.tokens.js.map +1 -0
- package/dist/cjs/features/terminus-health-check.module.d.ts +11 -0
- package/dist/cjs/features/terminus-health-check.module.js +3 -7
- package/dist/cjs/features/terminus-health-check.module.js.map +1 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +4 -16
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interceptors/response-pattern.interceptor.d.ts +8 -0
- package/dist/cjs/interceptors/response-pattern.interceptor.js +1 -0
- package/dist/cjs/interceptors/response-pattern.interceptor.js.map +1 -0
- package/dist/cjs/plugins/index.d.ts +3 -0
- package/dist/cjs/plugins/index.js +5 -17
- package/dist/cjs/plugins/index.js.map +1 -0
- package/dist/cjs/plugins/rate-limiter.plugin.d.ts +8 -0
- package/dist/cjs/plugins/rate-limiter.plugin.js +3 -4
- package/dist/cjs/plugins/rate-limiter.plugin.js.map +1 -0
- package/dist/cjs/plugins/request-logger.plugin.d.ts +5 -0
- package/dist/cjs/plugins/request-logger.plugin.js +3 -4
- package/dist/cjs/plugins/request-logger.plugin.js.map +1 -0
- package/dist/cjs/plugins/typeorm-migration.plugin.d.ts +6 -0
- package/dist/cjs/plugins/typeorm-migration.plugin.js +1 -9
- package/dist/cjs/plugins/typeorm-migration.plugin.js.map +1 -0
- package/dist/cjs/starters/caching.starter.d.ts +5 -0
- package/dist/cjs/starters/caching.starter.js +1 -4
- package/dist/cjs/starters/caching.starter.js.map +1 -0
- package/dist/cjs/starters/index.d.ts +3 -0
- package/dist/cjs/starters/index.js +5 -17
- package/dist/cjs/starters/index.js.map +1 -0
- package/dist/cjs/starters/mongoose.starter.d.ts +9 -0
- package/dist/cjs/starters/mongoose.starter.js +1 -4
- package/dist/cjs/starters/mongoose.starter.js.map +1 -0
- package/dist/cjs/starters/typeorm.starter.d.ts +12 -0
- package/dist/cjs/starters/typeorm.starter.js +1 -4
- package/dist/cjs/starters/typeorm.starter.js.map +1 -0
- package/dist/esm/core/app-initializer.d.ts +79 -0
- package/dist/esm/core/app-initializer.js +16 -162
- package/dist/esm/core/app-initializer.js.map +1 -0
- package/dist/esm/core/auto-discovery.helper.d.ts +10 -0
- package/dist/esm/core/auto-discovery.helper.js +7 -9
- package/dist/esm/core/auto-discovery.helper.js.map +1 -0
- package/dist/esm/core/config-validator.helper.d.ts +2 -0
- package/dist/esm/core/config-validator.helper.js +1 -7
- package/dist/esm/core/config-validator.helper.js.map +1 -0
- package/dist/esm/core/index.d.ts +1 -0
- package/dist/esm/core/index.js +3 -15
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/features/health.controller.d.ts +11 -0
- package/dist/esm/features/health.controller.js +11 -54
- package/dist/esm/features/health.controller.js.map +1 -0
- package/dist/esm/features/index.d.ts +2 -0
- package/dist/esm/features/index.js +4 -16
- package/dist/esm/features/index.js.map +1 -0
- package/dist/esm/features/metrics/metrics.controller.d.ts +6 -0
- package/dist/esm/features/metrics/metrics.controller.js +10 -20
- package/dist/esm/features/metrics/metrics.controller.js.map +1 -0
- package/dist/esm/features/metrics/metrics.interceptor.d.ts +8 -0
- package/dist/esm/features/metrics/metrics.interceptor.js +5 -15
- package/dist/esm/features/metrics/metrics.interceptor.js.map +1 -0
- package/dist/esm/features/metrics/metrics.module.d.ts +4 -0
- package/dist/esm/features/metrics/metrics.module.js +3 -7
- package/dist/esm/features/metrics/metrics.module.js.map +1 -0
- package/dist/esm/features/metrics/metrics.provider.d.ts +2 -0
- package/dist/esm/features/metrics/metrics.provider.js +2 -1
- package/dist/esm/features/metrics/metrics.provider.js.map +1 -0
- package/dist/esm/features/metrics/metrics.tokens.d.ts +2 -0
- package/dist/esm/features/metrics/metrics.tokens.js +1 -0
- package/dist/esm/features/metrics/metrics.tokens.js.map +1 -0
- package/dist/esm/features/terminus-health-check.module.d.ts +11 -0
- package/dist/esm/features/terminus-health-check.module.js +3 -7
- package/dist/esm/features/terminus-health-check.module.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +4 -16
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interceptors/response-pattern.interceptor.d.ts +8 -0
- package/dist/esm/interceptors/response-pattern.interceptor.js +1 -0
- package/dist/esm/interceptors/response-pattern.interceptor.js.map +1 -0
- package/dist/esm/plugins/index.d.ts +3 -0
- package/dist/esm/plugins/index.js +5 -17
- package/dist/esm/plugins/index.js.map +1 -0
- package/dist/esm/plugins/rate-limiter.plugin.d.ts +8 -0
- package/dist/esm/plugins/rate-limiter.plugin.js +3 -4
- package/dist/esm/plugins/rate-limiter.plugin.js.map +1 -0
- package/dist/esm/plugins/request-logger.plugin.d.ts +5 -0
- package/dist/esm/plugins/request-logger.plugin.js +3 -4
- package/dist/esm/plugins/request-logger.plugin.js.map +1 -0
- package/dist/esm/plugins/typeorm-migration.plugin.d.ts +6 -0
- package/dist/esm/plugins/typeorm-migration.plugin.js +1 -9
- package/dist/esm/plugins/typeorm-migration.plugin.js.map +1 -0
- package/dist/esm/starters/caching.starter.d.ts +5 -0
- package/dist/esm/starters/caching.starter.js +1 -4
- package/dist/esm/starters/caching.starter.js.map +1 -0
- package/dist/esm/starters/index.d.ts +3 -0
- package/dist/esm/starters/index.js +5 -17
- package/dist/esm/starters/index.js.map +1 -0
- package/dist/esm/starters/mongoose.starter.d.ts +9 -0
- package/dist/esm/starters/mongoose.starter.js +1 -4
- package/dist/esm/starters/mongoose.starter.js.map +1 -0
- package/dist/esm/starters/typeorm.starter.d.ts +12 -0
- package/dist/esm/starters/typeorm.starter.js +1 -4
- package/dist/esm/starters/typeorm.starter.js.map +1 -0
- package/dist/types/core/app-initializer.d.ts +2 -152
- package/dist/types/core/auto-discovery.helper.d.ts +1 -6
- package/dist/types/core/config-validator.helper.d.ts +0 -7
- package/dist/types/plugins/typeorm-migration.plugin.d.ts +0 -9
- package/dist/types/starters/caching.starter.d.ts +0 -15
- package/dist/types/starters/mongoose.starter.d.ts +0 -15
- package/dist/types/starters/typeorm.starter.d.ts +0 -7
- package/package.json +25 -30
- package/README.md +0 -257
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongoose.starter.js","sourceRoot":"","sources":["../../../src/starters/mongoose.starter.ts"],"names":[],"mappings":";;AAuBA,sDAiBC;AAxCD,2CAA+C;AAC/C,+CAAyE;AAsBzE,SAAgB,qBAAqB,CAAC,UAAkC,EAAE;IACxE,MAAM,EAAE,SAAS,GAAG,WAAW,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAElE,MAAM,qBAAqB,GAAG,yBAAc,CAAC,YAAY,CAAC;QACxD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,CAAC,sBAAa,CAAC;QAEvB,UAAU,EAAE,CAAC,aAA4B,EAAyB,EAAE,CAAC,CAAC;YACpE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;YACzC,GAAG,eAAe;SACnB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,EAAE,qBAAqB;QAC7B,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
|
2
|
+
import { AppInitializerPlugin } from '../core';
|
|
3
|
+
export interface TypeOrmStarterOptions {
|
|
4
|
+
autoLoadEntities?: boolean;
|
|
5
|
+
runMigrationsOnStartup?: boolean;
|
|
6
|
+
databaseUrlEnvKey?: string;
|
|
7
|
+
typeOrmOptions?: Omit<TypeOrmModuleOptions, 'url' | 'autoLoadEntities' | 'synchronize'>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createTypeOrmStarter(options?: TypeOrmStarterOptions): {
|
|
10
|
+
module: import("@nestjs/common").DynamicModule;
|
|
11
|
+
plugins: AppInitializerPlugin[];
|
|
12
|
+
};
|
|
@@ -4,10 +4,6 @@ exports.createTypeOrmStarter = createTypeOrmStarter;
|
|
|
4
4
|
const config_1 = require("@nestjs/config");
|
|
5
5
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
6
6
|
const plugins_1 = require("../plugins");
|
|
7
|
-
/**
|
|
8
|
-
* Cria o módulo dinâmico para o "Starter" de TypeORM.
|
|
9
|
-
* Esta função constrói toda a configuração necessária para o TypeOrmModule.
|
|
10
|
-
*/
|
|
11
7
|
function createTypeOrmStarter(options = {}) {
|
|
12
8
|
const { autoLoadEntities = true, runMigrationsOnStartup = false, databaseUrlEnvKey = 'DATABASE_URL', typeOrmOptions = {}, } = options;
|
|
13
9
|
const typeOrmDynamicModule = typeorm_1.TypeOrmModule.forRootAsync({
|
|
@@ -29,3 +25,4 @@ function createTypeOrmStarter(options = {}) {
|
|
|
29
25
|
plugins: plugins,
|
|
30
26
|
};
|
|
31
27
|
}
|
|
28
|
+
//# sourceMappingURL=typeorm.starter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm.starter.js","sourceRoot":"","sources":["../../../src/starters/typeorm.starter.ts"],"names":[],"mappings":";;AAuBA,oDA6BC;AApDD,2CAA+C;AAC/C,6CAAsE;AAGtE,wCAAoD;AAmBpD,SAAgB,oBAAoB,CAAC,UAAiC,EAAE;IACtE,MAAM,EACJ,gBAAgB,GAAG,IAAI,EACvB,sBAAsB,GAAG,KAAK,EAC9B,iBAAiB,GAAG,cAAc,EAClC,cAAc,GAAG,EAAE,GACpB,GAAG,OAAO,CAAC;IAEZ,MAAM,oBAAoB,GAAG,uBAAa,CAAC,YAAY,CAAC;QACtD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,CAAC,sBAAa,CAAC;QACvB,UAAU,EAAE,CAAC,aAA4B,EAAwB,EAAE,CACjE,CAAC;YACC,GAAG,EAAE,aAAa,CAAC,GAAG,CAAS,iBAAiB,CAAC;YACjD,gBAAgB,EAAE,gBAAgB;YAClC,WAAW,EAAE,KAAK;YAClB,GAAG,cAAc;SAClB,CAAyB;KAC7B,CAAC,CAAC;IAEH,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,gCAAsB,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO;QACL,MAAM,EAAE,oBAAoB;QAC5B,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { CanActivate, ExceptionFilter, INestApplication, NestInterceptor, PipeTransform, Type, ValidationPipeOptions, VersioningOptions } from '@nestjs/common';
|
|
3
|
+
import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
|
|
4
|
+
import { AbstractHttpAdapter } from '@nestjs/core';
|
|
5
|
+
import { SwaggerCustomOptions, SwaggerDocumentOptions } from '@nestjs/swagger';
|
|
6
|
+
import { TerminusHealthCheckOptions } from '../features';
|
|
7
|
+
import { CachingStarterOptions, MongooseStarterOptions, TypeOrmStarterOptions } from '../starters';
|
|
8
|
+
import { ResponseMapper } from '../interceptors/response-pattern.interceptor';
|
|
9
|
+
export interface AppInitializerPlugin {
|
|
10
|
+
apply(app: INestApplication): Promise<void> | void;
|
|
11
|
+
}
|
|
12
|
+
export type SwaggerDocumentTags = {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
export type SwaggerOptions = {
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
version: string;
|
|
20
|
+
tags?: SwaggerDocumentTags[];
|
|
21
|
+
path?: string;
|
|
22
|
+
documentOptions?: SwaggerDocumentOptions;
|
|
23
|
+
customOptions?: SwaggerCustomOptions;
|
|
24
|
+
};
|
|
25
|
+
type AppConfigurator<T extends INestApplication> = (app: AppInitializer<T>) => void;
|
|
26
|
+
export declare class AppInitializer<T extends INestApplication = INestApplication> {
|
|
27
|
+
private app;
|
|
28
|
+
private readonly module;
|
|
29
|
+
private readonly adapter?;
|
|
30
|
+
private readonly logger;
|
|
31
|
+
private port;
|
|
32
|
+
private globalPrefix?;
|
|
33
|
+
private versioningOptions?;
|
|
34
|
+
private corsOptions?;
|
|
35
|
+
private swaggerOptions?;
|
|
36
|
+
private readonly setupFunctions;
|
|
37
|
+
private readonly plugins;
|
|
38
|
+
private readonly featureModules;
|
|
39
|
+
private autoDiscoveredComponents?;
|
|
40
|
+
private readonly globalProviders;
|
|
41
|
+
private readonly nexusClientProviders;
|
|
42
|
+
private readonly globalInterceptors;
|
|
43
|
+
private readonly factoryGeneratedControllers;
|
|
44
|
+
private constructor();
|
|
45
|
+
useDevelopmentDefaults(swaggerOptions: Omit<SwaggerOptions, 'path'>): this;
|
|
46
|
+
useProductionDefaults(): this;
|
|
47
|
+
when(condition: boolean, configure: (builder: this) => void): this;
|
|
48
|
+
withHealthCheck(options: TerminusHealthCheckOptions): this;
|
|
49
|
+
withMetrics(): this;
|
|
50
|
+
static bootstrap<T extends INestApplication = INestApplication>(module: Type, configurator: AppConfigurator<T>): Promise<void>;
|
|
51
|
+
static bootstrap<T extends INestApplication = INestApplication>(module: Type, adapter: AbstractHttpAdapter, configurator: AppConfigurator<T>): Promise<void>;
|
|
52
|
+
onPort(port: number): this;
|
|
53
|
+
withPlugin(plugin: AppInitializerPlugin): this;
|
|
54
|
+
withVersioning(options: VersioningOptions): this;
|
|
55
|
+
withGlobalPrefix(prefix: string): this;
|
|
56
|
+
withCors(options?: CorsOptions): this;
|
|
57
|
+
withValidationPipe(options?: ValidationPipeOptions): this;
|
|
58
|
+
useGlobalPipe(pipe: Type<PipeTransform>): this;
|
|
59
|
+
useGlobalFilter(filter: Type<ExceptionFilter>): this;
|
|
60
|
+
useGlobalGuard(guard: Type<CanActivate>): this;
|
|
61
|
+
useGlobalInterceptor(interceptor: Type<NestInterceptor>): this;
|
|
62
|
+
withClassSerializer(): this;
|
|
63
|
+
withSwagger(options: SwaggerOptions): this;
|
|
64
|
+
withGracefulShutdown(): this;
|
|
65
|
+
useHelmet(): this;
|
|
66
|
+
enableCompression(): this;
|
|
67
|
+
withValidatedConfig<T extends object>(schema: Type<T>): this;
|
|
68
|
+
withTypeOrm(options?: TypeOrmStarterOptions): this;
|
|
69
|
+
withMongoose(options?: MongooseStarterOptions): this;
|
|
70
|
+
withCaching(options?: CachingStarterOptions): this;
|
|
71
|
+
getApp(): T;
|
|
72
|
+
withAutoDiscovery(options: {
|
|
73
|
+
basePath: string;
|
|
74
|
+
}): this;
|
|
75
|
+
addGlobalInterceptor(interceptor: NestInterceptor): this;
|
|
76
|
+
withResponseMapper<T>(mapper: ResponseMapper<T>): this;
|
|
77
|
+
private listen;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.AppInitializer = void 0;
|
|
13
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
require("reflect-metadata");
|
|
6
|
+
const nexus_1 = require("@innv/nexus");
|
|
14
7
|
const common_1 = require("@nestjs/common");
|
|
15
8
|
const config_1 = require("@nestjs/config");
|
|
16
9
|
const core_1 = require("@nestjs/core");
|
|
17
10
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const compression_1 = __importDefault(require("compression"));
|
|
19
|
-
const helmet_1 = __importDefault(require("helmet"));
|
|
11
|
+
const compression_1 = tslib_1.__importDefault(require("compression"));
|
|
12
|
+
const helmet_1 = tslib_1.__importDefault(require("helmet"));
|
|
20
13
|
const auto_discovery_helper_1 = require("./auto-discovery.helper");
|
|
21
14
|
const config_validator_helper_1 = require("./config-validator.helper");
|
|
22
15
|
const features_1 = require("../features");
|
|
23
16
|
const plugins_1 = require("../plugins");
|
|
24
17
|
const starters_1 = require("../starters");
|
|
25
18
|
const response_pattern_interceptor_1 = require("../interceptors/response-pattern.interceptor");
|
|
26
|
-
/**
|
|
27
|
-
* Uma classe fluente (Builder) para inicializar uma aplicação NestJS de forma declarativa.
|
|
28
|
-
*/
|
|
29
19
|
class AppInitializer {
|
|
30
20
|
app;
|
|
31
21
|
module;
|
|
@@ -39,29 +29,20 @@ class AppInitializer {
|
|
|
39
29
|
setupFunctions = [];
|
|
40
30
|
plugins = [];
|
|
41
31
|
featureModules = [];
|
|
42
|
-
advancedSwaggerUiOptions;
|
|
43
32
|
autoDiscoveredComponents;
|
|
44
33
|
globalProviders = [];
|
|
34
|
+
nexusClientProviders = [];
|
|
45
35
|
globalInterceptors = [];
|
|
46
36
|
factoryGeneratedControllers = [];
|
|
47
37
|
constructor(module, adapter) {
|
|
48
38
|
this.module = module;
|
|
49
39
|
this.adapter = adapter;
|
|
50
40
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Aplica um conjunto de configurações padrão recomendadas para o ambiente de desenvolvimento.
|
|
53
|
-
* Inclui Swagger e um logger de requisições.
|
|
54
|
-
* @param swaggerOptions Opções para customizar a documentação Swagger.
|
|
55
|
-
*/
|
|
56
41
|
useDevelopmentDefaults(swaggerOptions) {
|
|
57
42
|
this.withSwagger({ ...swaggerOptions, path: 'docs' });
|
|
58
43
|
this.withPlugin(new plugins_1.RequestLoggerPlugin());
|
|
59
44
|
return this;
|
|
60
45
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Aplica um conjunto de configurações padrão recomendadas para o ambiente de produção.
|
|
63
|
-
* Inclui Helmet, compressão, graceful shutdown e um rate limiter básico.
|
|
64
|
-
*/
|
|
65
46
|
useProductionDefaults() {
|
|
66
47
|
this.useHelmet();
|
|
67
48
|
this.enableCompression();
|
|
@@ -69,11 +50,6 @@ class AppInitializer {
|
|
|
69
50
|
this.withPlugin(new plugins_1.RateLimiterPlugin());
|
|
70
51
|
return this;
|
|
71
52
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Aplica um bloco de configurações de forma condicional.
|
|
74
|
-
* @param condition A condição booleana. Se for `true`, o callback de configuração será executado.
|
|
75
|
-
* @param configure A função de callback que recebe o builder para aplicar as configurações.
|
|
76
|
-
*/
|
|
77
53
|
when(condition, configure) {
|
|
78
54
|
if (condition) {
|
|
79
55
|
configure(this);
|
|
@@ -84,21 +60,10 @@ class AppInitializer {
|
|
|
84
60
|
this.featureModules.push(features_1.TerminusHealthCheckModule.forRoot(options));
|
|
85
61
|
return this;
|
|
86
62
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Habilita a coleta e exposição de métricas no padrão Prometheus
|
|
89
|
-
* no endpoint /metrics. Inclui métricas padrão do Node.js
|
|
90
|
-
* e métricas de latência de requisições HTTP.
|
|
91
|
-
*/
|
|
92
63
|
withMetrics() {
|
|
93
64
|
this.featureModules.push(features_1.MetricsModule.forRoot());
|
|
94
65
|
return this;
|
|
95
66
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Ponto de entrada estático para criar, configurar e iniciar a aplicação.
|
|
98
|
-
* @param module O módulo raiz da aplicação (ex: AppModule).
|
|
99
|
-
* @param adapterOrConfigurator O adaptador HTTP ou a função de configuração.
|
|
100
|
-
* @param configurator Uma função de callback que recebe o builder para aplicar as configurações.
|
|
101
|
-
*/
|
|
102
67
|
static async bootstrap(module, adapterOrConfigurator, configurator) {
|
|
103
68
|
const isExpress = typeof adapterOrConfigurator === 'function';
|
|
104
69
|
const adapter = isExpress ? undefined : adapterOrConfigurator;
|
|
@@ -122,51 +87,26 @@ class AppInitializer {
|
|
|
122
87
|
process.exit(1);
|
|
123
88
|
}
|
|
124
89
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Define a porta em que a aplicação vai rodar.
|
|
127
|
-
* @param port O número da porta.
|
|
128
|
-
*/
|
|
129
90
|
onPort(port) {
|
|
130
91
|
this.port = port;
|
|
131
92
|
return this;
|
|
132
93
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Registra um plugin para ser executado durante a inicialização.
|
|
135
|
-
* @param plugin Uma instância de um objeto que implementa a interface AppInitializerPlugin.
|
|
136
|
-
*/
|
|
137
94
|
withPlugin(plugin) {
|
|
138
95
|
this.plugins.push(plugin);
|
|
139
96
|
return this;
|
|
140
97
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Habilita e configura o versionamento da API.
|
|
143
|
-
* @param options As opções de versionamento do NestJS.
|
|
144
|
-
*/
|
|
145
98
|
withVersioning(options) {
|
|
146
99
|
this.versioningOptions = options;
|
|
147
100
|
return this;
|
|
148
101
|
}
|
|
149
|
-
/**
|
|
150
|
-
* Define um prefixo global para todas as rotas da aplicação (ex: /api/v1).
|
|
151
|
-
* @param prefix O prefixo a ser aplicado.
|
|
152
|
-
*/
|
|
153
102
|
withGlobalPrefix(prefix) {
|
|
154
103
|
this.globalPrefix = prefix.startsWith('/') ? prefix : `/${prefix}`;
|
|
155
104
|
return this;
|
|
156
105
|
}
|
|
157
|
-
/**
|
|
158
|
-
* Habilita e configura o Cross-Origin Resource Sharing (CORS).
|
|
159
|
-
* @param options As opções de configuração do CORS.
|
|
160
|
-
*/
|
|
161
106
|
withCors(options = {}) {
|
|
162
107
|
this.corsOptions = options;
|
|
163
108
|
return this;
|
|
164
109
|
}
|
|
165
|
-
/**
|
|
166
|
-
* Adiciona o ValidationPipe global com opções customizadas.
|
|
167
|
-
* Esta é a forma recomendada de habilitar a validação padrão.
|
|
168
|
-
* @param options Opções de configuração para o ValidationPipe.
|
|
169
|
-
*/
|
|
170
110
|
withValidationPipe(options = {}) {
|
|
171
111
|
const defaultOptions = {
|
|
172
112
|
whitelist: true,
|
|
@@ -181,11 +121,6 @@ class AppInitializer {
|
|
|
181
121
|
});
|
|
182
122
|
return this;
|
|
183
123
|
}
|
|
184
|
-
/**
|
|
185
|
-
* Registra um Pipe global customizado (ex: um pipe de parsing).
|
|
186
|
-
* O pipe participará da Injeção de Dependência.
|
|
187
|
-
* @param pipe A *classe* do pipe a ser registrada.
|
|
188
|
-
*/
|
|
189
124
|
useGlobalPipe(pipe) {
|
|
190
125
|
this.globalProviders.push({
|
|
191
126
|
provide: core_1.APP_PIPE,
|
|
@@ -193,11 +128,6 @@ class AppInitializer {
|
|
|
193
128
|
});
|
|
194
129
|
return this;
|
|
195
130
|
}
|
|
196
|
-
/**
|
|
197
|
-
* Registra um Filtro de Exceção global (ex: HttpExceptionFilter).
|
|
198
|
-
* O filtro participará da Injeção de Dependência.
|
|
199
|
-
* @param filter A *classe* do filtro a ser registrada.
|
|
200
|
-
*/
|
|
201
131
|
useGlobalFilter(filter) {
|
|
202
132
|
this.globalProviders.push({
|
|
203
133
|
provide: core_1.APP_FILTER,
|
|
@@ -205,11 +135,6 @@ class AppInitializer {
|
|
|
205
135
|
});
|
|
206
136
|
return this;
|
|
207
137
|
}
|
|
208
|
-
/**
|
|
209
|
-
* Registra um Guard global (ex: JwtAuthGuard).
|
|
210
|
-
* O guard participará da Injeção de Dependência.
|
|
211
|
-
* @param guard A *classe* do guard a ser registrada.
|
|
212
|
-
*/
|
|
213
138
|
useGlobalGuard(guard) {
|
|
214
139
|
this.globalProviders.push({
|
|
215
140
|
provide: core_1.APP_GUARD,
|
|
@@ -217,11 +142,6 @@ class AppInitializer {
|
|
|
217
142
|
});
|
|
218
143
|
return this;
|
|
219
144
|
}
|
|
220
|
-
/**
|
|
221
|
-
* Registra um Interceptor global (ex: LoggingInterceptor).
|
|
222
|
-
* O interceptor participará da Injeção de Dependência.
|
|
223
|
-
* @param interceptor A *classe* do interceptor a ser registrada.
|
|
224
|
-
*/
|
|
225
145
|
useGlobalInterceptor(interceptor) {
|
|
226
146
|
this.globalProviders.push({
|
|
227
147
|
provide: core_1.APP_INTERCEPTOR,
|
|
@@ -229,11 +149,6 @@ class AppInitializer {
|
|
|
229
149
|
});
|
|
230
150
|
return this;
|
|
231
151
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Registra o ClassSerializerInterceptor globalmente.
|
|
234
|
-
* Essencial para transformações de DTO (@Exclude, @Expose).
|
|
235
|
-
* Ele automaticamente recebe o Reflector via DI.
|
|
236
|
-
*/
|
|
237
152
|
withClassSerializer() {
|
|
238
153
|
this.globalProviders.push({
|
|
239
154
|
provide: core_1.APP_INTERCEPTOR,
|
|
@@ -241,56 +156,22 @@ class AppInitializer {
|
|
|
241
156
|
});
|
|
242
157
|
return this;
|
|
243
158
|
}
|
|
244
|
-
/**
|
|
245
|
-
* Habilita e configura a documentação da API via Swagger (OpenAPI).
|
|
246
|
-
* @param options As opções para construir a documentação.
|
|
247
|
-
*/
|
|
248
159
|
withSwagger(options) {
|
|
249
160
|
this.swaggerOptions = { path: 'docs', ...options };
|
|
250
161
|
return this;
|
|
251
162
|
}
|
|
252
|
-
/**
|
|
253
|
-
* Aplica customizações avançadas à interface do Swagger UI.
|
|
254
|
-
* Isso pode incluir temas, scripts e outras configurações visuais.
|
|
255
|
-
* Por padrão, aplica um tema escuro e algumas configurações de layout.
|
|
256
|
-
*/
|
|
257
|
-
withAdvancedSwaggerUI() {
|
|
258
|
-
// Aponta para os arquivos de customização que criamos.
|
|
259
|
-
// O __dirname aponta para o diretório compilado, que deve ser 'dist' ou 'build'.
|
|
260
|
-
// Os arquivos .css e .js devem estar lá também após a compilação.
|
|
261
|
-
this.advancedSwaggerUiOptions = {
|
|
262
|
-
customCss: (0, path_1.join)(__dirname, 'swagger-ui-customization', 'swagger-dark-theme.css'),
|
|
263
|
-
customJs: (0, path_1.join)(__dirname, 'swagger-ui-customization', 'swagger-custom.js'),
|
|
264
|
-
};
|
|
265
|
-
return this;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Habilita os 'shutdown hooks' do NestJS para um desligamento gracioso.
|
|
269
|
-
*/
|
|
270
163
|
withGracefulShutdown() {
|
|
271
164
|
this.setupFunctions.push((app) => app.enableShutdownHooks());
|
|
272
165
|
return this;
|
|
273
166
|
}
|
|
274
|
-
/**
|
|
275
|
-
* Adiciona o middleware de segurança Helmet com configurações padrão.
|
|
276
|
-
*/
|
|
277
167
|
useHelmet() {
|
|
278
168
|
this.setupFunctions.push((app) => app.use((0, helmet_1.default)()));
|
|
279
169
|
return this;
|
|
280
170
|
}
|
|
281
|
-
/**
|
|
282
|
-
* Adiciona o middleware de compressão (gzip) para as respostas.
|
|
283
|
-
*/
|
|
284
171
|
enableCompression() {
|
|
285
172
|
this.setupFunctions.push((app) => app.use((0, compression_1.default)()));
|
|
286
173
|
return this;
|
|
287
174
|
}
|
|
288
|
-
/**
|
|
289
|
-
* Carrega e valida as variáveis de ambiente na inicialização
|
|
290
|
-
* usando um schema de validação (classe com decoradores class-validator).
|
|
291
|
-
* Se a validação falhar, a aplicação não será iniciada.
|
|
292
|
-
* @param schema A classe de schema para validar (ex: EnvironmentVariables).
|
|
293
|
-
*/
|
|
294
175
|
withValidatedConfig(schema) {
|
|
295
176
|
const configModule = config_1.ConfigModule.forRoot({
|
|
296
177
|
isGlobal: true,
|
|
@@ -299,10 +180,6 @@ class AppInitializer {
|
|
|
299
180
|
this.featureModules.push(configModule);
|
|
300
181
|
return this;
|
|
301
182
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Configura e registra automaticamente o TypeOrmModule (Estilo "Starter").
|
|
304
|
-
* @param options Opções para o "Starter" de TypeORM.
|
|
305
|
-
*/
|
|
306
183
|
withTypeOrm(options = {}) {
|
|
307
184
|
const starter = (0, starters_1.createTypeOrmStarter)(options);
|
|
308
185
|
this.featureModules.push(starter.module);
|
|
@@ -311,60 +188,35 @@ class AppInitializer {
|
|
|
311
188
|
}
|
|
312
189
|
return this;
|
|
313
190
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Configura e registra automaticamente o MongooseModule (Estilo "Starter").
|
|
316
|
-
* Usa a configuração global (de .withValidatedConfig) para se conectar
|
|
317
|
-
* ao MongoDB e descobre schemas automaticamente.
|
|
318
|
-
*
|
|
319
|
-
* @param options Opções para o "Starter" de Mongoose.
|
|
320
|
-
*/
|
|
321
191
|
withMongoose(options = {}) {
|
|
322
192
|
const starter = (0, starters_1.createMongooseStarter)(options);
|
|
323
193
|
this.featureModules.push(starter.module);
|
|
324
194
|
return this;
|
|
325
195
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Configura e registra automaticamente o CacheModule (Estilo "Starter").
|
|
328
|
-
* Usa a configuração global (de .withValidatedConfig) para se conectar
|
|
329
|
-
* ao Redis e torna o cache globalmente disponível.
|
|
330
|
-
*
|
|
331
|
-
* @param options Opções para o "Starter" de Cache.
|
|
332
|
-
*/
|
|
333
196
|
withCaching(options = {}) {
|
|
334
197
|
const cacheDynamicModule = (0, starters_1.createCachingStarter)(options);
|
|
335
198
|
this.featureModules.push(cacheDynamicModule);
|
|
336
199
|
return this;
|
|
337
200
|
}
|
|
338
|
-
/**
|
|
339
|
-
* Retorna a instância da aplicação NestJS (INestApplication) após a inicialização.
|
|
340
|
-
* @throws Error se a aplicação ainda não foi inicializada.
|
|
341
|
-
*/
|
|
342
201
|
getApp() {
|
|
343
202
|
return this.app;
|
|
344
203
|
}
|
|
345
|
-
/**
|
|
346
|
-
* Habilita a descoberta e registro automático de Providers e Controllers.
|
|
347
|
-
* Varre o projeto em busca de classes com @Injectable() e @Controller()
|
|
348
|
-
* e as adiciona ao módulo raiz.
|
|
349
|
-
* @param options Opções para configurar a descoberta.
|
|
350
|
-
*/
|
|
351
204
|
withAutoDiscovery(options) {
|
|
352
205
|
const reflector = new core_1.Reflector();
|
|
353
206
|
this.autoDiscoveredComponents = (0, auto_discovery_helper_1.discoverComponents)(options.basePath, reflector);
|
|
207
|
+
if (this.autoDiscoveredComponents.nexusClients.length > 0) {
|
|
208
|
+
this.logger.log(`[Initializer] Auto-discovery encontrou ${this.autoDiscoveredComponents.nexusClients.length} clientes Nexus.`);
|
|
209
|
+
this.featureModules.push(nexus_1.NexusModule);
|
|
210
|
+
for (const clientClass of this.autoDiscoveredComponents.nexusClients) {
|
|
211
|
+
this.nexusClientProviders.push((0, nexus_1.createNexusClientProvider)(clientClass));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
354
214
|
return this;
|
|
355
215
|
}
|
|
356
|
-
/**
|
|
357
|
-
* Adiciona um Interceptor global diretamente (instância).
|
|
358
|
-
* @param interceptor
|
|
359
|
-
*/
|
|
360
216
|
addGlobalInterceptor(interceptor) {
|
|
361
217
|
this.globalInterceptors.push(interceptor);
|
|
362
218
|
return this;
|
|
363
219
|
}
|
|
364
|
-
/**
|
|
365
|
-
* Adiciona um ResponseMapper global para padronizar respostas.
|
|
366
|
-
* @param mapper
|
|
367
|
-
*/
|
|
368
220
|
withResponseMapper(mapper) {
|
|
369
221
|
this.globalInterceptors.push(new response_pattern_interceptor_1.ResponsePatternInterceptor(mapper));
|
|
370
222
|
return this;
|
|
@@ -375,6 +227,7 @@ class AppInitializer {
|
|
|
375
227
|
const allProviders = [
|
|
376
228
|
...(this.autoDiscoveredComponents?.providers ?? []),
|
|
377
229
|
...this.globalProviders,
|
|
230
|
+
...this.nexusClientProviders,
|
|
378
231
|
];
|
|
379
232
|
const allControllers = [
|
|
380
233
|
...(this.autoDiscoveredComponents?.controllers ?? []),
|
|
@@ -382,7 +235,7 @@ class AppInitializer {
|
|
|
382
235
|
];
|
|
383
236
|
let DynamicRootModule = class DynamicRootModule {
|
|
384
237
|
};
|
|
385
|
-
DynamicRootModule = __decorate([
|
|
238
|
+
DynamicRootModule = tslib_1.__decorate([
|
|
386
239
|
(0, common_1.Module)({
|
|
387
240
|
imports: rootImports,
|
|
388
241
|
controllers: allControllers,
|
|
@@ -431,3 +284,4 @@ class AppInitializer {
|
|
|
431
284
|
}
|
|
432
285
|
}
|
|
433
286
|
exports.AppInitializer = AppInitializer;
|
|
287
|
+
//# sourceMappingURL=app-initializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-initializer.js","sourceRoot":"","sources":["../../../src/core/app-initializer.ts"],"names":[],"mappings":";;;;AAAA,4BAA0B;AAE1B,uCAAqE;AAErE,2CAewB;AAGxB,2CAA8C;AAC9C,uCAQsB;AACtB,6CAKyB;AACzB,sEAAsC;AACtC,4DAA4B;AAE5B,mEAA6D;AAC7D,uEAA2D;AAC3D,0CAIqB;AACrB,wCAAoE;AACpE,0CAOqB;AACrB,+FAGsD;AAoDtD,MAAa,cAAc;IACjB,GAAG,CAAK;IACC,MAAM,CAAO;IACb,OAAO,CAAuB;IAC9B,MAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAElD,IAAI,GAAW,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;IACxD,YAAY,CAAU;IACtB,iBAAiB,CAAqB;IACtC,WAAW,CAAe;IAC1B,cAAc,CAAkB;IACvB,cAAc,GAAwC,EAAE,CAAC;IACzD,OAAO,GAA2B,EAAE,CAAC;IACrC,cAAc,GAAgB,EAAE,CAAC;IAE1C,wBAAwB,CAI9B;IACe,eAAe,GAAe,EAAE,CAAC;IACjC,oBAAoB,GAAe,EAAE,CAAC;IACtC,kBAAkB,GAAsB,EAAE,CAAC;IAC3C,2BAA2B,GAAW,EAAE,CAAC;IAE1D,YAAoB,MAAY,EAAE,OAA6B;QAC7D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAOM,sBAAsB,CAC3B,cAA4C;QAE5C,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,C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AE,CAAC;YACvC,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAC3C,IAAI,CAAC,GAAG,EACR,MAAM,EACN,IAAI,CAAC,cAAc,CAAC,eAAe,CACpC,CAAC;YAEF,uBAAa,CAAC,KAAK,CACjB,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,MAAM,EAClC,IAAI,CAAC,GAAG,EACR,QAAQ,EACR,IAAI,CAAC,cAAc,CAAC,aAAa,CAClC,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;QAEtD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,MAAM,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,0CAA0C,MAAM,IAAI,WAAW,EAAE,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA7fD,wCA6fC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
interface DiscoveredComponents {
|
|
4
|
+
providers: Type[];
|
|
5
|
+
controllers: Type[];
|
|
6
|
+
nexusClients: Type[];
|
|
7
|
+
}
|
|
8
|
+
type RequireFn = (id: string) => any;
|
|
9
|
+
export declare function discoverComponents(basePath: string, reflectorInst: Reflector, requireFn?: RequireFn): DiscoveredComponents;
|
|
10
|
+
export {};
|
|
@@ -3,15 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.discoverComponents = discoverComponents;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const glob_1 = require("glob");
|
|
6
|
-
|
|
7
|
-
* Descobre componentes NestJS (Providers e Controllers) em um diretório.
|
|
8
|
-
* @param basePath O diretório raiz para a varredura.
|
|
9
|
-
* @param reflectorInst Uma instância do Reflector.
|
|
10
|
-
* @param requireFn A função 'require' a ser usada (padrão: Node's require).
|
|
11
|
-
*/
|
|
6
|
+
const nexus_1 = require("@innv/nexus");
|
|
12
7
|
function discoverComponents(basePath, reflectorInst, requireFn = require) {
|
|
13
8
|
const providers = [];
|
|
14
9
|
const controllers = [];
|
|
10
|
+
const nexusClients = [];
|
|
15
11
|
const files = (0, glob_1.globSync)((0, path_1.join)(basePath, '**/*.{ts,js}'), {
|
|
16
12
|
ignore: [
|
|
17
13
|
'**/*.module.{ts,js}',
|
|
@@ -34,13 +30,15 @@ function discoverComponents(basePath, reflectorInst, requireFn = require) {
|
|
|
34
30
|
else if (reflectorInst.get('__injectable__', exportedClass)) {
|
|
35
31
|
providers.push(exportedClass);
|
|
36
32
|
}
|
|
33
|
+
else if (reflectorInst.get(nexus_1.API_CLIENT_META_KEY, exportedClass)) {
|
|
34
|
+
nexusClients.push(exportedClass);
|
|
35
|
+
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40
38
|
}
|
|
41
39
|
catch (_) {
|
|
42
|
-
// Ignora erros
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
return { providers, controllers };
|
|
42
|
+
return { providers, controllers, nexusClients };
|
|
46
43
|
}
|
|
44
|
+
//# sourceMappingURL=auto-discovery.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-discovery.helper.js","sourceRoot":"","sources":["../../../src/core/auto-discovery.helper.ts"],"names":[],"mappings":";;AAsBA,gDA4CC;AAlED,+BAA4B;AAG5B,+BAAgC;AAGhC,uCAAkD;AAgBlD,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,aAAwB,EACxB,YAA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 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateConfig = validateConfig;
|
|
4
4
|
const class_transformer_1 = require("class-transformer");
|
|
5
5
|
const class_validator_1 = require("class-validator");
|
|
6
|
-
/**
|
|
7
|
-
* Valida um objeto de configuração (ex: process.env) contra uma classe de schema.
|
|
8
|
-
* Se a validação falhar, lança um erro detalhado.
|
|
9
|
-
* @param config O objeto de configuração a ser validado (geralmente process.env).
|
|
10
|
-
* @param schema A classe de schema com decoradores do class-validator.
|
|
11
|
-
* @returns O objeto de configuração validado e transformado.
|
|
12
|
-
*/
|
|
13
6
|
function validateConfig(config, schema) {
|
|
14
7
|
const validatedConfig = (0, class_transformer_1.plainToInstance)(schema, config, {
|
|
15
8
|
enableImplicitConversion: true,
|
|
@@ -26,3 +19,4 @@ function validateConfig(config, schema) {
|
|
|
26
19
|
}
|
|
27
20
|
return validatedConfig;
|
|
28
21
|
}
|
|
22
|
+
//# sourceMappingURL=config-validator.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validator.helper.js","sourceRoot":"","sources":["../../../src/core/config-validator.helper.ts"],"names":[],"mappings":";;AAWA,wCAsBC;AAhCD,yDAAoD;AACpD,qDAA+C;AAS/C,SAAgB,cAAc,CAC5B,MAA2B,EAC3B,MAAe;IAEf,MAAM,eAAe,GAAG,IAAA,mCAAe,EAAC,MAAM,EAAE,MAAM,EAAE;QACtD,wBAAwB,EAAE,IAAI;QAC9B,uBAAuB,EAAE,IAAI;KAC9B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,8BAAY,EAAC,eAAe,EAAE;QAC3C,qBAAqB,EAAE,KAAK;KAC7B,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,MAAM;aACzB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAa,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './app-initializer';
|
package/dist/esm/core/index.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./app-initializer"), exports);
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HealthCheckService, MemoryHealthIndicator, TypeOrmHealthIndicator } from '@nestjs/terminus';
|
|
2
|
+
import * as terminusHealthCheckModule from './terminus-health-check.module';
|
|
3
|
+
export declare const HEALTH_CHECK_OPTIONS = "HEALTH_CHECK_OPTIONS";
|
|
4
|
+
export declare class HealthController {
|
|
5
|
+
private readonly options;
|
|
6
|
+
private readonly health;
|
|
7
|
+
private readonly db;
|
|
8
|
+
private readonly memory;
|
|
9
|
+
constructor(options: terminusHealthCheckModule.TerminusHealthCheckOptions, health: HealthCheckService, db: TypeOrmHealthIndicator, memory: MemoryHealthIndicator);
|
|
10
|
+
check(): Promise<import("@nestjs/terminus").HealthCheckResult>;
|
|
11
|
+
}
|