rl-core-api 0.15.0 → 0.15.1

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.
@@ -5,5 +5,6 @@ export interface BootstrapOptions {
5
5
  description?: string;
6
6
  version?: string;
7
7
  uploadsDir?: string;
8
+ bodyParser?: "json" | "all";
8
9
  }
9
10
  export declare const bootstrapCore: (appModule: IEntryNestModule, options?: BootstrapOptions) => Promise<NestExpressApplication>;
@@ -15,6 +15,7 @@ const winston_config_1 = require("../logger/winston.config");
15
15
  const bootstrapCore = async (appModule, options = {}) => {
16
16
  const app = await core_1.NestFactory.create(appModule, {
17
17
  logger: (0, winston_config_1.createAppLogger)(),
18
+ bodyParser: false,
18
19
  });
19
20
  const env = app.get(env_service_1.EnvService);
20
21
  const logger = new common_1.Logger("Bootstrap");
@@ -24,6 +25,10 @@ const bootstrapCore = async (appModule, options = {}) => {
24
25
  app.enableVersioning({ type: common_1.VersioningType.URI, defaultVersion: "1" });
25
26
  app.use((0, helmet_1.default)({ contentSecurityPolicy: false }));
26
27
  app.use((0, cookie_parser_1.default)());
28
+ app.useBodyParser("json");
29
+ if (options.bodyParser === "all") {
30
+ app.useBodyParser("urlencoded", { extended: true });
31
+ }
27
32
  app.useStaticAssets((0, path_1.join)(process.cwd(), options.uploadsDir ?? "uploads"), {
28
33
  prefix: "/uploads/",
29
34
  setHeaders: (res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rl-core-api",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Core NestJS: autenticação com 2FA, RBAC, auditoria, notificações e listagens com filtro dinâmico",
5
5
  "author": "Rodrigo Liberti",
6
6
  "license": "MIT",