@buka/nestjs-kit 4.1.7 → 4.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.1.9](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.8...v4.1.9) (2026-05-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * authLogging should export ([0f0bf53](https://github.com/buka-ltd/npm.nestjs-kit/commit/0f0bf53ff992b9fdf13e8f4e3641f5869e929623))
9
+
10
+ ## [4.1.8](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.7...v4.1.8) (2026-05-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 修复dek缓存返回原始数据被删除后缓存损坏的问题 ([5761659](https://github.com/buka-ltd/npm.nestjs-kit/commit/57616596144eaacb9e9488ed26d441f45ef1d9ac))
16
+
3
17
  ## [4.1.7](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.6...v4.1.7) (2026-05-23)
4
18
 
5
19
 
package/dist/index.d.mts CHANGED
@@ -10,6 +10,7 @@ import { Logger, LoggerErrorInterceptor } from "nestjs-pino";
10
10
  import { Readable } from "node:stream";
11
11
  import * as _$type_fest0 from "type-fest";
12
12
  import { Class, JsonValue, ValueOf } from "type-fest";
13
+ import { IncomingMessage } from "http";
13
14
 
14
15
  //#region src/swagger-patcher/deep-objectify-queries.d.ts
15
16
  /**
@@ -18472,6 +18473,10 @@ interface LoggerModuleOptions {
18472
18473
  level?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
18473
18474
  /** 开发模式——启用 pino-pretty 彩色输出 */
18474
18475
  pretty?: boolean;
18476
+ /** pino-http autoLogging 配置,用于跳过指定路由的成功日志(错误日志不受影响) */
18477
+ autoLogging?: {
18478
+ ignore: (req: IncomingMessage) => boolean;
18479
+ };
18475
18480
  }
18476
18481
  //#endregion
18477
18482
  //#region src/modules/logger/logger.module.d.ts
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ import { Keq, KeqMiddleware, KeqOperation, KeqPathParameterInit, KeqQueryInit, K
9
9
  import { Base32, ErrorCategory, ErrorCategory as ErrorCategory$1, ErrorCode, ErrorCodeOptions } from "@buka/error-codes";
10
10
  import { Exception, ExceptionDetail, ExceptionDetail as ExceptionDetail$1, ExceptionOptions as ExceptionOptions$1 } from "@buka/exception";
11
11
  import { Logger, LoggerErrorInterceptor } from "nestjs-pino";
12
+ import { IncomingMessage } from "http";
12
13
  import { Readable } from "node:stream";
13
14
 
14
15
  //#region src/swagger-patcher/deep-objectify-queries.d.ts
@@ -18472,6 +18473,10 @@ interface LoggerModuleOptions {
18472
18473
  level?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
18473
18474
  /** 开发模式——启用 pino-pretty 彩色输出 */
18474
18475
  pretty?: boolean;
18476
+ /** pino-http autoLogging 配置,用于跳过指定路由的成功日志(错误日志不受影响) */
18477
+ autoLogging?: {
18478
+ ignore: (req: IncomingMessage) => boolean;
18479
+ };
18475
18480
  }
18476
18481
  //#endregion
18477
18482
  //#region src/modules/logger/logger.module.d.ts
package/dist/index.js CHANGED
@@ -9490,7 +9490,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
9490
9490
  const cacheKey = encryptedDek.toString("base64");
9491
9491
  if (ttl > 0) {
9492
9492
  const cached = this.dekCache.get(cacheKey);
9493
- if (cached && cached.expireAt > Date.now()) return Promise.resolve(cached.dek);
9493
+ if (cached && cached.expireAt > Date.now()) return Promise.resolve(Buffer.from(cached.dek));
9494
9494
  const inflight = this.dekDecryptingPromises.get(cacheKey);
9495
9495
  if (inflight) return inflight;
9496
9496
  }
@@ -9507,7 +9507,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
9507
9507
  });
9508
9508
  const dek = Buffer.from(dekResponse.data.plaintext, "base64");
9509
9509
  if (ttl > 0) this.dekCache.set(cacheKey, {
9510
- dek,
9510
+ dek: Buffer.from(dek),
9511
9511
  expireAt: Date.now() + ttl * 1e3
9512
9512
  });
9513
9513
  return dek;
@@ -9711,7 +9711,7 @@ let LoggerModule = _LoggerModule = class LoggerModule {
9711
9711
  ...pretty ? { transport: { target: "pino-pretty" } } : {},
9712
9712
  level,
9713
9713
  genReqId: (req) => req.headers["x-request-id"] || crypto.randomUUID(),
9714
- autoLogging: { ignore: (req) => req.url?.startsWith("/api/v1/health") ?? false },
9714
+ autoLogging: options.autoLogging,
9715
9715
  customAttributeKeys: {
9716
9716
  reqId: "reqId",
9717
9717
  responseTime: "responseTime"