logixia 2.0.10 → 2.1.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 (190) hide show
  1. package/README.md +2 -1
  2. package/dist/{async-context-Dv0bmPC-.js → async-context-Dgl3ZLyb.js} +4 -4
  3. package/dist/{async-context-Dv0bmPC-.js.map → async-context-Dgl3ZLyb.js.map} +1 -1
  4. package/dist/{async-context-COuvmwsS.mjs → async-context-fBqC5lNc.mjs} +3 -3
  5. package/dist/{async-context-COuvmwsS.mjs.map → async-context-fBqC5lNc.mjs.map} +1 -1
  6. package/dist/{azure-monitor.transport-CbSHOnNX.d.mts → azure-monitor.transport-C5VjvREZ.d.mts} +2 -2
  7. package/dist/{azure-monitor.transport-CbSHOnNX.d.mts.map → azure-monitor.transport-C5VjvREZ.d.mts.map} +1 -1
  8. package/dist/{azure-monitor.transport-Bvf7Xegt.d.ts → azure-monitor.transport-CyHDjHS-.d.ts} +2 -2
  9. package/dist/{azure-monitor.transport-Bvf7Xegt.d.ts.map → azure-monitor.transport-CyHDjHS-.d.ts.map} +1 -1
  10. package/dist/{azure-monitor.transport-Coz5Gesu.mjs → azure-monitor.transport-DGiacfvT.mjs} +19 -8
  11. package/dist/{azure-monitor.transport-Coz5Gesu.mjs.map → azure-monitor.transport-DGiacfvT.mjs.map} +1 -1
  12. package/dist/{azure-monitor.transport-D6ryi8rA.js → azure-monitor.transport-DX3fuK2t.js} +19 -8
  13. package/dist/{azure-monitor.transport-D6ryi8rA.js.map → azure-monitor.transport-DX3fuK2t.js.map} +1 -1
  14. package/dist/azure.d.mts +1 -1
  15. package/dist/azure.d.ts +1 -1
  16. package/dist/azure.js +1 -1
  17. package/dist/azure.mjs +1 -1
  18. package/dist/{batch-buffer-CFzKnuNZ.js → batch-buffer-BLmVvJAZ.js} +11 -7
  19. package/dist/{batch-buffer-CFzKnuNZ.js.map → batch-buffer-BLmVvJAZ.js.map} +1 -1
  20. package/dist/{batch-buffer-CQUWDMYq.mjs → batch-buffer-CM-lK_Qy.mjs} +11 -7
  21. package/dist/{batch-buffer-CQUWDMYq.mjs.map → batch-buffer-CM-lK_Qy.mjs.map} +1 -1
  22. package/dist/browser.d.mts +2 -0
  23. package/dist/browser.d.mts.map +1 -1
  24. package/dist/browser.d.ts +2 -0
  25. package/dist/browser.d.ts.map +1 -1
  26. package/dist/browser.js +42 -13
  27. package/dist/browser.js.map +1 -1
  28. package/dist/browser.mjs +42 -13
  29. package/dist/browser.mjs.map +1 -1
  30. package/dist/{builder-Bj3mDeBw.mjs → builder-CA_dokb4.mjs} +246 -101
  31. package/dist/builder-CA_dokb4.mjs.map +1 -0
  32. package/dist/{builder-BLIStsCK.js → builder-jMlVYaQa.js} +256 -111
  33. package/dist/builder-jMlVYaQa.js.map +1 -0
  34. package/dist/cli/index.js +21 -16
  35. package/dist/cloudwatch.d.mts +1 -1
  36. package/dist/cloudwatch.d.ts +1 -1
  37. package/dist/cloudwatch.js +1 -1
  38. package/dist/cloudwatch.mjs +1 -1
  39. package/dist/{cloudwatch.transport-Cr1aeTGj.mjs → cloudwatch.transport-Cr0fEpko.mjs} +24 -9
  40. package/dist/{cloudwatch.transport-Cr1aeTGj.mjs.map → cloudwatch.transport-Cr0fEpko.mjs.map} +1 -1
  41. package/dist/{cloudwatch.transport-CQyT6U91.d.ts → cloudwatch.transport-DdSjUWvu.d.ts} +2 -2
  42. package/dist/{cloudwatch.transport-CQyT6U91.d.ts.map → cloudwatch.transport-DdSjUWvu.d.ts.map} +1 -1
  43. package/dist/{cloudwatch.transport-D4G5xYfG.js → cloudwatch.transport-Lst1Bbmr.js} +24 -9
  44. package/dist/{cloudwatch.transport-D4G5xYfG.js.map → cloudwatch.transport-Lst1Bbmr.js.map} +1 -1
  45. package/dist/{cloudwatch.transport-CjVrI6S4.d.mts → cloudwatch.transport-_hS7Mcc5.d.mts} +2 -2
  46. package/dist/{cloudwatch.transport-CjVrI6S4.d.mts.map → cloudwatch.transport-_hS7Mcc5.d.mts.map} +1 -1
  47. package/dist/correlation.js +3 -3
  48. package/dist/correlation.mjs +3 -3
  49. package/dist/{coerce.utils-C1C5sIX0.js → csv.utils-CbVHY1pd.js} +24 -1
  50. package/dist/csv.utils-CbVHY1pd.js.map +1 -0
  51. package/dist/{coerce.utils-B_rEudCn.mjs → csv.utils-ZdxSod5g.mjs} +19 -2
  52. package/dist/csv.utils-ZdxSod5g.mjs.map +1 -0
  53. package/dist/{entry-fields-CVwoQplO.js → entry-fields-BSLkzw18.js} +3 -3
  54. package/dist/{entry-fields-CVwoQplO.js.map → entry-fields-BSLkzw18.js.map} +1 -1
  55. package/dist/{entry-fields-DNTKQxoU.mjs → entry-fields-J1OBi24o.mjs} +2 -2
  56. package/dist/{entry-fields-DNTKQxoU.mjs.map → entry-fields-J1OBi24o.mjs.map} +1 -1
  57. package/dist/gcp.d.mts +1 -1
  58. package/dist/gcp.d.ts +1 -1
  59. package/dist/gcp.js +1 -1
  60. package/dist/gcp.mjs +1 -1
  61. package/dist/{gcp.transport-CVuRpchl.js → gcp.transport-5-ZIjN8r.js} +18 -9
  62. package/dist/{gcp.transport-CVuRpchl.js.map → gcp.transport-5-ZIjN8r.js.map} +1 -1
  63. package/dist/{gcp.transport-D9SdLPwP.d.mts → gcp.transport-C8VJiEM7.d.mts} +2 -2
  64. package/dist/{gcp.transport-D9SdLPwP.d.mts.map → gcp.transport-C8VJiEM7.d.mts.map} +1 -1
  65. package/dist/{gcp.transport-BCIvdFV-.d.ts → gcp.transport-Ct0BtKFo.d.ts} +2 -2
  66. package/dist/{gcp.transport-BCIvdFV-.d.ts.map → gcp.transport-Ct0BtKFo.d.ts.map} +1 -1
  67. package/dist/{gcp.transport-LLK2bw2-.mjs → gcp.transport-Cw3Qke85.mjs} +18 -9
  68. package/dist/{gcp.transport-LLK2bw2-.mjs.map → gcp.transport-Cw3Qke85.mjs.map} +1 -1
  69. package/dist/{index-BAkPHp5D.d.mts → index-B3ajtXJd.d.mts} +2 -2
  70. package/dist/{index-BAkPHp5D.d.mts.map → index-B3ajtXJd.d.mts.map} +1 -1
  71. package/dist/{index-e7LowmAu.d.ts → index-oqD3WNxf.d.ts} +2 -2
  72. package/dist/{index-e7LowmAu.d.ts.map → index-oqD3WNxf.d.ts.map} +1 -1
  73. package/dist/index.d.mts +8 -7
  74. package/dist/index.d.mts.map +1 -1
  75. package/dist/index.d.ts +8 -7
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +44 -26
  78. package/dist/index.js.map +1 -1
  79. package/dist/index.mjs +34 -17
  80. package/dist/index.mjs.map +1 -1
  81. package/dist/{logitron-logger-DVUdgmBY.d.ts → logitron-logger-Csn3e6Qu.d.ts} +2 -2
  82. package/dist/{logitron-logger-DVUdgmBY.d.ts.map → logitron-logger-Csn3e6Qu.d.ts.map} +1 -1
  83. package/dist/{logitron-logger-DoWmMjYB.d.mts → logitron-logger-fMOkXr8H.d.mts} +2 -2
  84. package/dist/{logitron-logger-DoWmMjYB.d.mts.map → logitron-logger-fMOkXr8H.d.mts.map} +1 -1
  85. package/dist/middleware.d.mts +1 -1
  86. package/dist/middleware.d.mts.map +1 -1
  87. package/dist/middleware.d.ts +1 -1
  88. package/dist/middleware.d.ts.map +1 -1
  89. package/dist/middleware.js +12 -7
  90. package/dist/middleware.js.map +1 -1
  91. package/dist/middleware.mjs +11 -6
  92. package/dist/middleware.mjs.map +1 -1
  93. package/dist/nest.d.mts +51 -18
  94. package/dist/nest.d.mts.map +1 -1
  95. package/dist/nest.d.ts +51 -18
  96. package/dist/nest.d.ts.map +1 -1
  97. package/dist/nest.js +207 -65
  98. package/dist/nest.js.map +1 -1
  99. package/dist/nest.mjs +202 -60
  100. package/dist/nest.mjs.map +1 -1
  101. package/dist/{otel-ChnVYRLA.js → otel-8ypFGG19.js} +452 -120
  102. package/dist/otel-8ypFGG19.js.map +1 -0
  103. package/dist/{otel-DOuwGPCd.mjs → otel-b-s2QbY4.mjs} +450 -118
  104. package/dist/otel-b-s2QbY4.mjs.map +1 -0
  105. package/dist/own-property-BWkibepN.js +40 -0
  106. package/dist/own-property-BWkibepN.js.map +1 -0
  107. package/dist/own-property-CjFw9qwZ.mjs +29 -0
  108. package/dist/own-property-CjFw9qwZ.mjs.map +1 -0
  109. package/dist/{request-trace-ByujsUZk.js → request-trace-C7kXMjx5.js} +5 -6
  110. package/dist/{request-trace-ByujsUZk.js.map → request-trace-C7kXMjx5.js.map} +1 -1
  111. package/dist/{request-trace-BgNykH9M.mjs → request-trace-Dekcnenb.mjs} +5 -6
  112. package/dist/{request-trace-BgNykH9M.mjs.map → request-trace-Dekcnenb.mjs.map} +1 -1
  113. package/dist/{safe-stringify--7gbe95n.mjs → safe-stringify-B5p5ktFe.mjs} +2 -2
  114. package/dist/{safe-stringify--7gbe95n.mjs.map → safe-stringify-B5p5ktFe.mjs.map} +1 -1
  115. package/dist/{safe-stringify-CN7icp8S.js → safe-stringify-J3sh-7YM.js} +5 -5
  116. package/dist/{safe-stringify-CN7icp8S.js.map → safe-stringify-J3sh-7YM.js.map} +1 -1
  117. package/dist/{search-DPwTKPve.d.ts → search-B-hJe2N-.d.mts} +9 -8
  118. package/dist/{search-D-8HJADE.d.mts.map → search-B-hJe2N-.d.mts.map} +1 -1
  119. package/dist/{search-D-8HJADE.d.mts → search-BlKBLm5D.d.ts} +9 -8
  120. package/dist/{search-DPwTKPve.d.ts.map → search-BlKBLm5D.d.ts.map} +1 -1
  121. package/dist/{search-DAXKE-P9.mjs → search-CTR4XNHq.mjs} +91 -44
  122. package/dist/search-CTR4XNHq.mjs.map +1 -0
  123. package/dist/{search-CRjhHxe9.js → search-_qx4YzRP.js} +94 -47
  124. package/dist/search-_qx4YzRP.js.map +1 -0
  125. package/dist/search.d.mts +1 -1
  126. package/dist/search.d.ts +1 -1
  127. package/dist/search.js +1 -1
  128. package/dist/search.mjs +1 -1
  129. package/dist/{secret-config-BvFl2dC8.js → secret-config--cVTOWwp.js} +6 -5
  130. package/dist/{secret-config-BvFl2dC8.js.map → secret-config--cVTOWwp.js.map} +1 -1
  131. package/dist/{secret-config-ByGq7kJd.mjs → secret-config-GKmb15Me.mjs} +3 -2
  132. package/dist/{secret-config-ByGq7kJd.mjs.map → secret-config-GKmb15Me.mjs.map} +1 -1
  133. package/dist/{sensitive-names-o__1PUUR.mjs → sensitive-names-BiBM6R1X.mjs} +2 -28
  134. package/dist/sensitive-names-BiBM6R1X.mjs.map +1 -0
  135. package/dist/{sensitive-names-CHMowujD.js → sensitive-names-NiKIRhp5.js} +5 -37
  136. package/dist/sensitive-names-NiKIRhp5.js.map +1 -0
  137. package/dist/{slack.transport-BDyENuR0.d.mts → slack.transport-5OPL7H3u.d.mts} +76 -3
  138. package/dist/slack.transport-5OPL7H3u.d.mts.map +1 -0
  139. package/dist/{slack.transport-C6E0l4kw.d.ts → slack.transport-BFpBD_Ri.d.ts} +76 -3
  140. package/dist/slack.transport-BFpBD_Ri.d.ts.map +1 -0
  141. package/dist/{slack.transport-zLQ9MGxS.js → slack.transport-Cpx5fKga.js} +272 -21
  142. package/dist/slack.transport-Cpx5fKga.js.map +1 -0
  143. package/dist/{slack.transport-CSj1j0_X.mjs → slack.transport-Qwj9WkrJ.mjs} +267 -22
  144. package/dist/slack.transport-Qwj9WkrJ.mjs.map +1 -0
  145. package/dist/testing.d.mts +1 -1
  146. package/dist/testing.d.ts +1 -1
  147. package/dist/{transport.types-CzJq4IrF.d.ts → transport.types-B1ejJJP6.d.mts} +6 -1
  148. package/dist/transport.types-B1ejJJP6.d.mts.map +1 -0
  149. package/dist/{transport.types-CzJq4IrF.d.mts → transport.types-B1ejJJP6.d.ts} +6 -1
  150. package/dist/transport.types-B1ejJJP6.d.ts.map +1 -0
  151. package/dist/transports.d.mts +61 -11
  152. package/dist/transports.d.mts.map +1 -1
  153. package/dist/transports.d.ts +61 -11
  154. package/dist/transports.d.ts.map +1 -1
  155. package/dist/transports.js +7 -6
  156. package/dist/transports.mjs +7 -7
  157. package/dist/worker-entry.js +200 -52
  158. package/dist/worker.d.mts +1 -1
  159. package/dist/worker.d.ts +1 -1
  160. package/dist/worker.js +1 -1
  161. package/dist/worker.mjs +1 -1
  162. package/dist/{worker.transport-B9mCQSM1.d.ts → worker.transport-B7olL1Uh.d.ts} +12 -2
  163. package/dist/worker.transport-B7olL1Uh.d.ts.map +1 -0
  164. package/dist/{worker.transport-D78xhNhB.mjs → worker.transport-BHnWDXPH.mjs} +59 -13
  165. package/dist/worker.transport-BHnWDXPH.mjs.map +1 -0
  166. package/dist/{worker.transport-DQDv1nAJ.js → worker.transport-C7jNGhev.js} +59 -13
  167. package/dist/worker.transport-C7jNGhev.js.map +1 -0
  168. package/dist/{worker.transport-Bl8lFRck.d.mts → worker.transport-DnU0_9Bd.d.mts} +12 -2
  169. package/dist/worker.transport-DnU0_9Bd.d.mts.map +1 -0
  170. package/package.json +10 -3
  171. package/dist/builder-BLIStsCK.js.map +0 -1
  172. package/dist/builder-Bj3mDeBw.mjs.map +0 -1
  173. package/dist/coerce.utils-B_rEudCn.mjs.map +0 -1
  174. package/dist/coerce.utils-C1C5sIX0.js.map +0 -1
  175. package/dist/otel-ChnVYRLA.js.map +0 -1
  176. package/dist/otel-DOuwGPCd.mjs.map +0 -1
  177. package/dist/search-CRjhHxe9.js.map +0 -1
  178. package/dist/search-DAXKE-P9.mjs.map +0 -1
  179. package/dist/sensitive-names-CHMowujD.js.map +0 -1
  180. package/dist/sensitive-names-o__1PUUR.mjs.map +0 -1
  181. package/dist/slack.transport-BDyENuR0.d.mts.map +0 -1
  182. package/dist/slack.transport-C6E0l4kw.d.ts.map +0 -1
  183. package/dist/slack.transport-CSj1j0_X.mjs.map +0 -1
  184. package/dist/slack.transport-zLQ9MGxS.js.map +0 -1
  185. package/dist/transport.types-CzJq4IrF.d.mts.map +0 -1
  186. package/dist/transport.types-CzJq4IrF.d.ts.map +0 -1
  187. package/dist/worker.transport-B9mCQSM1.d.ts.map +0 -1
  188. package/dist/worker.transport-Bl8lFRck.d.mts.map +0 -1
  189. package/dist/worker.transport-D78xhNhB.mjs.map +0 -1
  190. package/dist/worker.transport-DQDv1nAJ.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { u as isProtoKey } from "./sensitive-names-o__1PUUR.mjs";
1
+ import { n as isProtoKey } from "./own-property-CjFw9qwZ.mjs";
2
2
  // src/transports/entry-fields.ts
3
3
  const PAYLOAD_PREFIX = "data_";
4
4
  /**
@@ -31,4 +31,4 @@ function mergeCoreFields(core, data, extraReserved = []) {
31
31
  }
32
32
  export { mergeCoreFields as t };
33
33
 
34
- //# sourceMappingURL=entry-fields-DNTKQxoU.mjs.map
34
+ //# sourceMappingURL=entry-fields-J1OBi24o.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry-fields-DNTKQxoU.mjs","names":[],"sources":["../src/transports/entry-fields.ts"],"sourcesContent":["import { isProtoKey } from '../utils/own-property';\n\nconst PAYLOAD_PREFIX = 'data_';\n\n/**\n * Copies `core` and then the user payload into one object. The core fields stay\n * authoritative: a payload key that matches a core key (even one whose value is\n * undefined) or a reserved name is kept under a `data_` prefix instead. The\n * prefix is repeated until the name is free of core keys and of every other\n * payload key, so the result does not depend on key order and a payload's own\n * `data_level` stays where it is.\n *\n * Exception: a payload `traceId` equal to the core `traceId` is a duplicate (the\n * context middleware copies the trace id into the payload) and is dropped rather\n * than emitted again as `data_traceId`. A different value is still kept.\n */\nexport function mergeCoreFields(\n core: Record<string, unknown>,\n data: Record<string, unknown> | undefined,\n extraReserved: readonly string[] = []\n): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...core };\n if (!data) return merged;\n const reserved = new Set([...Object.keys(core), ...extraReserved]);\n const payloadKeys = new Set(Object.keys(data));\n for (const key of payloadKeys) {\n if (isProtoKey(key)) continue;\n if (key === 'traceId' && core['traceId'] !== undefined && data[key] === core['traceId'])\n continue;\n let target = key;\n if (reserved.has(target)) {\n do {\n target = `${PAYLOAD_PREFIX}${target}`;\n } while (reserved.has(target) || payloadKeys.has(target));\n }\n merged[target] = data[key];\n }\n return merged;\n}\n"],"mappings":";;AAEA,MAAM,iBAAiB;;;;;;;;;;;;;AAcvB,SAAgB,gBACd,MACA,MACA,gBAAmC,CAAC,GACX;CACzB,MAAM,SAAkC,EAAE,GAAG,KAAK;CAClD,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,IAAI,GAAG,GAAG,aAAa,CAAC;CACjE,MAAM,cAAc,IAAI,IAAI,OAAO,KAAK,IAAI,CAAC;CAC7C,KAAK,MAAM,OAAO,aAAa;EAC7B,IAAI,WAAW,GAAG,GAAG;EACrB,IAAI,QAAQ,aAAa,KAAK,eAAe,KAAA,KAAa,KAAK,SAAS,KAAK,YAC3E;EACF,IAAI,SAAS;EACb,IAAI,SAAS,IAAI,MAAM,GACrB;GACE,SAAS,GAAG,iBAAiB;SACtB,SAAS,IAAI,MAAM,KAAK,YAAY,IAAI,MAAM;EAEzD,OAAO,UAAU,KAAK;CACxB;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"entry-fields-J1OBi24o.mjs","names":[],"sources":["../src/transports/entry-fields.ts"],"sourcesContent":["import { isProtoKey } from '../utils/own-property';\n\nconst PAYLOAD_PREFIX = 'data_';\n\n/**\n * Copies `core` and then the user payload into one object. The core fields stay\n * authoritative: a payload key that matches a core key (even one whose value is\n * undefined) or a reserved name is kept under a `data_` prefix instead. The\n * prefix is repeated until the name is free of core keys and of every other\n * payload key, so the result does not depend on key order and a payload's own\n * `data_level` stays where it is.\n *\n * Exception: a payload `traceId` equal to the core `traceId` is a duplicate (the\n * context middleware copies the trace id into the payload) and is dropped rather\n * than emitted again as `data_traceId`. A different value is still kept.\n */\nexport function mergeCoreFields(\n core: Record<string, unknown>,\n data: Record<string, unknown> | undefined,\n extraReserved: readonly string[] = []\n): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...core };\n if (!data) return merged;\n const reserved = new Set([...Object.keys(core), ...extraReserved]);\n const payloadKeys = new Set(Object.keys(data));\n for (const key of payloadKeys) {\n if (isProtoKey(key)) continue;\n if (key === 'traceId' && core['traceId'] !== undefined && data[key] === core['traceId'])\n continue;\n let target = key;\n if (reserved.has(target)) {\n do {\n target = `${PAYLOAD_PREFIX}${target}`;\n } while (reserved.has(target) || payloadKeys.has(target));\n }\n merged[target] = data[key];\n }\n return merged;\n}\n"],"mappings":";;AAEA,MAAM,iBAAiB;;;;;;;;;;;;;AAcvB,SAAgB,gBACd,MACA,MACA,gBAAmC,CAAC,GACX;CACzB,MAAM,SAAkC,EAAE,GAAG,KAAK;CAClD,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,IAAI,GAAG,GAAG,aAAa,CAAC;CACjE,MAAM,cAAc,IAAI,IAAI,OAAO,KAAK,IAAI,CAAC;CAC7C,KAAK,MAAM,OAAO,aAAa;EAC7B,IAAI,WAAW,GAAG,GAAG;EACrB,IAAI,QAAQ,aAAa,KAAK,eAAe,KAAA,KAAa,KAAK,SAAS,KAAK,YAC3E;EACF,IAAI,SAAS;EACb,IAAI,SAAS,IAAI,MAAM,GACrB;GACE,SAAS,GAAG,iBAAiB;SACtB,SAAS,IAAI,MAAM,KAAK,YAAY,IAAI,MAAM;EAEzD,OAAO,UAAU,KAAK;CACxB;CACA,OAAO;AACT"}
package/dist/gcp.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as GCPTransport, r as GCPTransportConfig, t as GCPMonitoredResource } from "./gcp.transport-D9SdLPwP.mjs";
1
+ import { n as GCPTransport, r as GCPTransportConfig, t as GCPMonitoredResource } from "./gcp.transport-C8VJiEM7.mjs";
2
2
  export { GCPMonitoredResource, GCPTransport, GCPTransportConfig };
package/dist/gcp.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as GCPTransport, r as GCPTransportConfig, t as GCPMonitoredResource } from "./gcp.transport-BCIvdFV-.js";
1
+ import { n as GCPTransport, r as GCPTransportConfig, t as GCPMonitoredResource } from "./gcp.transport-Ct0BtKFo.js";
2
2
  export { GCPMonitoredResource, GCPTransport, GCPTransportConfig };
package/dist/gcp.js CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_gcp_transport = require("./gcp.transport-CVuRpchl.js");
2
+ const require_gcp_transport = require("./gcp.transport-5-ZIjN8r.js");
3
3
  exports.GCPTransport = require_gcp_transport.GCPTransport;
package/dist/gcp.mjs CHANGED
@@ -1 +1 @@
1
- export { t as GCPTransport } from "./gcp.transport-LLK2bw2-.mjs";
1
+ export { t as GCPTransport } from "./gcp.transport-Cw3Qke85.mjs";
@@ -1,8 +1,8 @@
1
- const require_secret_config = require("./secret-config-BvFl2dC8.js");
1
+ const require_secret_config = require("./secret-config--cVTOWwp.js");
2
2
  const require_internal_log = require("./internal-log-DwqTjhpb.js");
3
- const require_safe_stringify = require("./safe-stringify-CN7icp8S.js");
4
- const require_entry_fields = require("./entry-fields-CVwoQplO.js");
5
- const require_batch_buffer = require("./batch-buffer-CFzKnuNZ.js");
3
+ const require_safe_stringify = require("./safe-stringify-J3sh-7YM.js");
4
+ const require_entry_fields = require("./entry-fields-BSLkzw18.js");
5
+ const require_batch_buffer = require("./batch-buffer-BLmVvJAZ.js");
6
6
  let node_https = require("node:https");
7
7
  node_https = require_secret_config.__toESM(node_https);
8
8
  // src/transports/gcp.transport.ts
@@ -57,11 +57,20 @@ function toGcpSeverity(level) {
57
57
  * Google Cloud Logging transport with trace correlation and GCP severity mapping.
58
58
  */
59
59
  var GCPTransport = class {
60
+ name = "gcp";
61
+ batchSize;
62
+ flushInterval;
63
+ level;
64
+ buffer;
65
+ requestTimeoutMs;
66
+ flushTimer = null;
67
+ accessToken = null;
68
+ tokenExpiry = 0;
69
+ projectId;
70
+ logName;
71
+ resource;
72
+ credentials;
60
73
  constructor(config) {
61
- this.name = "gcp";
62
- this.flushTimer = null;
63
- this.accessToken = null;
64
- this.tokenExpiry = 0;
65
74
  require_secret_config.protectSecrets(this, ["credentials", "accessToken"]);
66
75
  this.projectId = config.projectId ?? process.env["GOOGLE_CLOUD_PROJECT"] ?? process.env["GCLOUD_PROJECT"] ?? "unknown-project";
67
76
  this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;
@@ -237,4 +246,4 @@ Object.defineProperty(exports, "GCPTransport", {
237
246
  }
238
247
  });
239
248
 
240
- //# sourceMappingURL=gcp.transport-CVuRpchl.js.map
249
+ //# sourceMappingURL=gcp.transport-5-ZIjN8r.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gcp.transport-CVuRpchl.js","names":["BatchBuffer","mergeCoreFields","https","httpRequest","stringifyForLog"],"sources":["../src/transports/gcp.transport.ts"],"sourcesContent":["/**\n * logixia — Google Cloud Logging (Stackdriver) transport\n *\n * Maps logixia log entries to the GCP Logging REST API format:\n * - Maps `level` → `severity` (INFO, WARNING, ERROR, CRITICAL…)\n * - Injects `logging.googleapis.com/trace` for Cloud Trace correlation\n * - Sets `traceSampled: true` whenever a trace id is present\n * (`logging.googleapis.com/spanId` and `sourceLocation` are not populated)\n * - Supports structured `jsonPayload` and plain `textPayload`\n *\n * Auth: the metadata server on GCE/GKE/Cloud Run, or a service-account key passed\n * as `credentials`. The `GOOGLE_APPLICATION_CREDENTIALS` key-file variable is not\n * read; full ADC is not supported.\n *\n * @example\n * ```ts\n * import { createLogger } from 'logixia';\n * import { GCPTransport } from 'logixia/gcp';\n *\n * const logger = createLogger({\n * transports: {\n * custom: [\n * new GCPTransport({\n * projectId: process.env.GOOGLE_CLOUD_PROJECT,\n * logName: 'projects/my-project/logs/api',\n * resource: { type: 'gce_instance', labels: { instance_id: '123' } },\n * }),\n * ],\n * },\n * });\n * ```\n */\n\nimport * as https from 'node:https';\n\nimport type { IAsyncTransport, TransportLogEntry } from '../types/transport.types';\nimport { internalError } from '../utils/internal-log';\nimport { stringifyForLog } from '../utils/safe-stringify';\nimport {\n BatchBuffer,\n DEFAULT_MAX_BUFFER_SIZE,\n DEFAULT_REQUEST_TIMEOUT_MS,\n httpRequest,\n} from './batch-buffer';\nimport { mergeCoreFields } from './entry-fields';\nimport { protectSecrets } from './secret-config';\n\nexport interface GCPMonitoredResource {\n type: string;\n labels?: Record<string, string>;\n}\n\nexport interface GCPTransportConfig {\n /** GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` or `GCLOUD_PROJECT` env vars. */\n projectId?: string;\n /**\n * Full log name, e.g. `'projects/my-project/logs/api'`.\n * If omitted, defaults to `projects/{projectId}/logs/logixia`.\n */\n logName?: string;\n /** Monitored resource descriptor. Defaults to `global`. */\n resource?: GCPMonitoredResource;\n /**\n * Service account key JSON (parsed). If omitted, only the metadata server\n * (GCE/GKE/Cloud Run) is tried; the key-file env var is not read.\n */\n credentials?: {\n client_email: string;\n private_key: string;\n };\n /** Number of entries to batch. @default 200 */\n batchSize?: number;\n /** Flush interval in ms. @default 5000 */\n flushIntervalMs?: number;\n /** Abort a request that has not finished after this many ms. @default 10000 */\n requestTimeoutMs?: number;\n /** Max buffered entries; the oldest are dropped past this. @default 10000 */\n maxBufferSize?: number;\n level?: string;\n}\n\ntype GcpSeverity =\n | 'DEFAULT'\n | 'DEBUG'\n | 'INFO'\n | 'NOTICE'\n | 'WARNING'\n | 'ERROR'\n | 'CRITICAL'\n | 'ALERT'\n | 'EMERGENCY';\n\nfunction toGcpSeverity(level: string): GcpSeverity {\n switch (level.toLowerCase()) {\n case 'trace':\n case 'verbose':\n case 'debug':\n return 'DEBUG';\n case 'info':\n case 'log':\n return 'INFO';\n case 'warn':\n case 'warning':\n return 'WARNING';\n case 'error':\n return 'ERROR';\n case 'critical':\n case 'fatal':\n return 'CRITICAL';\n default:\n return 'DEFAULT';\n }\n}\n\n/**\n * Google Cloud Logging transport with trace correlation and GCP severity mapping.\n */\nexport class GCPTransport implements IAsyncTransport {\n public readonly name = 'gcp';\n public readonly batchSize: number;\n public readonly flushInterval: number;\n public readonly level: string | undefined;\n\n private readonly buffer: BatchBuffer<TransportLogEntry>;\n private readonly requestTimeoutMs: number;\n private flushTimer: NodeJS.Timeout | null = null;\n private accessToken: string | null = null;\n private tokenExpiry = 0;\n\n private readonly projectId: string;\n private readonly logName: string;\n private readonly resource: GCPMonitoredResource;\n private readonly credentials: { client_email: string; private_key: string } | undefined;\n\n constructor(config: GCPTransportConfig) {\n protectSecrets(this, ['credentials', 'accessToken']);\n this.projectId =\n config.projectId ??\n process.env['GOOGLE_CLOUD_PROJECT'] ??\n process.env['GCLOUD_PROJECT'] ??\n 'unknown-project';\n this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;\n this.resource = config.resource ?? { type: 'global' };\n this.credentials = config.credentials;\n this.batchSize = config.batchSize ?? 200;\n this.flushInterval = config.flushIntervalMs ?? 5000;\n this.level = config.level;\n this.requestTimeoutMs = config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;\n this.buffer = new BatchBuffer<TransportLogEntry>({\n name: 'GCPTransport',\n batchSize: this.batchSize,\n maxBufferSize: config.maxBufferSize ?? DEFAULT_MAX_BUFFER_SIZE,\n send: (entries) => this.writeEntries(entries),\n secrets: () => this.secretValues(),\n });\n\n this.flushTimer = setInterval(() => {\n this.flush().catch(() => {});\n }, this.flushInterval);\n if (this.flushTimer.unref) this.flushTimer.unref();\n }\n\n write(entry: TransportLogEntry): void {\n this.buffer.push(entry);\n this.buffer.flushIfFull();\n }\n\n flush(): Promise<void> {\n return this.buffer.flush();\n }\n\n /**\n * Flush remaining entries and stop the interval timer on shutdown. Without\n * this the manager's close() skipped the transport (close was undefined) and\n * buffered entries were lost on deploy. Waits for any in-flight send first.\n */\n async close(): Promise<void> {\n if (this.flushTimer) {\n clearInterval(this.flushTimer);\n this.flushTimer = null;\n }\n await this.buffer.close();\n }\n\n private buildLogEntry(entry: TransportLogEntry): Record<string, unknown> {\n const gcpEntry: Record<string, unknown> = {\n logName: this.logName,\n resource: this.resource,\n severity: toGcpSeverity(entry.level),\n timestamp: entry.timestamp ?? new Date().toISOString(),\n jsonPayload: mergeCoreFields(\n { message: entry.message, appName: entry.appName, context: entry.context },\n entry.data\n ),\n };\n\n // GCP Cloud Trace correlation\n if (entry.traceId) {\n gcpEntry['trace'] = `projects/${this.projectId}/traces/${entry.traceId}`;\n gcpEntry['traceSampled'] = true;\n }\n\n return gcpEntry;\n }\n\n private async getAccessToken(): Promise<string | null> {\n if (this.accessToken && Date.now() < this.tokenExpiry) return this.accessToken;\n\n // Try ADC metadata server (GCE/GKE/Cloud Run)\n try {\n const token = await this.fetchFromMetadataServer();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000; // 55 minutes\n return this.accessToken;\n }\n } catch {\n /* fall through to service account */\n }\n\n // Try service account key\n if (this.credentials) {\n try {\n const token = await this.fetchServiceAccountToken();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000;\n return this.accessToken;\n }\n } catch (err) {\n internalError('GCPTransport service account token error', err);\n }\n }\n\n return null;\n }\n\n private fetchFromMetadataServer(): Promise<string | null> {\n return new Promise((resolve, reject) => {\n const req = https.request(\n {\n hostname: 'metadata.google.internal',\n path: '/computeMetadata/v1/instance/service-accounts/default/token',\n headers: { 'Metadata-Flavor': 'Google' },\n timeout: 3000,\n },\n (res) => {\n let raw = '';\n res.on('data', (c: Buffer) => (raw += c.toString()));\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(raw) as { access_token?: string };\n resolve(parsed.access_token ?? null);\n } catch {\n resolve(null);\n }\n } else {\n resolve(null);\n }\n });\n }\n );\n req.on('error', reject);\n req.on('timeout', () => {\n req.destroy();\n reject(new Error('metadata timeout'));\n });\n req.end();\n });\n }\n\n private fetchServiceAccountToken(): Promise<string | null> {\n // Minimal JWT creation for service account — only for environments without\n // the full Google Auth Library. For production workloads, prefer ADC.\n if (!this.credentials) return Promise.resolve(null);\n\n const iat = Math.floor(Date.now() / 1000);\n const exp = iat + 3600;\n const scope = 'https://www.googleapis.com/auth/logging.write';\n\n const header = Buffer.from(JSON.stringify({ alg: 'RS256', typ: 'JWT' })).toString('base64url');\n const payload = Buffer.from(\n JSON.stringify({\n iss: this.credentials.client_email,\n scope,\n aud: 'https://oauth2.googleapis.com/token',\n exp,\n iat,\n })\n ).toString('base64url');\n\n const signingInput = `${header}.${payload}`;\n\n let signature: string;\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const sign = require('node:crypto').createSign('RSA-SHA256');\n sign.update(signingInput);\n signature = sign.sign(this.credentials.private_key, 'base64url') as string;\n } catch {\n return Promise.resolve(null);\n }\n\n const jwt = `${signingInput}.${signature}`;\n const body = `grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=${jwt}`;\n\n return httpRequest({\n url: new URL('https://oauth2.googleapis.com/token'),\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP token request',\n }).then(\n (res) => (JSON.parse(res.body) as { access_token?: string }).access_token ?? null,\n () => null\n );\n }\n\n private secretValues(token?: string): (string | undefined)[] {\n return [\n ...(this.credentials?.private_key.split('\\n') ?? []),\n this.credentials?.private_key,\n this.accessToken ?? undefined,\n token,\n ];\n }\n\n private async writeEntries(entries: TransportLogEntry[]): Promise<void> {\n const token = await this.getAccessToken();\n if (!token) {\n throw new Error('GCPTransport: no access token available');\n }\n\n const body = stringifyForLog({\n logName: this.logName,\n resource: this.resource,\n entries: entries.map((e) => this.buildLogEntry(e)),\n });\n\n await httpRequest({\n url: new URL('https://logging.googleapis.com/v2/entries:write'),\n headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP Logging API',\n secrets: () => this.secretValues(token),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAS,cAAc,OAA4B;CACjD,QAAQ,MAAM,YAAY,GAA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KAAA,IAAA,kBAAa,YAAY,MAAM,IAAI,MAAK,CAAC;IAClD,qBAAA,KAAK,iBAAA,QAAA,uBAAA,KAAA,IAAA,KAAA,IAAA,mBAAa;GAClB,KAAK,eAAe,KAAA;GACpB;EACF;CACF;CAEA,MAAc,aAAa,SAA6C;EACtE,MAAM,QAAQ,MAAM,KAAK,eAAe;EACxC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,yCAAyC;EAG3D,MAAM,OAAOC,uBAAAA,gBAAgB;GAC3B,SAAS,KAAK;GACd,UAAU,KAAK;GACf,SAAS,QAAQ,KAAK,MAAM,KAAK,cAAc,CAAC,CAAC;EACnD,CAAC;EAED,MAAMD,qBAAAA,YAAY;GAChB,KAAK,IAAI,IAAI,iDAAiD;GAC9D,SAAS;IAAE,eAAe,UAAU;IAAS,gBAAgB;GAAmB;GAChF;GACA,WAAW,KAAK;GAChB,OAAO;GACP,eAAe,KAAK,aAAa,KAAK;EACxC,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"gcp.transport-5-ZIjN8r.js","names":["BatchBuffer","mergeCoreFields","https","httpRequest","stringifyForLog"],"sources":["../src/transports/gcp.transport.ts"],"sourcesContent":["/**\n * logixia — Google Cloud Logging (Stackdriver) transport\n *\n * Maps logixia log entries to the GCP Logging REST API format:\n * - Maps `level` → `severity` (INFO, WARNING, ERROR, CRITICAL…)\n * - Injects `logging.googleapis.com/trace` for Cloud Trace correlation\n * - Sets `traceSampled: true` whenever a trace id is present\n * (`logging.googleapis.com/spanId` and `sourceLocation` are not populated)\n * - Supports structured `jsonPayload` and plain `textPayload`\n *\n * Auth: the metadata server on GCE/GKE/Cloud Run, or a service-account key passed\n * as `credentials`. The `GOOGLE_APPLICATION_CREDENTIALS` key-file variable is not\n * read; full ADC is not supported.\n *\n * @example\n * ```ts\n * import { createLogger } from 'logixia';\n * import { GCPTransport } from 'logixia/gcp';\n *\n * const logger = createLogger({\n * transports: {\n * custom: [\n * new GCPTransport({\n * projectId: process.env.GOOGLE_CLOUD_PROJECT,\n * logName: 'projects/my-project/logs/api',\n * resource: { type: 'gce_instance', labels: { instance_id: '123' } },\n * }),\n * ],\n * },\n * });\n * ```\n */\n\nimport * as https from 'node:https';\n\nimport type { IAsyncTransport, TransportLogEntry } from '../types/transport.types';\nimport { internalError } from '../utils/internal-log';\nimport { stringifyForLog } from '../utils/safe-stringify';\nimport {\n BatchBuffer,\n DEFAULT_MAX_BUFFER_SIZE,\n DEFAULT_REQUEST_TIMEOUT_MS,\n httpRequest,\n} from './batch-buffer';\nimport { mergeCoreFields } from './entry-fields';\nimport { protectSecrets } from './secret-config';\n\nexport interface GCPMonitoredResource {\n type: string;\n labels?: Record<string, string>;\n}\n\nexport interface GCPTransportConfig {\n /** GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` or `GCLOUD_PROJECT` env vars. */\n projectId?: string;\n /**\n * Full log name, e.g. `'projects/my-project/logs/api'`.\n * If omitted, defaults to `projects/{projectId}/logs/logixia`.\n */\n logName?: string;\n /** Monitored resource descriptor. Defaults to `global`. */\n resource?: GCPMonitoredResource;\n /**\n * Service account key JSON (parsed). If omitted, only the metadata server\n * (GCE/GKE/Cloud Run) is tried; the key-file env var is not read.\n */\n credentials?: {\n client_email: string;\n private_key: string;\n };\n /** Number of entries to batch. @default 200 */\n batchSize?: number;\n /** Flush interval in ms. @default 5000 */\n flushIntervalMs?: number;\n /** Abort a request that has not finished after this many ms. @default 10000 */\n requestTimeoutMs?: number;\n /** Max buffered entries; the oldest are dropped past this. @default 10000 */\n maxBufferSize?: number;\n level?: string;\n}\n\ntype GcpSeverity =\n | 'DEFAULT'\n | 'DEBUG'\n | 'INFO'\n | 'NOTICE'\n | 'WARNING'\n | 'ERROR'\n | 'CRITICAL'\n | 'ALERT'\n | 'EMERGENCY';\n\nfunction toGcpSeverity(level: string): GcpSeverity {\n switch (level.toLowerCase()) {\n case 'trace':\n case 'verbose':\n case 'debug':\n return 'DEBUG';\n case 'info':\n case 'log':\n return 'INFO';\n case 'warn':\n case 'warning':\n return 'WARNING';\n case 'error':\n return 'ERROR';\n case 'critical':\n case 'fatal':\n return 'CRITICAL';\n default:\n return 'DEFAULT';\n }\n}\n\n/**\n * Google Cloud Logging transport with trace correlation and GCP severity mapping.\n */\nexport class GCPTransport implements IAsyncTransport {\n public readonly name = 'gcp';\n public readonly batchSize: number;\n public readonly flushInterval: number;\n public readonly level: string | undefined;\n\n private readonly buffer: BatchBuffer<TransportLogEntry>;\n private readonly requestTimeoutMs: number;\n private flushTimer: NodeJS.Timeout | null = null;\n private accessToken: string | null = null;\n private tokenExpiry = 0;\n\n private readonly projectId: string;\n private readonly logName: string;\n private readonly resource: GCPMonitoredResource;\n private readonly credentials: { client_email: string; private_key: string } | undefined;\n\n constructor(config: GCPTransportConfig) {\n protectSecrets(this, ['credentials', 'accessToken']);\n this.projectId =\n config.projectId ??\n process.env['GOOGLE_CLOUD_PROJECT'] ??\n process.env['GCLOUD_PROJECT'] ??\n 'unknown-project';\n this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;\n this.resource = config.resource ?? { type: 'global' };\n this.credentials = config.credentials;\n this.batchSize = config.batchSize ?? 200;\n this.flushInterval = config.flushIntervalMs ?? 5000;\n this.level = config.level;\n this.requestTimeoutMs = config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;\n this.buffer = new BatchBuffer<TransportLogEntry>({\n name: 'GCPTransport',\n batchSize: this.batchSize,\n maxBufferSize: config.maxBufferSize ?? DEFAULT_MAX_BUFFER_SIZE,\n send: (entries) => this.writeEntries(entries),\n secrets: () => this.secretValues(),\n });\n\n this.flushTimer = setInterval(() => {\n this.flush().catch(() => {});\n }, this.flushInterval);\n if (this.flushTimer.unref) this.flushTimer.unref();\n }\n\n write(entry: TransportLogEntry): void {\n this.buffer.push(entry);\n this.buffer.flushIfFull();\n }\n\n flush(): Promise<void> {\n return this.buffer.flush();\n }\n\n /**\n * Flush remaining entries and stop the interval timer on shutdown. Without\n * this the manager's close() skipped the transport (close was undefined) and\n * buffered entries were lost on deploy. Waits for any in-flight send first.\n */\n async close(): Promise<void> {\n if (this.flushTimer) {\n clearInterval(this.flushTimer);\n this.flushTimer = null;\n }\n await this.buffer.close();\n }\n\n private buildLogEntry(entry: TransportLogEntry): Record<string, unknown> {\n const gcpEntry: Record<string, unknown> = {\n logName: this.logName,\n resource: this.resource,\n severity: toGcpSeverity(entry.level),\n timestamp: entry.timestamp ?? new Date().toISOString(),\n jsonPayload: mergeCoreFields(\n { message: entry.message, appName: entry.appName, context: entry.context },\n entry.data\n ),\n };\n\n // GCP Cloud Trace correlation\n if (entry.traceId) {\n gcpEntry['trace'] = `projects/${this.projectId}/traces/${entry.traceId}`;\n gcpEntry['traceSampled'] = true;\n }\n\n return gcpEntry;\n }\n\n private async getAccessToken(): Promise<string | null> {\n if (this.accessToken && Date.now() < this.tokenExpiry) return this.accessToken;\n\n // Try ADC metadata server (GCE/GKE/Cloud Run)\n try {\n const token = await this.fetchFromMetadataServer();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000; // 55 minutes\n return this.accessToken;\n }\n } catch {\n /* fall through to service account */\n }\n\n // Try service account key\n if (this.credentials) {\n try {\n const token = await this.fetchServiceAccountToken();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000;\n return this.accessToken;\n }\n } catch (err) {\n internalError('GCPTransport service account token error', err);\n }\n }\n\n return null;\n }\n\n private fetchFromMetadataServer(): Promise<string | null> {\n return new Promise((resolve, reject) => {\n const req = https.request(\n {\n hostname: 'metadata.google.internal',\n path: '/computeMetadata/v1/instance/service-accounts/default/token',\n headers: { 'Metadata-Flavor': 'Google' },\n timeout: 3000,\n },\n (res) => {\n let raw = '';\n res.on('data', (c: Buffer) => (raw += c.toString()));\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(raw) as { access_token?: string };\n resolve(parsed.access_token ?? null);\n } catch {\n resolve(null);\n }\n } else {\n resolve(null);\n }\n });\n }\n );\n req.on('error', reject);\n req.on('timeout', () => {\n req.destroy();\n reject(new Error('metadata timeout'));\n });\n req.end();\n });\n }\n\n private fetchServiceAccountToken(): Promise<string | null> {\n // Minimal JWT creation for service account — only for environments without\n // the full Google Auth Library. For production workloads, prefer ADC.\n if (!this.credentials) return Promise.resolve(null);\n\n const iat = Math.floor(Date.now() / 1000);\n const exp = iat + 3600;\n const scope = 'https://www.googleapis.com/auth/logging.write';\n\n const header = Buffer.from(JSON.stringify({ alg: 'RS256', typ: 'JWT' })).toString('base64url');\n const payload = Buffer.from(\n JSON.stringify({\n iss: this.credentials.client_email,\n scope,\n aud: 'https://oauth2.googleapis.com/token',\n exp,\n iat,\n })\n ).toString('base64url');\n\n const signingInput = `${header}.${payload}`;\n\n let signature: string;\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const sign = require('node:crypto').createSign('RSA-SHA256');\n sign.update(signingInput);\n signature = sign.sign(this.credentials.private_key, 'base64url') as string;\n } catch {\n return Promise.resolve(null);\n }\n\n const jwt = `${signingInput}.${signature}`;\n const body = `grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=${jwt}`;\n\n return httpRequest({\n url: new URL('https://oauth2.googleapis.com/token'),\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP token request',\n }).then(\n (res) => (JSON.parse(res.body) as { access_token?: string }).access_token ?? null,\n () => null\n );\n }\n\n private secretValues(token?: string): (string | undefined)[] {\n return [\n ...(this.credentials?.private_key.split('\\n') ?? []),\n this.credentials?.private_key,\n this.accessToken ?? undefined,\n token,\n ];\n }\n\n private async writeEntries(entries: TransportLogEntry[]): Promise<void> {\n const token = await this.getAccessToken();\n if (!token) {\n throw new Error('GCPTransport: no access token available');\n }\n\n const body = stringifyForLog({\n logName: this.logName,\n resource: this.resource,\n entries: entries.map((e) => this.buildLogEntry(e)),\n });\n\n await httpRequest({\n url: new URL('https://logging.googleapis.com/v2/entries:write'),\n headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP Logging API',\n secrets: () => this.secretValues(token),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAS,cAAc,OAA4B;CACjD,QAAQ,MAAM,YAAY,GAA1B;EACE,KAAK;EACL,KAAK;EACL,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,OACH,OAAO;EACT,KAAK;EACL,KAAK,WACH,OAAO;EACT,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,SACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;AAKA,IAAa,eAAb,MAAqD;CACnD,OAAuB;CACvB;CACA;CACA;CAEA;CACA;CACA,aAA4C;CAC5C,cAAqC;CACrC,cAAsB;CAEtB;CACA;CACA;CACA;CAEA,YAAY,QAA4B;EACtC,sBAAA,eAAe,MAAM,CAAC,eAAe,aAAa,CAAC;EACnD,KAAK,YACH,OAAO,aACP,QAAQ,IAAI,2BACZ,QAAQ,IAAI,qBACZ;EACF,KAAK,UAAU,OAAO,WAAW,YAAY,KAAK,UAAU;EAC5D,KAAK,WAAW,OAAO,YAAY,EAAE,MAAM,SAAS;EACpD,KAAK,cAAc,OAAO;EAC1B,KAAK,YAAY,OAAO,aAAa;EACrC,KAAK,gBAAgB,OAAO,mBAAmB;EAC/C,KAAK,QAAQ,OAAO;EACpB,KAAK,mBAAmB,OAAO,oBAAA;EAC/B,KAAK,SAAS,IAAIA,qBAAAA,YAA+B;GAC/C,MAAM;GACN,WAAW,KAAK;GAChB,eAAe,OAAO,iBAAA;GACtB,OAAO,YAAY,KAAK,aAAa,OAAO;GAC5C,eAAe,KAAK,aAAa;EACnC,CAAC;EAED,KAAK,aAAa,kBAAkB;GAClC,KAAK,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;EAC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BAAAA,YAAY;GACjB,KAAK,IAAI,IAAI,qCAAqC;GAClD,SAAS,EAAE,gBAAgB,oCAAoC;GAC/D;GACA,WAAW,KAAK;GAChB,OAAO;EACT,CAAC,CAAC,CAAC,MACA,QAAS,KAAK,MAAM,IAAI,IAAI,CAAC,CAA+B,gBAAgB,YACvE,IACR;CACF;CAEA,aAAqB,OAAwC;;EAC3D,OAAO;GACL,KAAA,oBAAI,KAAK,iBAAA,QAAA,sBAAA,KAAA,IAAA,KAAA,IAAA,kBAAa,YAAY,MAAM,IAAI,MAAK,CAAC;IAClD,qBAAA,KAAK,iBAAA,QAAA,uBAAA,KAAA,IAAA,KAAA,IAAA,mBAAa;GAClB,KAAK,eAAe,KAAA;GACpB;EACF;CACF;CAEA,MAAc,aAAa,SAA6C;EACtE,MAAM,QAAQ,MAAM,KAAK,eAAe;EACxC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,yCAAyC;EAG3D,MAAM,OAAOC,uBAAAA,gBAAgB;GAC3B,SAAS,KAAK;GACd,UAAU,KAAK;GACf,SAAS,QAAQ,KAAK,MAAM,KAAK,cAAc,CAAC,CAAC;EACnD,CAAC;EAED,MAAMD,qBAAAA,YAAY;GAChB,KAAK,IAAI,IAAI,iDAAiD;GAC9D,SAAS;IAAE,eAAe,UAAU;IAAS,gBAAgB;GAAmB;GAChF;GACA,WAAW,KAAK;GAChB,OAAO;GACP,eAAe,KAAK,aAAa,KAAK;EACxC,CAAC;CACH;AACF"}
@@ -1,4 +1,4 @@
1
- import { _ as TransportLogEntry, l as IAsyncTransport } from "./transport.types-CzJq4IrF.mjs";
1
+ import { _ as TransportLogEntry, l as IAsyncTransport } from "./transport.types-B1ejJJP6.mjs";
2
2
  interface GCPMonitoredResource {
3
3
  type: string;
4
4
  labels?: Record<string, string>;
@@ -65,4 +65,4 @@ declare class GCPTransport implements IAsyncTransport {
65
65
  private writeEntries;
66
66
  }
67
67
  export { GCPTransport as n, GCPTransportConfig as r, GCPMonitoredResource as t };
68
- //# sourceMappingURL=gcp.transport-D9SdLPwP.d.mts.map
68
+ //# sourceMappingURL=gcp.transport-C8VJiEM7.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gcp.transport-D9SdLPwP.d.mts","names":[],"sources":["../src/transports/gcp.transport.ts"],"mappings":";UA+CiB;EACf;EACA,SAAS;;UAGM;;EAEf;;;;;EAKA;;EAEA,WAAW;;;;;EAKX;IACE;IACA;;;EAGF;;EAEA;;EAEA;;EAEA;EACA;;;;;cAuCW,wBAAwB;WACnB;WACA;WACA;WACA;mBAEC;mBACA;UACT;UACA;UACA;mBAES;mBACA;mBACA;mBACA;EAEL,YAAA,QAAQ;EA4BpB,MAAM,OAAO;EAKb,SAAS;;;;;;EASH,SAAS;UAQP;UAqBM;UAgCN;UAmCA;UA+CA;UASM"}
1
+ {"version":3,"file":"gcp.transport-C8VJiEM7.d.mts","names":[],"sources":["../src/transports/gcp.transport.ts"],"mappings":";UA+CiB;EACf;EACA,SAAS;;UAGM;;EAEf;;;;;EAKA;;EAEA,WAAW;;;;;EAKX;IACE;IACA;;;EAGF;;EAEA;;EAEA;;EAEA;EACA;;;;;cAuCW,wBAAwB;WACnB;WACA;WACA;WACA;mBAEC;mBACA;UACT;UACA;UACA;mBAES;mBACA;mBACA;mBACA;EAEL,YAAA,QAAQ;EA4BpB,MAAM,OAAO;EAKb,SAAS;;;;;;EASH,SAAS;UAQP;UAqBM;UAgCN;UAmCA;UA+CA;UASM"}
@@ -1,4 +1,4 @@
1
- import { _ as TransportLogEntry, l as IAsyncTransport } from "./transport.types-CzJq4IrF.js";
1
+ import { _ as TransportLogEntry, l as IAsyncTransport } from "./transport.types-B1ejJJP6.js";
2
2
  interface GCPMonitoredResource {
3
3
  type: string;
4
4
  labels?: Record<string, string>;
@@ -65,4 +65,4 @@ declare class GCPTransport implements IAsyncTransport {
65
65
  private writeEntries;
66
66
  }
67
67
  export { GCPTransport as n, GCPTransportConfig as r, GCPMonitoredResource as t };
68
- //# sourceMappingURL=gcp.transport-BCIvdFV-.d.ts.map
68
+ //# sourceMappingURL=gcp.transport-Ct0BtKFo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gcp.transport-BCIvdFV-.d.ts","names":[],"sources":["../src/transports/gcp.transport.ts"],"mappings":";UA+CiB;EACf;EACA,SAAS;;UAGM;;EAEf;;;;;EAKA;;EAEA,WAAW;;;;;EAKX;IACE;IACA;;;EAGF;;EAEA;;EAEA;;EAEA;EACA;;;;;cAuCW,wBAAwB;WACnB;WACA;WACA;WACA;mBAEC;mBACA;UACT;UACA;UACA;mBAES;mBACA;mBACA;mBACA;EAEL,YAAA,QAAQ;EA4BpB,MAAM,OAAO;EAKb,SAAS;;;;;;EASH,SAAS;UAQP;UAqBM;UAgCN;UAmCA;UA+CA;UASM"}
1
+ {"version":3,"file":"gcp.transport-Ct0BtKFo.d.ts","names":[],"sources":["../src/transports/gcp.transport.ts"],"mappings":";UA+CiB;EACf;EACA,SAAS;;UAGM;;EAEf;;;;;EAKA;;EAEA,WAAW;;;;;EAKX;IACE;IACA;;;EAGF;;EAEA;;EAEA;;EAEA;EACA;;;;;cAuCW,wBAAwB;WACnB;WACA;WACA;WACA;mBAEC;mBACA;UACT;UACA;UACA;mBAES;mBACA;mBACA;mBACA;EAEL,YAAA,QAAQ;EA4BpB,MAAM,OAAO;EAKb,SAAS;;;;;;EASH,SAAS;UAQP;UAqBM;UAgCN;UAmCA;UA+CA;UASM"}
@@ -1,9 +1,9 @@
1
1
  import { t as __require } from "./rolldown-runtime-D3PmRqjj.mjs";
2
- import { n as protectSecrets } from "./secret-config-ByGq7kJd.mjs";
2
+ import { n as protectSecrets } from "./secret-config-GKmb15Me.mjs";
3
3
  import { t as internalError } from "./internal-log-Cy5nF1ZL.mjs";
4
- import { i as stringifyForLog } from "./safe-stringify--7gbe95n.mjs";
5
- import { t as mergeCoreFields } from "./entry-fields-DNTKQxoU.mjs";
6
- import { a as httpRequest, t as BatchBuffer } from "./batch-buffer-CQUWDMYq.mjs";
4
+ import { i as stringifyForLog } from "./safe-stringify-B5p5ktFe.mjs";
5
+ import { t as mergeCoreFields } from "./entry-fields-J1OBi24o.mjs";
6
+ import { a as httpRequest, t as BatchBuffer } from "./batch-buffer-CM-lK_Qy.mjs";
7
7
  import * as https from "node:https";
8
8
  // src/transports/gcp.transport.ts
9
9
  /**
@@ -57,11 +57,20 @@ function toGcpSeverity(level) {
57
57
  * Google Cloud Logging transport with trace correlation and GCP severity mapping.
58
58
  */
59
59
  var GCPTransport = class {
60
+ name = "gcp";
61
+ batchSize;
62
+ flushInterval;
63
+ level;
64
+ buffer;
65
+ requestTimeoutMs;
66
+ flushTimer = null;
67
+ accessToken = null;
68
+ tokenExpiry = 0;
69
+ projectId;
70
+ logName;
71
+ resource;
72
+ credentials;
60
73
  constructor(config) {
61
- this.name = "gcp";
62
- this.flushTimer = null;
63
- this.accessToken = null;
64
- this.tokenExpiry = 0;
65
74
  protectSecrets(this, ["credentials", "accessToken"]);
66
75
  this.projectId = config.projectId ?? process.env["GOOGLE_CLOUD_PROJECT"] ?? process.env["GCLOUD_PROJECT"] ?? "unknown-project";
67
76
  this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;
@@ -232,4 +241,4 @@ var GCPTransport = class {
232
241
  };
233
242
  export { GCPTransport as t };
234
243
 
235
- //# sourceMappingURL=gcp.transport-LLK2bw2-.mjs.map
244
+ //# sourceMappingURL=gcp.transport-Cw3Qke85.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"gcp.transport-LLK2bw2-.mjs","names":[],"sources":["../src/transports/gcp.transport.ts"],"sourcesContent":["/**\n * logixia — Google Cloud Logging (Stackdriver) transport\n *\n * Maps logixia log entries to the GCP Logging REST API format:\n * - Maps `level` → `severity` (INFO, WARNING, ERROR, CRITICAL…)\n * - Injects `logging.googleapis.com/trace` for Cloud Trace correlation\n * - Sets `traceSampled: true` whenever a trace id is present\n * (`logging.googleapis.com/spanId` and `sourceLocation` are not populated)\n * - Supports structured `jsonPayload` and plain `textPayload`\n *\n * Auth: the metadata server on GCE/GKE/Cloud Run, or a service-account key passed\n * as `credentials`. The `GOOGLE_APPLICATION_CREDENTIALS` key-file variable is not\n * read; full ADC is not supported.\n *\n * @example\n * ```ts\n * import { createLogger } from 'logixia';\n * import { GCPTransport } from 'logixia/gcp';\n *\n * const logger = createLogger({\n * transports: {\n * custom: [\n * new GCPTransport({\n * projectId: process.env.GOOGLE_CLOUD_PROJECT,\n * logName: 'projects/my-project/logs/api',\n * resource: { type: 'gce_instance', labels: { instance_id: '123' } },\n * }),\n * ],\n * },\n * });\n * ```\n */\n\nimport * as https from 'node:https';\n\nimport type { IAsyncTransport, TransportLogEntry } from '../types/transport.types';\nimport { internalError } from '../utils/internal-log';\nimport { stringifyForLog } from '../utils/safe-stringify';\nimport {\n BatchBuffer,\n DEFAULT_MAX_BUFFER_SIZE,\n DEFAULT_REQUEST_TIMEOUT_MS,\n httpRequest,\n} from './batch-buffer';\nimport { mergeCoreFields } from './entry-fields';\nimport { protectSecrets } from './secret-config';\n\nexport interface GCPMonitoredResource {\n type: string;\n labels?: Record<string, string>;\n}\n\nexport interface GCPTransportConfig {\n /** GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` or `GCLOUD_PROJECT` env vars. */\n projectId?: string;\n /**\n * Full log name, e.g. `'projects/my-project/logs/api'`.\n * If omitted, defaults to `projects/{projectId}/logs/logixia`.\n */\n logName?: string;\n /** Monitored resource descriptor. Defaults to `global`. */\n resource?: GCPMonitoredResource;\n /**\n * Service account key JSON (parsed). If omitted, only the metadata server\n * (GCE/GKE/Cloud Run) is tried; the key-file env var is not read.\n */\n credentials?: {\n client_email: string;\n private_key: string;\n };\n /** Number of entries to batch. @default 200 */\n batchSize?: number;\n /** Flush interval in ms. @default 5000 */\n flushIntervalMs?: number;\n /** Abort a request that has not finished after this many ms. @default 10000 */\n requestTimeoutMs?: number;\n /** Max buffered entries; the oldest are dropped past this. @default 10000 */\n maxBufferSize?: number;\n level?: string;\n}\n\ntype GcpSeverity =\n | 'DEFAULT'\n | 'DEBUG'\n | 'INFO'\n | 'NOTICE'\n | 'WARNING'\n | 'ERROR'\n | 'CRITICAL'\n | 'ALERT'\n | 'EMERGENCY';\n\nfunction toGcpSeverity(level: string): GcpSeverity {\n switch (level.toLowerCase()) {\n case 'trace':\n case 'verbose':\n case 'debug':\n return 'DEBUG';\n case 'info':\n case 'log':\n return 'INFO';\n case 'warn':\n case 'warning':\n return 'WARNING';\n case 'error':\n return 'ERROR';\n case 'critical':\n case 'fatal':\n return 'CRITICAL';\n default:\n return 'DEFAULT';\n }\n}\n\n/**\n * Google Cloud Logging transport with trace correlation and GCP severity mapping.\n */\nexport class GCPTransport implements IAsyncTransport {\n public readonly name = 'gcp';\n public readonly batchSize: number;\n public readonly flushInterval: number;\n public readonly level: string | undefined;\n\n private readonly buffer: BatchBuffer<TransportLogEntry>;\n private readonly requestTimeoutMs: number;\n private flushTimer: NodeJS.Timeout | null = null;\n private accessToken: string | null = null;\n private tokenExpiry = 0;\n\n private readonly projectId: string;\n private readonly logName: string;\n private readonly resource: GCPMonitoredResource;\n private readonly credentials: { client_email: string; private_key: string } | undefined;\n\n constructor(config: GCPTransportConfig) {\n protectSecrets(this, ['credentials', 'accessToken']);\n this.projectId =\n config.projectId ??\n process.env['GOOGLE_CLOUD_PROJECT'] ??\n process.env['GCLOUD_PROJECT'] ??\n 'unknown-project';\n this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;\n this.resource = config.resource ?? { type: 'global' };\n this.credentials = config.credentials;\n this.batchSize = config.batchSize ?? 200;\n this.flushInterval = config.flushIntervalMs ?? 5000;\n this.level = config.level;\n this.requestTimeoutMs = config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;\n this.buffer = new BatchBuffer<TransportLogEntry>({\n name: 'GCPTransport',\n batchSize: this.batchSize,\n maxBufferSize: config.maxBufferSize ?? DEFAULT_MAX_BUFFER_SIZE,\n send: (entries) => this.writeEntries(entries),\n secrets: () => this.secretValues(),\n });\n\n this.flushTimer = setInterval(() => {\n this.flush().catch(() => {});\n }, this.flushInterval);\n if (this.flushTimer.unref) this.flushTimer.unref();\n }\n\n write(entry: TransportLogEntry): void {\n this.buffer.push(entry);\n this.buffer.flushIfFull();\n }\n\n flush(): Promise<void> {\n return this.buffer.flush();\n }\n\n /**\n * Flush remaining entries and stop the interval timer on shutdown. Without\n * this the manager's close() skipped the transport (close was undefined) and\n * buffered entries were lost on deploy. Waits for any in-flight send first.\n */\n async close(): Promise<void> {\n if (this.flushTimer) {\n clearInterval(this.flushTimer);\n this.flushTimer = null;\n }\n await this.buffer.close();\n }\n\n private buildLogEntry(entry: TransportLogEntry): Record<string, unknown> {\n const gcpEntry: Record<string, unknown> = {\n logName: this.logName,\n resource: this.resource,\n severity: toGcpSeverity(entry.level),\n timestamp: entry.timestamp ?? new Date().toISOString(),\n jsonPayload: mergeCoreFields(\n { message: entry.message, appName: entry.appName, context: entry.context },\n entry.data\n ),\n };\n\n // GCP Cloud Trace correlation\n if (entry.traceId) {\n gcpEntry['trace'] = `projects/${this.projectId}/traces/${entry.traceId}`;\n gcpEntry['traceSampled'] = true;\n }\n\n return gcpEntry;\n }\n\n private async getAccessToken(): Promise<string | null> {\n if (this.accessToken && Date.now() < this.tokenExpiry) return this.accessToken;\n\n // Try ADC metadata server (GCE/GKE/Cloud Run)\n try {\n const token = await this.fetchFromMetadataServer();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000; // 55 minutes\n return this.accessToken;\n }\n } catch {\n /* fall through to service account */\n }\n\n // Try service account key\n if (this.credentials) {\n try {\n const token = await this.fetchServiceAccountToken();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000;\n return this.accessToken;\n }\n } catch (err) {\n internalError('GCPTransport service account token error', err);\n }\n }\n\n return null;\n }\n\n private fetchFromMetadataServer(): Promise<string | null> {\n return new Promise((resolve, reject) => {\n const req = https.request(\n {\n hostname: 'metadata.google.internal',\n path: '/computeMetadata/v1/instance/service-accounts/default/token',\n headers: { 'Metadata-Flavor': 'Google' },\n timeout: 3000,\n },\n (res) => {\n let raw = '';\n res.on('data', (c: Buffer) => (raw += c.toString()));\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(raw) as { access_token?: string };\n resolve(parsed.access_token ?? null);\n } catch {\n resolve(null);\n }\n } else {\n resolve(null);\n }\n });\n }\n );\n req.on('error', reject);\n req.on('timeout', () => {\n req.destroy();\n reject(new Error('metadata timeout'));\n });\n req.end();\n });\n }\n\n private fetchServiceAccountToken(): Promise<string | null> {\n // Minimal JWT creation for service account — only for environments without\n // the full Google Auth Library. For production workloads, prefer ADC.\n if (!this.credentials) return Promise.resolve(null);\n\n const iat = Math.floor(Date.now() / 1000);\n const exp = iat + 3600;\n const scope = 'https://www.googleapis.com/auth/logging.write';\n\n const header = Buffer.from(JSON.stringify({ alg: 'RS256', typ: 'JWT' })).toString('base64url');\n const payload = Buffer.from(\n JSON.stringify({\n iss: this.credentials.client_email,\n scope,\n aud: 'https://oauth2.googleapis.com/token',\n exp,\n iat,\n })\n ).toString('base64url');\n\n const signingInput = `${header}.${payload}`;\n\n let signature: string;\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const sign = require('node:crypto').createSign('RSA-SHA256');\n sign.update(signingInput);\n signature = sign.sign(this.credentials.private_key, 'base64url') as string;\n } catch {\n return Promise.resolve(null);\n }\n\n const jwt = `${signingInput}.${signature}`;\n const body = `grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=${jwt}`;\n\n return httpRequest({\n url: new URL('https://oauth2.googleapis.com/token'),\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP token request',\n }).then(\n (res) => (JSON.parse(res.body) as { access_token?: string }).access_token ?? null,\n () => null\n );\n }\n\n private secretValues(token?: string): (string | undefined)[] {\n return [\n ...(this.credentials?.private_key.split('\\n') ?? []),\n this.credentials?.private_key,\n this.accessToken ?? undefined,\n token,\n ];\n }\n\n private async writeEntries(entries: TransportLogEntry[]): Promise<void> {\n const token = await this.getAccessToken();\n if (!token) {\n throw new Error('GCPTransport: no access token available');\n }\n\n const body = stringifyForLog({\n logName: this.logName,\n resource: this.resource,\n entries: entries.map((e) => this.buildLogEntry(e)),\n });\n\n await httpRequest({\n url: new URL('https://logging.googleapis.com/v2/entries:write'),\n headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP Logging API',\n secrets: () => this.secretValues(token),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAS,cAAc,OAA4B;CACjD,QAAQ,MAAM,YAAY,GAA1B;EACE,KAAK;EACL,KAAK;EACL,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,OACH,OAAO;EACT,KAAK;EACL,KAAK,WACH,OAAO;EACT,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,SACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;AAKA,IAAa,eAAb,MAAqD;CAiBnD,YAAY,QAA4B;EAhBjB,KAAA,OAAA;EAOqB,KAAA,aAAA;EACP,KAAA,cAAA;EACf,KAAA,cAAA;EAQpB,eAAe,MAAM,CAAC,eAAe,aAAa,CAAC;EACnD,KAAK,YACH,OAAO,aACP,QAAQ,IAAI,2BACZ,QAAQ,IAAI,qBACZ;EACF,KAAK,UAAU,OAAO,WAAW,YAAY,KAAK,UAAU;EAC5D,KAAK,WAAW,OAAO,YAAY,EAAE,MAAM,SAAS;EACpD,KAAK,cAAc,OAAO;EAC1B,KAAK,YAAY,OAAO,aAAa;EACrC,KAAK,gBAAgB,OAAO,mBAAmB;EAC/C,KAAK,QAAQ,OAAO;EACpB,KAAK,mBAAmB,OAAO,oBAAA;EAC/B,KAAK,SAA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AC,WAAW,YAAY;GAC3D,KAAK,OAAO,YAAY;GACxB,YAAY,KAAK,KAAK,KAAK,YAAY,aAAa,WAAW;EACjE,QAAQ;GACN,OAAO,QAAQ,QAAQ,IAAI;EAC7B;EAGA,MAAM,OAAO,8EAA8E,GAD5E,aAAa,GAAG;EAG/B,OAAO,YAAY;GACjB,KAAK,IAAI,IAAI,qCAAqC;GAClD,SAAS,EAAE,gBAAgB,oCAAoC;GAC/D;GACA,WAAW,KAAK;GAChB,OAAO;EACT,CAAC,CAAC,CAAC,MACA,QAAS,KAAK,MAAM,IAAI,IAAI,CAAC,CAA+B,gBAAgB,YACvE,IACR;CACF;CAEA,aAAqB,OAAwC;;EAC3D,OAAO;GACL,KAAA,oBAAI,KAAK,iBAAA,QAAA,sBAAA,KAAA,IAAA,KAAA,IAAA,kBAAa,YAAY,MAAM,IAAI,MAAK,CAAC;IAClD,qBAAA,KAAK,iBAAA,QAAA,uBAAA,KAAA,IAAA,KAAA,IAAA,mBAAa;GAClB,KAAK,eAAe,KAAA;GACpB;EACF;CACF;CAEA,MAAc,aAAa,SAA6C;EACtE,MAAM,QAAQ,MAAM,KAAK,eAAe;EACxC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,yCAAyC;EAG3D,MAAM,OAAO,gBAAgB;GAC3B,SAAS,KAAK;GACd,UAAU,KAAK;GACf,SAAS,QAAQ,KAAK,MAAM,KAAK,cAAc,CAAC,CAAC;EACnD,CAAC;EAED,MAAM,YAAY;GAChB,KAAK,IAAI,IAAI,iDAAiD;GAC9D,SAAS;IAAE,eAAe,UAAU;IAAS,gBAAgB;GAAmB;GAChF;GACA,WAAW,KAAK;GAChB,OAAO;GACP,eAAe,KAAK,aAAa,KAAK;EACxC,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"gcp.transport-Cw3Qke85.mjs","names":[],"sources":["../src/transports/gcp.transport.ts"],"sourcesContent":["/**\n * logixia — Google Cloud Logging (Stackdriver) transport\n *\n * Maps logixia log entries to the GCP Logging REST API format:\n * - Maps `level` → `severity` (INFO, WARNING, ERROR, CRITICAL…)\n * - Injects `logging.googleapis.com/trace` for Cloud Trace correlation\n * - Sets `traceSampled: true` whenever a trace id is present\n * (`logging.googleapis.com/spanId` and `sourceLocation` are not populated)\n * - Supports structured `jsonPayload` and plain `textPayload`\n *\n * Auth: the metadata server on GCE/GKE/Cloud Run, or a service-account key passed\n * as `credentials`. The `GOOGLE_APPLICATION_CREDENTIALS` key-file variable is not\n * read; full ADC is not supported.\n *\n * @example\n * ```ts\n * import { createLogger } from 'logixia';\n * import { GCPTransport } from 'logixia/gcp';\n *\n * const logger = createLogger({\n * transports: {\n * custom: [\n * new GCPTransport({\n * projectId: process.env.GOOGLE_CLOUD_PROJECT,\n * logName: 'projects/my-project/logs/api',\n * resource: { type: 'gce_instance', labels: { instance_id: '123' } },\n * }),\n * ],\n * },\n * });\n * ```\n */\n\nimport * as https from 'node:https';\n\nimport type { IAsyncTransport, TransportLogEntry } from '../types/transport.types';\nimport { internalError } from '../utils/internal-log';\nimport { stringifyForLog } from '../utils/safe-stringify';\nimport {\n BatchBuffer,\n DEFAULT_MAX_BUFFER_SIZE,\n DEFAULT_REQUEST_TIMEOUT_MS,\n httpRequest,\n} from './batch-buffer';\nimport { mergeCoreFields } from './entry-fields';\nimport { protectSecrets } from './secret-config';\n\nexport interface GCPMonitoredResource {\n type: string;\n labels?: Record<string, string>;\n}\n\nexport interface GCPTransportConfig {\n /** GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` or `GCLOUD_PROJECT` env vars. */\n projectId?: string;\n /**\n * Full log name, e.g. `'projects/my-project/logs/api'`.\n * If omitted, defaults to `projects/{projectId}/logs/logixia`.\n */\n logName?: string;\n /** Monitored resource descriptor. Defaults to `global`. */\n resource?: GCPMonitoredResource;\n /**\n * Service account key JSON (parsed). If omitted, only the metadata server\n * (GCE/GKE/Cloud Run) is tried; the key-file env var is not read.\n */\n credentials?: {\n client_email: string;\n private_key: string;\n };\n /** Number of entries to batch. @default 200 */\n batchSize?: number;\n /** Flush interval in ms. @default 5000 */\n flushIntervalMs?: number;\n /** Abort a request that has not finished after this many ms. @default 10000 */\n requestTimeoutMs?: number;\n /** Max buffered entries; the oldest are dropped past this. @default 10000 */\n maxBufferSize?: number;\n level?: string;\n}\n\ntype GcpSeverity =\n | 'DEFAULT'\n | 'DEBUG'\n | 'INFO'\n | 'NOTICE'\n | 'WARNING'\n | 'ERROR'\n | 'CRITICAL'\n | 'ALERT'\n | 'EMERGENCY';\n\nfunction toGcpSeverity(level: string): GcpSeverity {\n switch (level.toLowerCase()) {\n case 'trace':\n case 'verbose':\n case 'debug':\n return 'DEBUG';\n case 'info':\n case 'log':\n return 'INFO';\n case 'warn':\n case 'warning':\n return 'WARNING';\n case 'error':\n return 'ERROR';\n case 'critical':\n case 'fatal':\n return 'CRITICAL';\n default:\n return 'DEFAULT';\n }\n}\n\n/**\n * Google Cloud Logging transport with trace correlation and GCP severity mapping.\n */\nexport class GCPTransport implements IAsyncTransport {\n public readonly name = 'gcp';\n public readonly batchSize: number;\n public readonly flushInterval: number;\n public readonly level: string | undefined;\n\n private readonly buffer: BatchBuffer<TransportLogEntry>;\n private readonly requestTimeoutMs: number;\n private flushTimer: NodeJS.Timeout | null = null;\n private accessToken: string | null = null;\n private tokenExpiry = 0;\n\n private readonly projectId: string;\n private readonly logName: string;\n private readonly resource: GCPMonitoredResource;\n private readonly credentials: { client_email: string; private_key: string } | undefined;\n\n constructor(config: GCPTransportConfig) {\n protectSecrets(this, ['credentials', 'accessToken']);\n this.projectId =\n config.projectId ??\n process.env['GOOGLE_CLOUD_PROJECT'] ??\n process.env['GCLOUD_PROJECT'] ??\n 'unknown-project';\n this.logName = config.logName ?? `projects/${this.projectId}/logs/logixia`;\n this.resource = config.resource ?? { type: 'global' };\n this.credentials = config.credentials;\n this.batchSize = config.batchSize ?? 200;\n this.flushInterval = config.flushIntervalMs ?? 5000;\n this.level = config.level;\n this.requestTimeoutMs = config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;\n this.buffer = new BatchBuffer<TransportLogEntry>({\n name: 'GCPTransport',\n batchSize: this.batchSize,\n maxBufferSize: config.maxBufferSize ?? DEFAULT_MAX_BUFFER_SIZE,\n send: (entries) => this.writeEntries(entries),\n secrets: () => this.secretValues(),\n });\n\n this.flushTimer = setInterval(() => {\n this.flush().catch(() => {});\n }, this.flushInterval);\n if (this.flushTimer.unref) this.flushTimer.unref();\n }\n\n write(entry: TransportLogEntry): void {\n this.buffer.push(entry);\n this.buffer.flushIfFull();\n }\n\n flush(): Promise<void> {\n return this.buffer.flush();\n }\n\n /**\n * Flush remaining entries and stop the interval timer on shutdown. Without\n * this the manager's close() skipped the transport (close was undefined) and\n * buffered entries were lost on deploy. Waits for any in-flight send first.\n */\n async close(): Promise<void> {\n if (this.flushTimer) {\n clearInterval(this.flushTimer);\n this.flushTimer = null;\n }\n await this.buffer.close();\n }\n\n private buildLogEntry(entry: TransportLogEntry): Record<string, unknown> {\n const gcpEntry: Record<string, unknown> = {\n logName: this.logName,\n resource: this.resource,\n severity: toGcpSeverity(entry.level),\n timestamp: entry.timestamp ?? new Date().toISOString(),\n jsonPayload: mergeCoreFields(\n { message: entry.message, appName: entry.appName, context: entry.context },\n entry.data\n ),\n };\n\n // GCP Cloud Trace correlation\n if (entry.traceId) {\n gcpEntry['trace'] = `projects/${this.projectId}/traces/${entry.traceId}`;\n gcpEntry['traceSampled'] = true;\n }\n\n return gcpEntry;\n }\n\n private async getAccessToken(): Promise<string | null> {\n if (this.accessToken && Date.now() < this.tokenExpiry) return this.accessToken;\n\n // Try ADC metadata server (GCE/GKE/Cloud Run)\n try {\n const token = await this.fetchFromMetadataServer();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000; // 55 minutes\n return this.accessToken;\n }\n } catch {\n /* fall through to service account */\n }\n\n // Try service account key\n if (this.credentials) {\n try {\n const token = await this.fetchServiceAccountToken();\n if (token) {\n this.accessToken = token;\n this.tokenExpiry = Date.now() + 55 * 60 * 1000;\n return this.accessToken;\n }\n } catch (err) {\n internalError('GCPTransport service account token error', err);\n }\n }\n\n return null;\n }\n\n private fetchFromMetadataServer(): Promise<string | null> {\n return new Promise((resolve, reject) => {\n const req = https.request(\n {\n hostname: 'metadata.google.internal',\n path: '/computeMetadata/v1/instance/service-accounts/default/token',\n headers: { 'Metadata-Flavor': 'Google' },\n timeout: 3000,\n },\n (res) => {\n let raw = '';\n res.on('data', (c: Buffer) => (raw += c.toString()));\n res.on('end', () => {\n if (res.statusCode === 200) {\n try {\n const parsed = JSON.parse(raw) as { access_token?: string };\n resolve(parsed.access_token ?? null);\n } catch {\n resolve(null);\n }\n } else {\n resolve(null);\n }\n });\n }\n );\n req.on('error', reject);\n req.on('timeout', () => {\n req.destroy();\n reject(new Error('metadata timeout'));\n });\n req.end();\n });\n }\n\n private fetchServiceAccountToken(): Promise<string | null> {\n // Minimal JWT creation for service account — only for environments without\n // the full Google Auth Library. For production workloads, prefer ADC.\n if (!this.credentials) return Promise.resolve(null);\n\n const iat = Math.floor(Date.now() / 1000);\n const exp = iat + 3600;\n const scope = 'https://www.googleapis.com/auth/logging.write';\n\n const header = Buffer.from(JSON.stringify({ alg: 'RS256', typ: 'JWT' })).toString('base64url');\n const payload = Buffer.from(\n JSON.stringify({\n iss: this.credentials.client_email,\n scope,\n aud: 'https://oauth2.googleapis.com/token',\n exp,\n iat,\n })\n ).toString('base64url');\n\n const signingInput = `${header}.${payload}`;\n\n let signature: string;\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const sign = require('node:crypto').createSign('RSA-SHA256');\n sign.update(signingInput);\n signature = sign.sign(this.credentials.private_key, 'base64url') as string;\n } catch {\n return Promise.resolve(null);\n }\n\n const jwt = `${signingInput}.${signature}`;\n const body = `grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=${jwt}`;\n\n return httpRequest({\n url: new URL('https://oauth2.googleapis.com/token'),\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP token request',\n }).then(\n (res) => (JSON.parse(res.body) as { access_token?: string }).access_token ?? null,\n () => null\n );\n }\n\n private secretValues(token?: string): (string | undefined)[] {\n return [\n ...(this.credentials?.private_key.split('\\n') ?? []),\n this.credentials?.private_key,\n this.accessToken ?? undefined,\n token,\n ];\n }\n\n private async writeEntries(entries: TransportLogEntry[]): Promise<void> {\n const token = await this.getAccessToken();\n if (!token) {\n throw new Error('GCPTransport: no access token available');\n }\n\n const body = stringifyForLog({\n logName: this.logName,\n resource: this.resource,\n entries: entries.map((e) => this.buildLogEntry(e)),\n });\n\n await httpRequest({\n url: new URL('https://logging.googleapis.com/v2/entries:write'),\n headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },\n body,\n timeoutMs: this.requestTimeoutMs,\n label: 'GCP Logging API',\n secrets: () => this.secretValues(token),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAS,cAAc,OAA4B;CACjD,QAAQ,MAAM,YAAY,GAA1B;EACE,KAAK;EACL,KAAK;EACL,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,OACH,OAAO;EACT,KAAK;EACL,KAAK,WACH,OAAO;EACT,KAAK,SACH,OAAO;EACT,KAAK;EACL,KAAK,SACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;AAKA,IAAa,eAAb,MAAqD;CACnD,OAAuB;CACvB;CACA;CACA;CAEA;CACA;CACA,aAA4C;CAC5C,cAAqC;CACrC,cAAsB;CAEtB;CACA;CACA;CACA;CAEA,YAAY,QAA4B;EACtC,eAAe,MAAM,CAAC,eAAe,aAAa,CAAC;EACnD,KAAK,YACH,OAAO,aACP,QAAQ,IAAI,2BACZ,QAAQ,IAAI,qBACZ;EACF,KAAK,UAAU,OAAO,WAAW,YAAY,KAAK,UAAU;EAC5D,KAAK,WAA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O;GACP,eAAe,KAAK,aAAa,KAAK;EACxC,CAAC;CACH;AACF"}
@@ -1,4 +1,4 @@
1
- import { h as TransportConfig } from "./transport.types-CzJq4IrF.mjs";
1
+ import { h as TransportConfig } from "./transport.types-B1ejJJP6.mjs";
2
2
  interface LogixiaPlugin {
3
3
  /**
4
4
  * Unique plugin name.
@@ -523,4 +523,4 @@ declare const DEFAULT_LOG_COLORS: {
523
523
  verbose: string;
524
524
  };
525
525
  export { TraceIdConfig as A, usePlugin as B, LogixiaLoggerInstance as C, ReservedLevelName as D, RequestContext as E, RequestMetrics as F, RequestTiming as I, LogixiaPlugin as L, HttpError as M, HttpRequest as N, SamplingConfig as O, HttpResponse as P, PluginRegistry as R, LogixiaLoggerDefault as S, RedactConfig as T, LogFieldKey as _, DEFAULT_LOG_LEVELS as a, LoggerConfig as b, ExtractLevels as c, ILogFormatter as d, ILogger as f, LogEntry as g, LogColor as h, DEFAULT_LOG_COLORS as i, TraceIdExtractorConfig as j, TimingEntry as k, GracefulShutdownConfig as l, ILoggerRuntimeControls as m, ContextData as n, Environment as o, ILoggerDefault as p, CustomLevelMethods as r, ErrorSerializationOptions as s, AdaptiveSamplingConfig as t, IBaseLogger as u, LogLevel as v, NamespaceLevels as w, LoggerWithLevels as x, LogLevelString as y, globalPluginRegistry as z };
526
- //# sourceMappingURL=index-BAkPHp5D.d.mts.map
526
+ //# sourceMappingURL=index-B3ajtXJd.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BAkPHp5D.d.mts","names":[],"sources":["../src/plugin.ts","../src/types/http.types.ts","../src/types/index.ts"],"mappings":";UAkCiB;;;;;;EAMf;;;;;;EAOA,kBAAkB;;;;;;;;;;;;EAalB,OAAO,OAAO,WAAW,kBAAkB,QAAQ;;;;;;EAOnD,SAAS,OAAO,OAAO,QAAQ,kBAAkB;;;;;;EAOjD,sBAAsB;;;;;;;cAUX;mBACM;;;;;EAMjB,SAAS,QAAQ;;EAiBjB,WAAW;;EAMX,IAAI;;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EACA;EACA;EACA;EACA,UAAU;EACV;EACA,QAAQ;;UAIO;EACf;EACA;EACA;;UAIe;EACf;EACA;EACA;EACA;;UAIe;GACd;;UAIc;EACf,OAAO,OAAO;;UAIC;EACf;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;;cAIW;;;;;;;;cASA"}
1
+ {"version":3,"file":"index-B3ajtXJd.d.mts","names":[],"sources":["../src/plugin.ts","../src/types/http.types.ts","../src/types/index.ts"],"mappings":";UAkCiB;;;;;;EAMf;;;;;;EAOA,kBAAkB;;;;;;;;;;;;EAalB,OAAO,OAAO,WAAW,kBAAkB,QAAQ;;;;;;EAOnD,SAAS,OAAO,OAAO,QAAQ,kBAAkB;;;;;;EAOjD,sBAAsB;;;;;;;cAUX;mBACM;;;;;EAMjB,SAAS,QAAQ;;EAiBjB,WAAW;;EAMX,IAAI;;MAKA;;;;;;EASE,SAAS,OAAO,WAAW,QAAQ;;;;;EAsBnC,WAAW,OAAO,OAAO,QAAQ,WAAW;;EAiB5C,iBAAiB;;;;;;;;;cA2BZ,sBAAoB;;;;;;;;;;;;;;;;;;iBAmBjB,UAAU,QAAQ;;;;UCjNjB;EACf;EACA;EACA,SAAS;EACT,QAAQ;EACR,SAAS;EACT;EACA;EACA;EACA;;UAGe;EACf;EACA,SAAS;EACT;EACA;EACA;;UAGe,kBAAkB;EACjC;EACA;EACA,UAAU;;UAGK;EACf;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;cC3CW;;;;;;;;KASD,mBAAmB,uBAAuB;KAC1C,iBAAiB;KAGjB;KAoBA;KAeA;UAGK;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,YAAY;;;;;;;;;;;EAWZ;;UAIe;;;;;EAKf;;;;;;;;EAQA;;;;;;;;;;;;;;EAcA;;;;;EAKA,WAAW;;EAEX;;;;;;;;;;;;;;;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BAAqB,QAAQ;;EAE7B,sBAAsB;;EAEtB,SAAS;;EAET,eAAe;IAAU;IAAkB,SAAS;;;;;;;;KAQ1C,oBAAoB,cACxB,oBAAoB;KAKhB,mBAAmB,UAAU,6BACtC,WAAW,KAAK,UAAU,4BAA4B,KACrD,iBACA,OAAO,4BACJ;KAKK,QAAQ,gBAAgB,+BAA+B,cACjE,mBAAmB;UAIJ,uBAAuB;;KAI5B,sBAAsB,gBAAgB;;EAEhD,MAAM,iBAAiB,OAAO,0BAA0B,sBAAsB;IAC5E,QAAQ,WACV;;UAGe,6BAA6B,gBAAgB;EAC5D,MAAM,iBAAiB,OAAO,0BAA0B;;KAK9C,iBAAiB,UAAU,qBAAqB;EAC1D,cAAc;IAEZ,UAAU,yBACR,sBAAsB,KACtB,uBACF;KAGQ,cAAc,KAAK,UAAU,mBAAmB,KAAK,IAAI;UAGpD;EACf;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;EACA,QAAQ;;UAIO;EACf;EACA;EACA;;UAIe;EACf;EACA;EACA;EACA;;UAIe;GACd;;UAIc;EACf,OAAO,OAAO;;UAIC;EACf;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;;cAIW;;;;;;;;cASA"}
@@ -1,4 +1,4 @@
1
- import { h as TransportConfig } from "./transport.types-CzJq4IrF.js";
1
+ import { h as TransportConfig } from "./transport.types-B1ejJJP6.js";
2
2
  interface LogixiaPlugin {
3
3
  /**
4
4
  * Unique plugin name.
@@ -523,4 +523,4 @@ declare const DEFAULT_LOG_COLORS: {
523
523
  verbose: string;
524
524
  };
525
525
  export { TraceIdConfig as A, usePlugin as B, LogixiaLoggerInstance as C, ReservedLevelName as D, RequestContext as E, RequestMetrics as F, RequestTiming as I, LogixiaPlugin as L, HttpError as M, HttpRequest as N, SamplingConfig as O, HttpResponse as P, PluginRegistry as R, LogixiaLoggerDefault as S, RedactConfig as T, LogFieldKey as _, DEFAULT_LOG_LEVELS as a, LoggerConfig as b, ExtractLevels as c, ILogFormatter as d, ILogger as f, LogEntry as g, LogColor as h, DEFAULT_LOG_COLORS as i, TraceIdExtractorConfig as j, TimingEntry as k, GracefulShutdownConfig as l, ILoggerRuntimeControls as m, ContextData as n, Environment as o, ILoggerDefault as p, CustomLevelMethods as r, ErrorSerializationOptions as s, AdaptiveSamplingConfig as t, IBaseLogger as u, LogLevel as v, NamespaceLevels as w, LoggerWithLevels as x, LogLevelString as y, globalPluginRegistry as z };
526
- //# sourceMappingURL=index-e7LowmAu.d.ts.map
526
+ //# sourceMappingURL=index-oqD3WNxf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-e7LowmAu.d.ts","names":[],"sources":["../src/plugin.ts","../src/types/http.types.ts","../src/types/index.ts"],"mappings":";UAkCiB;;;;;;EAMf;;;;;;EAOA,kBAAkB;;;;;;;;;;;;EAalB,OAAO,OAAO,WAAW,kBAAkB,QAAQ;;;;;;EAOnD,SAAS,OAAO,OAAO,QAAQ,kBAAkB;;;;;;EAOjD,sBAAsB;;;;;;;cAUX;mBACM;;;;;EAMjB,SAAS,QAAQ;;EAiBjB,WAAW;;EAMX,IAAI;;MAKA;;;;;;EASE,SAAS,OAAO,WAAW,QAAQ;;;;;EAsBnC,WAAW,OAAO,OAAO,QAAQ,WAAW;;EAiB5C,iBAAiB;;;;;;;;;cA2BZ,sBAAoB;;;;;;;;;;;;;;;;;;iBAmBjB,UAAU,QAAQ;;;;UCjNjB;EACf;EACA;EACA,SAAS;EACT,QAAQ;EACR,SAAS;EACT;EACA;EACA;EACA;;UAGe;EACf;EACA,SAAS;EACT;EACA;EACA;;UAGe,kBAAkB;EACjC;EACA;EACA,UAAU;;UAGK;EACf;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;cC3CW;;;;;;;;KASD,mBAAmB,uBAAuB;KAC1C,iBAAiB;KAGjB;KAoBA;KAeA;UAGK;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AmB,qBAAqB;EACxC,mBAAmB;EACnB;EACA;EAEA,MAAM,iBAAiB,OAAO,0BAA0B;EACxD,SAAS;EAIT,IAAI,QAAQ;EACZ,MAAM;;;;;;;UAQS;;;;;EAKf,mBAAmB,QAAQ;;EAE3B,qBAAqB,QAAQ;;EAE7B,sBAAsB;;EAEtB,SAAS;;EAET,eAAe;IAAU;IAAkB,SAAS;;;;;;;;KAQ1C,oBAAoB,cACxB,oBAAoB;KAKhB,mBAAmB,UAAU,6BACtC,WAAW,KAAK,UAAU,4BAA4B,KACrD,iBACA,OAAO,4BACJ;KAKK,QAAQ,gBAAgB,+BAA+B,cACjE,mBAAmB;UAIJ,uBAAuB;;KAI5B,sBAAsB,gBAAgB;;EAEhD,MAAM,iBAAiB,OAAO,0BAA0B,sBAAsB;IAC5E,QAAQ,WACV;;UAGe,6BAA6B,gBAAgB;EAC5D,MAAM,iBAAiB,OAAO,0BAA0B;;KAK9C,iBAAiB,UAAU,qBAAqB;EAC1D,cAAc;IAEZ,UAAU,yBACR,sBAAsB,KACtB,uBACF;KAGQ,cAAc,KAAK,UAAU,mBAAmB,KAAK,IAAI;UAGpD;EACf;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;EACA,QAAQ;;UAIO;EACf;EACA;EACA;;UAIe;EACf;EACA;EACA;EACA;;UAIe;GACd;;UAIc;EACf,OAAO,OAAO;;UAIC;EACf;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;;cAIW;;;;;;;;cASA"}
1
+ {"version":3,"file":"index-oqD3WNxf.d.ts","names":[],"sources":["../src/plugin.ts","../src/types/http.types.ts","../src/types/index.ts"],"mappings":";UAkCiB;;;;;;EAMf;;;;;;EAOA,kBAAkB;;;;;;;;;;;;EAalB,OAAO,OAAO,WAAW,kBAAkB,QAAQ;;;;;;EAOnD,SAAS,OAAO,OAAO,QAAQ,kBAAkB;;;;;;EAOjD,sBAAsB;;;;;;;cAUX;mBACM;;;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AAK,UAAU,mBAAmB,KAAK,IAAI;UAGpD;EACf;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;EACA,QAAQ;;UAIO;EACf;EACA;EACA;;UAIe;EACf;EACA;EACA;EACA;;UAIe;GACd;;UAIc;EACf,OAAO,OAAO;;UAIC;EACf;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;;cAIW;;;;;;;;cASA"}
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as TransportLogEntry, d as ITransport, h as TransportConfig } from "./transport.types-CzJq4IrF.mjs";
1
+ import { _ as TransportLogEntry, d as ITransport, h as TransportConfig } from "./transport.types-B1ejJJP6.mjs";
2
2
  import { n as HttpResponseShape, t as HttpRequestShape } from "./http-shapes-BnBkJcid.mjs";
3
- import { A as TraceIdConfig, B as usePlugin, C as LogixiaLoggerInstance, D as ReservedLevelName, E as RequestContext, F as RequestMetrics, I as RequestTiming, L as LogixiaPlugin, M as HttpError, N as HttpRequest, O as SamplingConfig, P as HttpResponse, R as PluginRegistry, S as LogixiaLoggerDefault, T as RedactConfig, _ as LogFieldKey, a as DEFAULT_LOG_LEVELS, b as LoggerConfig, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogEntry, h as LogColor, i as DEFAULT_LOG_COLORS, j as TraceIdExtractorConfig, k as TimingEntry, l as GracefulShutdownConfig, m as ILoggerRuntimeControls, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevel, w as NamespaceLevels, x as LoggerWithLevels, y as LogLevelString, z as globalPluginRegistry } from "./index-BAkPHp5D.mjs";
4
- import { n as createLogger$1, t as LogixiaLogger } from "./logitron-logger-DoWmMjYB.mjs";
5
- 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-BDyENuR0.mjs";
6
- 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-D-8HJADE.mjs";
3
+ import { A as TraceIdConfig, B as usePlugin, C as LogixiaLoggerInstance, D as ReservedLevelName, E as RequestContext, F as RequestMetrics, I as RequestTiming, L as LogixiaPlugin, M as HttpError, N as HttpRequest, O as SamplingConfig, P as HttpResponse, R as PluginRegistry, S as LogixiaLoggerDefault, T as RedactConfig, _ as LogFieldKey, a as DEFAULT_LOG_LEVELS, b as LoggerConfig, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogEntry, h as LogColor, i as DEFAULT_LOG_COLORS, j as TraceIdExtractorConfig, k as TimingEntry, l as GracefulShutdownConfig, m as ILoggerRuntimeControls, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevel, w as NamespaceLevels, x as LoggerWithLevels, y as LogLevelString, z as globalPluginRegistry } from "./index-B3ajtXJd.mjs";
4
+ import { n as createLogger$1, t as LogixiaLogger } from "./logitron-logger-fMOkXr8H.mjs";
5
+ import { a as SentryLoggerLike, c as SentryTransport, d as DiscordTransport, f as DiscordTransportConfig, h as toOtelSeverity, i as SentryLike, l as SentryTransportConfig, m as OtlpLogTransportConfig, n as SlackTransport, o as SentryScopeLike, p as OtlpLogTransport, r as SlackTransportConfig, s as SentrySeverity, t as SlackMessage, u as DiscordEmbed } from "./slack.transport-5OPL7H3u.mjs";
6
+ 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-B-hJe2N-.mjs";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
  import { IncomingMessage, ServerResponse } from "node:http";
9
9
  /**
@@ -394,7 +394,8 @@ export declare function deregisterFromShutdown(logger: Closeable): void;
394
394
  * the process exits. Idempotent — the first call wins and later calls with
395
395
  * conflicting options print a warning. The process is ended with 128 + signal
396
396
  * number only when logixia's handler is the sole listener for that signal (see
397
- * `exit`); otherwise it just flushes and leaves shutdown to the application.
397
+ * `exit`), closing the loggers first; otherwise it only flushes them and leaves
398
+ * shutdown to the application.
398
399
  * Loggers are also flushed (not closed) on `beforeExit`.
399
400
  *
400
401
  * @example
@@ -1333,5 +1334,5 @@ export declare const logger: LogixiaLogger<{
1333
1334
  /**
1334
1335
  * Export default configuration for reference
1335
1336
  */
1336
- 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, ILoggerRuntimeControls, type ITransport, 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, LogixiaLoggerDefault, LogixiaLoggerInstance, 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, ReservedLevelName, 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 TransportConfig, type TransportLogEntry, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, globalPluginRegistry, toOtelSeverity, usePlugin };
1337
+ 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, ILoggerRuntimeControls, type ITransport, 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, LogixiaLoggerDefault, LogixiaLoggerInstance, 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, ReservedLevelName, 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 SentryLike, type SentryLoggerLike, type SentryScopeLike, type SentrySeverity, SentryTransport, type SentryTransportConfig, type SimilarLog, type SlackMessage, SlackTransport, type SlackTransportConfig, type SortField, type SuggestionType, type TimeRange, type TimelineEvent, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, type TransportConfig, type TransportLogEntry, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, globalPluginRegistry, toOtelSeverity, usePlugin };
1337
1338
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["createLoggerFromCore","_$__types0.Environment","_$__types0.LogColor"],"sources":["../src/core/default-config.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/runtime-control.ts","../src/utils/safe-stringify.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/wide-events.ts","../src/utils/request-trace.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"],"mappings":";;;;;;;;;;;qBAMa;;EAEmB,aAAA;;;;;;;;;;;;;;;;;;IAyBvB,QAAA,eAAe;;;;;;;;;;;;;qBCTX,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;;EAWJ,OAAO,OAAO;UA0DN;;qBC/FG,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;IACA,SAAS;;EAuBb,OAAO,OAAO;UA+DN;UAcA;;;;SAqDD,gBAAgB;SAWhB,kBAAkB;SAWlB,iBAAiB;;;;;;;;;;wBC/JV,eACd,OAAO,OACP,UAAS,4BACR;;;;wBAsIa,QAAQ,iBAAiB,SAAS;;;;;;;;wBAoBlC,sBAAsB,MAAM,0BAA0B;;;;wBAwEtD,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC7O/B;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe;;;;;EAKf;;;;;EAKA;;;;;EAKA;;;;;EAKA;;;;;;;;;;;wBA4Cc,qBAAqB,OAAM,oBAAyB;;;;;;;;;;;;;;;wBA0C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ACT;;;;;;qBCtYU,qBAAYA;;;;qBAKZ,QAAM;;E,aAANC"}
1
+ {"version":3,"file":"index.d.mts","names":["createLoggerFromCore","_$__types0.Environment","_$__types0.LogColor"],"sources":["../src/core/default-config.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/runtime-control.ts","../src/utils/safe-stringify.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/wide-events.ts","../src/utils/request-trace.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"],"mappings":";;;;;;;;;;;qBAMa;;EAEmB,aAAA;;;;;;;;;;;;;;;;;;IAyBvB,QAAA,eAAe;;;;;;;;;;;;;qBCTX,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;;EAWJ,OAAO,OAAO;UA0DN;;qBC/FG,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;IACA,SAAS;;EAuBb,OAAO,OAAO;UA+DN;UAcA;;;;SAwDD,gBAAgB;SAWhB,kBAAkB;SAWlB,iBAAiB;;;;;;;;;;wBClKV,eACd,OAAO,OACP,UAAS,4BACR;;;;wBAsIa,QAAQ,iBAAiB,SAAS;;;;;;;;wBAoBlC,sBAAsB,MAAM,0BAA0B;;;;wBAwEtD,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC7O/B;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe;;;;;EAKf;;;;;EAKA;;;;;EAKA;;;;;EAKA;;;;;;;;;;;wBA4Cc,qBAAqB,OAAM,oBAAyB;;;;;;;;;;;;;;;wBA0CpD,kBAAkB,OAAM,oBAA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AYA;;;;qBAKZ,QAAM;;E,aAANC"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as TransportLogEntry, d as ITransport, h as TransportConfig } from "./transport.types-CzJq4IrF.js";
1
+ import { _ as TransportLogEntry, d as ITransport, h as TransportConfig } from "./transport.types-B1ejJJP6.js";
2
2
  import { n as HttpResponseShape, t as HttpRequestShape } from "./http-shapes-BnBkJcid.js";
3
- import { A as TraceIdConfig, B as usePlugin, C as LogixiaLoggerInstance, D as ReservedLevelName, E as RequestContext, F as RequestMetrics, I as RequestTiming, L as LogixiaPlugin, M as HttpError, N as HttpRequest, O as SamplingConfig, P as HttpResponse, R as PluginRegistry, S as LogixiaLoggerDefault, T as RedactConfig, _ as LogFieldKey, a as DEFAULT_LOG_LEVELS, b as LoggerConfig, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogEntry, h as LogColor, i as DEFAULT_LOG_COLORS, j as TraceIdExtractorConfig, k as TimingEntry, l as GracefulShutdownConfig, m as ILoggerRuntimeControls, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevel, w as NamespaceLevels, x as LoggerWithLevels, y as LogLevelString, z as globalPluginRegistry } from "./index-e7LowmAu.js";
4
- import { n as createLogger$1, t as LogixiaLogger } from "./logitron-logger-DVUdgmBY.js";
5
- 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-C6E0l4kw.js";
6
- 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-DPwTKPve.js";
3
+ import { A as TraceIdConfig, B as usePlugin, C as LogixiaLoggerInstance, D as ReservedLevelName, E as RequestContext, F as RequestMetrics, I as RequestTiming, L as LogixiaPlugin, M as HttpError, N as HttpRequest, O as SamplingConfig, P as HttpResponse, R as PluginRegistry, S as LogixiaLoggerDefault, T as RedactConfig, _ as LogFieldKey, a as DEFAULT_LOG_LEVELS, b as LoggerConfig, c as ExtractLevels, d as ILogFormatter, f as ILogger, g as LogEntry, h as LogColor, i as DEFAULT_LOG_COLORS, j as TraceIdExtractorConfig, k as TimingEntry, l as GracefulShutdownConfig, m as ILoggerRuntimeControls, n as ContextData, o as Environment, p as ILoggerDefault, r as CustomLevelMethods, s as ErrorSerializationOptions, t as AdaptiveSamplingConfig, u as IBaseLogger, v as LogLevel, w as NamespaceLevels, x as LoggerWithLevels, y as LogLevelString, z as globalPluginRegistry } from "./index-oqD3WNxf.js";
4
+ import { n as createLogger$1, t as LogixiaLogger } from "./logitron-logger-Csn3e6Qu.js";
5
+ import { a as SentryLoggerLike, c as SentryTransport, d as DiscordTransport, f as DiscordTransportConfig, h as toOtelSeverity, i as SentryLike, l as SentryTransportConfig, m as OtlpLogTransportConfig, n as SlackTransport, o as SentryScopeLike, p as OtlpLogTransport, r as SlackTransportConfig, s as SentrySeverity, t as SlackMessage, u as DiscordEmbed } from "./slack.transport-BFpBD_Ri.js";
6
+ 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-BlKBLm5D.js";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
  import { IncomingMessage, ServerResponse } from "node:http";
9
9
  /**
@@ -394,7 +394,8 @@ export declare function deregisterFromShutdown(logger: Closeable): void;
394
394
  * the process exits. Idempotent — the first call wins and later calls with
395
395
  * conflicting options print a warning. The process is ended with 128 + signal
396
396
  * number only when logixia's handler is the sole listener for that signal (see
397
- * `exit`); otherwise it just flushes and leaves shutdown to the application.
397
+ * `exit`), closing the loggers first; otherwise it only flushes them and leaves
398
+ * shutdown to the application.
398
399
  * Loggers are also flushed (not closed) on `beforeExit`.
399
400
  *
400
401
  * @example
@@ -1333,5 +1334,5 @@ export declare const logger: LogixiaLogger<{
1333
1334
  /**
1334
1335
  * Export default configuration for reference
1335
1336
  */
1336
- 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, ILoggerRuntimeControls, type ITransport, 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, LogixiaLoggerDefault, LogixiaLoggerInstance, 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, ReservedLevelName, 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 TransportConfig, type TransportLogEntry, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, globalPluginRegistry, toOtelSeverity, usePlugin };
1337
+ 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, ILoggerRuntimeControls, type ITransport, 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, LogixiaLoggerDefault, LogixiaLoggerInstance, 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, ReservedLevelName, 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 SentryLike, type SentryLoggerLike, type SentryScopeLike, type SentrySeverity, SentryTransport, type SentryTransportConfig, type SimilarLog, type SlackMessage, SlackTransport, type SlackTransportConfig, type SortField, type SuggestionType, type TimeRange, type TimelineEvent, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, type TransportConfig, type TransportLogEntry, type TypedLogger, type WideEventFields, type WideEventLogger, type WideEventMiddlewareOptions, type WideEventOptions, globalPluginRegistry, toOtelSeverity, usePlugin };
1337
1338
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["createLoggerFromCore","_$__types0.Environment","_$__types0.LogColor"],"sources":["../src/core/default-config.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/runtime-control.ts","../src/utils/safe-stringify.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/wide-events.ts","../src/utils/request-trace.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"],"mappings":";;;;;;;;;;;qBAMa;;EAEmB,aAAA;;;;;;;;;;;;;;;;;;IAyBvB,QAAA,eAAe;;;;;;;;;;;;;qBCTX,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;;EAWJ,OAAO,OAAO;UA0DN;;qBC/FG,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;IACA,SAAS;;EAuBb,OAAO,OAAO;UA+DN;UAcA;;;;SAqDD,gBAAgB;SAWhB,kBAAkB;SAWlB,iBAAiB;;;;;;;;;;wBC/JV,eACd,OAAO,OACP,UAAS,4BACR;;;;wBAsIa,QAAQ,iBAAiB,SAAS;;;;;;;;wBAoBlC,sBAAsB,MAAM,0BAA0B;;;;wBAwEtD,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC7O/B;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe;;;;;EAKf;;;;;EAKA;;;;;EAKA;;;;;EAKA;;;;;;;;;;;wBA4Cc,qBAAqB,OAAM,oBAAyB;;;;;;;;;;;;;;;wBA0CpD,kBAAkB,OAAM,oBAAyB;;;;;;;;;;;;;;wBA8BjD,eAAe,OAAM;;;;wBAyCrB;;;;;;wBCsLA,aACd,KAAK,yBACL,QAAQ,cACR,wBACC;;;;;wBAyBa,eACd,SAAS,qCACT,QAAQ,2BACP;;UCvZc;EACf,YAAY;EACZ,SAAS,OAAO;EAChB,oBAAoB,QAAQ;EAC5B,uBAAuB;;UAYR;;EAEf,SAAS,OAAO;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;EAMA,MAAM;;;;;EAMN,MAAM;;;;;EAMN;;;;;EAMA;;;;;EAMA;;;;;EAMA,UAAU;;;;;EAMV;;;;;;EAOA,QAAQ;;;;;;;;;;;EAYR,WAAW;;qBAKA,iBACX,+BACA,uCACQ;;WAEQ,WAAW;;WAEX,WAAW;;WAEX;;WAEA;;WAEA,SAAS;;WAET;;;;WAIA,UAAU;EAEd,YAAA,SAAS,wBAAwB,OAAO;;;;;;;;;;;;;;;wBAkCtC,mBAAmB,+BAA+B,+BAChE,kBACC,SAAS,iBAAiB,OAAO;;;;;;;;;;;;;;UCrInB;EACf;;EAEA;;;;;EAKA;EACA;;EAEA;EACA;;;;;;;;;;;;;;;UAgBe;EACf;;EAEA;;EAEA;EACA;;;;;EAKA;;;;;;;;;;UAWe;EACf;;EAEA;;EAEA;EACA;;KAGU,eAAe,gBAAgB,kBAAkB;KACjD,aAAa,eAAe;;qBAkC3B;UAEI;;;;;;;;EAQf;;;;;;;;;;;;;;;;;qBAsEW,yBAAyB;WACpB;mBAEC;mBACA;mBACA;mBAEA;EAEL,YAAA,KAAK,YAAY,UAAS;EAYtC;EAIA,MAAM,OAAO,WAAW;;;;;;;;;;;;;;EAsExB;;;;;EAwDA;;;;;;;;;;;EAeA,mBACE,cACA;IAAO,IAAI,WAAW;IAAqB,IAAI;;;;;;;;;;;;;EAmBjD,gBAAgB,KAAK,iBAAiB,KAAK;;;;;UAsBnC;UAKA;UAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkDM,oBACd,KAAK,YACL,UAAU,uBACT;;;;;;qBCtYU,qBAAYA;;;;qBAKZ,QAAM;;E,aAANC"}
1
+ {"version":3,"file":"index.d.ts","names":["createLoggerFromCore","_$__types0.Environment","_$__types0.LogColor"],"sources":["../src/core/default-config.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/runtime-control.ts","../src/utils/safe-stringify.ts","../src/utils/shutdown.utils.ts","../src/utils/trace.utils.ts","../src/utils/typed-logger.ts","../src/wide-events.ts","../src/utils/request-trace.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"],"mappings":";;;;;;;;;;;qBAMa;;EAEmB,aAAA;;;;;;;;;;;;;;;;;;IAyBvB,QAAA,eAAe;;;;;;;;;;;;;qBCTX,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;;EAWJ,OAAO,OAAO;UA0DN;;qBC/FG,yBAAyB;UAC5B;UACA;UACA;UACA;UACA;UACA;UACA;EAGN,YAAA;IACE;IACA;IACA;IACA;IACA;IACA;IACA,SAAS;;EAuBb,OAAO,OAAO;UA+DN;UAcA;;;;SAwDD,gBAAgB;SAWhB,kBAAkB;SAWlB,iBAAiB;;;;;;;;;;wBClKV,eACd,OAAO,OACP,UAAS,4BACR;;;;wBAsIa,QAAQ,iBAAiB,SAAS;;;;;;;;wBAoBlC,sBAAsB,MAAM,0BAA0B;;;;wBAwEtD,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC7O/B;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe;;;;;EAKf;;;;;EAKA;;;;;EAKA;;;;;EAKA;;;;;;;;;;;wBA4Cc,qBAAqB,OAAM,oBAAyB;;;;;;;;;;;;;;;wBA0CpD,kBAAkB,OAAM,oBAAyB;;;;;;;;;;;;;;wBA8BjD,eAAe,OAAM;;;;wBAyCrB;;;;;;wBCuOA,aACd,KAAK,yBACL,QAAQ,cACR,wBACC;;;;;wBA2Ca,eACd,SAAS,qCACT,QAAQ,2BACP;;UC1dc;EACf,YAAY;EACZ,SAAS,OAAO;EAChB,oBAAoB,QAAQ;EAC5B,uBAAuB;;UAYR;;EAEf,SAAS,OAAO;;EAEhB,QAAQ;;;;;;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