autotel 2.25.3 → 2.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{chunk-FXKB7EPR.cjs → chunk-A5ZUL2RZ.cjs} +5 -5
  2. package/dist/{chunk-FXKB7EPR.cjs.map → chunk-A5ZUL2RZ.cjs.map} +1 -1
  3. package/dist/{chunk-SR35DG5A.js → chunk-BBBWDIYQ.js} +27 -13
  4. package/dist/chunk-BBBWDIYQ.js.map +1 -0
  5. package/dist/{chunk-3ZLYWPMY.js → chunk-CMUM4JQI.js} +3 -3
  6. package/dist/{chunk-3ZLYWPMY.js.map → chunk-CMUM4JQI.js.map} +1 -1
  7. package/dist/{chunk-AQXPGGQK.cjs → chunk-EEJGUBWV.cjs} +5 -5
  8. package/dist/{chunk-AQXPGGQK.cjs.map → chunk-EEJGUBWV.cjs.map} +1 -1
  9. package/dist/{chunk-W4EUTSB2.cjs → chunk-HZ3FYBJG.cjs} +27 -12
  10. package/dist/chunk-HZ3FYBJG.cjs.map +1 -0
  11. package/dist/{chunk-WOWTZ4EB.cjs → chunk-I6JPSD4R.cjs} +5 -5
  12. package/dist/{chunk-WOWTZ4EB.cjs.map → chunk-I6JPSD4R.cjs.map} +1 -1
  13. package/dist/{chunk-XRKAL7WJ.cjs → chunk-JSNUWSBH.cjs} +6 -6
  14. package/dist/chunk-JSNUWSBH.cjs.map +1 -0
  15. package/dist/{chunk-OWXXS4JB.cjs → chunk-MN6PZ4AN.cjs} +7 -7
  16. package/dist/{chunk-OWXXS4JB.cjs.map → chunk-MN6PZ4AN.cjs.map} +1 -1
  17. package/dist/{chunk-JM63D22M.js → chunk-OPTGXEVN.js} +368 -349
  18. package/dist/chunk-OPTGXEVN.js.map +1 -0
  19. package/dist/{chunk-PKXD2RMI.js → chunk-QDREXAD7.js} +3 -3
  20. package/dist/{chunk-PKXD2RMI.js.map → chunk-QDREXAD7.js.map} +1 -1
  21. package/dist/{chunk-RMGSBMQF.cjs → chunk-QQLP4M6W.cjs} +372 -353
  22. package/dist/chunk-QQLP4M6W.cjs.map +1 -0
  23. package/dist/{chunk-USSL3D6L.js → chunk-S4OFEXLA.js} +6 -6
  24. package/dist/chunk-S4OFEXLA.js.map +1 -0
  25. package/dist/{chunk-VVYSQXQL.js → chunk-WYP6OOCT.js} +3 -3
  26. package/dist/{chunk-VVYSQXQL.js.map → chunk-WYP6OOCT.js.map} +1 -1
  27. package/dist/{chunk-IFKDBL65.js → chunk-XB2GITM5.js} +3 -3
  28. package/dist/{chunk-IFKDBL65.js.map → chunk-XB2GITM5.js.map} +1 -1
  29. package/dist/correlation-id.cjs +10 -9
  30. package/dist/correlation-id.d.cts +4 -1
  31. package/dist/correlation-id.d.ts +4 -1
  32. package/dist/correlation-id.js +2 -1
  33. package/dist/decorators.cjs +4 -4
  34. package/dist/decorators.js +3 -3
  35. package/dist/event.cjs +6 -5
  36. package/dist/event.js +3 -2
  37. package/dist/functional.cjs +10 -10
  38. package/dist/functional.js +3 -3
  39. package/dist/http.cjs +2 -2
  40. package/dist/http.js +1 -1
  41. package/dist/index.cjs +45 -45
  42. package/dist/index.js +10 -10
  43. package/dist/messaging.cjs +7 -7
  44. package/dist/messaging.js +4 -4
  45. package/dist/semantic-helpers.cjs +8 -8
  46. package/dist/semantic-helpers.js +4 -4
  47. package/dist/webhook.cjs +4 -4
  48. package/dist/webhook.js +3 -3
  49. package/dist/workflow-distributed.cjs +5 -5
  50. package/dist/workflow-distributed.js +3 -3
  51. package/dist/workflow.cjs +8 -8
  52. package/dist/workflow.js +4 -4
  53. package/package.json +1 -1
  54. package/src/correlation-id.ts +10 -5
  55. package/src/functional.ts +440 -420
  56. package/src/trace-context.test.ts +73 -0
  57. package/src/trace-context.ts +44 -12
  58. package/dist/chunk-JM63D22M.js.map +0 -1
  59. package/dist/chunk-RMGSBMQF.cjs.map +0 -1
  60. package/dist/chunk-SR35DG5A.js.map +0 -1
  61. package/dist/chunk-USSL3D6L.js.map +0 -1
  62. package/dist/chunk-W4EUTSB2.cjs.map +0 -1
  63. package/dist/chunk-XRKAL7WJ.cjs.map +0 -1
package/dist/workflow.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkAQXPGGQK_cjs = require('./chunk-AQXPGGQK.cjs');
4
- require('./chunk-RMGSBMQF.cjs');
5
- require('./chunk-W4EUTSB2.cjs');
3
+ var chunkEEJGUBWV_cjs = require('./chunk-EEJGUBWV.cjs');
4
+ require('./chunk-QQLP4M6W.cjs');
6
5
  require('./chunk-GML3FBOT.cjs');
7
6
  require('./chunk-D5LMF53P.cjs');
8
- require('./chunk-XRKAL7WJ.cjs');
7
+ require('./chunk-JSNUWSBH.cjs');
8
+ require('./chunk-HZ3FYBJG.cjs');
9
9
  require('./chunk-ITYASFHQ.cjs');
10
10
  require('./chunk-OFPZULMQ.cjs');
11
11
  require('./chunk-KZEC4CHV.cjs');
@@ -25,19 +25,19 @@ require('./chunk-JEQ2X3Z6.cjs');
25
25
 
26
26
  Object.defineProperty(exports, "getCurrentWorkflowContext", {
27
27
  enumerable: true,
28
- get: function () { return chunkAQXPGGQK_cjs.getCurrentWorkflowContext; }
28
+ get: function () { return chunkEEJGUBWV_cjs.getCurrentWorkflowContext; }
29
29
  });
30
30
  Object.defineProperty(exports, "isInWorkflow", {
31
31
  enumerable: true,
32
- get: function () { return chunkAQXPGGQK_cjs.isInWorkflow; }
32
+ get: function () { return chunkEEJGUBWV_cjs.isInWorkflow; }
33
33
  });
34
34
  Object.defineProperty(exports, "traceStep", {
35
35
  enumerable: true,
36
- get: function () { return chunkAQXPGGQK_cjs.traceStep; }
36
+ get: function () { return chunkEEJGUBWV_cjs.traceStep; }
37
37
  });
38
38
  Object.defineProperty(exports, "traceWorkflow", {
39
39
  enumerable: true,
40
- get: function () { return chunkAQXPGGQK_cjs.traceWorkflow; }
40
+ get: function () { return chunkEEJGUBWV_cjs.traceWorkflow; }
41
41
  });
42
42
  //# sourceMappingURL=workflow.cjs.map
43
43
  //# sourceMappingURL=workflow.cjs.map
package/dist/workflow.js CHANGED
@@ -1,9 +1,9 @@
1
- export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-VVYSQXQL.js';
2
- import './chunk-JM63D22M.js';
3
- import './chunk-SR35DG5A.js';
1
+ export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-WYP6OOCT.js';
2
+ import './chunk-OPTGXEVN.js';
4
3
  import './chunk-B3ZHLLMP.js';
5
4
  import './chunk-WD4RP6IV.js';
6
- import './chunk-USSL3D6L.js';
5
+ import './chunk-S4OFEXLA.js';
6
+ import './chunk-BBBWDIYQ.js';
7
7
  import './chunk-MNBAXRVG.js';
8
8
  import './chunk-RUD7KS4R.js';
9
9
  import './chunk-XDKK53OL.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel",
3
- "version": "2.25.3",
3
+ "version": "2.25.4",
4
4
  "description": "Write Once, Observe Anywhere",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,12 +24,17 @@
24
24
 
25
25
  import { trace, propagation, context } from '@opentelemetry/api';
26
26
  import { AsyncLocalStorage } from 'node:async_hooks';
27
+ import { enterOrRun } from './trace-context';
28
+
29
+ type CorrelationStore = {
30
+ value: string;
31
+ };
27
32
 
28
33
  /**
29
34
  * AsyncLocalStorage for storing correlation ID
30
35
  * This allows correlation IDs to persist across async boundaries
31
36
  */
32
- const correlationStorage = new AsyncLocalStorage<string>();
37
+ const correlationStorage = new AsyncLocalStorage<CorrelationStore>();
33
38
 
34
39
  /**
35
40
  * Baggage key for correlation ID propagation
@@ -79,7 +84,7 @@ export function generateCorrelationId(): string {
79
84
  */
80
85
  export function getCorrelationId(): string | undefined {
81
86
  // 1. Check AsyncLocalStorage first (explicit correlation ID)
82
- const storedId = correlationStorage.getStore();
87
+ const storedId = correlationStorage.getStore()?.value;
83
88
  if (storedId) {
84
89
  return storedId;
85
90
  }
@@ -140,7 +145,7 @@ export function getOrCreateCorrelationId(): string {
140
145
  * ```
141
146
  */
142
147
  export function runWithCorrelationId<T>(correlationId: string, fn: () => T): T {
143
- return correlationStorage.run(correlationId, fn);
148
+ return correlationStorage.run({ value: correlationId }, fn);
144
149
  }
145
150
 
146
151
  /**
@@ -158,7 +163,7 @@ export function runWithCorrelationId<T>(correlationId: string, fn: () => T): T {
158
163
  * ```
159
164
  */
160
165
  export function setCorrelationId(correlationId: string): void {
161
- correlationStorage.enterWith(correlationId);
166
+ enterOrRun(correlationStorage, correlationId);
162
167
  }
163
168
 
164
169
  /**
@@ -196,6 +201,6 @@ export function setCorrelationIdInBaggage(
196
201
  /**
197
202
  * Get the correlation storage instance (for internal use in init/shutdown)
198
203
  */
199
- export function getCorrelationStorage(): AsyncLocalStorage<string> {
204
+ export function getCorrelationStorage(): AsyncLocalStorage<CorrelationStore> {
200
205
  return correlationStorage;
201
206
  }