@innv/nest-initializer 0.2.1 → 0.4.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/README.md +43 -41
- package/dist/cjs/core/app-initializer.d.ts +81 -0
- package/dist/cjs/core/app-initializer.js +22 -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-page.factory.d.ts +8 -0
- package/dist/cjs/features/index-page.factory.js +30 -0
- package/dist/cjs/features/index-page.factory.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 +7 -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 +81 -0
- package/dist/esm/core/app-initializer.js +22 -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-page.factory.d.ts +8 -0
- package/dist/esm/features/index-page.factory.js +30 -0
- package/dist/esm/features/index-page.factory.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 +7 -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 +4 -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/features/index-page.factory.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- 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 +26 -30
|
@@ -3,17 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TypeOrmMigrationPlugin = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
|
-
/**
|
|
7
|
-
* Um plugin do AppInitializer que executa automaticamente as migrations
|
|
8
|
-
* do TypeORM na inicialização da aplicação.
|
|
9
|
-
*/
|
|
10
6
|
class TypeOrmMigrationPlugin {
|
|
11
7
|
logger = new common_1.Logger(TypeOrmMigrationPlugin.name);
|
|
12
|
-
/**
|
|
13
|
-
* Método 'apply' que será chamado pelo AppInitializer durante o bootstrap.
|
|
14
|
-
* Este método é assíncrono para poder aguardar a conclusão das migrations.
|
|
15
|
-
* @param app A instância da aplicação NestJS.
|
|
16
|
-
*/
|
|
17
8
|
async apply(app) {
|
|
18
9
|
try {
|
|
19
10
|
const dataSource = app.get(typeorm_1.DataSource);
|
|
@@ -28,3 +19,4 @@ class TypeOrmMigrationPlugin {
|
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
21
|
exports.TypeOrmMigrationPlugin = TypeOrmMigrationPlugin;
|
|
22
|
+
//# sourceMappingURL=typeorm-migration.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm-migration.plugin.js","sourceRoot":"","sources":["../../../src/plugins/typeorm-migration.plugin.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAC1D,qCAAqC;AAQrC,MAAa,sBAAsB;IAChB,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAOlE,KAAK,CAAC,KAAK,CAAC,GAAqB;QAC/B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,oBAAU,CAAC,CAAC;YAEvC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;YAE1E,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC;YAEjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,mDAAmD,EACnD,KAAK,CACN,CAAC;YACF,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAzBD,wDAyBC"}
|
|
@@ -4,10 +4,6 @@ exports.createCachingStarter = createCachingStarter;
|
|
|
4
4
|
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
5
5
|
const config_1 = require("@nestjs/config");
|
|
6
6
|
const cache_manager_redis_store_1 = require("cache-manager-redis-store");
|
|
7
|
-
/**
|
|
8
|
-
* Cria o módulo dinâmico para o "Starter" de Cache.
|
|
9
|
-
* Configura o CacheModule para ser global e usar o Redis.
|
|
10
|
-
*/
|
|
11
7
|
function createCachingStarter(options = {}) {
|
|
12
8
|
const { redisUrlEnvKey = 'REDIS_URL', defaultTtlInSeconds = 300 } = options;
|
|
13
9
|
return cache_manager_1.CacheModule.registerAsync({
|
|
@@ -25,3 +21,4 @@ function createCachingStarter(options = {}) {
|
|
|
25
21
|
},
|
|
26
22
|
});
|
|
27
23
|
}
|
|
24
|
+
//# sourceMappingURL=caching.starter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caching.starter.js","sourceRoot":"","sources":["../../../src/starters/caching.starter.ts"],"names":[],"mappings":";;AAwBA,oDAqBC;AA7CD,yDAAoD;AACpD,2CAA+C;AAC/C,yEAAuD;AAsBvD,SAAgB,oBAAoB,CAAC,UAAiC,EAAE;IACtE,MAAM,EAAE,cAAc,GAAG,WAAW,EAAE,mBAAmB,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAE5E,OAAO,2BAAW,CAAC,aAAa,CAAC;QAC/B,QAAQ,EAAE,IAAI;QAEd,OAAO,EAAE,EAAE;QAEX,MAAM,EAAE,CAAC,sBAAa,CAAC;QAEvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE;YACjD,MAAM,KAAK,GAAG,MAAM,IAAA,sCAAU,EAAC;gBAC7B,GAAG,EAAE,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC;aAC/C,CAAC,CAAC;YAEH,OAAO;gBACL,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK;gBAClB,GAAG,EAAE,mBAAmB;aACzB,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,19 +1,7 @@
|
|
|
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
|
-
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./typeorm.starter"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./mongoose.starter"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./caching.starter"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/starters/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,6DAAmC;AACnC,4DAAkC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MongooseModuleOptions } from '@nestjs/mongoose';
|
|
2
|
+
export interface MongooseStarterOptions {
|
|
3
|
+
uriEnvKey?: string;
|
|
4
|
+
mongooseOptions?: Omit<MongooseModuleOptions, 'uri'>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createMongooseStarter(options?: MongooseStarterOptions): {
|
|
7
|
+
module: import("@nestjs/common").DynamicModule;
|
|
8
|
+
plugins: never[];
|
|
9
|
+
};
|
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createMongooseStarter = createMongooseStarter;
|
|
4
4
|
const config_1 = require("@nestjs/config");
|
|
5
5
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
6
|
-
/**
|
|
7
|
-
* Cria o módulo dinâmico para o "Starter" de Mongoose.
|
|
8
|
-
* Configura o MongooseModule para ser global e usar a URI do .env.
|
|
9
|
-
*/
|
|
10
6
|
function createMongooseStarter(options = {}) {
|
|
11
7
|
const { uriEnvKey = 'MONGO_URI', mongooseOptions = {} } = options;
|
|
12
8
|
const mongooseDynamicModule = mongoose_1.MongooseModule.forRootAsync({
|
|
@@ -22,3 +18,4 @@ function createMongooseStarter(options = {}) {
|
|
|
22
18
|
plugins: [],
|
|
23
19
|
};
|
|
24
20
|
}
|
|
21
|
+
//# sourceMappingURL=mongoose.starter.js.map
|
|
@@ -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,81 @@
|
|
|
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
|
+
import { IndexPageOptions } from '../features/index-page.factory';
|
|
10
|
+
export interface AppInitializerPlugin {
|
|
11
|
+
apply(app: INestApplication): Promise<void> | void;
|
|
12
|
+
}
|
|
13
|
+
export type SwaggerDocumentTags = {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
};
|
|
17
|
+
export type SwaggerOptions = {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
version: string;
|
|
21
|
+
tags?: SwaggerDocumentTags[];
|
|
22
|
+
path?: string;
|
|
23
|
+
documentOptions?: SwaggerDocumentOptions;
|
|
24
|
+
customOptions?: SwaggerCustomOptions;
|
|
25
|
+
};
|
|
26
|
+
type AppConfigurator<T extends INestApplication> = (app: AppInitializer<T>) => void;
|
|
27
|
+
export declare class AppInitializer<T extends INestApplication = INestApplication> {
|
|
28
|
+
private app;
|
|
29
|
+
private readonly module;
|
|
30
|
+
private readonly adapter?;
|
|
31
|
+
private readonly logger;
|
|
32
|
+
private port;
|
|
33
|
+
private globalPrefix?;
|
|
34
|
+
private versioningOptions?;
|
|
35
|
+
private corsOptions?;
|
|
36
|
+
private swaggerOptions?;
|
|
37
|
+
private readonly setupFunctions;
|
|
38
|
+
private readonly plugins;
|
|
39
|
+
private readonly featureModules;
|
|
40
|
+
private autoDiscoveredComponents?;
|
|
41
|
+
private readonly globalProviders;
|
|
42
|
+
private readonly nexusClientProviders;
|
|
43
|
+
private readonly globalInterceptors;
|
|
44
|
+
private readonly factoryGeneratedControllers;
|
|
45
|
+
private constructor();
|
|
46
|
+
useDevelopmentDefaults(swaggerOptions: Omit<SwaggerOptions, 'path'>): this;
|
|
47
|
+
useProductionDefaults(): this;
|
|
48
|
+
when(condition: boolean, configure: (builder: this) => void): this;
|
|
49
|
+
withHealthCheck(options: TerminusHealthCheckOptions): this;
|
|
50
|
+
withMetrics(): this;
|
|
51
|
+
static bootstrap<T extends INestApplication = INestApplication>(module: Type, configurator: AppConfigurator<T>): Promise<void>;
|
|
52
|
+
static bootstrap<T extends INestApplication = INestApplication>(module: Type, adapter: AbstractHttpAdapter, configurator: AppConfigurator<T>): Promise<void>;
|
|
53
|
+
onPort(port: number): this;
|
|
54
|
+
withPlugin(plugin: AppInitializerPlugin): this;
|
|
55
|
+
withVersioning(options: VersioningOptions): this;
|
|
56
|
+
withGlobalPrefix(prefix: string): this;
|
|
57
|
+
withCors(options?: CorsOptions): this;
|
|
58
|
+
withValidationPipe(options?: ValidationPipeOptions): this;
|
|
59
|
+
useGlobalPipe(pipe: Type<PipeTransform>): this;
|
|
60
|
+
useGlobalFilter(filter: Type<ExceptionFilter>): this;
|
|
61
|
+
useGlobalGuard(guard: Type<CanActivate>): this;
|
|
62
|
+
useGlobalInterceptor(interceptor: Type<NestInterceptor>): this;
|
|
63
|
+
withClassSerializer(): this;
|
|
64
|
+
withSwagger(options: SwaggerOptions): this;
|
|
65
|
+
withGracefulShutdown(): this;
|
|
66
|
+
useHelmet(): this;
|
|
67
|
+
enableCompression(): this;
|
|
68
|
+
withValidatedConfig<T extends object>(schema: Type<T>): this;
|
|
69
|
+
withTypeOrm(options?: TypeOrmStarterOptions): this;
|
|
70
|
+
withMongoose(options?: MongooseStarterOptions): this;
|
|
71
|
+
withCaching(options?: CachingStarterOptions): this;
|
|
72
|
+
getApp(): T;
|
|
73
|
+
withAutoDiscovery(options: {
|
|
74
|
+
basePath: string;
|
|
75
|
+
}): this;
|
|
76
|
+
withIndexPage(options?: IndexPageOptions): this;
|
|
77
|
+
addGlobalInterceptor(interceptor: NestInterceptor): this;
|
|
78
|
+
withResponseMapper<T>(mapper: ResponseMapper<T>): this;
|
|
79
|
+
private listen;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -1,31 +1,22 @@
|
|
|
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
|
-
*/
|
|
19
|
+
const index_page_factory_1 = require("../features/index-page.factory");
|
|
29
20
|
class AppInitializer {
|
|
30
21
|
app;
|
|
31
22
|
module;
|
|
@@ -39,29 +30,20 @@ class AppInitializer {
|
|
|
39
30
|
setupFunctions = [];
|
|
40
31
|
plugins = [];
|
|
41
32
|
featureModules = [];
|
|
42
|
-
advancedSwaggerUiOptions;
|
|
43
33
|
autoDiscoveredComponents;
|
|
44
34
|
globalProviders = [];
|
|
35
|
+
nexusClientProviders = [];
|
|
45
36
|
globalInterceptors = [];
|
|
46
37
|
factoryGeneratedControllers = [];
|
|
47
38
|
constructor(module, adapter) {
|
|
48
39
|
this.module = module;
|
|
49
40
|
this.adapter = adapter;
|
|
50
41
|
}
|
|
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
42
|
useDevelopmentDefaults(swaggerOptions) {
|
|
57
43
|
this.withSwagger({ ...swaggerOptions, path: 'docs' });
|
|
58
44
|
this.withPlugin(new plugins_1.RequestLoggerPlugin());
|
|
59
45
|
return this;
|
|
60
46
|
}
|
|
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
47
|
useProductionDefaults() {
|
|
66
48
|
this.useHelmet();
|
|
67
49
|
this.enableCompression();
|
|
@@ -69,11 +51,6 @@ class AppInitializer {
|
|
|
69
51
|
this.withPlugin(new plugins_1.RateLimiterPlugin());
|
|
70
52
|
return this;
|
|
71
53
|
}
|
|
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
54
|
when(condition, configure) {
|
|
78
55
|
if (condition) {
|
|
79
56
|
configure(this);
|
|
@@ -84,21 +61,10 @@ class AppInitializer {
|
|
|
84
61
|
this.featureModules.push(features_1.TerminusHealthCheckModule.forRoot(options));
|
|
85
62
|
return this;
|
|
86
63
|
}
|
|
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
64
|
withMetrics() {
|
|
93
65
|
this.featureModules.push(features_1.MetricsModule.forRoot());
|
|
94
66
|
return this;
|
|
95
67
|
}
|
|
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
68
|
static async bootstrap(module, adapterOrConfigurator, configurator) {
|
|
103
69
|
const isExpress = typeof adapterOrConfigurator === 'function';
|
|
104
70
|
const adapter = isExpress ? undefined : adapterOrConfigurator;
|
|
@@ -122,51 +88,26 @@ class AppInitializer {
|
|
|
122
88
|
process.exit(1);
|
|
123
89
|
}
|
|
124
90
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Define a porta em que a aplicação vai rodar.
|
|
127
|
-
* @param port O número da porta.
|
|
128
|
-
*/
|
|
129
91
|
onPort(port) {
|
|
130
92
|
this.port = port;
|
|
131
93
|
return this;
|
|
132
94
|
}
|
|
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
95
|
withPlugin(plugin) {
|
|
138
96
|
this.plugins.push(plugin);
|
|
139
97
|
return this;
|
|
140
98
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Habilita e configura o versionamento da API.
|
|
143
|
-
* @param options As opções de versionamento do NestJS.
|
|
144
|
-
*/
|
|
145
99
|
withVersioning(options) {
|
|
146
100
|
this.versioningOptions = options;
|
|
147
101
|
return this;
|
|
148
102
|
}
|
|
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
103
|
withGlobalPrefix(prefix) {
|
|
154
104
|
this.globalPrefix = prefix.startsWith('/') ? prefix : `/${prefix}`;
|
|
155
105
|
return this;
|
|
156
106
|
}
|
|
157
|
-
/**
|
|
158
|
-
* Habilita e configura o Cross-Origin Resource Sharing (CORS).
|
|
159
|
-
* @param options As opções de configuração do CORS.
|
|
160
|
-
*/
|
|
161
107
|
withCors(options = {}) {
|
|
162
108
|
this.corsOptions = options;
|
|
163
109
|
return this;
|
|
164
110
|
}
|
|
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
111
|
withValidationPipe(options = {}) {
|
|
171
112
|
const defaultOptions = {
|
|
172
113
|
whitelist: true,
|
|
@@ -181,11 +122,6 @@ class AppInitializer {
|
|
|
181
122
|
});
|
|
182
123
|
return this;
|
|
183
124
|
}
|
|
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
125
|
useGlobalPipe(pipe) {
|
|
190
126
|
this.globalProviders.push({
|
|
191
127
|
provide: core_1.APP_PIPE,
|
|
@@ -193,11 +129,6 @@ class AppInitializer {
|
|
|
193
129
|
});
|
|
194
130
|
return this;
|
|
195
131
|
}
|
|
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
132
|
useGlobalFilter(filter) {
|
|
202
133
|
this.globalProviders.push({
|
|
203
134
|
provide: core_1.APP_FILTER,
|
|
@@ -205,11 +136,6 @@ class AppInitializer {
|
|
|
205
136
|
});
|
|
206
137
|
return this;
|
|
207
138
|
}
|
|
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
139
|
useGlobalGuard(guard) {
|
|
214
140
|
this.globalProviders.push({
|
|
215
141
|
provide: core_1.APP_GUARD,
|
|
@@ -217,11 +143,6 @@ class AppInitializer {
|
|
|
217
143
|
});
|
|
218
144
|
return this;
|
|
219
145
|
}
|
|
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
146
|
useGlobalInterceptor(interceptor) {
|
|
226
147
|
this.globalProviders.push({
|
|
227
148
|
provide: core_1.APP_INTERCEPTOR,
|
|
@@ -229,11 +150,6 @@ class AppInitializer {
|
|
|
229
150
|
});
|
|
230
151
|
return this;
|
|
231
152
|
}
|
|
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
153
|
withClassSerializer() {
|
|
238
154
|
this.globalProviders.push({
|
|
239
155
|
provide: core_1.APP_INTERCEPTOR,
|
|
@@ -241,56 +157,22 @@ class AppInitializer {
|
|
|
241
157
|
});
|
|
242
158
|
return this;
|
|
243
159
|
}
|
|
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
160
|
withSwagger(options) {
|
|
249
161
|
this.swaggerOptions = { path: 'docs', ...options };
|
|
250
162
|
return this;
|
|
251
163
|
}
|
|
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
164
|
withGracefulShutdown() {
|
|
271
165
|
this.setupFunctions.push((app) => app.enableShutdownHooks());
|
|
272
166
|
return this;
|
|
273
167
|
}
|
|
274
|
-
/**
|
|
275
|
-
* Adiciona o middleware de segurança Helmet com configurações padrão.
|
|
276
|
-
*/
|
|
277
168
|
useHelmet() {
|
|
278
169
|
this.setupFunctions.push((app) => app.use((0, helmet_1.default)()));
|
|
279
170
|
return this;
|
|
280
171
|
}
|
|
281
|
-
/**
|
|
282
|
-
* Adiciona o middleware de compressão (gzip) para as respostas.
|
|
283
|
-
*/
|
|
284
172
|
enableCompression() {
|
|
285
173
|
this.setupFunctions.push((app) => app.use((0, compression_1.default)()));
|
|
286
174
|
return this;
|
|
287
175
|
}
|
|
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
176
|
withValidatedConfig(schema) {
|
|
295
177
|
const configModule = config_1.ConfigModule.forRoot({
|
|
296
178
|
isGlobal: true,
|
|
@@ -299,10 +181,6 @@ class AppInitializer {
|
|
|
299
181
|
this.featureModules.push(configModule);
|
|
300
182
|
return this;
|
|
301
183
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Configura e registra automaticamente o TypeOrmModule (Estilo "Starter").
|
|
304
|
-
* @param options Opções para o "Starter" de TypeORM.
|
|
305
|
-
*/
|
|
306
184
|
withTypeOrm(options = {}) {
|
|
307
185
|
const starter = (0, starters_1.createTypeOrmStarter)(options);
|
|
308
186
|
this.featureModules.push(starter.module);
|
|
@@ -311,60 +189,40 @@ class AppInitializer {
|
|
|
311
189
|
}
|
|
312
190
|
return this;
|
|
313
191
|
}
|
|
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
192
|
withMongoose(options = {}) {
|
|
322
193
|
const starter = (0, starters_1.createMongooseStarter)(options);
|
|
323
194
|
this.featureModules.push(starter.module);
|
|
324
195
|
return this;
|
|
325
196
|
}
|
|
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
197
|
withCaching(options = {}) {
|
|
334
198
|
const cacheDynamicModule = (0, starters_1.createCachingStarter)(options);
|
|
335
199
|
this.featureModules.push(cacheDynamicModule);
|
|
336
200
|
return this;
|
|
337
201
|
}
|
|
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
202
|
getApp() {
|
|
343
203
|
return this.app;
|
|
344
204
|
}
|
|
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
205
|
withAutoDiscovery(options) {
|
|
352
206
|
const reflector = new core_1.Reflector();
|
|
353
207
|
this.autoDiscoveredComponents = (0, auto_discovery_helper_1.discoverComponents)(options.basePath, reflector);
|
|
208
|
+
if (this.autoDiscoveredComponents.nexusClients.length > 0) {
|
|
209
|
+
this.logger.log(`[Initializer] Auto-discovery encontrou ${this.autoDiscoveredComponents.nexusClients.length} clientes Nexus.`);
|
|
210
|
+
this.featureModules.push(nexus_1.NexusModule);
|
|
211
|
+
for (const clientClass of this.autoDiscoveredComponents.nexusClients) {
|
|
212
|
+
this.nexusClientProviders.push((0, nexus_1.createNexusClientProvider)(clientClass));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
withIndexPage(options = {}) {
|
|
218
|
+
const IndexController = (0, index_page_factory_1.createIndexPageController)(options);
|
|
219
|
+
this.factoryGeneratedControllers.push(IndexController);
|
|
354
220
|
return this;
|
|
355
221
|
}
|
|
356
|
-
/**
|
|
357
|
-
* Adiciona um Interceptor global diretamente (instância).
|
|
358
|
-
* @param interceptor
|
|
359
|
-
*/
|
|
360
222
|
addGlobalInterceptor(interceptor) {
|
|
361
223
|
this.globalInterceptors.push(interceptor);
|
|
362
224
|
return this;
|
|
363
225
|
}
|
|
364
|
-
/**
|
|
365
|
-
* Adiciona um ResponseMapper global para padronizar respostas.
|
|
366
|
-
* @param mapper
|
|
367
|
-
*/
|
|
368
226
|
withResponseMapper(mapper) {
|
|
369
227
|
this.globalInterceptors.push(new response_pattern_interceptor_1.ResponsePatternInterceptor(mapper));
|
|
370
228
|
return this;
|
|
@@ -375,6 +233,7 @@ class AppInitializer {
|
|
|
375
233
|
const allProviders = [
|
|
376
234
|
...(this.autoDiscoveredComponents?.providers ?? []),
|
|
377
235
|
...this.globalProviders,
|
|
236
|
+
...this.nexusClientProviders,
|
|
378
237
|
];
|
|
379
238
|
const allControllers = [
|
|
380
239
|
...(this.autoDiscoveredComponents?.controllers ?? []),
|
|
@@ -382,7 +241,7 @@ class AppInitializer {
|
|
|
382
241
|
];
|
|
383
242
|
let DynamicRootModule = class DynamicRootModule {
|
|
384
243
|
};
|
|
385
|
-
DynamicRootModule = __decorate([
|
|
244
|
+
DynamicRootModule = tslib_1.__decorate([
|
|
386
245
|
(0, common_1.Module)({
|
|
387
246
|
imports: rootImports,
|
|
388
247
|
controllers: allControllers,
|
|
@@ -431,3 +290,4 @@ class AppInitializer {
|
|
|
431
290
|
}
|
|
432
291
|
}
|
|
433
292
|
exports.AppInitializer = AppInitializer;
|
|
293
|
+
//# 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;AACtD,uEAGwC;AAoDxC,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,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C"}
|
|
@@ -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 {};
|