logixia 2.0.0 → 2.0.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.
Files changed (231) hide show
  1. package/README.md +46 -29
  2. package/dist/async-context-B05ArHgM.mjs +134 -0
  3. package/dist/async-context-B05ArHgM.mjs.map +1 -0
  4. package/dist/async-context-DTQgi8f7.js +150 -0
  5. package/dist/async-context-DTQgi8f7.js.map +1 -0
  6. package/dist/{azure-monitor.transport-CHnjVRF-.mjs → azure-monitor.transport-BPbgjATu.mjs} +27 -15
  7. package/dist/azure-monitor.transport-BPbgjATu.mjs.map +1 -0
  8. package/dist/{azure-monitor.transport-Cn_3Usvu.d.ts → azure-monitor.transport-C7kYyZUW.d.mts} +3 -6
  9. package/dist/azure-monitor.transport-C7kYyZUW.d.mts.map +1 -0
  10. package/dist/{azure-monitor.transport-CrvfHd9C.js → azure-monitor.transport-CwbOLZHB.js} +32 -20
  11. package/dist/azure-monitor.transport-CwbOLZHB.js.map +1 -0
  12. package/dist/{azure-monitor.transport-D7Da4RAb.d.mts → azure-monitor.transport-DV03Z5P4.d.ts} +3 -6
  13. package/dist/azure-monitor.transport-DV03Z5P4.d.ts.map +1 -0
  14. package/dist/azure.d.mts +1 -2
  15. package/dist/azure.d.ts +1 -2
  16. package/dist/azure.js +3 -6
  17. package/dist/azure.mjs +1 -6
  18. package/dist/{batch-buffer-PGvSgbmd.mjs → batch-buffer-0fgLmIPn.mjs} +21 -7
  19. package/dist/batch-buffer-0fgLmIPn.mjs.map +1 -0
  20. package/dist/{batch-buffer-BY-mRWIK.js → batch-buffer-DT4gdXmf.js} +53 -40
  21. package/dist/batch-buffer-DT4gdXmf.js.map +1 -0
  22. package/dist/browser.d.mts +45 -25
  23. package/dist/browser.d.mts.map +1 -1
  24. package/dist/browser.d.ts +45 -25
  25. package/dist/browser.d.ts.map +1 -1
  26. package/dist/browser.js +420 -53
  27. package/dist/browser.js.map +1 -1
  28. package/dist/browser.mjs +421 -56
  29. package/dist/browser.mjs.map +1 -1
  30. package/dist/{builder-0gEzRopq.mjs → builder-D70z6kjj.mjs} +212 -104
  31. package/dist/builder-D70z6kjj.mjs.map +1 -0
  32. package/dist/{builder-D44QktIo.js → builder-M7NoaugM.js} +355 -249
  33. package/dist/builder-M7NoaugM.js.map +1 -0
  34. package/dist/cli/index.js +59 -59
  35. package/dist/cloudwatch.d.mts +1 -2
  36. package/dist/cloudwatch.d.ts +1 -2
  37. package/dist/cloudwatch.js +3 -7
  38. package/dist/cloudwatch.mjs +1 -7
  39. package/dist/{cloudwatch.transport-BO1ahxw-.js → cloudwatch.transport-B2wKQFF7.js} +61 -36
  40. package/dist/cloudwatch.transport-B2wKQFF7.js.map +1 -0
  41. package/dist/{cloudwatch.transport-DZ6ies7g.mjs → cloudwatch.transport-BTvYfLs9.mjs} +54 -28
  42. package/dist/cloudwatch.transport-BTvYfLs9.mjs.map +1 -0
  43. package/dist/{cloudwatch.transport-DsEq633o.d.ts → cloudwatch.transport-Bf7L4I59.d.ts} +2 -6
  44. package/dist/cloudwatch.transport-Bf7L4I59.d.ts.map +1 -0
  45. package/dist/{cloudwatch.transport-UlyZFWMn.d.mts → cloudwatch.transport-Rj4yTpRn.d.mts} +2 -6
  46. package/dist/cloudwatch.transport-Rj4yTpRn.d.mts.map +1 -0
  47. package/dist/{coerce.utils-Cu6IUTgX.mjs → coerce.utils-B_rEudCn.mjs} +3 -4
  48. package/dist/{coerce.utils-Cu6IUTgX.mjs.map → coerce.utils-B_rEudCn.mjs.map} +1 -1
  49. package/dist/{coerce.utils-B-LilukN.js → coerce.utils-C1C5sIX0.js} +8 -10
  50. package/dist/{coerce.utils-B-LilukN.js.map → coerce.utils-C1C5sIX0.js.map} +1 -1
  51. package/dist/correlation.d.mts +13 -16
  52. package/dist/correlation.d.mts.map +1 -1
  53. package/dist/correlation.d.ts +13 -16
  54. package/dist/correlation.d.ts.map +1 -1
  55. package/dist/correlation.js +58 -9
  56. package/dist/correlation.js.map +1 -1
  57. package/dist/correlation.mjs +56 -6
  58. package/dist/correlation.mjs.map +1 -1
  59. package/dist/{entry-fields-BJkuPnIg.mjs → entry-fields-CGuvT2R0.mjs} +5 -6
  60. package/dist/entry-fields-CGuvT2R0.mjs.map +1 -0
  61. package/dist/{entry-fields-BvOLFlJ4.js → entry-fields-RLd1jCoR.js} +10 -12
  62. package/dist/entry-fields-RLd1jCoR.js.map +1 -0
  63. package/dist/gcp.d.mts +1 -2
  64. package/dist/gcp.d.ts +1 -2
  65. package/dist/gcp.js +3 -7
  66. package/dist/gcp.mjs +1 -7
  67. package/dist/{gcp.transport-B7oc97sG.d.ts → gcp.transport-C5D72b1g.d.mts} +3 -6
  68. package/dist/gcp.transport-C5D72b1g.d.mts.map +1 -0
  69. package/dist/{gcp.transport-GrJurKo8.d.mts → gcp.transport-CFQfdAOK.d.ts} +3 -6
  70. package/dist/gcp.transport-CFQfdAOK.d.ts.map +1 -0
  71. package/dist/{gcp.transport-DBX5TPIy.mjs → gcp.transport-CGKopAhQ.mjs} +55 -16
  72. package/dist/gcp.transport-CGKopAhQ.mjs.map +1 -0
  73. package/dist/{gcp.transport-CHV8MGgz.js → gcp.transport-KZe9hCAR.js} +60 -22
  74. package/dist/gcp.transport-KZe9hCAR.js.map +1 -0
  75. package/dist/{index-DhIoploR.d.ts → index-DwozbmB4.d.ts} +3 -8
  76. package/dist/index-DwozbmB4.d.ts.map +1 -0
  77. package/dist/{index-3mw5gaCw.d.mts → index-xqaJtAZn.d.mts} +3 -8
  78. package/dist/index-xqaJtAZn.d.mts.map +1 -0
  79. package/dist/index.d.mts +106 -165
  80. package/dist/index.d.mts.map +1 -1
  81. package/dist/index.d.ts +105 -164
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +164 -261
  84. package/dist/index.js.map +1 -1
  85. package/dist/index.mjs +147 -243
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/internal-log-b0Vp4qrB.js +183 -0
  88. package/dist/internal-log-b0Vp4qrB.js.map +1 -0
  89. package/dist/internal-log-uCSd1PMc.mjs +142 -0
  90. package/dist/internal-log-uCSd1PMc.mjs.map +1 -0
  91. package/dist/{logitron-logger-UVeN-mQm.d.ts → logitron-logger-D2B75Oc7.d.ts} +116 -8
  92. package/dist/logitron-logger-D2B75Oc7.d.ts.map +1 -0
  93. package/dist/{logitron-logger-BFDSO8Io.d.mts → logitron-logger-oEd6wNhf.d.mts} +116 -8
  94. package/dist/logitron-logger-oEd6wNhf.d.mts.map +1 -0
  95. package/dist/middleware.d.mts +10 -12
  96. package/dist/middleware.d.mts.map +1 -1
  97. package/dist/middleware.d.ts +10 -12
  98. package/dist/middleware.d.ts.map +1 -1
  99. package/dist/middleware.js +16 -47
  100. package/dist/middleware.js.map +1 -1
  101. package/dist/middleware.mjs +13 -45
  102. package/dist/middleware.mjs.map +1 -1
  103. package/dist/nest.d.mts +26 -44
  104. package/dist/nest.d.mts.map +1 -1
  105. package/dist/nest.d.ts +26 -44
  106. package/dist/nest.d.ts.map +1 -1
  107. package/dist/nest.js +116 -132
  108. package/dist/nest.js.map +1 -1
  109. package/dist/nest.mjs +59 -73
  110. package/dist/nest.mjs.map +1 -1
  111. package/dist/{trace.utils-CvXgaiQT.mjs → request-trace-C_fvIDv4.mjs} +44 -9
  112. package/dist/request-trace-C_fvIDv4.mjs.map +1 -0
  113. package/dist/{trace.utils-DpBOLDtq.js → request-trace-wTJdKp6-.js} +121 -77
  114. package/dist/request-trace-wTJdKp6-.js.map +1 -0
  115. package/dist/rolldown-runtime-D3PmRqjj.mjs +4 -0
  116. package/dist/{safe-stringify-DJ66tW5I.mjs → safe-stringify-BMRl3EX3.mjs} +3 -4
  117. package/dist/safe-stringify-BMRl3EX3.mjs.map +1 -0
  118. package/dist/{safe-stringify-DWo3aZp_.js → safe-stringify-DLz1Kz3o.js} +23 -25
  119. package/dist/safe-stringify-DLz1Kz3o.js.map +1 -0
  120. package/dist/{search-CNh9uVwR.d.ts → search-BH33XhuU.d.mts} +2 -22
  121. package/dist/search-BH33XhuU.d.mts.map +1 -0
  122. package/dist/{search-BFbu_oVn.mjs → search-CWMVYC-R.mjs} +22 -39
  123. package/dist/search-CWMVYC-R.mjs.map +1 -0
  124. package/dist/{search-DXANsQ2n.d.mts → search-CazwyX5Z.d.ts} +2 -22
  125. package/dist/search-CazwyX5Z.d.ts.map +1 -0
  126. package/dist/{search-C4V0OMEn.js → search-DUfWuzFP.js} +52 -69
  127. package/dist/search-DUfWuzFP.js.map +1 -0
  128. package/dist/search.d.mts +2 -4
  129. package/dist/search.d.ts +2 -4
  130. package/dist/search.js +3 -4
  131. package/dist/search.mjs +1 -4
  132. package/dist/secret-config-BegMLkYl.mjs +209 -0
  133. package/dist/secret-config-BegMLkYl.mjs.map +1 -0
  134. package/dist/secret-config-CBZBs0p1.js +271 -0
  135. package/dist/secret-config-CBZBs0p1.js.map +1 -0
  136. package/dist/{slack.transport-Bzw7sucI.mjs → slack.transport-Ce96JBDk.mjs} +212 -31
  137. package/dist/slack.transport-Ce96JBDk.mjs.map +1 -0
  138. package/dist/{slack.transport-BfJRouB2.js → slack.transport-Dlx3xvb7.js} +234 -41
  139. package/dist/slack.transport-Dlx3xvb7.js.map +1 -0
  140. package/dist/{slack.transport-BZzoXDPn.d.mts → slack.transport-DrirgDNy.d.ts} +56 -9
  141. package/dist/slack.transport-DrirgDNy.d.ts.map +1 -0
  142. package/dist/{slack.transport-CXjQYOes.d.ts → slack.transport-DxHOXlLu.d.mts} +56 -9
  143. package/dist/slack.transport-DxHOXlLu.d.mts.map +1 -0
  144. package/dist/testing.d.mts +3 -8
  145. package/dist/testing.d.mts.map +1 -1
  146. package/dist/testing.d.ts +3 -8
  147. package/dist/testing.d.ts.map +1 -1
  148. package/dist/testing.js +3 -4
  149. package/dist/testing.js.map +1 -1
  150. package/dist/testing.mjs +2 -3
  151. package/dist/testing.mjs.map +1 -1
  152. package/dist/{transport.manager-CXbKKdVE.js → transport.manager-DkcEOlqV.js} +164 -160
  153. package/dist/transport.manager-DkcEOlqV.js.map +1 -0
  154. package/dist/{transport.manager-BiuCAJd2.mjs → transport.manager-eZ_EeC00.mjs} +108 -99
  155. package/dist/transport.manager-eZ_EeC00.mjs.map +1 -0
  156. package/dist/{transport.types-CGoHpWQR.d.ts → transport.types-BJVL1QQl.d.mts} +1 -3
  157. package/dist/transport.types-BJVL1QQl.d.mts.map +1 -0
  158. package/dist/{transport.types-BMnurPcc.d.mts → transport.types-BJVL1QQl.d.ts} +1 -3
  159. package/dist/transport.types-BJVL1QQl.d.ts.map +1 -0
  160. package/dist/transports.d.mts +22 -36
  161. package/dist/transports.d.mts.map +1 -1
  162. package/dist/transports.d.ts +22 -36
  163. package/dist/transports.d.ts.map +1 -1
  164. package/dist/transports.js +10 -13
  165. package/dist/transports.mjs +7 -13
  166. package/dist/worker-entry.js +337 -87
  167. package/dist/worker.d.mts +1 -2
  168. package/dist/worker.d.ts +1 -2
  169. package/dist/worker.js +3 -4
  170. package/dist/worker.mjs +1 -4
  171. package/dist/{worker.transport-CdzSZJmw.d.ts → worker.transport-BuPwBi3d.d.ts} +2 -6
  172. package/dist/worker.transport-BuPwBi3d.d.ts.map +1 -0
  173. package/dist/{worker.transport-BdPxu3PN.js → worker.transport-C6GNl_r2.js} +44 -14
  174. package/dist/worker.transport-C6GNl_r2.js.map +1 -0
  175. package/dist/{worker.transport-lPxO2MVL.mjs → worker.transport-DLVA4y2e.mjs} +39 -9
  176. package/dist/worker.transport-DLVA4y2e.mjs.map +1 -0
  177. package/dist/{worker.transport-JvGPog3C.d.mts → worker.transport-hJay1wxA.d.mts} +2 -6
  178. package/dist/worker.transport-hJay1wxA.d.mts.map +1 -0
  179. package/package.json +19 -11
  180. package/dist/async-context-BzJrbfQs.mjs +0 -72
  181. package/dist/async-context-BzJrbfQs.mjs.map +0 -1
  182. package/dist/async-context-DyQQYq3I.js +0 -92
  183. package/dist/async-context-DyQQYq3I.js.map +0 -1
  184. package/dist/azure-monitor.transport-CHnjVRF-.mjs.map +0 -1
  185. package/dist/azure-monitor.transport-Cn_3Usvu.d.ts.map +0 -1
  186. package/dist/azure-monitor.transport-CrvfHd9C.js.map +0 -1
  187. package/dist/azure-monitor.transport-D7Da4RAb.d.mts.map +0 -1
  188. package/dist/batch-buffer-BY-mRWIK.js.map +0 -1
  189. package/dist/batch-buffer-PGvSgbmd.mjs.map +0 -1
  190. package/dist/builder-0gEzRopq.mjs.map +0 -1
  191. package/dist/builder-D44QktIo.js.map +0 -1
  192. package/dist/chunk-DLSkYcPk.mjs +0 -7
  193. package/dist/chunk-nOFOJqeH.js +0 -30
  194. package/dist/cloudwatch.transport-BO1ahxw-.js.map +0 -1
  195. package/dist/cloudwatch.transport-DZ6ies7g.mjs.map +0 -1
  196. package/dist/cloudwatch.transport-DsEq633o.d.ts.map +0 -1
  197. package/dist/cloudwatch.transport-UlyZFWMn.d.mts.map +0 -1
  198. package/dist/entry-fields-BJkuPnIg.mjs.map +0 -1
  199. package/dist/entry-fields-BvOLFlJ4.js.map +0 -1
  200. package/dist/gcp.transport-B7oc97sG.d.ts.map +0 -1
  201. package/dist/gcp.transport-CHV8MGgz.js.map +0 -1
  202. package/dist/gcp.transport-DBX5TPIy.mjs.map +0 -1
  203. package/dist/gcp.transport-GrJurKo8.d.mts.map +0 -1
  204. package/dist/index-3mw5gaCw.d.mts.map +0 -1
  205. package/dist/index-DhIoploR.d.ts.map +0 -1
  206. package/dist/internal-log-BUJYMZbE.js +0 -70
  207. package/dist/internal-log-BUJYMZbE.js.map +0 -1
  208. package/dist/internal-log-Cm8SOWSV.mjs +0 -52
  209. package/dist/internal-log-Cm8SOWSV.mjs.map +0 -1
  210. package/dist/logitron-logger-BFDSO8Io.d.mts.map +0 -1
  211. package/dist/logitron-logger-UVeN-mQm.d.ts.map +0 -1
  212. package/dist/safe-stringify-DJ66tW5I.mjs.map +0 -1
  213. package/dist/safe-stringify-DWo3aZp_.js.map +0 -1
  214. package/dist/search-BFbu_oVn.mjs.map +0 -1
  215. package/dist/search-C4V0OMEn.js.map +0 -1
  216. package/dist/search-CNh9uVwR.d.ts.map +0 -1
  217. package/dist/search-DXANsQ2n.d.mts.map +0 -1
  218. package/dist/slack.transport-BZzoXDPn.d.mts.map +0 -1
  219. package/dist/slack.transport-BfJRouB2.js.map +0 -1
  220. package/dist/slack.transport-Bzw7sucI.mjs.map +0 -1
  221. package/dist/slack.transport-CXjQYOes.d.ts.map +0 -1
  222. package/dist/trace.utils-CvXgaiQT.mjs.map +0 -1
  223. package/dist/trace.utils-DpBOLDtq.js.map +0 -1
  224. package/dist/transport.manager-BiuCAJd2.mjs.map +0 -1
  225. package/dist/transport.manager-CXbKKdVE.js.map +0 -1
  226. package/dist/transport.types-BMnurPcc.d.mts.map +0 -1
  227. package/dist/transport.types-CGoHpWQR.d.ts.map +0 -1
  228. package/dist/worker.transport-BdPxu3PN.js.map +0 -1
  229. package/dist/worker.transport-CdzSZJmw.d.ts.map +0 -1
  230. package/dist/worker.transport-JvGPog3C.d.mts.map +0 -1
  231. package/dist/worker.transport-lPxO2MVL.mjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,16 +1,13 @@
1
- import { p as TransportLogEntry, s as IAsyncTransport } from "./transport.types-CGoHpWQR.js";
2
- import { A as HttpResponse, C as RequestContext, D as TraceIdExtractorConfig, E as TraceIdConfig, M as RequestTiming, O as HttpError, S as RedactConfig, T as TimingEntry, _ as LogLevel, a as DEFAULT_LOG_LEVELS, b as LoggerWithLevels, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogFieldKey, h as LogEntry, i as DEFAULT_LOG_COLORS, j as RequestMetrics, k as HttpRequest, l as GracefulShutdownConfig, m as LogColor, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevelString, w as SamplingConfig, x as NamespaceLevels, y as LoggerConfig } from "./index-DhIoploR.js";
3
- import { a as globalPluginRegistry, i as PluginRegistry, n as createLogger$1, o as usePlugin, r as LogixiaPlugin, t as LogixiaLogger } from "./logitron-logger-UVeN-mQm.js";
4
- import { a as DiscordTransport, i as DiscordEmbed, n as SlackTransport, o as DiscordTransportConfig, r as SlackTransportConfig, t as SlackMessage } from "./slack.transport-CXjQYOes.js";
5
- import { A as SearchStats, C as SearchFilters, D as SearchPreset, E as SearchOptions, F as SuggestionType, I as TimeRange, L as TimelineEvent, M as SemanticIndex, N as SimilarLog, O as SearchQuery, P as SortField, S as RelativeTime, T as SearchMatch, _ as ParsedNLQuery, a as ILogSearchEngine, b as RelatedLog, c as SearchManager, d as CorrelatedLogs, f as EntityType, g as LogPattern, h as LogCorrelationSummary, i as BasicSearchEngine, j as SearchSuggestion, k as SearchResult, l as SearchManagerConfig, m as LogCluster, n as NLPSearchEngine, o as BasicLogIndexer, p as ExportOptions, r as CorrelationEngine, s as ILogIndexer, t as PatternRecognitionEngine, u as AnomalyDetection, v as QueryEntity, w as SearchHighlight, x as RelationshipType, y as QueryIntent } from "./search-CNh9uVwR.js";
1
+ import { A as HttpResponse, C as RequestContext, D as TraceIdExtractorConfig, E as TraceIdConfig, M as RequestTiming, O as HttpError, S as RedactConfig, T as TimingEntry, _ as LogLevel, a as DEFAULT_LOG_LEVELS, b as LoggerWithLevels, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogFieldKey, h as LogEntry, i as DEFAULT_LOG_COLORS, j as RequestMetrics, k as HttpRequest, l as GracefulShutdownConfig, m as LogColor, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevelString, w as SamplingConfig, x as NamespaceLevels, y as LoggerConfig } from "./index-DwozbmB4.js";
2
+ import { a as globalPluginRegistry, i as PluginRegistry, n as createLogger$1, o as usePlugin, r as LogixiaPlugin, t as LogixiaLogger } from "./logitron-logger-D2B75Oc7.js";
3
+ import { a as DiscordTransport, c as OtlpLogTransportConfig, i as DiscordEmbed, l as toOtelSeverity, n as SlackTransport, o as DiscordTransportConfig, r as SlackTransportConfig, s as OtlpLogTransport, t as SlackMessage } from "./slack.transport-DrirgDNy.js";
4
+ import { A as SearchStats, C as SearchFilters, D as SearchPreset, E as SearchOptions, F as SuggestionType, I as TimeRange, L as TimelineEvent, M as SemanticIndex, N as SimilarLog, O as SearchQuery, P as SortField, S as RelativeTime, T as SearchMatch, _ as ParsedNLQuery, a as ILogSearchEngine, b as RelatedLog, c as SearchManager, d as CorrelatedLogs, f as EntityType, g as LogPattern, h as LogCorrelationSummary, i as BasicSearchEngine, j as SearchSuggestion, k as SearchResult, l as SearchManagerConfig, m as LogCluster, n as NLPSearchEngine, o as BasicLogIndexer, p as ExportOptions, r as CorrelationEngine, s as ILogIndexer, t as PatternRecognitionEngine, u as AnomalyDetection, v as QueryEntity, w as SearchHighlight, x as RelationshipType, y as QueryIntent } from "./search-CazwyX5Z.js";
6
5
  import { AsyncLocalStorage } from "node:async_hooks";
7
6
  import { IncomingMessage, ServerResponse } from "node:http";
8
-
9
- //#region src/core/default-config.d.ts
10
7
  /**
11
8
  * Default configuration for Logixia logger
12
9
  */
13
- declare const DEFAULT_CONFIG: {
10
+ export declare const DEFAULT_CONFIG: {
14
11
  appName: string;
15
12
  environment: Environment;
16
13
  traceId: boolean;
@@ -43,9 +40,7 @@ declare const DEFAULT_CONFIG: {
43
40
  };
44
41
  outputs: string[];
45
42
  };
46
- //#endregion
47
- //#region src/formatters/json.formatter.d.ts
48
- declare class JsonFormatter implements ILogFormatter {
43
+ export declare class JsonFormatter implements ILogFormatter {
49
44
  private includeTimestamp;
50
45
  private includeLevel;
51
46
  private includeAppName;
@@ -63,9 +58,7 @@ declare class JsonFormatter implements ILogFormatter {
63
58
  format(entry: LogEntry): string;
64
59
  private serializePayload;
65
60
  }
66
- //#endregion
67
- //#region src/formatters/text.formatter.d.ts
68
- declare class TextFormatter implements ILogFormatter {
61
+ export declare class TextFormatter implements ILogFormatter {
69
62
  private colorize;
70
63
  private includeTimestamp;
71
64
  private includeAppName;
@@ -92,8 +85,6 @@ declare class TextFormatter implements ILogFormatter {
92
85
  static createDetailed(): TextFormatter;
93
86
  static createMinimal(): TextFormatter;
94
87
  }
95
- //#endregion
96
- //#region src/utils/error.utils.d.ts
97
88
  /**
98
89
  * Serialize an Error into a plain JSON-safe object, including:
99
90
  * - `name`, `message`, `stack`
@@ -102,17 +93,15 @@ declare class TextFormatter implements ILogFormatter {
102
93
  * - standard Node.js error fields (`code`, `statusCode`, `errno`, …)
103
94
  * - any other enumerable own properties
104
95
  */
105
- declare function serializeError(error: Error, options?: ErrorSerializationOptions): Record<string, unknown>;
96
+ export declare function serializeError(error: Error, options?: ErrorSerializationOptions): Record<string, unknown>;
106
97
  /**
107
98
  * Type guard: returns true if the value looks like an Error object.
108
99
  */
109
- declare function isError(value: unknown): value is Error;
100
+ export declare function isError(value: unknown): value is Error;
110
101
  /**
111
102
  * Coerce any thrown value into a proper Error instance.
112
103
  */
113
- declare function normalizeError(error: unknown): Error;
114
- //#endregion
115
- //#region src/utils/otel.d.ts
104
+ export declare function normalizeError(error: unknown): Error;
116
105
  /**
117
106
  * logixia — OpenTelemetry auto trace-log correlation
118
107
  *
@@ -189,7 +178,7 @@ interface OtelBridgeOptions {
189
178
  * - No active span exists (root context)
190
179
  * - The span context is invalid (all-zeros)
191
180
  */
192
- declare function getActiveOtelContext(opts?: OtelBridgeOptions): OtelSpanContext | undefined;
181
+ export declare function getActiveOtelContext(opts?: OtelBridgeOptions): OtelSpanContext | undefined;
193
182
  /**
194
183
  * Returns a metadata object with OTel context fields ready to merge into a log call,
195
184
  * using the configured field names.
@@ -204,7 +193,7 @@ declare function getActiveOtelContext(opts?: OtelBridgeOptions): OtelSpanContext
204
193
  * });
205
194
  * ```
206
195
  */
207
- declare function getOtelMetaFields(opts?: OtelBridgeOptions): Record<string, unknown>;
196
+ export declare function getOtelMetaFields(opts?: OtelBridgeOptions): Record<string, unknown>;
208
197
  /**
209
198
  * Initialise the global OTel bridge.
210
199
  *
@@ -218,26 +207,22 @@ declare function getOtelMetaFields(opts?: OtelBridgeOptions): Record<string, unk
218
207
  * initOtelBridge();
219
208
  * ```
220
209
  */
221
- declare function initOtelBridge(opts?: OtelBridgeOptions): void;
210
+ export declare function initOtelBridge(opts?: OtelBridgeOptions): void;
222
211
  /**
223
212
  * Disable the OTel bridge (useful for tests).
224
213
  */
225
- declare function disableOtelBridge(): void;
226
- //#endregion
227
- //#region src/utils/redact.utils.d.ts
214
+ export declare function disableOtelBridge(): void;
228
215
  /**
229
216
  * Redact an object according to the given RedactConfig and return a new
230
217
  * top-level object. Subtrees with nothing to redact are shared with the input,
231
218
  * never mutated. Circular references become `[Circular]`.
232
219
  */
233
- declare function redactObject(obj: Record<string, unknown>, config: RedactConfig, _currentPath?: string): Record<string, unknown>;
220
+ export declare function redactObject(obj: Record<string, unknown>, config: RedactConfig, _currentPath?: string): Record<string, unknown>;
234
221
  /**
235
222
  * Apply redaction to a log payload (top-level call convenience wrapper).
236
223
  * Returns a new object — never mutates the input.
237
224
  */
238
- declare function applyRedaction(payload: Record<string, unknown> | undefined, config: RedactConfig | undefined): Record<string, unknown> | undefined;
239
- //#endregion
240
- //#region src/utils/runtime-control.d.ts
225
+ export declare function applyRedaction(payload: Record<string, unknown> | undefined, config: RedactConfig | undefined): Record<string, unknown> | undefined;
241
226
  /** Minimal logger surface the runtime controls need. */
242
227
  interface ReconfigurableLogger {
243
228
  getLevel(): LogLevelString;
@@ -259,7 +244,7 @@ interface LevelSignalOptions {
259
244
  * memorizable command (`kill -USR2 <pid>`) is enough to ratchet verbosity up
260
245
  * while chasing a bug and back down again — no value to remember.
261
246
  */
262
- declare function registerLevelSignal(logger: ReconfigurableLogger, options?: LevelSignalOptions): () => void;
247
+ export declare function registerLevelSignal(logger: ReconfigurableLogger, options?: LevelSignalOptions): () => void;
263
248
  interface MinimalReq {
264
249
  method?: string | undefined;
265
250
  headers?: Record<string, string | string[] | undefined> | undefined;
@@ -290,11 +275,9 @@ interface MinimalRes {
290
275
  * which also keeps cross-site form posts out) and a body of at most 16 KB
291
276
  * (otherwise 413).
292
277
  */
293
- declare function createLevelControlHandler(logger: ReconfigurableLogger, options?: {
278
+ export declare function createLevelControlHandler(logger: ReconfigurableLogger, options?: {
294
279
  allowedLevels?: string[];
295
280
  }): (req: MinimalReq, res: MinimalRes) => void;
296
- //#endregion
297
- //#region src/utils/safe-stringify.d.ts
298
281
  /**
299
282
  * logixia — robust JSON serialization for log payloads.
300
283
  *
@@ -334,27 +317,25 @@ interface SafeStringifyOptions {
334
317
  * Serialize any value to JSON without throwing on circular references or BigInt.
335
318
  * Circular refs become `"[Circular]"` (or `{ $ref }` pointers when `decycle`).
336
319
  */
337
- declare function safeStringify(value: unknown, options?: SafeStringifyOptions): string;
320
+ export declare function safeStringify(value: unknown, options?: SafeStringifyOptions): string;
338
321
  /**
339
322
  * Replace repeated object references with round-trippable `{ "$ref": "$..." }`
340
323
  * JSONPath pointers (the classic Crockford decycle). Pair with {@link retrocycle}
341
324
  * to reconstruct the original shared/circular graph.
342
325
  */
343
- declare function decycleValue(value: unknown, bigint?: 'string' | 'number'): unknown;
326
+ export declare function decycleValue(value: unknown, bigint?: 'string' | 'number'): unknown;
344
327
  /**
345
328
  * Inverse of {@link decycleValue}: resolve `{ "$ref": "$..." }` pointers back
346
329
  * into the live object graph (mutates and returns the parsed input).
347
330
  */
348
- declare function retrocycle<T>(root: T): T;
331
+ export declare function retrocycle<T>(root: T): T;
349
332
  /**
350
333
  * `JSON.stringify` for log output. Takes the plain fast path first and only
351
334
  * falls back to {@link safeStringify} when that throws (a cycle, a BigInt, a
352
335
  * throwing `toJSON`), so a bad payload costs nothing until it shows up.
353
336
  * Never throws: if even the safe walk fails, the value is replaced by a marker.
354
337
  */
355
- declare function stringifyForLog(value: unknown): string;
356
- //#endregion
357
- //#region src/utils/shutdown.utils.d.ts
338
+ export declare function stringifyForLog(value: unknown): string;
358
339
  /**
359
340
  * Graceful shutdown utilities for Logixia
360
341
  *
@@ -362,8 +343,8 @@ declare function stringifyForLog(value: unknown): string;
362
343
  * exits on SIGTERM / SIGINT — solving the "last N seconds of logs are lost on
363
344
  * deployment" problem reported in Pino issue #2002 and LogDNA issue #15.
364
345
  */
365
- type ExitMode = 'auto' | 'always' | 'never';
366
- interface FlushOnExitOptions {
346
+ export type ExitMode = 'auto' | 'always' | 'never';
347
+ export interface FlushOnExitOptions {
367
348
  /** How long (ms) to wait for transports to flush before force-exiting. Default: 5000 */
368
349
  timeout?: number;
369
350
  /** OS signals that trigger a graceful flush. Default: ['SIGTERM', 'SIGINT'] */
@@ -392,12 +373,12 @@ type Closeable = {
392
373
  * Called automatically when `gracefulShutdown: true` is set in logger config.
393
374
  */
394
375
  /** Test helper: number of loggers currently registered for graceful shutdown. */
395
- declare function _shutdownRegistrySize(): number;
396
- declare function registerForShutdown(logger: Closeable): void;
376
+ export declare function _shutdownRegistrySize(): number;
377
+ export declare function registerForShutdown(logger: Closeable): void;
397
378
  /**
398
379
  * Deregister a logger (e.g. after `logger.close()` is called manually).
399
380
  */
400
- declare function deregisterFromShutdown(logger: Closeable): void;
381
+ export declare function deregisterFromShutdown(logger: Closeable): void;
401
382
  /**
402
383
  * Register SIGTERM / SIGINT handlers that flush all registered loggers before
403
384
  * the process exits. Idempotent — the first call wins and later calls with
@@ -412,16 +393,14 @@ declare function deregisterFromShutdown(logger: Closeable): void;
412
393
  * flushOnExit({ timeout: 5000 });
413
394
  * ```
414
395
  */
415
- declare function flushOnExit(options?: FlushOnExitOptions): void;
396
+ export declare function flushOnExit(options?: FlushOnExitOptions): void;
416
397
  /**
417
398
  * Remove all graceful shutdown handlers and clear the registry.
418
399
  * Primarily useful in tests.
419
400
  */
420
- declare function resetShutdownHandlers(): void;
421
- //#endregion
422
- //#region src/utils/trace.utils.d.ts
401
+ export declare function resetShutdownHandlers(): void;
423
402
  /** Default key used to store the trace ID in AsyncLocalStorage. */
424
- declare const TRACE_CONTEXT_KEY: "traceId";
403
+ export declare const TRACE_CONTEXT_KEY: "traceId";
425
404
  /**
426
405
  * Singleton that owns the AsyncLocalStorage and the active contextKey.
427
406
  *
@@ -437,7 +416,7 @@ declare const TRACE_CONTEXT_KEY: "traceId";
437
416
  * TraceContext.instance.contextKey // → 'traceId' (or custom)
438
417
  * TraceContext.instance.getCurrentTraceId() // same as standalone fn
439
418
  */
440
- declare class TraceContext {
419
+ export declare class TraceContext {
441
420
  private static _instance;
442
421
  readonly storage: AsyncLocalStorage<Record<string, unknown>>;
443
422
  private _contextKey;
@@ -479,16 +458,16 @@ declare class TraceContext {
479
458
  * The shared AsyncLocalStorage instance.
480
459
  * @deprecated Prefer `TraceContext.instance.storage` for new code.
481
460
  */
482
- declare const traceStorage: AsyncLocalStorage<Record<string, unknown>>;
461
+ export declare const traceStorage: AsyncLocalStorage<Record<string, unknown>>;
483
462
  /** Returns the key currently used to store the trace ID in AsyncLocalStorage. */
484
- declare function getTraceContextKey(): string;
463
+ export declare function getTraceContextKey(): string;
485
464
  /** @internal Called by TraceMiddleware / traceMiddleware() when they boot. */
486
- declare function _setActiveContextKey(key: string): void;
465
+ export declare function _setActiveContextKey(key: string): void;
487
466
  /**
488
467
  * Get the current trace ID from async context.
489
468
  * Returns `undefined` when called outside a traced request.
490
469
  */
491
- declare function getCurrentTraceId(): string | undefined;
470
+ export declare function getCurrentTraceId(): string | undefined;
492
471
  /**
493
472
  * Set trace ID in the CURRENT async context without starting a new one.
494
473
  *
@@ -542,11 +521,11 @@ declare function getCurrentTraceId(): string | undefined;
542
521
  * @deprecated Use `runWithTraceId(traceId, fn)` — do not call `setTraceId`
543
522
  * from request-handling code.
544
523
  */
545
- declare function setTraceId(traceId: string, data?: Record<string, unknown>): void;
524
+ export declare function setTraceId(traceId: string, data?: Record<string, unknown>): void;
546
525
  /** Run `fn` inside a new async context carrying `traceId`. */
547
- declare function runWithTraceId<T>(traceId: string, fn: () => T, data?: Record<string, unknown>): T;
526
+ export declare function runWithTraceId<T>(traceId: string, fn: () => T, data?: Record<string, unknown>): T;
548
527
  /** Maximum accepted length for an incoming trace / correlation / request ID. */
549
- declare const MAX_INCOMING_ID_LENGTH = 128;
528
+ export declare const MAX_INCOMING_ID_LENGTH = 128;
550
529
  /**
551
530
  * Validate an externally supplied identifier (trace ID, correlation ID, origin
552
531
  * service name, message-queue ID). Accepts only 1-128 characters from
@@ -554,20 +533,18 @@ declare const MAX_INCOMING_ID_LENGTH = 128;
554
533
  * first element. Returns the cleaned value, or `undefined` when it is unusable
555
534
  * so callers can generate a fresh ID instead of passing client text through.
556
535
  */
557
- declare function sanitizeIncomingId(value: unknown): string | undefined;
536
+ export declare function sanitizeIncomingId(value: unknown): string | undefined;
558
537
  /** Extract trace ID from request using configuration (header → query → body → params). */
559
- declare function extractTraceId(request: unknown, config: TraceIdExtractorConfig): string | undefined;
538
+ export declare function extractTraceId(request: unknown, config: TraceIdExtractorConfig): string | undefined;
560
539
  /**
561
540
  * Default headers checked for incoming trace ID propagation, in priority order:
562
541
  * traceparent (W3C/OTel) → x-trace-id → x-request-id → x-correlation-id → trace-id
563
542
  */
564
- declare const DEFAULT_TRACE_HEADERS: string[];
543
+ export declare const DEFAULT_TRACE_HEADERS: string[];
565
544
  /**
566
545
  * Create trace ID middleware for Express/NestJS
567
546
  */
568
- declare function createTraceMiddleware(config: TraceIdConfig): (req: unknown, res: unknown, next: () => void) => void;
569
- //#endregion
570
- //#region src/utils/typed-logger.d.ts
547
+ export declare function createTraceMiddleware(config: TraceIdConfig): (req: unknown, res: unknown, next: () => void) => void;
571
548
  /**
572
549
  * logixia — TypeScript typed log fields
573
550
  *
@@ -616,7 +593,7 @@ interface LogFieldDef {
616
593
  /** Custom validator — return a string to emit it as a warning message. */
617
594
  validate?: (value: unknown) => string | undefined;
618
595
  }
619
- type LogSchema<TFields extends Record<string, unknown>> = { [K in keyof TFields]: LogFieldDef };
596
+ type LogSchema<TFields extends Record<string, unknown>> = { [K in keyof TFields]: LogFieldDef; };
620
597
  interface CompiledSchema<TFields extends Record<string, unknown>> {
621
598
  readonly fields: LogSchema<TFields>;
622
599
  /**
@@ -632,7 +609,7 @@ interface CompiledSchema<TFields extends Record<string, unknown>> {
632
609
  * Call this once at module initialisation and pass it to `createTypedLogger`.
633
610
  * In development, every log call is validated against the schema.
634
611
  */
635
- declare function defineLogSchema<TFields extends Record<string, unknown>>(fields: LogSchema<TFields>): CompiledSchema<TFields>;
612
+ export declare function defineLogSchema<TFields extends Record<string, unknown>>(fields: LogSchema<TFields>): CompiledSchema<TFields>;
636
613
  /** IBaseLogger-compatible subset used by TypedLogger */
637
614
  interface LoggerLike {
638
615
  error(message: string | Error, data?: Record<string, unknown>): Promise<void>;
@@ -665,9 +642,7 @@ interface TypedLogger<TFields extends Record<string, unknown>> {
665
642
  * @param logger Any object that implements `IBaseLogger` (e.g. the result of `createLogger()`)
666
643
  * @param schema Optional schema for dev-time validation. Created with `defineLogSchema()`.
667
644
  */
668
- declare function createTypedLogger<TFields extends Record<string, unknown>>(logger: LoggerLike, schema?: CompiledSchema<TFields>): TypedLogger<TFields>;
669
- //#endregion
670
- //#region src/wide-events.d.ts
645
+ export declare function createTypedLogger<TFields extends Record<string, unknown>>(logger: LoggerLike, schema?: CompiledSchema<TFields>): TypedLogger<TFields>;
671
646
  /**
672
647
  * logixia — Canonical Log Lines / Wide Events.
673
648
  *
@@ -725,18 +700,18 @@ interface WideEventOptions {
725
700
  * throw) when called outside a `withWideEvent` / middleware scope, so business
726
701
  * code can call it unconditionally.
727
702
  */
728
- declare function addEventFields(fields: WideEventFields): void;
703
+ export declare function addEventFields(fields: WideEventFields): void;
729
704
  /** Set a single field on the current wide event. */
730
- declare function setEventField(key: string, value: unknown): void;
705
+ export declare function setEventField(key: string, value: unknown): void;
731
706
  /** Read a shallow copy of the wide event accumulated so far, or undefined. */
732
- declare function getEventFields(): WideEventFields | undefined;
707
+ export declare function getEventFields(): WideEventFields | undefined;
733
708
  /**
734
709
  * Run `callback` inside a wide-event scope. `addEventFields` calls anywhere in
735
710
  * the (async) call tree accumulate onto one event, which is emitted exactly once
736
711
  * when the callback settles — on success OR error (the canonical "emit in
737
712
  * finally" guarantee). On error, `error` + `errorMessage` fields are added.
738
713
  */
739
- declare function withWideEvent<T>(logger: WideEventLogger, initialFields: WideEventFields, callback: () => Promise<T> | T, options?: WideEventOptions): Promise<T>;
714
+ export declare function withWideEvent<T>(logger: WideEventLogger, initialFields: WideEventFields, callback: () => Promise<T> | T, options?: WideEventOptions): Promise<T>;
740
715
  interface MwReq {
741
716
  method?: string | undefined;
742
717
  url?: string | undefined;
@@ -764,63 +739,17 @@ interface WideEventMiddlewareOptions extends WideEventOptions {
764
739
  * more via `addEventFields`. The completion event includes `statusCode` and the
765
740
  * request duration.
766
741
  */
767
- declare function wideEventMiddleware(logger: WideEventLogger, options?: WideEventMiddlewareOptions): (req: MwReq, res: MwRes, next: () => void) => void;
768
- //#endregion
769
- //#region src/transports/otlp.transport.d.ts
770
- interface OtlpLogTransportConfig {
771
- /** OTLP/HTTP logs endpoint, e.g. `http://localhost:4318/v1/logs`. */
772
- url: string;
773
- /** Extra HTTP headers (auth, tenant, etc.). */
774
- headers?: Record<string, string>;
775
- /** `service.name` resource attribute. Default: 'logixia'. */
776
- serviceName?: string;
777
- /** `service.version` resource attribute. */
778
- serviceVersion?: string;
779
- /** `deployment.environment` resource attribute. */
780
- environment?: string;
781
- /** Extra resource attributes merged into the OTLP resource. */
782
- resourceAttributes?: Record<string, string | number | boolean>;
783
- /** Entries per batch / per POST. Default: 100. */
784
- batchSize?: number;
785
- /** Auto-flush interval (ms). Default: 5000. */
786
- flushIntervalMs?: number;
787
- /** Abort a request that has not finished after this many ms. Default: 10000. */
788
- requestTimeoutMs?: number;
789
- /** Max buffered entries; the oldest are dropped past this. Default: 10000. */
790
- maxBufferSize?: number;
791
- level?: string;
792
- }
742
+ export declare function wideEventMiddleware(logger: WideEventLogger, options?: WideEventMiddlewareOptions): (req: MwReq, res: MwRes, next: () => void) => void;
793
743
  /**
794
- * Map a logixia level name to an OTel SeverityNumber (1–24) and text.
795
- * Per the OTel logs SDK spec: TRACE=1, DEBUG=5, INFO=9, WARN=13, ERROR=17,
796
- * FATAL=21. Custom/unknown levels fall back to INFO (9).
744
+ * Per-request trace ID resolution shared by the HTTP logger middleware and the
745
+ * context helpers. Internal: not re-exported from the package entry points.
797
746
  */
798
- declare function toOtelSeverity(level: string): {
799
- number: number;
800
- text: string;
801
- };
802
- declare class OtlpLogTransport implements IAsyncTransport {
803
- readonly name = "otlp";
804
- readonly level: string | undefined;
805
- private readonly url;
806
- private readonly headers;
807
- private readonly batchSize;
808
- private readonly flushIntervalMs;
809
- private readonly requestTimeoutMs;
810
- private readonly resourceAttrs;
811
- private readonly buffer;
812
- private flushTimer;
813
- constructor(config: OtlpLogTransportConfig);
814
- write(entry: TransportLogEntry): void;
815
- /** Convert one entry into an OTLP LogRecord. */
816
- private toLogRecord;
817
- private buildPayload;
818
- flush(): Promise<void>;
819
- private send;
820
- close(): Promise<void>;
747
+ type TraceHeaderOption = string | readonly string[];
748
+ /** Minimal structural request shape; Express and Fastify requests satisfy it. */
749
+ interface ContextRequestLike {
750
+ headers?: Record<string, string | string[] | undefined>;
751
+ id?: unknown;
821
752
  }
822
- //#endregion
823
- //#region src/context/async-context.d.ts
824
753
  interface LogContext {
825
754
  traceId?: string;
826
755
  spanId?: string;
@@ -829,7 +758,7 @@ interface LogContext {
829
758
  sessionId?: string;
830
759
  [key: string]: unknown;
831
760
  }
832
- declare const LogixiaContext: {
761
+ export declare const LogixiaContext: {
833
762
  /**
834
763
  * Run `callback` inside an async context that carries `store` fields.
835
764
  * All loggers queried within `callback` (and its async descendants) will
@@ -859,33 +788,53 @@ declare const LogixiaContext: {
859
788
  */
860
789
  getStorage(): AsyncLocalStorage<LogContext>;
861
790
  };
791
+ interface ContextHelperOptions<Req extends ContextRequestLike> {
792
+ /**
793
+ * Extract additional fields from the request. A `traceId` returned here is ignored:
794
+ * the resolved request trace ID always wins.
795
+ */
796
+ enrich?: (request: Req & Record<string, unknown>) => Partial<LogContext>;
797
+ /**
798
+ * Header name, or list of names tried in order, to read the trace ID from.
799
+ * Default: `DEFAULT_TRACE_HEADERS` (traceparent is parsed to its 32-hex trace id).
800
+ */
801
+ traceIdHeader?: TraceHeaderOption;
802
+ /**
803
+ * Echo the resolved trace ID on the response under this header name.
804
+ * Default: `false` (no response header is set).
805
+ */
806
+ responseHeader?: string | false;
807
+ }
862
808
  /**
863
809
  * Create an Express/Connect-compatible middleware that wraps each request in
864
810
  * a `LogixiaContext.run()` scope populated with common request fields.
865
811
  *
812
+ * Trace ID: the first present header of `traceIdHeader` (default
813
+ * `DEFAULT_TRACE_HEADERS`, `traceparent` parsed), else `request.id`, else a
814
+ * generated UUID. It is available via `getCurrentTraceId()` and is the logger's
815
+ * top-level `traceId` inside the request. No response header is set unless
816
+ * `responseHeader` is given.
817
+ *
866
818
  * @example
867
819
  * ```ts
868
820
  * import { createExpressContextMiddleware } from 'logixia';
869
- * app.use(createExpressContextMiddleware());
821
+ * app.use(createExpressContextMiddleware({ responseHeader: 'x-trace-id' }));
870
822
  * ```
871
823
  */
872
- declare function createExpressContextMiddleware(options?: {
873
- /** Extract additional fields from the request. */
874
- enrich?: (req: Record<string, unknown>) => Partial<LogContext>;
875
- /** Header to read the traceId from. Default: 'x-trace-id'. */
876
- traceIdHeader?: string;
877
- }): (req: Record<string, unknown>, _res: unknown, next: () => void) => void;
824
+ export declare function createExpressContextMiddleware<Req extends ContextRequestLike = ContextRequestLike>(options?: ContextHelperOptions<Req>): (req: Req, res: {
825
+ setHeader?: (name: string, value: string) => unknown;
826
+ }, next: () => void) => void;
878
827
  /**
879
828
  * Create a Fastify lifecycle hook that wraps each request in a context scope.
880
829
  *
881
830
  * Register with `fastify.addHook('onRequest', createFastifyContextHook())`.
831
+ * Resolves the trace ID exactly like {@link createExpressContextMiddleware} and
832
+ * shares it with `createFastifyPlugin()` from `logixia/middleware`. Fastify's
833
+ * default counter `request.id` (`req-1`, ...) is never used as a trace ID.
882
834
  */
883
- declare function createFastifyContextHook(options?: {
884
- enrich?: (request: Record<string, unknown>) => Partial<LogContext>;
885
- traceIdHeader?: string;
886
- }): (request: Record<string, unknown>, _reply: unknown, done: () => void) => void;
887
- //#endregion
888
- //#region src/utils/sampling.utils.d.ts
835
+ export declare function createFastifyContextHook<Req extends ContextRequestLike = ContextRequestLike>(options?: ContextHelperOptions<Req>): (request: Req, reply: {
836
+ header?: (name: string, value: string) => unknown;
837
+ }, done: () => void) => void;
889
838
  interface SamplingStats {
890
839
  /** Total calls evaluated since last reset. */
891
840
  evaluated: number;
@@ -901,8 +850,6 @@ interface SamplingStats {
901
850
  /** Window start (ms since epoch). */
902
851
  windowStart: number;
903
852
  }
904
- //#endregion
905
- //#region src/exceptions/types.d.ts
906
853
  /**
907
854
  * Unified error response shape for logixia.
908
855
  *
@@ -1010,8 +957,6 @@ interface ErrorDetail {
1010
957
  */
1011
958
  code: string;
1012
959
  }
1013
- //#endregion
1014
- //#region src/exceptions/builder.d.ts
1015
960
  /** Input parameters for `ErrorResponseBuilder.build`. */
1016
961
  interface BuildParams {
1017
962
  /** The caught exception — any type. */
@@ -1057,10 +1002,10 @@ interface BuildParams {
1057
1002
  *
1058
1003
  * @example `'550e8400-e29b-41d4-a716-446655440000'`
1059
1004
  */
1060
- declare function generateTraceId(): string;
1005
+ export declare function generateTraceId(): string;
1061
1006
  /** @deprecated Use `generateTraceId` instead. */
1062
- declare const generateRequestId: typeof generateTraceId;
1063
- declare class ErrorResponseBuilder {
1007
+ export declare const generateRequestId: typeof generateTraceId;
1008
+ export declare class ErrorResponseBuilder {
1064
1009
  /**
1065
1010
  * Build a `LogixiaErrorResponse` from any thrown value.
1066
1011
  *
@@ -1097,8 +1042,6 @@ declare class ErrorResponseBuilder {
1097
1042
  httpStatus: number;
1098
1043
  };
1099
1044
  }
1100
- //#endregion
1101
- //#region src/exceptions/exception.d.ts
1102
1045
  /**
1103
1046
  * Constructor options for `LogixiaException`.
1104
1047
  *
@@ -1158,7 +1101,7 @@ interface LogixiaExceptionOptions<TCode extends string = string, TType extends s
1158
1101
  */
1159
1102
  metadata?: Record<string, unknown>;
1160
1103
  }
1161
- declare class LogixiaException<TCode extends string = string, TType extends string = string> extends Error {
1104
+ export declare class LogixiaException<TCode extends string = string, TType extends string = string> extends Error {
1162
1105
  /** @readonly The machine-readable error code supplied by the caller. */
1163
1106
  readonly errorCode: TCode;
1164
1107
  /** @readonly The error type category supplied by the caller. */
@@ -1190,9 +1133,7 @@ declare class LogixiaException<TCode extends string = string, TType extends stri
1190
1133
  * }
1191
1134
  * ```
1192
1135
  */
1193
- declare function isLogixiaException<TCode extends string = string, TType extends string = string>(value?: unknown): value is LogixiaException<TCode, TType>;
1194
- //#endregion
1195
- //#region src/metrics.d.ts
1136
+ export declare function isLogixiaException<TCode extends string = string, TType extends string = string>(value?: unknown): value is LogixiaException<TCode, TType>;
1196
1137
  /**
1197
1138
  * Increment a counter on each matching log entry.
1198
1139
  *
@@ -1265,7 +1206,7 @@ interface GaugeConfig {
1265
1206
  type MetricConfig = CounterConfig | HistogramConfig | GaugeConfig;
1266
1207
  type MetricsMap = Record<string, MetricConfig>;
1267
1208
  /** Label value used for the series that absorbs label sets beyond the cardinality cap. */
1268
- declare const OVERFLOW_LABEL_VALUE = "__overflow__";
1209
+ export declare const OVERFLOW_LABEL_VALUE = "__overflow__";
1269
1210
  interface MetricsPluginOptions {
1270
1211
  /**
1271
1212
  * Maximum number of distinct label sets tracked per metric. Once reached, new
@@ -1291,7 +1232,7 @@ interface MetricsPluginOptions {
1291
1232
  * logger.use(metrics);
1292
1233
  * ```
1293
1234
  */
1294
- declare class MetricsPlugin implements LogixiaPlugin {
1235
+ export declare class MetricsPlugin implements LogixiaPlugin {
1295
1236
  readonly name = "logixia-metrics";
1296
1237
  private readonly map;
1297
1238
  private readonly metricState;
@@ -1382,19 +1323,17 @@ declare class MetricsPlugin implements LogixiaPlugin {
1382
1323
  *
1383
1324
  * Pass `{ maxLabelSets }` to change the per-metric label cardinality cap (default 1000).
1384
1325
  */
1385
- declare function createMetricsPlugin(map: MetricsMap, options?: MetricsPluginOptions): MetricsPlugin;
1386
- //#endregion
1387
- //#region src/index.d.ts
1326
+ export declare function createMetricsPlugin(map: MetricsMap, options?: MetricsPluginOptions): MetricsPlugin;
1388
1327
  /**
1389
1328
  * Create a new Logixia logger instance with TypeScript support for custom levels
1390
1329
  * @param config - Logger configuration
1391
1330
  * @returns Typed logger instance
1392
1331
  */
1393
- declare const createLogger: typeof createLogger$1;
1332
+ export declare const createLogger: typeof createLogger$1;
1394
1333
  /**
1395
1334
  * Default logger instance
1396
1335
  */
1397
- declare const logger: LogixiaLogger<{
1336
+ export declare const logger: LogixiaLogger<{
1398
1337
  appName: string;
1399
1338
  environment: Environment;
1400
1339
  traceId: boolean;
@@ -1427,6 +1366,8 @@ declare const logger: LogixiaLogger<{
1427
1366
  };
1428
1367
  outputs: string[];
1429
1368
  }>;
1430
- //#endregion
1431
- export { AdaptiveSamplingConfig, AnomalyDetection, BasicLogIndexer, BasicSearchEngine, type BuildParams, type CompiledSchema, ContextData, CorrelatedLogs, CorrelationEngine, type CounterConfig, CustomLevelMethods, DEFAULT_CONFIG, DEFAULT_LOG_COLORS, DEFAULT_LOG_LEVELS, DEFAULT_TRACE_HEADERS, type DiscordEmbed, DiscordTransport, type DiscordTransportConfig, EntityType, Environment, type ErrorDetail, ErrorResponseBuilder, ErrorSerializationOptions, ExitMode, ExportOptions, ExtractLevels, FlushOnExitOptions, type GaugeConfig, GracefulShutdownConfig, type HistogramConfig, HttpError, HttpRequest, HttpResponse, IBaseLogger, ILogFormatter, ILogIndexer, ILogSearchEngine, ILogger, ILoggerDefault, JsonFormatter, type LevelSignalOptions, LogCluster, LogColor, type LogContext, LogCorrelationSummary, LogEntry, type LogFieldDef, LogFieldKey, type LogFieldType, LogLevel, LogLevelString, LogPattern, type LogSchema, LoggerConfig, LoggerConfig as LoggerConfigInterface, type LoggerLike, LoggerWithLevels, LogixiaContext, type LogixiaErrorResponse, LogixiaException, type LogixiaExceptionOptions, LogixiaLogger, type LogixiaPlugin, MAX_INCOMING_ID_LENGTH, type MetricConfig, type MetricsMap, MetricsPlugin, type MetricsPluginOptions, NLPSearchEngine, NamespaceLevels, OVERFLOW_LABEL_VALUE, type OtelBridgeOptions, type OtelSpanContext, OtlpLogTransport, type OtlpLogTransportConfig, ParsedNLQuery, PatternRecognitionEngine, PluginRegistry, QueryEntity, QueryIntent, type ReconfigurableLogger, type RedactConfig, RelatedLog, RelationshipType, RelativeTime, RequestContext, RequestMetrics, RequestTiming, type SafeStringifyOptions, SamplingConfig, type SamplingStats, SearchFilters, SearchHighlight, SearchManager, SearchManagerConfig, SearchMatch, SearchOptions, SearchPreset, SearchQuery, SearchResult, SearchStats, SearchSuggestion, SemanticIndex, SimilarLog, type SlackMessage, SlackTransport, type SlackTransportConfig, SortField, SuggestionType, TRACE_CONTEXT_KEY, TextFormatter, TimeRange, TimelineEvent, TimingEntry, TraceContext, TraceIdConfig, TraceIdExtractorConfig, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, _setActiveContextKey, _shutdownRegistrySize, addEventFields, applyRedaction, createExpressContextMiddleware, createFastifyContextHook, createLevelControlHandler, createLogger, createMetricsPlugin, createTraceMiddleware, createTypedLogger, decycleValue, defineLogSchema, deregisterFromShutdown, disableOtelBridge, extractTraceId, flushOnExit, generateRequestId, generateTraceId, getActiveOtelContext, getCurrentTraceId, getEventFields, getOtelMetaFields, getTraceContextKey, globalPluginRegistry, initOtelBridge, isError, isLogixiaException, logger, normalizeError, redactObject, registerForShutdown, registerLevelSignal, resetShutdownHandlers, retrocycle, runWithTraceId, safeStringify, sanitizeIncomingId, serializeError, setEventField, setTraceId, stringifyForLog, toOtelSeverity, traceStorage, usePlugin, wideEventMiddleware, withWideEvent };
1369
+ /**
1370
+ * Export default configuration for reference
1371
+ */
1372
+ export { AdaptiveSamplingConfig, type AnomalyDetection, BasicLogIndexer, BasicSearchEngine, type BuildParams, type CompiledSchema, ContextData, type CorrelatedLogs, CorrelationEngine, type CounterConfig, CustomLevelMethods, DEFAULT_LOG_COLORS, DEFAULT_LOG_LEVELS, type DiscordEmbed, DiscordTransport, type DiscordTransportConfig, type EntityType, Environment, type ErrorDetail, ErrorSerializationOptions, type ExportOptions, ExtractLevels, type GaugeConfig, GracefulShutdownConfig, type HistogramConfig, HttpError, HttpRequest, HttpResponse, IBaseLogger, ILogFormatter, type ILogIndexer, type ILogSearchEngine, ILogger, ILoggerDefault, type LevelSignalOptions, type LogCluster, LogColor, type LogContext, type LogCorrelationSummary, LogEntry, type LogFieldDef, LogFieldKey, type LogFieldType, LogLevel, LogLevelString, type LogPattern, type LogSchema, LoggerConfig, type LoggerConfig as LoggerConfigInterface, type LoggerLike, LoggerWithLevels, type LogixiaErrorResponse, type LogixiaExceptionOptions, LogixiaLogger, type LogixiaPlugin, type MetricConfig, type MetricsMap, type MetricsPluginOptions, NLPSearchEngine, NamespaceLevels, type OtelBridgeOptions, type OtelSpanContext, OtlpLogTransport, type OtlpLogTransportConfig, type ParsedNLQuery, PatternRecognitionEngine, PluginRegistry, type QueryEntity, type QueryIntent, type ReconfigurableLogger, RedactConfig, type RelatedLog, type RelationshipType, type RelativeTime, RequestContext, RequestMetrics, RequestTiming, type SafeStringifyOptions, SamplingConfig, type SamplingStats, type SearchFilters, type SearchHighlight, SearchManager, type SearchManagerConfig, type SearchMatch, type SearchOptions, type SearchPreset, type SearchQuery, type SearchResult, type SearchStats, type SearchSuggestion, type SemanticIndex, type SimilarLog, type SlackMessage, SlackTransport, type SlackTransportConfig, type SortField, type SuggestionType, type TimeRange, type TimelineEvent, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, globalPluginRegistry, toOtelSeverity, usePlugin };
1432
1373
  //# sourceMappingURL=index.d.ts.map