logixia 1.4.0 → 1.6.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.
Files changed (39) hide show
  1. package/README.md +76 -9
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/{index-Ium497V3.d.mts → index-C0sp2BVU.d.ts} +2 -2
  4. package/dist/index-C0sp2BVU.d.ts.map +1 -0
  5. package/dist/{index-t-ActikQ.d.ts → index-CNSfc_Or.d.mts} +2 -2
  6. package/dist/index-CNSfc_Or.d.mts.map +1 -0
  7. package/dist/index.d.mts +281 -5
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.d.ts +281 -5
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +225 -18
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +222 -20
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/{logitron-logger.module-CCnX7GwK.js → logitron-logger.module-B_VVi3P9.js} +74 -48
  16. package/dist/logitron-logger.module-B_VVi3P9.js.map +1 -0
  17. package/dist/{logitron-logger.module-C939PIEV.mjs → logitron-logger.module-BauCVR0-.mjs} +74 -48
  18. package/dist/logitron-logger.module-BauCVR0-.mjs.map +1 -0
  19. package/dist/{logitron-logger.module-SArymP6b.d.mts → logitron-logger.module-Cu7QdkAm.d.mts} +94 -33
  20. package/dist/logitron-logger.module-Cu7QdkAm.d.mts.map +1 -0
  21. package/dist/{logitron-logger.module-9vOhKWDG.d.ts → logitron-logger.module-NI0xuTJj.d.ts} +94 -33
  22. package/dist/logitron-logger.module-NI0xuTJj.d.ts.map +1 -0
  23. package/dist/middleware.d.mts +1 -1
  24. package/dist/middleware.d.ts +1 -1
  25. package/dist/nest.d.mts +2 -2
  26. package/dist/nest.d.ts +2 -2
  27. package/dist/nest.js +1 -1
  28. package/dist/nest.mjs +1 -1
  29. package/dist/testing.d.mts +1 -1
  30. package/dist/testing.d.ts +1 -1
  31. package/dist/transports.d.mts +1 -1
  32. package/dist/transports.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/dist/index-Ium497V3.d.mts.map +0 -1
  35. package/dist/index-t-ActikQ.d.ts.map +0 -1
  36. package/dist/logitron-logger.module-9vOhKWDG.d.ts.map +0 -1
  37. package/dist/logitron-logger.module-C939PIEV.mjs.map +0 -1
  38. package/dist/logitron-logger.module-CCnX7GwK.js.map +0 -1
  39. package/dist/logitron-logger.module-SArymP6b.d.mts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as SamplingConfig, E as TraceIdExtractorConfig, G as RequestTiming, H as HttpRequest, S as RequestContext, T as TraceIdConfig, U as HttpResponse, V as HttpError, W as RequestMetrics, _ as LogLevelString, a as Environment, b as NamespaceLevels, c as GracefulShutdownConfig, d as ILogger, f as ILoggerDefault, g as LogLevel, h as LogFieldKey, i as DEFAULT_LOG_LEVELS, l as IBaseLogger, m as LogEntry, n as CustomLevelMethods, o as ErrorSerializationOptions, p as LogColor, r as DEFAULT_LOG_COLORS, s as ExtractLevels, t as ContextData, u as ILogFormatter, v as LoggerConfig, w as TimingEntry, x as RedactConfig, y as LoggerWithLevels } from "./index-t-ActikQ.js";
2
- import { a as LogixiaOptionsFactory, c as LogixiaLoggerService, d as LogixiaPlugin, f as PluginRegistry, i as LogixiaLoggerModule, l as LogixiaLogger, m as usePlugin, n as LOGIXIA_LOGGER_PREFIX, o as WebSocketTraceInterceptor, p as globalPluginRegistry, r as LogixiaAsyncOptions, s as KafkaTraceInterceptor, t as LOGIXIA_LOGGER_CONFIG, u as createLogger$1 } from "./logitron-logger.module-9vOhKWDG.js";
1
+ import { C as SamplingConfig, E as TraceIdExtractorConfig, G as RequestTiming, H as HttpRequest, S as RequestContext, T as TraceIdConfig, U as HttpResponse, V as HttpError, W as RequestMetrics, _ as LogLevelString, a as Environment, b as NamespaceLevels, c as GracefulShutdownConfig, d as ILogger, f as ILoggerDefault, g as LogLevel, h as LogFieldKey, i as DEFAULT_LOG_LEVELS, l as IBaseLogger, m as LogEntry, n as CustomLevelMethods, o as ErrorSerializationOptions, p as LogColor, r as DEFAULT_LOG_COLORS, s as ExtractLevels, t as ContextData, u as ILogFormatter, v as LoggerConfig, w as TimingEntry, x as RedactConfig, y as LoggerWithLevels } from "./index-C0sp2BVU.js";
2
+ import { a as LogixiaOptionsFactory, c as LogixiaLoggerService, d as createLogger$1, f as LogixiaPlugin, h as usePlugin, i as LogixiaLoggerModule, l as LogixiaServiceWithLevels, m as globalPluginRegistry, n as LOGIXIA_LOGGER_PREFIX, o as WebSocketTraceInterceptor, p as PluginRegistry, r as LogixiaAsyncOptions, s as KafkaTraceInterceptor, t as LOGIXIA_LOGGER_CONFIG, u as LogixiaLogger } from "./logitron-logger.module-NI0xuTJj.js";
3
3
  import "./search-Cg_OasF-.js";
4
4
  import { ArgumentsHost, ExceptionFilter } from "@nestjs/common";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -60,8 +60,23 @@ interface LogMethodOptions {
60
60
  */
61
61
  declare function LogMethod(options?: LogMethodOptions): MethodDecorator;
62
62
  /**
63
- * Global NestJS exception filter that logs every unhandled exception with full
64
- * request context (method, URL, status) before delegating the response.
63
+ * Global NestJS exception filter that converts any exception into the standard
64
+ * `LogixiaErrorResponse` wire format and logs it with full request context.
65
+ *
66
+ * Handles three exception types in priority order:
67
+ * 1. `LogixiaException` — typed fields used directly
68
+ * 2. NestJS `HttpException` — status + message extracted
69
+ * 3. Unknown / plain Error — falls back to 500 `server_error`
70
+ *
71
+ * **Debug stripping in production:**
72
+ * The `debug` block is automatically stripped when `NODE_ENV === 'production'`.
73
+ *
74
+ * **Trace ID headers:**
75
+ * `X-Trace-ID` and `X-Request-ID` are echoed back on every error response so
76
+ * clients can correlate with server logs.
77
+ *
78
+ * **Retry-After header:**
79
+ * Automatically added for `429` responses (`Retry-After: 60`).
65
80
  *
66
81
  * Register in `main.ts`:
67
82
  * ```ts
@@ -543,6 +558,267 @@ interface SamplingStats {
543
558
  windowStart: number;
544
559
  }
545
560
  //#endregion
561
+ //#region src/exceptions/types.d.ts
562
+ /**
563
+ * Unified error response shape for logixia.
564
+ *
565
+ * Design-inspired by Stripe (`type` + `code` + `param`), GitHub (`details[]`),
566
+ * Twilio (`doc_url`), and Cloudflare (`success: false` envelope).
567
+ *
568
+ * The shape is intentionally framework-agnostic — it works for HTTP, WebSocket,
569
+ * Queue/RPC, and any other transport. Your exception filter is responsible for
570
+ * serialising it onto the wire.
571
+ *
572
+ * @template TCode - Union of valid error code strings you define (e.g. `'PE-AUTH-001' | 'PE-USR-001'`).
573
+ * Defaults to `string` for untyped usage.
574
+ * @template TType - Union of valid error type strings you define (e.g. `'authentication_error' | 'validation_error'`).
575
+ * Defaults to `string` for untyped usage.
576
+ *
577
+ * @example Fully typed usage
578
+ * ```ts
579
+ * type AppCode = 'PE-AUTH-001' | 'PE-VAL-001';
580
+ * type AppType = 'authentication_error' | 'validation_error';
581
+ *
582
+ * const response: LogixiaErrorResponse<AppCode, AppType> = { ... };
583
+ * ```
584
+ */
585
+ interface LogixiaErrorResponse<TCode extends string = string, TType extends string = string> {
586
+ /** Always `false` — allows `if (response.success)` branching on the client. */
587
+ success: false;
588
+ error: {
589
+ /**
590
+ * Broad category that tells the client **how** to handle this error.
591
+ * e.g. `'validation_error'` → show field errors; `'authentication_error'` → redirect to login.
592
+ */
593
+ type: TType;
594
+ /**
595
+ * Machine-readable, stable error identifier.
596
+ * e.g. `'PE-AUTH-001'` — never changes; safe to switch/match on.
597
+ */
598
+ code: TCode;
599
+ /**
600
+ * Human-readable message shown to the end-user.
601
+ * May change between releases — do not rely on it programmatically.
602
+ */
603
+ message: string;
604
+ /**
605
+ * The specific request field that caused this error (Stripe pattern).
606
+ * e.g. `'email'` | `'metadata.name'`
607
+ */
608
+ param?: string;
609
+ /**
610
+ * Array of field-level errors for batch validation failures (GitHub pattern).
611
+ * Only present when more than one field is invalid.
612
+ */
613
+ details?: ErrorDetail[];
614
+ /**
615
+ * Documentation URL for this specific error (Twilio pattern).
616
+ * e.g. `'https://docs.example.com/errors/PE-AUTH-001'`
617
+ */
618
+ doc_url?: string;
619
+ };
620
+ meta: {
621
+ /** ULID / UUID-based request identifier for log correlation. */
622
+ request_id: string;
623
+ /** ISO 8601 timestamp of when the error was produced. */
624
+ timestamp: string;
625
+ /** Request path that caused the error. e.g. `'/api/v1/auth/login'` */
626
+ path: string;
627
+ /** HTTP status code mirrored in the body for clients that can't read headers. */
628
+ status: number;
629
+ };
630
+ /**
631
+ * Developer / diagnostic context.
632
+ *
633
+ * ⚠️ **Strip this in production.** The `ErrorResponseBuilder` always populates it
634
+ * (when possible); your exception filter should call `delete response.debug` before
635
+ * sending the response when `NODE_ENV === 'production'`.
636
+ */
637
+ debug?: {
638
+ /** Full stack trace of the underlying error. */
639
+ stack?: string;
640
+ /** Serialised `error.cause` (ES 2022 chained errors). */
641
+ cause?: string;
642
+ /** Originating micro-service name. e.g. `'gatekeeper'` | `'worker'` */
643
+ service?: string;
644
+ /** Wall-clock time in ms from `request.startTime` to error handling. */
645
+ duration_ms?: number;
646
+ };
647
+ }
648
+ /**
649
+ * A single field-level validation error (GitHub pattern).
650
+ *
651
+ * @example
652
+ * ```ts
653
+ * { field: 'email', message: 'must be a valid email address', code: 'invalid_format' }
654
+ * { field: 'password', message: 'required', code: 'required' }
655
+ * ```
656
+ */
657
+ interface ErrorDetail {
658
+ /** Dot-notation field path. e.g. `'email'` | `'user.address.zip'` */
659
+ field: string;
660
+ /** Human-readable reason this field failed. */
661
+ message: string;
662
+ /**
663
+ * Machine-readable failure code for this field.
664
+ * Suggested values: `'required'` | `'invalid_format'` | `'too_long'` | `'too_short'` |
665
+ * `'out_of_range'` | `'invalid_enum_value'` | `'duplicate'`
666
+ */
667
+ code: string;
668
+ }
669
+ //#endregion
670
+ //#region src/exceptions/builder.d.ts
671
+ /** Input parameters for `ErrorResponseBuilder.build`. */
672
+ interface BuildParams {
673
+ /** The caught exception — any type. */
674
+ exception: unknown;
675
+ /**
676
+ * Request / correlation ID to embed in `meta.request_id`.
677
+ * If omitted a UUID-based ID is auto-generated: `req_<uuid without dashes>`.
678
+ */
679
+ requestId?: string | undefined;
680
+ /** Request path. e.g. `'/api/v1/auth/login'` */
681
+ path: string;
682
+ /**
683
+ * Originating service name for `debug.service`.
684
+ * e.g. `process.env.SERVICE_NAME` → `'gatekeeper'`
685
+ */
686
+ service?: string | undefined;
687
+ /**
688
+ * `Date.now()` captured at the start of the request.
689
+ * When present, `debug.duration_ms` is computed automatically.
690
+ */
691
+ startTime?: number | undefined;
692
+ }
693
+ /**
694
+ * Generates a `req_` prefixed request ID using Node's built-in `crypto.randomUUID`.
695
+ * No extra dependencies required.
696
+ *
697
+ * @example `'req_550e8400e29b41d4a716446655440000'`
698
+ */
699
+ declare function generateRequestId(): string;
700
+ declare class ErrorResponseBuilder {
701
+ /**
702
+ * Build a `LogixiaErrorResponse` from any thrown value.
703
+ *
704
+ * @param params - See `BuildParams`.
705
+ * @returns The unified error response and the HTTP status code to send.
706
+ *
707
+ * @example In a NestJS exception filter
708
+ * ```ts
709
+ * const { response, httpStatus } = ErrorResponseBuilder.build<AppCode, AppType>({
710
+ * exception,
711
+ * requestId: request.headers['x-trace-id'] as string | undefined,
712
+ * path: request.url,
713
+ * service: process.env.SERVICE_NAME,
714
+ * startTime: request.startTime,
715
+ * });
716
+ *
717
+ * if (process.env.NODE_ENV === 'production') delete response.debug;
718
+ * response.setHeader('X-Trace-ID', response.meta.request_id);
719
+ * response.status(httpStatus).json(response);
720
+ * ```
721
+ */
722
+ static build<TCode extends string = string, TType extends string = string>(params: BuildParams): {
723
+ response: LogixiaErrorResponse<TCode, TType>;
724
+ httpStatus: number;
725
+ };
726
+ }
727
+ //#endregion
728
+ //#region src/exceptions/exception.d.ts
729
+ /**
730
+ * Constructor options for `LogixiaException`.
731
+ *
732
+ * All user-supplied fields — logixia only owns the wire format.
733
+ */
734
+ interface LogixiaExceptionOptions<TCode extends string = string, TType extends string = string> {
735
+ /**
736
+ * Machine-readable, stable error code.
737
+ * e.g. `'PE-AUTH-001'`
738
+ */
739
+ code: TCode;
740
+ /**
741
+ * Broad error type category.
742
+ * e.g. `'authentication_error'` | `'validation_error'` | `'rate_limit_error'`
743
+ */
744
+ type: TType;
745
+ /**
746
+ * HTTP status code to send on the wire.
747
+ * e.g. `401` | `400` | `429` | `500`
748
+ */
749
+ httpStatus: number;
750
+ /**
751
+ * Human-readable message for the end-user.
752
+ * This IS sent in the response body — keep it safe (no internal paths, etc.).
753
+ */
754
+ message: string;
755
+ /**
756
+ * The specific request field that caused this error (Stripe pattern).
757
+ * e.g. `'email'` | `'metadata.name'`
758
+ */
759
+ param?: string;
760
+ /**
761
+ * Array of per-field validation errors (GitHub pattern).
762
+ * Typically used for `400` / `422` validation failures.
763
+ */
764
+ details?: ErrorDetail[];
765
+ /**
766
+ * Documentation URL for this error (Twilio pattern).
767
+ * e.g. `'https://docs.example.com/errors/PE-AUTH-001'`
768
+ */
769
+ docUrl?: string;
770
+ /**
771
+ * Original error for ES 2022 cause chaining.
772
+ * Serialised into `debug.cause` by the `ErrorResponseBuilder`.
773
+ * Never sent to the client in production.
774
+ */
775
+ cause?: Error;
776
+ /**
777
+ * Arbitrary metadata for logging purposes only.
778
+ * This is **never** included in the HTTP response — it is passed to your
779
+ * logger / monitoring integrations through the exception object.
780
+ *
781
+ * @example
782
+ * ```ts
783
+ * metadata: { userId: 'u_abc', attemptCount: 3 }
784
+ * ```
785
+ */
786
+ metadata?: Record<string, unknown>;
787
+ }
788
+ declare class LogixiaException<TCode extends string = string, TType extends string = string> extends Error {
789
+ /** @readonly The machine-readable error code supplied by the caller. */
790
+ readonly errorCode: TCode;
791
+ /** @readonly The error type category supplied by the caller. */
792
+ readonly errorType: TType;
793
+ /** @readonly HTTP status code to respond with. */
794
+ readonly httpStatus: number;
795
+ /** @readonly Field pointer that caused this error (Stripe pattern). */
796
+ readonly param: string | undefined;
797
+ /** @readonly Field-level validation errors (GitHub pattern). */
798
+ readonly details: ErrorDetail[] | undefined;
799
+ /** @readonly Documentation URL for this error (Twilio pattern). */
800
+ readonly docUrl: string | undefined;
801
+ /**
802
+ * @readonly Extra context for your logger — never serialised into the HTTP response.
803
+ */
804
+ readonly metadata: Record<string, unknown> | undefined;
805
+ constructor(options: LogixiaExceptionOptions<TCode, TType>);
806
+ }
807
+ /**
808
+ * Returns `true` when `value` is a `LogixiaException` instance.
809
+ *
810
+ * Useful in exception filters or middleware that need to distinguish a
811
+ * `LogixiaException` from a plain `Error` or a framework `HttpException`.
812
+ *
813
+ * @example
814
+ * ```ts
815
+ * if (isLogixiaException(err)) {
816
+ * console.log(err.errorCode, err.httpStatus);
817
+ * }
818
+ * ```
819
+ */
820
+ declare function isLogixiaException<TCode extends string = string, TType extends string = string>(value?: unknown): value is LogixiaException<TCode, TType>;
821
+ //#endregion
546
822
  //#region src/metrics.d.ts
547
823
  /**
548
824
  * Increment a counter on each matching log entry.
@@ -800,5 +1076,5 @@ declare const logger: LogixiaLogger<{
800
1076
  outputs: string[];
801
1077
  }>;
802
1078
  //#endregion
803
- export { type CompiledSchema, ContextData, type CounterConfig, CustomLevelMethods, DEFAULT_CONFIG, DEFAULT_LOG_COLORS, DEFAULT_LOG_LEVELS, DEFAULT_TRACE_HEADERS, Environment, ErrorSerializationOptions, ExtractLevels, FlushOnExitOptions, type GaugeConfig, GracefulShutdownConfig, type HistogramConfig, HttpError, HttpRequest, HttpResponse, IBaseLogger, ILogFormatter, ILogger, ILoggerDefault, InjectLogger, JsonFormatter, KafkaTraceInterceptor, LOGIXIA_LOGGER_CONFIG, LOGIXIA_LOGGER_PREFIX, LogColor, type LogContext, LogEntry, type LogFieldDef, LogFieldKey, type LogFieldType, LogLevel, LogLevelString, LogMethod, type LogMethodOptions, type LogSchema, LoggerConfig, LoggerConfig as LoggerConfigInterface, type LoggerLike, LoggerWithLevels, LogixiaAsyncOptions, LogixiaContext, LogixiaExceptionFilter, LogixiaLogger, LogixiaLoggerModule, LogixiaLoggerService, LogixiaOptionsFactory, type LogixiaPlugin, type MetricConfig, type MetricsMap, MetricsPlugin, NamespaceLevels, type OtelBridgeOptions, type OtelSpanContext, PluginRegistry, type RedactConfig, RequestContext, RequestMetrics, RequestTiming, SamplingConfig, type SamplingStats, TextFormatter, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, type TypedLogger, WebSocketTraceInterceptor, applyRedaction, createExpressContextMiddleware, createFastifyContextHook, createLogger, createLoggerService, createMetricsPlugin, createTraceMiddleware, createTypedLogger, defineLogSchema, deregisterFromShutdown, disableOtelBridge, extractTraceId, flushOnExit, generateTraceId, getActiveOtelContext, getCurrentTraceId, getOtelMetaFields, globalPluginRegistry, initOtelBridge, isError, logger, normalizeError, redactObject, registerForShutdown, resetShutdownHandlers, runWithTraceId, serializeError, setTraceId, traceStorage, usePlugin };
1079
+ export { type BuildParams, type CompiledSchema, ContextData, type CounterConfig, CustomLevelMethods, DEFAULT_CONFIG, DEFAULT_LOG_COLORS, DEFAULT_LOG_LEVELS, DEFAULT_TRACE_HEADERS, Environment, type ErrorDetail, ErrorResponseBuilder, ErrorSerializationOptions, ExtractLevels, FlushOnExitOptions, type GaugeConfig, GracefulShutdownConfig, type HistogramConfig, HttpError, HttpRequest, HttpResponse, IBaseLogger, ILogFormatter, ILogger, ILoggerDefault, InjectLogger, JsonFormatter, KafkaTraceInterceptor, LOGIXIA_LOGGER_CONFIG, LOGIXIA_LOGGER_PREFIX, LogColor, type LogContext, LogEntry, type LogFieldDef, LogFieldKey, type LogFieldType, LogLevel, LogLevelString, LogMethod, type LogMethodOptions, type LogSchema, LoggerConfig, LoggerConfig as LoggerConfigInterface, type LoggerLike, LoggerWithLevels, LogixiaAsyncOptions, LogixiaContext, type LogixiaErrorResponse, LogixiaException, LogixiaExceptionFilter, type LogixiaExceptionOptions, LogixiaLogger, LogixiaLoggerModule, LogixiaLoggerService, LogixiaOptionsFactory, type LogixiaPlugin, LogixiaServiceWithLevels, type MetricConfig, type MetricsMap, MetricsPlugin, NamespaceLevels, type OtelBridgeOptions, type OtelSpanContext, PluginRegistry, type RedactConfig, RequestContext, RequestMetrics, RequestTiming, SamplingConfig, type SamplingStats, TextFormatter, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, type TypedLogger, WebSocketTraceInterceptor, applyRedaction, createExpressContextMiddleware, createFastifyContextHook, createLogger, createLoggerService, createMetricsPlugin, createTraceMiddleware, createTypedLogger, defineLogSchema, deregisterFromShutdown, disableOtelBridge, extractTraceId, flushOnExit, generateRequestId, generateTraceId, getActiveOtelContext, getCurrentTraceId, getOtelMetaFields, globalPluginRegistry, initOtelBridge, isError, isLogixiaException, logger, normalizeError, redactObject, registerForShutdown, resetShutdownHandlers, runWithTraceId, serializeError, setTraceId, traceStorage, usePlugin };
804
1080
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/core/nestjs-extras.ts","../src/formatters/json.formatter.ts","../src/formatters/text.formatter.ts","../src/utils/error.utils.ts","../src/utils/otel.ts","../src/utils/redact.utils.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/context/async-context.ts","../src/utils/sampling.utils.ts","../src/metrics.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AGqKA;AAaA;;;;AC5IA;AAWA;AA8DgB,cJ1DH,YI0DuB,EAAA,GAAA,GJ1DJ,kBI0DoC;AAkCpD,UJxFC,gBAAA,CIwFgB;EA8BjB;AAiBhB;;;;ECfgB;;;;;EA0DA,OAAA,CAAA,EAAA,OAAc;EACnB;;;;;;;ACpOX;;EAM6B,SAAA,CAAA,EAAA,OAAA;EAED;;AAC3B;EAYe,KAAA,CAAA,EAAA,MAAA;AAOhB;AAcA;AAwCA;;;;AC/EA;AAQA;AAOA;AAcA;AAQA;;;AAAiG,iBPiDjF,SAAA,COjDiF,OAAA,CAAA,EPiD9D,gBOjD8D,CAAA,EPiDtC,eOjDsC;;AAejG;AAwDA;AAWA;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A;IAIE,OAAA,EAAA,OAAA;IAEU,OAAA,EAAA,OAAA;IAED,OAAA,EAAA,OAAA;IAAO,OAAA,EAAA,OAAA;IAG9B,SAAS,EAAA,OAAA;EAUE,CAAA;EAOA,OAAA,EAAA,MAAA,EAAA;AAchB,CAAA;AAwCA;;;;AC/EA;AAQgB,cK4GH,YL5GkB,EAAA,OK4GN,cL5GM;AAO/B;AAcA;AAQA;;;AAAiG,iBKsFjF,mBAAA,CLtFiF,MAAA,CAAA,EKsFpD,OLtFoD,CKsF5C,YLtF4C,CAAA,CAAA,EKsF5B,oBLtF4B;;AAejG;AAwDA;AAWgB,cKWH,MLXG,EKWG,aLX2B,CAAA;;eK/Cd;;EJtCpB,MAAA,EAAA;IAEK,SAAA,EAAW,OAAA;IAQhB,QAAS,EAAA,OAAA;IAAiB,IAAA,EAAA,OAAA;EACxB,CAAA;EAAU,MAAA,EAAA,OAAA;EAAW,YAAA,EAAA;IAGlB,KAAA,EAAA,MAAc;IAAiB,MAAA,EAAA;MACnB,KAAA,EAAA,MAAA;MAAV,IAAA,EAAA,MAAA;MAMS,IAAA,EAAA,MAAA;MAAR,KAAA,EAAA,MAAA;MAAO,KAAA,EAAA,MAAA;MAWX,OAAA,EAAA,MAAe;IAAiB,CAAA;IAC5B,MAAA,EI8BX,MJ9BW,CAAA,MAAA,EI8BI,QJ9BJ,CAAA;EAAV,CAAA;EACQ,MAAA,EAAA;IAAf,SAAA,EAAA,OAAA;IAAc,KAAA,EAAA,OAAA;IAqCA,OAAA,EAAU,OAAA;IACD,OAAA,EAAA,OAAA;IAAc,OAAA,EAAA,OAAA;IAA0B,OAAA,EAAA,OAAA;IACnC,SAAA,EAAA,OAAA;EAA0B,CAAA;EAC1B,OAAA,EAAA,MAAA,EAAA;CAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/core/nestjs-extras.ts","../src/formatters/json.formatter.ts","../src/formatters/text.formatter.ts","../src/utils/error.utils.ts","../src/utils/otel.ts","../src/utils/redact.utils.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/context/async-context.ts","../src/utils/sampling.utils.ts","../src/exceptions/types.ts","../src/exceptions/builder.ts","../src/exceptions/exception.ts","../src/metrics.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AGqKA;AAaA;;;;AC5IA;AAWA;AA8DgB,cJxDH,YIwDuB,EAAA,GAAA,GJxDJ,kBIwDoC;AAkCpD,UJtFC,gBAAA,CIsFgB;EA8BjB;AAiBhB;;;;ECfgB;;;;;EA0DA,OAAA,CAAA,EAAA,OAAc;EACnB;;;;;;;ACpOX;;EAM6B,SAAA,CAAA,EAAA,OAAA;EAED;;AAC3B;EAYe,KAAA,CAAA,EAAA,MAAA;AAOhB;AAcA;AAwCA;;;;AC/EA;AAQA;AAOA;AAcA;AAQA;;;AAAiG,iBPmDjF,SAAA,COnDiF,OAAA,CAAA,EPmD9D,gBOnD8D,CAAA,EPmDtC,eOnDsC;;AAejG;AAwDA;AAWA;;;;ACrFA;AAEA;AAQA;;;;;AAIA;;;;;;;AAkBA;;;;AAEkB,cRuIL,sBAAA,YAAkC,eQvI7B,CAAA;EAAf,iBAAA,MAAA;EAAc,WAAA,CAAA,MAAA,CAAA,ER2Ia,oBQ3Ib,GAAA,SAAA;EAqCA,KAAA,CAAA,SAAU,EAAA,OAAA,EAAA,IAAA,ERyGO,aQzGP,CAAA,EAAA,IAAA;;;;cP7Gd,aAAA,YAAyB;;;;EDgDzB,QAAA,cAAkF;EAI9E,QAAA,cAAgB;EAwCjB,QAAA,WAAS;EAmHZ,WAAA,CAAA,QAAA,EAAA;IAIiB,gBAAA,CAAA,EAAA,OAAA;IAGI,YAAA,CAAA,EAAA,OAAA;IAPa,cAAA,CAAA,EAAA,OAAA;IAAe,cAAA,CAAA,EAAA,OAAA;;;;EC/MjD,MAAA,CAAA,KAAA,EA0BG,QA1BW,CAAA,EAAA,MA0BX;;;;;cC1BH,a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AAtB,EQmFmC,ORnFb,CQmFqB,YRnFrB,CAAA,CAAA,EQmFqC,oBRnFrC;AAsDhC;AAWA;;cQyBa,QAAM;;EP9GP,WAAA,EOoDoB,WPpDR;EAEP,OAAA,EAAA,OAAW;EAQhB,MAAA,EAAA;IAA0B,SAAA,EAAA,OAAA;IACxB,QAAA,EAAA,OAAA;IAAU,IAAA,EAAA,OAAA;EAAW,CAAA;EAGlB,MAAA,EAAA,OAAA;EAA+B,YAAA,EAAA;IACnB,KAAA,EAAA,MAAA;IAAV,MAAA,EAAA;MAMS,KAAA,EAAA,MAAA;MAAR,IAAA,EAAA,MAAA;MAAO,IAAA,EAAA,MAAA;MAWX,KAAA,EAAA,MAAe;MAAiB,KAAA,EAAA,MAAA;MAC5B,OAAA,EAAA,MAAA;IAAV,CAAA;IACQ,MAAA,EO2CT,MP3CS,CAAA,MAAA,EO2CM,QP3CN,CAAA;EAAf,CAAA;EAAc,MAAA,EAAA;IAqCA,SAAU,EAAA,OAAA;IACD,KAAA,EAAA,OAAA;IAAc,OAAA,EAAA,OAAA;IAA0B,OAAA,EAAA,OAAA;IACnC,OAAA,EAAA,OAAA;IAA0B,OAAA,EAAA,OAAA;IAC1B,SAAA,EAAA,OAAA;EAA0B,CAAA;EACzB,OAAA,EAAA,MAAA,EAAA;CAA0B,CAAA"}
package/dist/index.js CHANGED
@@ -1,10 +1,204 @@
1
1
  const require_chunk = require('./chunk-BTgCAUrQ.js');
2
- const require_logitron_logger_module = require('./logitron-logger.module-CCnX7GwK.js');
2
+ const require_logitron_logger_module = require('./logitron-logger.module-B_VVi3P9.js');
3
3
  const require_transport_manager = require('./transport.manager-DVTM978M.js');
4
4
  require('./search-DeZHhWxB.js');
5
5
  let __nestjs_common = require("@nestjs/common");
6
6
  __nestjs_common = require_chunk.__toESM(__nestjs_common);
7
+ let node_crypto = require("node:crypto");
8
+ node_crypto = require_chunk.__toESM(node_crypto);
7
9
 
10
+ //#region src/exceptions/exception.ts
11
+ var LogixiaException = class extends Error {
12
+ constructor(options) {
13
+ super(options.message, { cause: options.cause });
14
+ this.name = "LogixiaException";
15
+ this.errorCode = options.code;
16
+ this.errorType = options.type;
17
+ this.httpStatus = options.httpStatus;
18
+ this.param = options.param;
19
+ this.details = options.details;
20
+ this.docUrl = options.docUrl;
21
+ this.metadata = options.metadata;
22
+ Object.setPrototypeOf(this, new.target.prototype);
23
+ }
24
+ };
25
+ /**
26
+ * Returns `true` when `value` is a `LogixiaException` instance.
27
+ *
28
+ * Useful in exception filters or middleware that need to distinguish a
29
+ * `LogixiaException` from a plain `Error` or a framework `HttpException`.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * if (isLogixiaException(err)) {
34
+ * console.log(err.errorCode, err.httpStatus);
35
+ * }
36
+ * ```
37
+ */
38
+ function isLogixiaException(value) {
39
+ return value instanceof LogixiaException;
40
+ }
41
+
42
+ //#endregion
43
+ //#region src/exceptions/builder.ts
44
+ /**
45
+ * Generates a `req_` prefixed request ID using Node's built-in `crypto.randomUUID`.
46
+ * No extra dependencies required.
47
+ *
48
+ * @example `'req_550e8400e29b41d4a716446655440000'`
49
+ */
50
+ function generateRequestId() {
51
+ return `req_${(0, node_crypto.randomUUID)().replaceAll("-", "")}`;
52
+ }
53
+ /**
54
+ * Maps an HTTP status code to a human-friendly error type string.
55
+ * Used as a fallback when the exception is a generic `HttpException`.
56
+ */
57
+ function httpStatusToType(status) {
58
+ if (status === 400) return "api_error";
59
+ if (status === 401) return "authentication_error";
60
+ if (status === 402) return "payment_error";
61
+ if (status === 403) return "authorization_error";
62
+ if (status === 404) return "not_found_error";
63
+ if (status === 408) return "timeout_error";
64
+ if (status === 409) return "conflict_error";
65
+ if (status === 422) return "validation_error";
66
+ if (status === 429) return "rate_limit_error";
67
+ if (status >= 500) return "server_error";
68
+ if (status >= 400) return "api_error";
69
+ return "server_error";
70
+ }
71
+ /**
72
+ * Duck-type check for NestJS `HttpException`.
73
+ * Avoids a hard import on `@nestjs/common` so the builder is usable outside NestJS.
74
+ */
75
+ function isHttpException(value) {
76
+ return typeof value === "object" && value !== null && typeof value["getStatus"] === "function" && typeof value["getResponse"] === "function";
77
+ }
78
+ /**
79
+ * Builds the optional `debug` block from an error.
80
+ * Returns `undefined` when there is nothing useful to include.
81
+ */
82
+ function buildDebug(error, service, durationMs) {
83
+ const stack = error instanceof Error ? error.stack : void 0;
84
+ const causeRaw = error instanceof Error ? error.cause : void 0;
85
+ let cause;
86
+ if (causeRaw instanceof Error) cause = causeRaw.message;
87
+ else if (causeRaw !== void 0 && causeRaw !== null) cause = String(causeRaw);
88
+ if (!stack && !cause && !service && durationMs === void 0) return void 0;
89
+ return {
90
+ ...stack !== void 0 ? { stack } : {},
91
+ ...cause !== void 0 ? { cause } : {},
92
+ ...service !== void 0 ? { service } : {},
93
+ ...durationMs !== void 0 ? { duration_ms: durationMs } : {}
94
+ };
95
+ }
96
+ var ErrorResponseBuilder = class {
97
+ /**
98
+ * Build a `LogixiaErrorResponse` from any thrown value.
99
+ *
100
+ * @param params - See `BuildParams`.
101
+ * @returns The unified error response and the HTTP status code to send.
102
+ *
103
+ * @example In a NestJS exception filter
104
+ * ```ts
105
+ * const { response, httpStatus } = ErrorResponseBuilder.build<AppCode, AppType>({
106
+ * exception,
107
+ * requestId: request.headers['x-trace-id'] as string | undefined,
108
+ * path: request.url,
109
+ * service: process.env.SERVICE_NAME,
110
+ * startTime: request.startTime,
111
+ * });
112
+ *
113
+ * if (process.env.NODE_ENV === 'production') delete response.debug;
114
+ * response.setHeader('X-Trace-ID', response.meta.request_id);
115
+ * response.status(httpStatus).json(response);
116
+ * ```
117
+ */
118
+ static build(params) {
119
+ const { exception, path, service, startTime, requestId: rawRequestId } = params;
120
+ const requestId = rawRequestId ?? generateRequestId();
121
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
122
+ const durationMs = startTime !== void 0 ? Date.now() - startTime : void 0;
123
+ if (isLogixiaException(exception)) {
124
+ const debug$1 = buildDebug(exception, service, durationMs);
125
+ const errorBlock = {
126
+ type: exception.errorType,
127
+ code: exception.errorCode,
128
+ message: exception.message
129
+ };
130
+ if (exception.param !== void 0) errorBlock.param = exception.param;
131
+ if (exception.details !== void 0 && exception.details.length > 0) errorBlock.details = exception.details;
132
+ if (exception.docUrl !== void 0) errorBlock.doc_url = exception.docUrl;
133
+ return {
134
+ response: {
135
+ success: false,
136
+ error: errorBlock,
137
+ meta: {
138
+ request_id: requestId,
139
+ timestamp,
140
+ path,
141
+ status: exception.httpStatus
142
+ },
143
+ ...debug$1 !== void 0 ? { debug: debug$1 } : {}
144
+ },
145
+ httpStatus: exception.httpStatus
146
+ };
147
+ }
148
+ if (isHttpException(exception)) {
149
+ const status = exception.getStatus();
150
+ const exResponse = exception.getResponse();
151
+ let message;
152
+ if (typeof exResponse === "string") message = exResponse;
153
+ else if (typeof exResponse === "object" && exResponse !== null && "message" in exResponse) {
154
+ const raw = exResponse.message;
155
+ message = Array.isArray(raw) ? raw.join(", ") : String(raw);
156
+ } else message = exception.message;
157
+ const type = httpStatusToType(status);
158
+ const code = `HTTP_${status}`;
159
+ const debug$1 = buildDebug(exception, service, durationMs);
160
+ return {
161
+ response: {
162
+ success: false,
163
+ error: {
164
+ type,
165
+ code,
166
+ message
167
+ },
168
+ meta: {
169
+ request_id: requestId,
170
+ timestamp,
171
+ path,
172
+ status
173
+ },
174
+ ...debug$1 !== void 0 ? { debug: debug$1 } : {}
175
+ },
176
+ httpStatus: status
177
+ };
178
+ }
179
+ const debug = buildDebug(exception instanceof Error ? exception : new Error(String(exception)), service, durationMs);
180
+ return {
181
+ response: {
182
+ success: false,
183
+ error: {
184
+ type: "server_error",
185
+ code: "INTERNAL_SERVER_ERROR",
186
+ message: "An unexpected error occurred."
187
+ },
188
+ meta: {
189
+ request_id: requestId,
190
+ timestamp,
191
+ path,
192
+ status: 500
193
+ },
194
+ ...debug !== void 0 ? { debug } : {}
195
+ },
196
+ httpStatus: 500
197
+ };
198
+ }
199
+ };
200
+
201
+ //#endregion
8
202
  //#region \0@oxc-project+runtime@0.95.0/helpers/decorateParam.js
9
203
  function __decorateParam(paramIndex, decorator) {
10
204
  return function(target, key) {
@@ -84,26 +278,35 @@ let LogixiaExceptionFilter = class LogixiaExceptionFilter$1 {
84
278
  this.logger = logger$1;
85
279
  }
86
280
  catch(exception, host) {
281
+ var _request$headers;
87
282
  const ctx = host.switchToHttp();
88
- const response = ctx.getResponse();
89
283
  const request = ctx.getRequest();
90
- const isHttp = exception instanceof __nestjs_common.HttpException;
91
- const status = isHttp ? exception.getStatus() : 500;
92
- let message;
93
- if (isHttp) message = exception.message;
94
- else if (exception instanceof Error) message = exception.message;
95
- else message = "Internal server error";
96
- const contextStr = `method=${String(request.method ?? "")} url=${String(request.url ?? "")} status=${status}`;
97
- if (this.logger) if (status >= 500) {
98
- const err = exception instanceof Error ? exception : new Error(String(exception));
99
- this.logger.error(err, void 0, contextStr);
100
- } else this.logger.warn(`[${status}] ${message}`, contextStr);
101
- response.status(status).json({
102
- statusCode: status,
103
- message,
104
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
105
- path: request.url
284
+ const response = ctx.getResponse();
285
+ const requestId = ((_request$headers = request.headers) === null || _request$headers === void 0 ? void 0 : _request$headers["x-trace-id"]) ?? request.id ?? void 0;
286
+ const { response: errorResponse, httpStatus } = ErrorResponseBuilder.build({
287
+ exception,
288
+ requestId,
289
+ path: request.url ?? "/",
290
+ startTime: request.startTime
106
291
  });
292
+ if (this.logger) {
293
+ const contextStr = [
294
+ `method=${String(request.method ?? "")}`,
295
+ `url=${String(request.url ?? "")}`,
296
+ `status=${httpStatus}`,
297
+ `request_id=${errorResponse.meta.request_id}`
298
+ ].join(" ");
299
+ if (httpStatus >= 500) {
300
+ const err = exception instanceof Error ? exception : new Error(String(exception));
301
+ this.logger.error(err, void 0, contextStr);
302
+ } else if (isLogixiaException(exception)) this.logger.warn(`[${errorResponse.error.code}] ${errorResponse.error.message}`, contextStr);
303
+ else this.logger.warn(`[${httpStatus}] ${errorResponse.error.message}`, contextStr);
304
+ }
305
+ if (process.env["NODE_ENV"] === "production") delete errorResponse.debug;
306
+ response.setHeader("X-Trace-ID", errorResponse.meta.request_id);
307
+ response.setHeader("X-Request-ID", errorResponse.meta.request_id);
308
+ if (httpStatus === 429) response.setHeader("Retry-After", "60");
309
+ response.status(httpStatus).json(errorResponse);
107
310
  }
108
311
  };
109
312
  LogixiaExceptionFilter = require_logitron_logger_module.__decorate([
@@ -655,6 +858,7 @@ exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
655
858
  exports.DEFAULT_LOG_COLORS = require_logitron_logger_module.DEFAULT_LOG_COLORS;
656
859
  exports.DEFAULT_LOG_LEVELS = require_logitron_logger_module.DEFAULT_LOG_LEVELS;
657
860
  exports.DEFAULT_TRACE_HEADERS = require_logitron_logger_module.DEFAULT_TRACE_HEADERS;
861
+ exports.ErrorResponseBuilder = ErrorResponseBuilder;
658
862
  exports.InjectLogger = InjectLogger;
659
863
  exports.JsonFormatter = JsonFormatter;
660
864
  Object.defineProperty(exports, 'KafkaTraceInterceptor', {
@@ -668,6 +872,7 @@ exports.LOGIXIA_LOGGER_PREFIX = require_logitron_logger_module.LOGIXIA_LOGGER_PR
668
872
  exports.LogLevel = require_logitron_logger_module.LogLevel;
669
873
  exports.LogMethod = LogMethod;
670
874
  exports.LogixiaContext = require_logitron_logger_module.LogixiaContext;
875
+ exports.LogixiaException = LogixiaException;
671
876
  Object.defineProperty(exports, 'LogixiaExceptionFilter', {
672
877
  enumerable: true,
673
878
  get: function () {
@@ -709,6 +914,7 @@ exports.deregisterFromShutdown = require_logitron_logger_module.deregisterFromSh
709
914
  exports.disableOtelBridge = require_logitron_logger_module.disableOtelBridge;
710
915
  exports.extractTraceId = require_logitron_logger_module.extractTraceId;
711
916
  exports.flushOnExit = require_logitron_logger_module.flushOnExit;
917
+ exports.generateRequestId = generateRequestId;
712
918
  exports.generateTraceId = require_logitron_logger_module.generateTraceId;
713
919
  exports.getActiveOtelContext = require_logitron_logger_module.getActiveOtelContext;
714
920
  exports.getCurrentTraceId = require_logitron_logger_module.getCurrentTraceId;
@@ -716,6 +922,7 @@ exports.getOtelMetaFields = require_logitron_logger_module.getOtelMetaFields;
716
922
  exports.globalPluginRegistry = require_logitron_logger_module.globalPluginRegistry;
717
923
  exports.initOtelBridge = require_logitron_logger_module.initOtelBridge;
718
924
  exports.isError = require_logitron_logger_module.isError;
925
+ exports.isLogixiaException = isLogixiaException;
719
926
  exports.logger = logger;
720
927
  exports.normalizeError = require_logitron_logger_module.normalizeError;
721
928
  exports.redactObject = require_logitron_logger_module.redactObject;