logixia 1.6.3 → 1.6.4

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.
@@ -1,11 +1,16 @@
1
1
  import { a as __toESM, r as __require, t as __commonJS } from "./chunk-uEZWKkIX.mjs";
2
- import { d as internalLog, f as internalWarn, t as TransportManager, u as internalError } from "./transport.manager-D-wsr3QW.mjs";
2
+ import { d as internalLog, f as internalWarn, t as TransportManager, u as internalError } from "./transport.manager-BCnLEmOy.mjs";
3
3
  import buildFastStringify from "fast-json-stringify";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
- import crypto$1 from "crypto";
5
+ import { randomUUID } from "node:crypto";
6
+ import crypto from "crypto";
6
7
  import { Injectable, Module, RequestMethod, Scope } from "@nestjs/common";
7
8
 
8
9
  //#region src/context/async-context.ts
10
+ /** Short request-scoped ID — uses Node's built-in crypto, never the global. */
11
+ function randomShortId() {
12
+ return randomUUID().slice(0, 8);
13
+ }
9
14
  const _storage = new AsyncLocalStorage();
10
15
  const LogixiaContext = {
11
16
  run(store, callback) {
@@ -43,7 +48,7 @@ function createExpressContextMiddleware(options = {}) {
43
48
  const headers = req["headers"] ?? {};
44
49
  const traceId = headers[traceIdHeader];
45
50
  const base = {
46
- requestId: headers[requestIdHeader] ?? crypto.randomUUID().slice(0, 8),
51
+ requestId: headers[requestIdHeader] ?? randomShortId(),
47
52
  ...traceId !== void 0 ? { traceId } : {}
48
53
  };
49
54
  LogixiaContext.run({
@@ -63,7 +68,7 @@ function createFastifyContextHook(options = {}) {
63
68
  const headers = request["headers"] ?? {};
64
69
  const traceId = headers[traceIdHeader];
65
70
  const base = {
66
- requestId: headers[requestIdHeader] ?? request["id"] ?? crypto.randomUUID().slice(0, 8),
71
+ requestId: headers[requestIdHeader] ?? request["id"] ?? randomShortId(),
67
72
  ...traceId !== void 0 ? { traceId } : {}
68
73
  };
69
74
  LogixiaContext.run({
@@ -761,7 +766,7 @@ const rnds8Pool = new Uint8Array(256);
761
766
  let poolPtr = rnds8Pool.length;
762
767
  function rng() {
763
768
  if (poolPtr > rnds8Pool.length - 16) {
764
- crypto$1.randomFillSync(rnds8Pool);
769
+ crypto.randomFillSync(rnds8Pool);
765
770
  poolPtr = 0;
766
771
  }
767
772
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
@@ -781,7 +786,7 @@ function unsafeStringify(arr, offset = 0) {
781
786
 
782
787
  //#endregion
783
788
  //#region node_modules/uuid/dist/esm-node/native.js
784
- var native_default = { randomUUID: crypto$1.randomUUID };
789
+ var native_default = { randomUUID: crypto.randomUUID };
785
790
 
786
791
  //#endregion
787
792
  //#region node_modules/uuid/dist/esm-node/v4.js
@@ -10894,4 +10899,4 @@ LogixiaLoggerModule = _LogixiaLoggerModule = __decorate([Module({})], LogixiaLog
10894
10899
 
10895
10900
  //#endregion
10896
10901
  export { isError as A, createExpressContextMiddleware as B, resetShutdownHandlers as C, getActiveOtelContext as D, disableOtelBridge as E, LogLevel as F, PluginRegistry as I, globalPluginRegistry as L, serializeError as M, DEFAULT_LOG_COLORS as N, getOtelMetaFields as O, DEFAULT_LOG_LEVELS as P, usePlugin as R, registerForShutdown as S, redactObject as T, createFastifyContextHook as V, runWithTraceId as _, TraceMiddleware as a, deregisterFromShutdown as b, __decorate as c, createLogger as d, DEFAULT_TRACE_HEADERS$1 as f, getCurrentTraceId as g, generateTraceId as h, WebSocketTraceInterceptor as i, normalizeError as j, initOtelBridge as k, __decorateMetadata as l, extractTraceId as m, LOGIXIA_LOGGER_PREFIX as n, KafkaTraceInterceptor as o, createTraceMiddleware as p, LogixiaLoggerModule as r, LogixiaLoggerService as s, LOGIXIA_LOGGER_CONFIG as t, LogixiaLogger as u, setTraceId as v, applyRedaction as w, flushOnExit as x, traceStorage as y, LogixiaContext as z };
10897
- //# sourceMappingURL=logitron-logger.module-BfeerFYH.mjs.map
10902
+ //# sourceMappingURL=logitron-logger.module-Doeo-Bfk.mjs.map