@liberstudio/cloudflare-list 2.2.7 → 2.2.9

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 CHANGED
@@ -37,6 +37,7 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
37
37
  logPath: "<logPath>",
38
38
  excludedPaths: "<excludedList>",
39
39
  silentPaths: "<silentList>",
40
+ verbose: false, // default: false — log solo riga breve; true = log completo con body, query, stack
40
41
  }),
41
42
  ],
42
43
  })
@@ -61,6 +62,7 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
61
62
  logPath: config.get<string>("CLOUDFLARE_LIST_LOG_PATH") || "/var/log/nestjs-attacks.log",
62
63
  excludedPaths: ["/api/health", "/api/webhook", /^\/api\/public\/.*/],
63
64
  silentPaths: ["/auth/me", "/auth/refresh"],
65
+ verbose: false, // default: false — log solo riga breve; true = log completo con body, query, stack
64
66
  }),
65
67
  }),
66
68
  ],
@@ -48,12 +48,12 @@ let AllExceptionsFilter = AllExceptionsFilter_1 = class AllExceptionsFilter {
48
48
  };
49
49
  /* const isMissingToken = message === "Invalid or missing token"; */
50
50
  if (!isSilentPath) {
51
+ const verbose = this.options?.verbose === true;
51
52
  if (status >= 500) {
52
- this.logger.error(`[${ip}] [${request.method}] ${request.url} → ${status}`, JSON.stringify(errorLog, null, 2));
53
+ this.logger.error(`[${ip}] [${request.method}] ${request.url} → ${status}`, verbose ? JSON.stringify(errorLog, null, 2) : undefined);
53
54
  }
54
55
  else {
55
- // this.logger.error(`[${ip}] [${request.method}] ${request.url} → ${status}`);
56
- this.logger.warn(`[${ip}] [${request.method}] ${request.url} → ${status}`, JSON.stringify(errorLog, null, 2));
56
+ this.logger.warn(`[${ip}] [${request.method}] ${request.url} → ${status}`, verbose ? JSON.stringify(errorLog, null, 2) : undefined);
57
57
  }
58
58
  }
59
59
  response.status(status).json({
@@ -6,6 +6,7 @@ export interface CloudflareAttacksOptions {
6
6
  logPath: string;
7
7
  excludedPaths?: (string | RegExp)[];
8
8
  silentPaths?: (string | RegExp)[];
9
+ verbose?: boolean;
9
10
  }
10
11
  export interface CloudflareAttacksAsyncOptions {
11
12
  imports?: any[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberstudio/cloudflare-list",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "Modulo NestJS per gestione IP List Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",