autotel 3.0.7 → 3.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.
- package/dist/{chunk-I7ODAZJL.js → chunk-5GQOWMEY.js} +3 -3
- package/dist/{chunk-I7ODAZJL.js.map → chunk-5GQOWMEY.js.map} +1 -1
- package/dist/{chunk-NC5BG7B3.cjs → chunk-A7VZ7CSC.cjs} +5 -5
- package/dist/{chunk-NC5BG7B3.cjs.map → chunk-A7VZ7CSC.cjs.map} +1 -1
- package/dist/{chunk-6VVEOLG5.js → chunk-BJDZXR3Y.js} +3 -3
- package/dist/{chunk-6VVEOLG5.js.map → chunk-BJDZXR3Y.js.map} +1 -1
- package/dist/{chunk-JITYRSI4.js → chunk-D6ELKUMF.js} +16 -3
- package/dist/chunk-D6ELKUMF.js.map +1 -0
- package/dist/{chunk-VNMT2TDZ.cjs → chunk-H5P4ZTCX.cjs} +16 -2
- package/dist/chunk-H5P4ZTCX.cjs.map +1 -0
- package/dist/{chunk-727YZJUB.cjs → chunk-I36M5IZD.cjs} +7 -7
- package/dist/{chunk-727YZJUB.cjs.map → chunk-I36M5IZD.cjs.map} +1 -1
- package/dist/{chunk-KGBRZ7J5.js → chunk-TDJXVXM4.js} +3 -3
- package/dist/{chunk-KGBRZ7J5.js.map → chunk-TDJXVXM4.js.map} +1 -1
- package/dist/{chunk-LOTJ7SDI.cjs → chunk-ZUOASZED.cjs} +5 -5
- package/dist/{chunk-LOTJ7SDI.cjs.map → chunk-ZUOASZED.cjs.map} +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.js +1 -1
- package/dist/functional.cjs +12 -8
- package/dist/functional.d.cts +21 -1
- package/dist/functional.d.ts +21 -1
- package/dist/functional.js +1 -1
- package/dist/index.cjs +25 -21
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/messaging.cjs +5 -5
- package/dist/messaging.js +2 -2
- package/dist/semantic-helpers.cjs +6 -6
- package/dist/semantic-helpers.js +2 -2
- package/dist/webhook.cjs +2 -2
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +3 -3
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +6 -6
- package/dist/workflow.js +2 -2
- package/package.json +1 -1
- package/src/functional.test.ts +25 -0
- package/src/functional.ts +49 -0
- package/src/index.ts +1 -0
- package/dist/chunk-JITYRSI4.js.map +0 -1
- package/dist/chunk-VNMT2TDZ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk7EQ4G4SI_cjs = require('./chunk-7EQ4G4SI.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkA7VZ7CSC_cjs = require('./chunk-A7VZ7CSC.cjs');
|
|
5
5
|
var chunkDQ2SUROF_cjs = require('./chunk-DQ2SUROF.cjs');
|
|
6
6
|
var chunk2ZKEORFN_cjs = require('./chunk-2ZKEORFN.cjs');
|
|
7
7
|
var chunkESMHTKLJ_cjs = require('./chunk-ESMHTKLJ.cjs');
|
|
8
8
|
var chunkT4B5LB6E_cjs = require('./chunk-T4B5LB6E.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkZUOASZED_cjs = require('./chunk-ZUOASZED.cjs');
|
|
10
10
|
var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
|
|
11
11
|
var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
|
|
12
12
|
var chunkTC5ZPWM4_cjs = require('./chunk-TC5ZPWM4.cjs');
|
|
13
13
|
require('./chunk-YTXEZ4SD.cjs');
|
|
14
14
|
var chunkWJH6IYU2_cjs = require('./chunk-WJH6IYU2.cjs');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var chunkI36M5IZD_cjs = require('./chunk-I36M5IZD.cjs');
|
|
16
|
+
var chunkH5P4ZTCX_cjs = require('./chunk-H5P4ZTCX.cjs');
|
|
17
17
|
var chunkBGAR6MCX_cjs = require('./chunk-BGAR6MCX.cjs');
|
|
18
18
|
var chunkADZDAWNV_cjs = require('./chunk-ADZDAWNV.cjs');
|
|
19
19
|
require('./chunk-NZ72VDNY.cjs');
|
|
@@ -54,7 +54,7 @@ var otelMethods = {
|
|
|
54
54
|
setSpanContext: api.trace.setSpanContext
|
|
55
55
|
};
|
|
56
56
|
var trace2 = Object.assign(
|
|
57
|
-
|
|
57
|
+
chunkH5P4ZTCX_cjs.trace,
|
|
58
58
|
otelMethods
|
|
59
59
|
);
|
|
60
60
|
|
|
@@ -607,19 +607,19 @@ Object.defineProperty(exports, "createDrainPipeline", {
|
|
|
607
607
|
});
|
|
608
608
|
Object.defineProperty(exports, "getCurrentWorkflowContext", {
|
|
609
609
|
enumerable: true,
|
|
610
|
-
get: function () { return
|
|
610
|
+
get: function () { return chunkA7VZ7CSC_cjs.getCurrentWorkflowContext; }
|
|
611
611
|
});
|
|
612
612
|
Object.defineProperty(exports, "isInWorkflow", {
|
|
613
613
|
enumerable: true,
|
|
614
|
-
get: function () { return
|
|
614
|
+
get: function () { return chunkA7VZ7CSC_cjs.isInWorkflow; }
|
|
615
615
|
});
|
|
616
616
|
Object.defineProperty(exports, "traceStep", {
|
|
617
617
|
enumerable: true,
|
|
618
|
-
get: function () { return
|
|
618
|
+
get: function () { return chunkA7VZ7CSC_cjs.traceStep; }
|
|
619
619
|
});
|
|
620
620
|
Object.defineProperty(exports, "traceWorkflow", {
|
|
621
621
|
enumerable: true,
|
|
622
|
-
get: function () { return
|
|
622
|
+
get: function () { return chunkA7VZ7CSC_cjs.traceWorkflow; }
|
|
623
623
|
});
|
|
624
624
|
Object.defineProperty(exports, "attrs", {
|
|
625
625
|
enumerable: true,
|
|
@@ -711,11 +711,11 @@ Object.defineProperty(exports, "parseError", {
|
|
|
711
711
|
});
|
|
712
712
|
Object.defineProperty(exports, "traceConsumer", {
|
|
713
713
|
enumerable: true,
|
|
714
|
-
get: function () { return
|
|
714
|
+
get: function () { return chunkZUOASZED_cjs.traceConsumer; }
|
|
715
715
|
});
|
|
716
716
|
Object.defineProperty(exports, "traceProducer", {
|
|
717
717
|
enumerable: true,
|
|
718
|
-
get: function () { return
|
|
718
|
+
get: function () { return chunkZUOASZED_cjs.traceProducer; }
|
|
719
719
|
});
|
|
720
720
|
Object.defineProperty(exports, "BusinessBaggage", {
|
|
721
721
|
enumerable: true,
|
|
@@ -759,43 +759,47 @@ Object.defineProperty(exports, "getMeter", {
|
|
|
759
759
|
});
|
|
760
760
|
Object.defineProperty(exports, "traceDB", {
|
|
761
761
|
enumerable: true,
|
|
762
|
-
get: function () { return
|
|
762
|
+
get: function () { return chunkI36M5IZD_cjs.traceDB; }
|
|
763
763
|
});
|
|
764
764
|
Object.defineProperty(exports, "traceHTTP", {
|
|
765
765
|
enumerable: true,
|
|
766
|
-
get: function () { return
|
|
766
|
+
get: function () { return chunkI36M5IZD_cjs.traceHTTP; }
|
|
767
767
|
});
|
|
768
768
|
Object.defineProperty(exports, "traceLLM", {
|
|
769
769
|
enumerable: true,
|
|
770
|
-
get: function () { return
|
|
770
|
+
get: function () { return chunkI36M5IZD_cjs.traceLLM; }
|
|
771
771
|
});
|
|
772
772
|
Object.defineProperty(exports, "traceMessaging", {
|
|
773
773
|
enumerable: true,
|
|
774
|
-
get: function () { return
|
|
774
|
+
get: function () { return chunkI36M5IZD_cjs.traceMessaging; }
|
|
775
775
|
});
|
|
776
776
|
Object.defineProperty(exports, "ctx", {
|
|
777
777
|
enumerable: true,
|
|
778
|
-
get: function () { return
|
|
778
|
+
get: function () { return chunkH5P4ZTCX_cjs.ctx; }
|
|
779
779
|
});
|
|
780
780
|
Object.defineProperty(exports, "instrument", {
|
|
781
781
|
enumerable: true,
|
|
782
|
-
get: function () { return
|
|
782
|
+
get: function () { return chunkH5P4ZTCX_cjs.instrument; }
|
|
783
|
+
});
|
|
784
|
+
Object.defineProperty(exports, "markAsImmediate", {
|
|
785
|
+
enumerable: true,
|
|
786
|
+
get: function () { return chunkH5P4ZTCX_cjs.markAsImmediate; }
|
|
783
787
|
});
|
|
784
788
|
Object.defineProperty(exports, "span", {
|
|
785
789
|
enumerable: true,
|
|
786
|
-
get: function () { return
|
|
790
|
+
get: function () { return chunkH5P4ZTCX_cjs.span; }
|
|
787
791
|
});
|
|
788
792
|
Object.defineProperty(exports, "withBaggage", {
|
|
789
793
|
enumerable: true,
|
|
790
|
-
get: function () { return
|
|
794
|
+
get: function () { return chunkH5P4ZTCX_cjs.withBaggage; }
|
|
791
795
|
});
|
|
792
796
|
Object.defineProperty(exports, "withNewContext", {
|
|
793
797
|
enumerable: true,
|
|
794
|
-
get: function () { return
|
|
798
|
+
get: function () { return chunkH5P4ZTCX_cjs.withNewContext; }
|
|
795
799
|
});
|
|
796
800
|
Object.defineProperty(exports, "withTracing", {
|
|
797
801
|
enumerable: true,
|
|
798
|
-
get: function () { return
|
|
802
|
+
get: function () { return chunkH5P4ZTCX_cjs.withTracing; }
|
|
799
803
|
});
|
|
800
804
|
Object.defineProperty(exports, "createDeterministicTraceId", {
|
|
801
805
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ export { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizerConfig, Span
|
|
|
7
7
|
import { AttributeRedactorConfig, AttributeRedactorPreset } from './attribute-redacting-processor.cjs';
|
|
8
8
|
export { AttributeRedactingProcessor, AttributeRedactingProcessorOptions, AttributeRedactorFn, BuiltinPatternName, MaskFn, REDACTOR_PATTERNS, REDACTOR_PRESETS, ValuePatternConfig, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig } from './attribute-redacting-processor.cjs';
|
|
9
9
|
import { trace as trace$1 } from './functional.cjs';
|
|
10
|
-
export { InstrumentOptions, SpanOptions, WithBaggageOptions, WithNewContextOptions, ctx, instrument, span, withBaggage, withNewContext, withTracing } from './functional.cjs';
|
|
10
|
+
export { InstrumentOptions, SpanOptions, WithBaggageOptions, WithNewContextOptions, ctx, instrument, markAsImmediate, span, withBaggage, withNewContext, withTracing } from './functional.cjs';
|
|
11
11
|
import { EventSubscriber, EventAttributes, AutotelEventContext } from './event-subscriber.cjs';
|
|
12
12
|
export { FunnelStatus, OutcomeStatus } from './event-subscriber.cjs';
|
|
13
13
|
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from './correlation-id.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizerConfig, Span
|
|
|
7
7
|
import { AttributeRedactorConfig, AttributeRedactorPreset } from './attribute-redacting-processor.js';
|
|
8
8
|
export { AttributeRedactingProcessor, AttributeRedactingProcessorOptions, AttributeRedactorFn, BuiltinPatternName, MaskFn, REDACTOR_PATTERNS, REDACTOR_PRESETS, ValuePatternConfig, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig } from './attribute-redacting-processor.js';
|
|
9
9
|
import { trace as trace$1 } from './functional.js';
|
|
10
|
-
export { InstrumentOptions, SpanOptions, WithBaggageOptions, WithNewContextOptions, ctx, instrument, span, withBaggage, withNewContext, withTracing } from './functional.js';
|
|
10
|
+
export { InstrumentOptions, SpanOptions, WithBaggageOptions, WithNewContextOptions, ctx, instrument, markAsImmediate, span, withBaggage, withNewContext, withTracing } from './functional.js';
|
|
11
11
|
import { EventSubscriber, EventAttributes, AutotelEventContext } from './event-subscriber.js';
|
|
12
12
|
export { FunnelStatus, OutcomeStatus } from './event-subscriber.js';
|
|
13
13
|
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from './correlation-id.js';
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export { createDrainPipeline } from './chunk-KFOHQK7X.js';
|
|
2
|
-
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-
|
|
2
|
+
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-BJDZXR3Y.js';
|
|
3
3
|
export { attrs, autoRedactPII, dbClient, httpClient, httpServer, identify, mergeAttrs, mergeServiceResource, request, safeSetAttributes, setDevice, setError, setException, setSession, setUser, validateAttribute } from './chunk-DDXIUZEG.js';
|
|
4
4
|
export { httpRequestHeaderAttribute, httpResponseHeaderAttribute } from './chunk-7552UTQW.js';
|
|
5
5
|
export { HTTPAttributes, ServiceAttributes, URLAttributes } from './chunk-4A53YIAX.js';
|
|
6
6
|
export { parseError } from './chunk-J7VGRIAJ.js';
|
|
7
|
-
export { traceConsumer, traceProducer } from './chunk-
|
|
7
|
+
export { traceConsumer, traceProducer } from './chunk-TDJXVXM4.js';
|
|
8
8
|
import { emitCorrelatedEvent } from './chunk-KIL5CUN6.js';
|
|
9
9
|
export { BusinessBaggage, createSafeBaggageSchema } from './chunk-4IFSYQVX.js';
|
|
10
10
|
import { resetMetrics } from './chunk-7SAWIN74.js';
|
|
11
11
|
export { Metric, getMetrics, resetMetrics } from './chunk-7SAWIN74.js';
|
|
12
12
|
import './chunk-5ZN622AO.js';
|
|
13
13
|
export { createCounter, createHistogram, createObservableGauge, createUpDownCounter, getMeter } from './chunk-TQ5UWA7S.js';
|
|
14
|
-
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-
|
|
15
|
-
import { trace as trace$1 } from './chunk-
|
|
16
|
-
export { ctx, instrument, span, withBaggage, withNewContext, withTracing } from './chunk-
|
|
14
|
+
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-5GQOWMEY.js';
|
|
15
|
+
import { trace as trace$1 } from './chunk-D6ELKUMF.js';
|
|
16
|
+
export { ctx, instrument, markAsImmediate, span, withBaggage, withNewContext, withTracing } from './chunk-D6ELKUMF.js';
|
|
17
17
|
export { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from './chunk-MBEHEGQE.js';
|
|
18
18
|
import { resetEvents } from './chunk-MAITXZFR.js';
|
|
19
19
|
export { Event, getEvents, resetEvents } from './chunk-MAITXZFR.js';
|
package/dist/messaging.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZUOASZED_cjs = require('./chunk-ZUOASZED.cjs');
|
|
4
4
|
require('./chunk-4P6ZOARG.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-H5P4ZTCX.cjs');
|
|
6
6
|
require('./chunk-BGAR6MCX.cjs');
|
|
7
7
|
require('./chunk-VQTCQKHQ.cjs');
|
|
8
8
|
require('./chunk-KAELJC6T.cjs');
|
|
@@ -24,15 +24,15 @@ require('./chunk-YREV3LGG.cjs');
|
|
|
24
24
|
|
|
25
25
|
Object.defineProperty(exports, "clearOrderingState", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkZUOASZED_cjs.clearOrderingState; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "traceConsumer", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkZUOASZED_cjs.traceConsumer; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "traceProducer", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkZUOASZED_cjs.traceProducer; }
|
|
36
36
|
});
|
|
37
37
|
//# sourceMappingURL=messaging.cjs.map
|
|
38
38
|
//# sourceMappingURL=messaging.cjs.map
|
package/dist/messaging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { clearOrderingState, traceConsumer, traceProducer } from './chunk-
|
|
1
|
+
export { clearOrderingState, traceConsumer, traceProducer } from './chunk-TDJXVXM4.js';
|
|
2
2
|
import './chunk-KIL5CUN6.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-D6ELKUMF.js';
|
|
4
4
|
import './chunk-MBEHEGQE.js';
|
|
5
5
|
import './chunk-SEO6NAQT.js';
|
|
6
6
|
import './chunk-IC4AZUGC.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkI36M5IZD_cjs = require('./chunk-I36M5IZD.cjs');
|
|
4
|
+
require('./chunk-H5P4ZTCX.cjs');
|
|
5
5
|
require('./chunk-BGAR6MCX.cjs');
|
|
6
6
|
require('./chunk-VQTCQKHQ.cjs');
|
|
7
7
|
require('./chunk-KAELJC6T.cjs');
|
|
@@ -23,19 +23,19 @@ require('./chunk-YREV3LGG.cjs');
|
|
|
23
23
|
|
|
24
24
|
Object.defineProperty(exports, "traceDB", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkI36M5IZD_cjs.traceDB; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "traceHTTP", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkI36M5IZD_cjs.traceHTTP; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "traceLLM", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkI36M5IZD_cjs.traceLLM; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "traceMessaging", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkI36M5IZD_cjs.traceMessaging; }
|
|
39
39
|
});
|
|
40
40
|
//# sourceMappingURL=semantic-helpers.cjs.map
|
|
41
41
|
//# sourceMappingURL=semantic-helpers.cjs.map
|
package/dist/semantic-helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-5GQOWMEY.js';
|
|
2
|
+
import './chunk-D6ELKUMF.js';
|
|
3
3
|
import './chunk-MBEHEGQE.js';
|
|
4
4
|
import './chunk-SEO6NAQT.js';
|
|
5
5
|
import './chunk-IC4AZUGC.js';
|
package/dist/webhook.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkH5P4ZTCX_cjs = require('./chunk-H5P4ZTCX.cjs');
|
|
5
5
|
require('./chunk-BGAR6MCX.cjs');
|
|
6
6
|
require('./chunk-VQTCQKHQ.cjs');
|
|
7
7
|
var chunkKAELJC6T_cjs = require('./chunk-KAELJC6T.cjs');
|
|
@@ -157,7 +157,7 @@ function createParkingLot(config) {
|
|
|
157
157
|
},
|
|
158
158
|
traceCallback(callbackConfig) {
|
|
159
159
|
return (fnFactory) => {
|
|
160
|
-
return
|
|
160
|
+
return chunkH5P4ZTCX_cjs.trace(
|
|
161
161
|
{
|
|
162
162
|
name: callbackConfig.name,
|
|
163
163
|
spanKind: api.SpanKind.SERVER
|
package/dist/webhook.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { emitCorrelatedEvent } from './chunk-KIL5CUN6.js';
|
|
2
|
-
import { trace } from './chunk-
|
|
2
|
+
import { trace } from './chunk-D6ELKUMF.js';
|
|
3
3
|
import './chunk-MBEHEGQE.js';
|
|
4
4
|
import './chunk-SEO6NAQT.js';
|
|
5
5
|
import { recordStructuredError } from './chunk-IC4AZUGC.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
|
|
4
4
|
var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkH5P4ZTCX_cjs = require('./chunk-H5P4ZTCX.cjs');
|
|
6
6
|
require('./chunk-BGAR6MCX.cjs');
|
|
7
7
|
require('./chunk-VQTCQKHQ.cjs');
|
|
8
8
|
require('./chunk-KAELJC6T.cjs');
|
|
@@ -58,7 +58,7 @@ var WorkflowBaggage = chunkINJD3G4K_cjs.createSafeBaggageSchema(workflowBaggageF
|
|
|
58
58
|
function traceDistributedWorkflow(config) {
|
|
59
59
|
const spanName = `workflow.${config.name}`;
|
|
60
60
|
return (fnFactory) => {
|
|
61
|
-
return
|
|
61
|
+
return chunkH5P4ZTCX_cjs.trace(
|
|
62
62
|
{ name: spanName, spanKind: api.SpanKind.INTERNAL },
|
|
63
63
|
(baseCtx) => {
|
|
64
64
|
return async (...args) => {
|
|
@@ -157,7 +157,7 @@ function traceDistributedWorkflow(config) {
|
|
|
157
157
|
function traceDistributedStep(config) {
|
|
158
158
|
const spanName = `workflow.step.${config.name}`;
|
|
159
159
|
return (fnFactory) => {
|
|
160
|
-
return
|
|
160
|
+
return chunkH5P4ZTCX_cjs.trace(
|
|
161
161
|
{ name: spanName, spanKind: api.SpanKind.INTERNAL },
|
|
162
162
|
(baseCtx) => {
|
|
163
163
|
return async (...args) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { emitCorrelatedEvent } from './chunk-KIL5CUN6.js';
|
|
2
2
|
import { createSafeBaggageSchema } from './chunk-4IFSYQVX.js';
|
|
3
|
-
import { trace } from './chunk-
|
|
3
|
+
import { trace } from './chunk-D6ELKUMF.js';
|
|
4
4
|
import './chunk-MBEHEGQE.js';
|
|
5
5
|
import './chunk-SEO6NAQT.js';
|
|
6
6
|
import './chunk-IC4AZUGC.js';
|
package/dist/workflow.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA7VZ7CSC_cjs = require('./chunk-A7VZ7CSC.cjs');
|
|
4
4
|
require('./chunk-4P6ZOARG.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-H5P4ZTCX.cjs');
|
|
6
6
|
require('./chunk-BGAR6MCX.cjs');
|
|
7
7
|
require('./chunk-VQTCQKHQ.cjs');
|
|
8
8
|
require('./chunk-KAELJC6T.cjs');
|
|
@@ -24,19 +24,19 @@ require('./chunk-YREV3LGG.cjs');
|
|
|
24
24
|
|
|
25
25
|
Object.defineProperty(exports, "getCurrentWorkflowContext", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkA7VZ7CSC_cjs.getCurrentWorkflowContext; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "isInWorkflow", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkA7VZ7CSC_cjs.isInWorkflow; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "traceStep", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkA7VZ7CSC_cjs.traceStep; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "traceWorkflow", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkA7VZ7CSC_cjs.traceWorkflow; }
|
|
40
40
|
});
|
|
41
41
|
//# sourceMappingURL=workflow.cjs.map
|
|
42
42
|
//# sourceMappingURL=workflow.cjs.map
|
package/dist/workflow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-
|
|
1
|
+
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-BJDZXR3Y.js';
|
|
2
2
|
import './chunk-KIL5CUN6.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-D6ELKUMF.js';
|
|
4
4
|
import './chunk-MBEHEGQE.js';
|
|
5
5
|
import './chunk-SEO6NAQT.js';
|
|
6
6
|
import './chunk-IC4AZUGC.js';
|
package/package.json
CHANGED
package/src/functional.test.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ctx,
|
|
8
8
|
span,
|
|
9
9
|
withBaggage,
|
|
10
|
+
markAsImmediate,
|
|
10
11
|
} from './functional';
|
|
11
12
|
import type { TraceContext } from './trace-helpers';
|
|
12
13
|
import type { TracingOptions } from './functional';
|
|
@@ -921,6 +922,30 @@ describe('Functional API', () => {
|
|
|
921
922
|
expect(spans[0]!.attributes['operation.id']).toBe('123');
|
|
922
923
|
});
|
|
923
924
|
|
|
925
|
+
// Regression: when esbuild/terser minifies the inner function, the
|
|
926
|
+
// `ctx` parameter gets renamed to a single letter and the name-allowlist
|
|
927
|
+
// in looksLikeTraceFactory stops matching. Library authors who wrap user
|
|
928
|
+
// handlers (e.g. autotel-aws/lambda's wrapHandler) should use
|
|
929
|
+
// `markAsImmediate` to opt the inner function into immediate execution
|
|
930
|
+
// regardless of parameter naming.
|
|
931
|
+
it('honors markAsImmediate so dispatch survives minified parameter names', async () => {
|
|
932
|
+
const collector = createTraceCollector();
|
|
933
|
+
|
|
934
|
+
// Parameter named `d` simulates the post-minification shape.
|
|
935
|
+
const inner = markAsImmediate(async (d: TraceContext) => {
|
|
936
|
+
d.setAttribute('test.minified', true);
|
|
937
|
+
return 'ok';
|
|
938
|
+
});
|
|
939
|
+
const result = await trace('minified.handler', inner);
|
|
940
|
+
|
|
941
|
+
expect(result).toBe('ok');
|
|
942
|
+
|
|
943
|
+
const spans = collector.getSpans();
|
|
944
|
+
expect(spans).toHaveLength(1);
|
|
945
|
+
expect(spans[0]!.name).toBe('minified.handler');
|
|
946
|
+
expect(spans[0]!.attributes['test.minified']).toBe(true);
|
|
947
|
+
});
|
|
948
|
+
|
|
924
949
|
it('should support options with immediate execution', async () => {
|
|
925
950
|
const collector = createTraceCollector();
|
|
926
951
|
|
package/src/functional.ts
CHANGED
|
@@ -169,10 +169,59 @@ function getFirstParameterToken(fn: GenericFunction): string | null {
|
|
|
169
169
|
return null;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Symbol that explicitly marks a function as immediate-execution-with-ctx
|
|
174
|
+
* (`(ctx) => result`), bypassing parameter-name introspection. Library
|
|
175
|
+
* authors who wrap user handlers — like `autotel-aws/lambda`'s `wrapHandler`
|
|
176
|
+
* — should mark their inner trace function with this so dispatch survives
|
|
177
|
+
* downstream bundlers that minify parameter names.
|
|
178
|
+
*/
|
|
179
|
+
const IMMEDIATE_EXECUTION_SYMBOL = Symbol.for('autotel.immediate-execution');
|
|
180
|
+
|
|
181
|
+
type ImmediateExecutionFlag = {
|
|
182
|
+
[IMMEDIATE_EXECUTION_SYMBOL]?: true;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
function hasImmediateExecutionMark(fn: unknown): boolean {
|
|
186
|
+
return (
|
|
187
|
+
typeof fn === 'function' &&
|
|
188
|
+
(fn as ImmediateExecutionFlag)[IMMEDIATE_EXECUTION_SYMBOL] === true
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Mark a function as immediate-execution-with-ctx so `trace(name, fn)`
|
|
194
|
+
* dispatch doesn't depend on the first parameter being named `ctx`.
|
|
195
|
+
*
|
|
196
|
+
* Necessary when the function will be bundled by a minifier (esbuild,
|
|
197
|
+
* terser, etc.) that renames identifiers. The name-allowlist heuristic in
|
|
198
|
+
* `looksLikeTraceFactory` cannot recover from that; the marker can.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* import { markAsImmediate, trace } from 'autotel';
|
|
203
|
+
*
|
|
204
|
+
* const inner = markAsImmediate(async (ctx) => {
|
|
205
|
+
* ctx.setAttribute('user.id', '123');
|
|
206
|
+
* return { ok: true };
|
|
207
|
+
* });
|
|
208
|
+
* const result = await trace('user.read', inner);
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
export function markAsImmediate<F>(fn: F): F {
|
|
212
|
+
if (typeof fn === 'function') {
|
|
213
|
+
(fn as unknown as ImmediateExecutionFlag)[IMMEDIATE_EXECUTION_SYMBOL] = true;
|
|
214
|
+
}
|
|
215
|
+
return fn;
|
|
216
|
+
}
|
|
217
|
+
|
|
172
218
|
function looksLikeTraceFactory(fn: GenericFunction): boolean {
|
|
173
219
|
if (hasFactoryMark(fn)) {
|
|
174
220
|
return true;
|
|
175
221
|
}
|
|
222
|
+
if (hasImmediateExecutionMark(fn)) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
176
225
|
|
|
177
226
|
if (fn.length === 0) {
|
|
178
227
|
if (!isAsyncFunction(fn)) {
|
package/src/index.ts
CHANGED