autotel-adapters 2.0.1 → 2.0.3
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/README.md +8 -0
- package/dist/cloudflare.cjs +2 -3
- package/dist/cloudflare.d.cts +2 -3
- package/dist/cloudflare.d.ts +2 -3
- package/dist/cloudflare.js +2 -3
- package/dist/core.cjs +2 -3
- package/dist/core.d.cts +2 -3
- package/dist/core.d.ts +2 -3
- package/dist/core.js +2 -3
- package/dist/elysia.cjs +2 -3
- package/dist/elysia.d.cts +2 -3
- package/dist/elysia.d.ts +2 -3
- package/dist/elysia.js +2 -3
- package/dist/express.cjs +2 -3
- package/dist/express.d.cts +2 -3
- package/dist/express.d.ts +2 -3
- package/dist/express.js +2 -3
- package/dist/fastify.cjs +2 -3
- package/dist/fastify.d.cts +2 -3
- package/dist/fastify.d.ts +2 -3
- package/dist/fastify.js +2 -3
- package/dist/hono.cjs +3 -4
- package/dist/hono.d.cts +2 -3
- package/dist/hono.d.ts +2 -3
- package/dist/hono.js +3 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{integration-DI-1RuTh.d.cts → integration-BAs5uTiD.d.ts} +5 -4
- package/dist/{integration-guh7BHTF.cjs → integration-Cc8bXel_.cjs} +8 -5
- package/dist/{integration-rYoX8QLk.d.ts → integration-D_rlU8Nx.d.cts} +5 -4
- package/dist/{integration-IUpfttGT.js → integration-DvibHRzI.js} +8 -5
- package/dist/nestjs.cjs +2 -3
- package/dist/nestjs.d.cts +2 -3
- package/dist/nestjs.d.ts +2 -3
- package/dist/nestjs.js +2 -3
- package/dist/next.cjs +30 -6
- package/dist/next.d.cts +2 -3
- package/dist/next.d.ts +2 -3
- package/dist/next.js +30 -6
- package/dist/nitro.cjs +2 -3
- package/dist/nitro.d.cts +2 -3
- package/dist/nitro.d.ts +2 -3
- package/dist/nitro.js +2 -3
- package/dist/sveltekit.cjs +2 -3
- package/dist/sveltekit.d.cts +2 -3
- package/dist/sveltekit.d.ts +2 -3
- package/dist/sveltekit.js +2 -3
- package/dist/tanstack.cjs +1 -2
- package/dist/tanstack.d.cts +1 -2
- package/dist/tanstack.d.ts +1 -2
- package/dist/tanstack.js +1 -2
- package/dist/toolkit/index.cjs +1 -1
- package/dist/toolkit/index.d.cts +2 -3
- package/dist/toolkit/index.d.ts +2 -3
- package/dist/toolkit/index.js +1 -1
- package/dist/toolkit/storage.cjs +1 -2
- package/dist/toolkit/storage.d.cts +1 -2
- package/dist/toolkit/storage.d.ts +1 -2
- package/dist/toolkit/storage.js +1 -2
- package/package.json +6 -6
- package/dist/cloudflare.cjs.map +0 -1
- package/dist/cloudflare.d.cts.map +0 -1
- package/dist/cloudflare.d.ts.map +0 -1
- package/dist/cloudflare.js.map +0 -1
- package/dist/core.cjs.map +0 -1
- package/dist/core.d.cts.map +0 -1
- package/dist/core.d.ts.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/elysia.cjs.map +0 -1
- package/dist/elysia.d.cts.map +0 -1
- package/dist/elysia.d.ts.map +0 -1
- package/dist/elysia.js.map +0 -1
- package/dist/express.cjs.map +0 -1
- package/dist/express.d.cts.map +0 -1
- package/dist/express.d.ts.map +0 -1
- package/dist/express.js.map +0 -1
- package/dist/fastify.cjs.map +0 -1
- package/dist/fastify.d.cts.map +0 -1
- package/dist/fastify.d.ts.map +0 -1
- package/dist/fastify.js.map +0 -1
- package/dist/hono.cjs.map +0 -1
- package/dist/hono.d.cts.map +0 -1
- package/dist/hono.d.ts.map +0 -1
- package/dist/hono.js.map +0 -1
- package/dist/integration-DI-1RuTh.d.cts.map +0 -1
- package/dist/integration-IUpfttGT.js.map +0 -1
- package/dist/integration-guh7BHTF.cjs.map +0 -1
- package/dist/integration-rYoX8QLk.d.ts.map +0 -1
- package/dist/nestjs.cjs.map +0 -1
- package/dist/nestjs.d.cts.map +0 -1
- package/dist/nestjs.d.ts.map +0 -1
- package/dist/nestjs.js.map +0 -1
- package/dist/next.cjs.map +0 -1
- package/dist/next.d.cts.map +0 -1
- package/dist/next.d.ts.map +0 -1
- package/dist/next.js.map +0 -1
- package/dist/nitro.cjs.map +0 -1
- package/dist/nitro.d.cts.map +0 -1
- package/dist/nitro.d.ts.map +0 -1
- package/dist/nitro.js.map +0 -1
- package/dist/sveltekit.cjs.map +0 -1
- package/dist/sveltekit.d.cts.map +0 -1
- package/dist/sveltekit.d.ts.map +0 -1
- package/dist/sveltekit.js.map +0 -1
- package/dist/tanstack.cjs.map +0 -1
- package/dist/tanstack.d.cts.map +0 -1
- package/dist/tanstack.d.ts.map +0 -1
- package/dist/tanstack.js.map +0 -1
- package/dist/toolkit/index.d.cts.map +0 -1
- package/dist/toolkit/index.d.ts.map +0 -1
- package/dist/toolkit/storage.cjs.map +0 -1
- package/dist/toolkit/storage.d.cts.map +0 -1
- package/dist/toolkit/storage.d.ts.map +0 -1
- package/dist/toolkit/storage.js.map +0 -1
package/README.md
CHANGED
|
@@ -91,6 +91,10 @@ export const POST = withAutotel(async (request: Request) => {
|
|
|
91
91
|
});
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
Navigation helpers such as `redirect()` and `notFound()` remain framework
|
|
95
|
+
control flow: `withAutotel()` rethrows their signals without recording a
|
|
96
|
+
phantom request error, including when a signal is wrapped in `cause`.
|
|
97
|
+
|
|
94
98
|
## Nitro
|
|
95
99
|
|
|
96
100
|
```ts
|
|
@@ -117,6 +121,10 @@ app.get('/orders/:id', (c) => {
|
|
|
117
121
|
});
|
|
118
122
|
```
|
|
119
123
|
|
|
124
|
+
`autotelMiddleware()` also observes SSE, NDJSON, and AI response streams. The
|
|
125
|
+
request snapshot is emitted once when the body closes, errors, or is cancelled,
|
|
126
|
+
so context added during streaming is retained.
|
|
127
|
+
|
|
120
128
|
## Cloudflare Workers
|
|
121
129
|
|
|
122
130
|
```ts
|
package/dist/cloudflare.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_core = require('./core.cjs');
|
|
4
4
|
let autotel = require("autotel");
|
|
5
5
|
|
|
@@ -88,5 +88,4 @@ exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
|
88
88
|
exports.createStructuredError = autotel.createStructuredError;
|
|
89
89
|
exports.parseError = autotel.parseError;
|
|
90
90
|
exports.useLogger = useLogger;
|
|
91
|
-
exports.withAutotelFetch = withAutotelFetch;
|
|
92
|
-
//# sourceMappingURL=cloudflare.cjs.map
|
|
91
|
+
exports.withAutotelFetch = withAutotelFetch;
|
package/dist/cloudflare.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/cloudflare.d.ts
|
|
@@ -26,5 +26,4 @@ interface CloudflareWithAutotelOptions<TEnv = unknown> extends Omit<FrameworkHan
|
|
|
26
26
|
declare function useLogger(request?: CloudflareRequestLike, requestLoggerOptions?: RequestLoggerOptions): RequestLogger;
|
|
27
27
|
declare function withAutotelFetch<TEnv, TRequest extends CloudflareRequestLike, TContext extends CloudflareExecutionContextLike, TReturn>(handler: (request: TRequest, env: TEnv, ctx: TContext) => TReturn | Promise<TReturn>, options?: CloudflareWithAutotelOptions<TEnv>): (request: TRequest, env: TEnv, ctx: TContext) => Promise<TReturn>;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { CloudflareExecutionContextLike, CloudflareHandlerContext, CloudflareRequestLike, CloudflareWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
|
30
|
-
//# sourceMappingURL=cloudflare.d.cts.map
|
|
29
|
+
export { CloudflareExecutionContextLike, CloudflareHandlerContext, CloudflareRequestLike, CloudflareWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/cloudflare.d.ts
|
|
@@ -26,5 +26,4 @@ interface CloudflareWithAutotelOptions<TEnv = unknown> extends Omit<FrameworkHan
|
|
|
26
26
|
declare function useLogger(request?: CloudflareRequestLike, requestLoggerOptions?: RequestLoggerOptions): RequestLogger;
|
|
27
27
|
declare function withAutotelFetch<TEnv, TRequest extends CloudflareRequestLike, TContext extends CloudflareExecutionContextLike, TReturn>(handler: (request: TRequest, env: TEnv, ctx: TContext) => TReturn | Promise<TReturn>, options?: CloudflareWithAutotelOptions<TEnv>): (request: TRequest, env: TEnv, ctx: TContext) => Promise<TReturn>;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { CloudflareExecutionContextLike, CloudflareHandlerContext, CloudflareRequestLike, CloudflareWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
|
30
|
-
//# sourceMappingURL=cloudflare.d.ts.map
|
|
29
|
+
export { CloudflareExecutionContextLike, CloudflareHandlerContext, CloudflareRequestLike, CloudflareWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
package/dist/cloudflare.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as runWithIntegratedHandle, i as defineFrameworkIntegration, n as buildTracedOptions, t as applyLoggerEnrichment } from "./integration-
|
|
1
|
+
import { a as runWithIntegratedHandle, i as defineFrameworkIntegration, n as buildTracedOptions, t as applyLoggerEnrichment } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createUseLogger, getHeader } from "./core.js";
|
|
3
3
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
|
|
@@ -83,5 +83,4 @@ function withAutotelFetch(handler, options) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
//#endregion
|
|
86
|
-
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
|
87
|
-
//# sourceMappingURL=cloudflare.js.map
|
|
86
|
+
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelFetch };
|
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
let autotel = require("autotel");
|
|
4
4
|
let autotel_edge = require("autotel-edge");
|
|
5
5
|
|
|
@@ -109,5 +109,4 @@ exports.createUseLogger = createUseLogger;
|
|
|
109
109
|
exports.getHeader = getHeader;
|
|
110
110
|
exports.resolveAdapterConfig = resolveAdapterConfig;
|
|
111
111
|
exports.shouldProbeRuntime = shouldProbeRuntime;
|
|
112
|
-
exports.toRouteAdapterOptions = require_integration.toRouteAdapterOptions;
|
|
113
|
-
//# sourceMappingURL=core.cjs.map
|
|
112
|
+
exports.toRouteAdapterOptions = require_integration.toRouteAdapterOptions;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import { DrainPipelineOptions, ParsedError, PipelineDrainFn, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, StructuredError, StructuredErrorInput } from "autotel";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
//#region src/core.d.ts
|
|
@@ -69,5 +69,4 @@ type HeadersLike = {
|
|
|
69
69
|
} | Record<string, string | undefined>;
|
|
70
70
|
declare function getHeader(headers: HeadersLike | undefined, name: string): string | undefined;
|
|
71
71
|
//#endregion
|
|
72
|
-
export { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, type DrainPipelineOptions, type FrameworkHandlerOptions, HeadersLike, type IntegratedCompletionOptions, type ParsedError, type PipelineDrainFn, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, RequestRunnerOptions, type RouteAdapterOptions, type StructuredError, type StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
|
73
|
-
//# sourceMappingURL=core.d.cts.map
|
|
72
|
+
export { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, type DrainPipelineOptions, type FrameworkHandlerOptions, HeadersLike, type IntegratedCompletionOptions, type ParsedError, type PipelineDrainFn, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, RequestRunnerOptions, type RouteAdapterOptions, type StructuredError, type StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import { DrainPipelineOptions, ParsedError, PipelineDrainFn, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, StructuredError, StructuredErrorInput } from "autotel";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
//#region src/core.d.ts
|
|
@@ -69,5 +69,4 @@ type HeadersLike = {
|
|
|
69
69
|
} | Record<string, string | undefined>;
|
|
70
70
|
declare function getHeader(headers: HeadersLike | undefined, name: string): string | undefined;
|
|
71
71
|
//#endregion
|
|
72
|
-
export { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, type DrainPipelineOptions, type FrameworkHandlerOptions, HeadersLike, type IntegratedCompletionOptions, type ParsedError, type PipelineDrainFn, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, RequestRunnerOptions, type RouteAdapterOptions, type StructuredError, type StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
|
73
|
-
//# sourceMappingURL=core.d.ts.map
|
|
72
|
+
export { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, type DrainPipelineOptions, type FrameworkHandlerOptions, HeadersLike, type IntegratedCompletionOptions, type ParsedError, type PipelineDrainFn, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, RequestRunnerOptions, type RouteAdapterOptions, type StructuredError, type StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as mergeRequestLoggerOptions, f as shouldInstrumentPath, o as toRouteAdapterOptions } from "./integration-
|
|
1
|
+
import { d as mergeRequestLoggerOptions, f as shouldInstrumentPath, o as toRouteAdapterOptions } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { getRequestLogger, withTracing } from "autotel";
|
|
3
3
|
|
|
4
4
|
//#region src/core.ts
|
|
@@ -102,5 +102,4 @@ function getHeader(headers, name) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
//#endregion
|
|
105
|
-
export { createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
|
106
|
-
//# sourceMappingURL=core.js.map
|
|
105
|
+
export { createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime, toRouteAdapterOptions };
|
package/dist/elysia.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_toolkit_storage = require('./toolkit/storage.cjs');
|
|
4
4
|
const require_core = require('./core.cjs');
|
|
5
5
|
let autotel = require("autotel");
|
|
@@ -46,5 +46,4 @@ exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
|
46
46
|
exports.createStructuredError = autotel.createStructuredError;
|
|
47
47
|
exports.parseError = autotel.parseError;
|
|
48
48
|
exports.useLogger = useLogger;
|
|
49
|
-
exports.withAutotelHandler = withAutotelHandler;
|
|
50
|
-
//# sourceMappingURL=elysia.cjs.map
|
|
49
|
+
exports.withAutotelHandler = withAutotelHandler;
|
package/dist/elysia.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/elysia.d.ts
|
|
@@ -14,5 +14,4 @@ declare function withAutotelHandler<T>(handler: (ctx: ElysiaContextLike) => T |
|
|
|
14
14
|
/** @deprecated Use {@link withAutotelHandler}. */
|
|
15
15
|
declare const autotel: typeof withAutotelHandler;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { ElysiaContextLike, ElysiaWithAutotelOptions, autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
|
18
|
-
//# sourceMappingURL=elysia.d.cts.map
|
|
17
|
+
export { ElysiaContextLike, ElysiaWithAutotelOptions, autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
package/dist/elysia.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/elysia.d.ts
|
|
@@ -14,5 +14,4 @@ declare function withAutotelHandler<T>(handler: (ctx: ElysiaContextLike) => T |
|
|
|
14
14
|
/** @deprecated Use {@link withAutotelHandler}. */
|
|
15
15
|
declare const autotel: typeof withAutotelHandler;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { ElysiaContextLike, ElysiaWithAutotelOptions, autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
|
18
|
-
//# sourceMappingURL=elysia.d.ts.map
|
|
17
|
+
export { ElysiaContextLike, ElysiaWithAutotelOptions, autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
package/dist/elysia.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as runWithIntegratedHandle, i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-
|
|
1
|
+
import { a as runWithIntegratedHandle, i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createLoggerStorage } from "./toolkit/storage.js";
|
|
3
3
|
import { getHeader } from "./core.js";
|
|
4
4
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
@@ -40,5 +40,4 @@ function withAutotelHandler(handler, options = {}) {
|
|
|
40
40
|
const autotel = withAutotelHandler;
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
43
|
-
export { autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
|
44
|
-
//# sourceMappingURL=elysia.js.map
|
|
43
|
+
export { autotel, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotelHandler };
|
package/dist/express.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_core = require('./core.cjs');
|
|
4
4
|
let autotel = require("autotel");
|
|
5
5
|
let node_async_hooks = require("node:async_hooks");
|
|
@@ -71,5 +71,4 @@ exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
|
71
71
|
exports.createStructuredError = autotel.createStructuredError;
|
|
72
72
|
exports.parseError = autotel.parseError;
|
|
73
73
|
exports.useLogger = useLogger;
|
|
74
|
-
exports.withAutotel = withAutotel;
|
|
75
|
-
//# sourceMappingURL=express.cjs.map
|
|
74
|
+
exports.withAutotel = withAutotel;
|
package/dist/express.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/express.d.ts
|
|
@@ -30,5 +30,4 @@ declare function useLogger(request?: ExpressRequestLike, requestLoggerOptions?:
|
|
|
30
30
|
*/
|
|
31
31
|
declare function withAutotel<TReq extends ExpressRequestLike, TRes extends ExpressResponseLike, TReturn>(handler: (req: TReq, res: TRes, next?: ExpressNext) => TReturn | Promise<TReturn>, options?: ExpressWithAutotelOptions): (req: TReq, res: TRes, next?: ExpressNext) => Promise<TReturn | undefined>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { ExpressNext, ExpressRequestLike, ExpressResponseLike, ExpressWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
34
|
-
//# sourceMappingURL=express.d.cts.map
|
|
33
|
+
export { ExpressNext, ExpressRequestLike, ExpressResponseLike, ExpressWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/express.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/express.d.ts
|
|
@@ -30,5 +30,4 @@ declare function useLogger(request?: ExpressRequestLike, requestLoggerOptions?:
|
|
|
30
30
|
*/
|
|
31
31
|
declare function withAutotel<TReq extends ExpressRequestLike, TRes extends ExpressResponseLike, TReturn>(handler: (req: TReq, res: TRes, next?: ExpressNext) => TReturn | Promise<TReturn>, options?: ExpressWithAutotelOptions): (req: TReq, res: TRes, next?: ExpressNext) => Promise<TReturn | undefined>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { ExpressNext, ExpressRequestLike, ExpressResponseLike, ExpressWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
34
|
-
//# sourceMappingURL=express.d.ts.map
|
|
33
|
+
export { ExpressNext, ExpressRequestLike, ExpressResponseLike, ExpressWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/express.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as toRouteAdapterOptions } from "./integration-
|
|
1
|
+
import { o as toRouteAdapterOptions } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createRequestRunner, createUseLogger } from "./core.js";
|
|
3
3
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -66,5 +66,4 @@ function withAutotel(handler, options) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
|
-
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
70
|
-
//# sourceMappingURL=express.js.map
|
|
69
|
+
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/fastify.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_core = require('./core.cjs');
|
|
4
4
|
let autotel = require("autotel");
|
|
5
5
|
let node_async_hooks = require("node:async_hooks");
|
|
@@ -63,5 +63,4 @@ exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
|
63
63
|
exports.createStructuredError = autotel.createStructuredError;
|
|
64
64
|
exports.parseError = autotel.parseError;
|
|
65
65
|
exports.useLogger = useLogger;
|
|
66
|
-
exports.withAutotel = withAutotel;
|
|
67
|
-
//# sourceMappingURL=fastify.cjs.map
|
|
66
|
+
exports.withAutotel = withAutotel;
|
package/dist/fastify.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/fastify.d.ts
|
|
@@ -30,5 +30,4 @@ declare function useLogger(request?: FastifyRequestLike, requestLoggerOptions?:
|
|
|
30
30
|
*/
|
|
31
31
|
declare function withAutotel<TReq extends FastifyRequestLike, TRes extends FastifyReplyLike, TReturn>(handler: (request: TReq, reply: TRes) => TReturn | Promise<TReturn>, options?: FastifyWithAutotelOptions): (request: TReq, reply: TRes) => Promise<TReturn>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { FastifyReplyLike, FastifyRequestLike, FastifyWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
34
|
-
//# sourceMappingURL=fastify.d.cts.map
|
|
33
|
+
export { FastifyReplyLike, FastifyRequestLike, FastifyWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/fastify.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, RequestLoggerOptions, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
//#region src/fastify.d.ts
|
|
@@ -30,5 +30,4 @@ declare function useLogger(request?: FastifyRequestLike, requestLoggerOptions?:
|
|
|
30
30
|
*/
|
|
31
31
|
declare function withAutotel<TReq extends FastifyRequestLike, TRes extends FastifyReplyLike, TReturn>(handler: (request: TReq, reply: TRes) => TReturn | Promise<TReturn>, options?: FastifyWithAutotelOptions): (request: TReq, reply: TRes) => Promise<TReturn>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { FastifyReplyLike, FastifyRequestLike, FastifyWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
34
|
-
//# sourceMappingURL=fastify.d.ts.map
|
|
33
|
+
export { FastifyReplyLike, FastifyRequestLike, FastifyWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/fastify.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as toRouteAdapterOptions } from "./integration-
|
|
1
|
+
import { o as toRouteAdapterOptions } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createRequestRunner, createUseLogger } from "./core.js";
|
|
3
3
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -58,5 +58,4 @@ function withAutotel(handler, options) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
//#endregion
|
|
61
|
-
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
|
62
|
-
//# sourceMappingURL=fastify.js.map
|
|
61
|
+
export { createDrainPipeline, createStructuredError, parseError, useLogger, withAutotel };
|
package/dist/hono.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_toolkit_storage = require('./toolkit/storage.cjs');
|
|
4
4
|
const require_core = require('./core.cjs');
|
|
5
5
|
let autotel = require("autotel");
|
|
@@ -45,7 +45,7 @@ function autotelMiddleware(options = {}) {
|
|
|
45
45
|
require_integration.applyLoggerEnrichment(handle.logger, enrichFromContext(c), options.enrichRequest?.(c));
|
|
46
46
|
try {
|
|
47
47
|
await handle.runWith(() => next());
|
|
48
|
-
if (options.autoEmit !== false) await handle.
|
|
48
|
+
if (options.autoEmit !== false) c.res = await handle.finishResponse(c.res);
|
|
49
49
|
} catch (error) {
|
|
50
50
|
if (options.autoEmit !== false) await handle.finish({ error: error instanceof Error ? error : new Error(String(error)) });
|
|
51
51
|
throw error;
|
|
@@ -62,5 +62,4 @@ exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
|
62
62
|
exports.createStructuredError = autotel.createStructuredError;
|
|
63
63
|
exports.parseError = autotel.parseError;
|
|
64
64
|
exports.useLogger = useLogger;
|
|
65
|
-
exports.useLoggerFromContext = useLoggerFromContext;
|
|
66
|
-
//# sourceMappingURL=hono.cjs.map
|
|
65
|
+
exports.useLoggerFromContext = useLoggerFromContext;
|
package/dist/hono.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { Context } from "hono";
|
|
@@ -12,5 +12,4 @@ declare function autotelMiddleware(options?: HonoWithAutotelOptions): (c: Contex
|
|
|
12
12
|
/** Alias for {@link useLogger} inside autotelMiddleware. */
|
|
13
13
|
declare const useLoggerFromContext: typeof useLogger;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { HonoWithAutotelOptions, autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
|
16
|
-
//# sourceMappingURL=hono.d.cts.map
|
|
15
|
+
export { HonoWithAutotelOptions, autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
package/dist/hono.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { Context } from "hono";
|
|
@@ -12,5 +12,4 @@ declare function autotelMiddleware(options?: HonoWithAutotelOptions): (c: Contex
|
|
|
12
12
|
/** Alias for {@link useLogger} inside autotelMiddleware. */
|
|
13
13
|
declare const useLoggerFromContext: typeof useLogger;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { HonoWithAutotelOptions, autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
|
16
|
-
//# sourceMappingURL=hono.d.ts.map
|
|
15
|
+
export { HonoWithAutotelOptions, autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
package/dist/hono.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-
|
|
1
|
+
import { i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createLoggerStorage } from "./toolkit/storage.js";
|
|
3
3
|
import { createUseLogger } from "./core.js";
|
|
4
4
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
@@ -44,7 +44,7 @@ function autotelMiddleware(options = {}) {
|
|
|
44
44
|
applyLoggerEnrichment(handle.logger, enrichFromContext(c), options.enrichRequest?.(c));
|
|
45
45
|
try {
|
|
46
46
|
await handle.runWith(() => next());
|
|
47
|
-
if (options.autoEmit !== false) await handle.
|
|
47
|
+
if (options.autoEmit !== false) c.res = await handle.finishResponse(c.res);
|
|
48
48
|
} catch (error) {
|
|
49
49
|
if (options.autoEmit !== false) await handle.finish({ error: error instanceof Error ? error : new Error(String(error)) });
|
|
50
50
|
throw error;
|
|
@@ -56,5 +56,4 @@ function autotelMiddleware(options = {}) {
|
|
|
56
56
|
const useLoggerFromContext = useLogger;
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
|
-
export { autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
|
60
|
-
//# sourceMappingURL=hono.js.map
|
|
59
|
+
export { autotelMiddleware, createDrainPipeline, createStructuredError, parseError, useLogger, useLoggerFromContext };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_core = require('./core.cjs');
|
|
4
4
|
const require_next = require('./next.cjs');
|
|
5
5
|
const require_nitro = require('./nitro.cjs');
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, DrainPipelineOptions, HeadersLike, ParsedError, PipelineDrainFn, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, RequestRunnerOptions, StructuredError, StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime } from "./core.cjs";
|
|
3
3
|
import { withAutotelFetch } from "./cloudflare.cjs";
|
|
4
4
|
import { autotel, useLogger, withAutotelHandler } from "./elysia.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-
|
|
1
|
+
import { _ as RouteAdapterOptions, f as toRouteAdapterOptions, n as FrameworkHandlerOptions, o as IntegratedCompletionOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import { AdapterUseLoggerOptions, BaseAdapterOptions, ConfigField, DrainPipelineOptions, HeadersLike, ParsedError, PipelineDrainFn, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, RequestRunnerOptions, StructuredError, StructuredErrorInput, createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime } from "./core.js";
|
|
3
3
|
import { withAutotelFetch } from "./cloudflare.js";
|
|
4
4
|
import { autotel, useLogger, withAutotelHandler } from "./elysia.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as toRouteAdapterOptions } from "./integration-
|
|
1
|
+
import { o as toRouteAdapterOptions } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createRequestRunner, createUseLogger, getHeader, resolveAdapterConfig, shouldProbeRuntime } from "./core.js";
|
|
3
3
|
import { withAutotel } from "./next.js";
|
|
4
4
|
import { withAutotelEventHandler } from "./nitro.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForkLifecycle, ForkLifecycle as ForkLifecycle$1, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, TraceContext } from "autotel";
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
2
|
import { RouteFilterOptions, RouteServiceConfig, getServiceForPath, matchesRoutePattern, shouldInstrumentPath } from "autotel-edge";
|
|
3
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
//#region src/toolkit/middleware.d.ts
|
|
5
5
|
type Awaitable<T> = T | Promise<T>;
|
|
6
6
|
interface RouteAdapterOptions {
|
|
@@ -64,6 +64,8 @@ interface ExtractedRequest {
|
|
|
64
64
|
}
|
|
65
65
|
interface IntegratedCompletionOptions {
|
|
66
66
|
autoEmit?: boolean;
|
|
67
|
+
/** Return false for framework control-flow throws that are not failures. */
|
|
68
|
+
isError?: (error: unknown) => boolean;
|
|
67
69
|
}
|
|
68
70
|
type TracedOptionInput = RouteAdapterOptions & {
|
|
69
71
|
requestLoggerOptions?: RequestLoggerOptions;
|
|
@@ -87,7 +89,7 @@ interface FrameworkRequestHandle extends MiddlewareLoggerResult {
|
|
|
87
89
|
}
|
|
88
90
|
interface FrameworkIntegrationHelpers<TCtx> {
|
|
89
91
|
begin: (traceCtx: TraceContext, ctx: TCtx, options?: FrameworkHandlerOptions) => FrameworkRequestHandle;
|
|
90
|
-
runTraced: <T>(ctx: TCtx, options: FrameworkHandlerOptions | undefined, handler: (handle: FrameworkRequestHandle) => Promise<T>) => Promise<T>;
|
|
92
|
+
runTraced: <T>(ctx: TCtx, options: FrameworkHandlerOptions | undefined, handler: (handle: FrameworkRequestHandle) => Promise<T>, completion?: Pick<IntegratedCompletionOptions, 'isError'>) => Promise<T>;
|
|
91
93
|
}
|
|
92
94
|
declare function applyLoggerEnrichment(logger: RequestLogger, ...attributeSets: Array<Record<string, unknown> | undefined | null>): void;
|
|
93
95
|
declare function completeIntegratedRequest<T>(handle: FrameworkRequestHandle, options: IntegratedCompletionOptions | undefined, result: T): Promise<T>;
|
|
@@ -96,5 +98,4 @@ declare function toRouteAdapterOptions(options?: Pick<FrameworkHandlerOptions, k
|
|
|
96
98
|
declare function buildTracedOptions(options: TracedOptionInput | undefined, spanName: string): FrameworkHandlerOptions;
|
|
97
99
|
declare function defineFrameworkIntegration<TCtx>(spec: FrameworkIntegrationSpec<TCtx>): FrameworkIntegrationHelpers<TCtx>;
|
|
98
100
|
//#endregion
|
|
99
|
-
export { matchesRoutePattern as C, getServiceForPath as S, shouldInstrumentPath as T, RouteAdapterOptions as _, FrameworkRequestHandle as a, TailSamplingContext as b, buildTracedOptions as c, runWithIntegratedHandle as d, toRouteAdapterOptions as f, MiddlewareLoggerResult as g, MiddlewareLoggerOptions as h, FrameworkIntegrationSpec as i, completeIntegratedRequest as l, ForkLifecycle$1 as m, FrameworkHandlerOptions as n, IntegratedCompletionOptions as o, BaseAdapterOptions as p, FrameworkIntegrationHelpers as r, applyLoggerEnrichment as s, ExtractedRequest as t, defineFrameworkIntegration as u, RouteFilterOptions as v, mergeRequestLoggerOptions as w, createMiddlewareLogger as x, RouteServiceConfig as y };
|
|
100
|
-
//# sourceMappingURL=integration-DI-1RuTh.d.cts.map
|
|
101
|
+
export { matchesRoutePattern as C, getServiceForPath as S, shouldInstrumentPath as T, RouteAdapterOptions as _, FrameworkRequestHandle as a, TailSamplingContext as b, buildTracedOptions as c, runWithIntegratedHandle as d, toRouteAdapterOptions as f, MiddlewareLoggerResult as g, MiddlewareLoggerOptions as h, FrameworkIntegrationSpec as i, completeIntegratedRequest as l, ForkLifecycle$1 as m, FrameworkHandlerOptions as n, IntegratedCompletionOptions as o, BaseAdapterOptions as p, FrameworkIntegrationHelpers as r, applyLoggerEnrichment as s, ExtractedRequest as t, defineFrameworkIntegration as u, RouteFilterOptions as v, mergeRequestLoggerOptions as w, createMiddlewareLogger as x, RouteServiceConfig as y };
|
|
@@ -231,7 +231,8 @@ async function runWithIntegratedHandle(handle, options, fn) {
|
|
|
231
231
|
try {
|
|
232
232
|
return completeIntegratedRequest(handle, options, await handle.runWith(fn));
|
|
233
233
|
} catch (error) {
|
|
234
|
-
if (options?.autoEmit !== false)
|
|
234
|
+
if (options?.autoEmit !== false) if (options?.isError?.(error) === false) await handle.finish({});
|
|
235
|
+
else await handle.finish({ error: error instanceof Error ? error : new Error(String(error)) });
|
|
235
236
|
throw error;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
@@ -320,10 +321,13 @@ function defineFrameworkIntegration(spec) {
|
|
|
320
321
|
if (!(0, autotel_edge.shouldInstrumentPath)(extracted.path, toRouteAdapterOptions(options))) return buildSkippedHandle(spec, ctx, extracted, options);
|
|
321
322
|
return buildHandle(spec, ctx, traceCtx, options);
|
|
322
323
|
},
|
|
323
|
-
runTraced(ctx, options, handler) {
|
|
324
|
+
runTraced(ctx, options, handler, completion) {
|
|
324
325
|
const extracted = spec.extractRequest(ctx);
|
|
325
326
|
if (!(0, autotel_edge.shouldInstrumentPath)(extracted.path, toRouteAdapterOptions(options))) return handler(buildSkippedHandle(spec, ctx, extracted, options));
|
|
326
|
-
return (0, autotel.withTracing)({
|
|
327
|
+
return (0, autotel.withTracing)({
|
|
328
|
+
name: options?.spanName ?? resolveSpanName(spec, ctx, extracted),
|
|
329
|
+
isError: completion?.isError
|
|
330
|
+
})((traceCtx) => async () => {
|
|
327
331
|
return handler(buildHandle(spec, ctx, traceCtx, options ?? {}));
|
|
328
332
|
})();
|
|
329
333
|
}
|
|
@@ -408,5 +412,4 @@ Object.defineProperty(exports, 'toRouteAdapterOptions', {
|
|
|
408
412
|
get: function () {
|
|
409
413
|
return toRouteAdapterOptions;
|
|
410
414
|
}
|
|
411
|
-
});
|
|
412
|
-
//# sourceMappingURL=integration-guh7BHTF.cjs.map
|
|
415
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForkLifecycle, ForkLifecycle as ForkLifecycle$1, RequestLogSnapshot, RequestLogger, RequestLoggerOptions, TraceContext } from "autotel";
|
|
2
|
-
import { RouteFilterOptions, RouteServiceConfig, getServiceForPath, matchesRoutePattern, shouldInstrumentPath } from "autotel-edge";
|
|
3
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
+
import { RouteFilterOptions, RouteServiceConfig, getServiceForPath, matchesRoutePattern, shouldInstrumentPath } from "autotel-edge";
|
|
4
4
|
//#region src/toolkit/middleware.d.ts
|
|
5
5
|
type Awaitable<T> = T | Promise<T>;
|
|
6
6
|
interface RouteAdapterOptions {
|
|
@@ -64,6 +64,8 @@ interface ExtractedRequest {
|
|
|
64
64
|
}
|
|
65
65
|
interface IntegratedCompletionOptions {
|
|
66
66
|
autoEmit?: boolean;
|
|
67
|
+
/** Return false for framework control-flow throws that are not failures. */
|
|
68
|
+
isError?: (error: unknown) => boolean;
|
|
67
69
|
}
|
|
68
70
|
type TracedOptionInput = RouteAdapterOptions & {
|
|
69
71
|
requestLoggerOptions?: RequestLoggerOptions;
|
|
@@ -87,7 +89,7 @@ interface FrameworkRequestHandle extends MiddlewareLoggerResult {
|
|
|
87
89
|
}
|
|
88
90
|
interface FrameworkIntegrationHelpers<TCtx> {
|
|
89
91
|
begin: (traceCtx: TraceContext, ctx: TCtx, options?: FrameworkHandlerOptions) => FrameworkRequestHandle;
|
|
90
|
-
runTraced: <T>(ctx: TCtx, options: FrameworkHandlerOptions | undefined, handler: (handle: FrameworkRequestHandle) => Promise<T>) => Promise<T>;
|
|
92
|
+
runTraced: <T>(ctx: TCtx, options: FrameworkHandlerOptions | undefined, handler: (handle: FrameworkRequestHandle) => Promise<T>, completion?: Pick<IntegratedCompletionOptions, 'isError'>) => Promise<T>;
|
|
91
93
|
}
|
|
92
94
|
declare function applyLoggerEnrichment(logger: RequestLogger, ...attributeSets: Array<Record<string, unknown> | undefined | null>): void;
|
|
93
95
|
declare function completeIntegratedRequest<T>(handle: FrameworkRequestHandle, options: IntegratedCompletionOptions | undefined, result: T): Promise<T>;
|
|
@@ -96,5 +98,4 @@ declare function toRouteAdapterOptions(options?: Pick<FrameworkHandlerOptions, k
|
|
|
96
98
|
declare function buildTracedOptions(options: TracedOptionInput | undefined, spanName: string): FrameworkHandlerOptions;
|
|
97
99
|
declare function defineFrameworkIntegration<TCtx>(spec: FrameworkIntegrationSpec<TCtx>): FrameworkIntegrationHelpers<TCtx>;
|
|
98
100
|
//#endregion
|
|
99
|
-
export { matchesRoutePattern as C, getServiceForPath as S, shouldInstrumentPath as T, RouteAdapterOptions as _, FrameworkRequestHandle as a, TailSamplingContext as b, buildTracedOptions as c, runWithIntegratedHandle as d, toRouteAdapterOptions as f, MiddlewareLoggerResult as g, MiddlewareLoggerOptions as h, FrameworkIntegrationSpec as i, completeIntegratedRequest as l, ForkLifecycle$1 as m, FrameworkHandlerOptions as n, IntegratedCompletionOptions as o, BaseAdapterOptions as p, FrameworkIntegrationHelpers as r, applyLoggerEnrichment as s, ExtractedRequest as t, defineFrameworkIntegration as u, RouteFilterOptions as v, mergeRequestLoggerOptions as w, createMiddlewareLogger as x, RouteServiceConfig as y };
|
|
100
|
-
//# sourceMappingURL=integration-rYoX8QLk.d.ts.map
|
|
101
|
+
export { matchesRoutePattern as C, getServiceForPath as S, shouldInstrumentPath as T, RouteAdapterOptions as _, FrameworkRequestHandle as a, TailSamplingContext as b, buildTracedOptions as c, runWithIntegratedHandle as d, toRouteAdapterOptions as f, MiddlewareLoggerResult as g, MiddlewareLoggerOptions as h, FrameworkIntegrationSpec as i, completeIntegratedRequest as l, ForkLifecycle$1 as m, FrameworkHandlerOptions as n, IntegratedCompletionOptions as o, BaseAdapterOptions as p, FrameworkIntegrationHelpers as r, applyLoggerEnrichment as s, ExtractedRequest as t, defineFrameworkIntegration as u, RouteFilterOptions as v, mergeRequestLoggerOptions as w, createMiddlewareLogger as x, RouteServiceConfig as y };
|
|
@@ -231,7 +231,8 @@ async function runWithIntegratedHandle(handle, options, fn) {
|
|
|
231
231
|
try {
|
|
232
232
|
return completeIntegratedRequest(handle, options, await handle.runWith(fn));
|
|
233
233
|
} catch (error) {
|
|
234
|
-
if (options?.autoEmit !== false)
|
|
234
|
+
if (options?.autoEmit !== false) if (options?.isError?.(error) === false) await handle.finish({});
|
|
235
|
+
else await handle.finish({ error: error instanceof Error ? error : new Error(String(error)) });
|
|
235
236
|
throw error;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
@@ -320,10 +321,13 @@ function defineFrameworkIntegration(spec) {
|
|
|
320
321
|
if (!shouldInstrumentPath(extracted.path, toRouteAdapterOptions(options))) return buildSkippedHandle(spec, ctx, extracted, options);
|
|
321
322
|
return buildHandle(spec, ctx, traceCtx, options);
|
|
322
323
|
},
|
|
323
|
-
runTraced(ctx, options, handler) {
|
|
324
|
+
runTraced(ctx, options, handler, completion) {
|
|
324
325
|
const extracted = spec.extractRequest(ctx);
|
|
325
326
|
if (!shouldInstrumentPath(extracted.path, toRouteAdapterOptions(options))) return handler(buildSkippedHandle(spec, ctx, extracted, options));
|
|
326
|
-
return withTracing({
|
|
327
|
+
return withTracing({
|
|
328
|
+
name: options?.spanName ?? resolveSpanName(spec, ctx, extracted),
|
|
329
|
+
isError: completion?.isError
|
|
330
|
+
})((traceCtx) => async () => {
|
|
327
331
|
return handler(buildHandle(spec, ctx, traceCtx, options ?? {}));
|
|
328
332
|
})();
|
|
329
333
|
}
|
|
@@ -331,5 +335,4 @@ function defineFrameworkIntegration(spec) {
|
|
|
331
335
|
}
|
|
332
336
|
|
|
333
337
|
//#endregion
|
|
334
|
-
export { runWithIntegratedHandle as a, createMiddlewareLogger as c, mergeRequestLoggerOptions as d, shouldInstrumentPath as f, extendDeferredDrain as g, shouldDeferEmitForResponse as h, defineFrameworkIntegration as i, getServiceForPath as l, isStreamingResponse as m, buildTracedOptions as n, toRouteAdapterOptions as o, bindStreamingResponseLifecycle as p, completeIntegratedRequest as r, attachForkToLogger as s, applyLoggerEnrichment as t, matchesRoutePattern as u };
|
|
335
|
-
//# sourceMappingURL=integration-IUpfttGT.js.map
|
|
338
|
+
export { runWithIntegratedHandle as a, createMiddlewareLogger as c, mergeRequestLoggerOptions as d, shouldInstrumentPath as f, extendDeferredDrain as g, shouldDeferEmitForResponse as h, defineFrameworkIntegration as i, getServiceForPath as l, isStreamingResponse as m, buildTracedOptions as n, toRouteAdapterOptions as o, bindStreamingResponseLifecycle as p, completeIntegratedRequest as r, attachForkToLogger as s, applyLoggerEnrichment as t, matchesRoutePattern as u };
|
package/dist/nestjs.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_integration = require('./integration-
|
|
2
|
+
const require_integration = require('./integration-Cc8bXel_.cjs');
|
|
3
3
|
const require_toolkit_storage = require('./toolkit/storage.cjs');
|
|
4
4
|
let autotel = require("autotel");
|
|
5
5
|
let rxjs = require("rxjs");
|
|
@@ -115,5 +115,4 @@ exports.AutotelInterceptor = AutotelInterceptor;
|
|
|
115
115
|
exports.createDrainPipeline = autotel.createDrainPipeline;
|
|
116
116
|
exports.createStructuredError = autotel.createStructuredError;
|
|
117
117
|
exports.parseError = autotel.parseError;
|
|
118
|
-
exports.useLogger = useLogger;
|
|
119
|
-
//# sourceMappingURL=nestjs.cjs.map
|
|
118
|
+
exports.useLogger = useLogger;
|
package/dist/nestjs.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-D_rlU8Nx.cjs";
|
|
2
2
|
import "./core.cjs";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
@@ -38,5 +38,4 @@ declare class AutotelInterceptor {
|
|
|
38
38
|
}): Observable<unknown>;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
export { AutotelInterceptor, NestExecutionContextLike, NestRequestLike, NestResponseLike, NestWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger };
|
|
42
|
-
//# sourceMappingURL=nestjs.d.cts.map
|
|
41
|
+
export { AutotelInterceptor, NestExecutionContextLike, NestRequestLike, NestResponseLike, NestWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger };
|
package/dist/nestjs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FrameworkHandlerOptions } from "./integration-
|
|
1
|
+
import { n as FrameworkHandlerOptions } from "./integration-BAs5uTiD.js";
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { RequestLogger, createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
@@ -38,5 +38,4 @@ declare class AutotelInterceptor {
|
|
|
38
38
|
}): Observable<unknown>;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
export { AutotelInterceptor, NestExecutionContextLike, NestRequestLike, NestResponseLike, NestWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger };
|
|
42
|
-
//# sourceMappingURL=nestjs.d.ts.map
|
|
41
|
+
export { AutotelInterceptor, NestExecutionContextLike, NestRequestLike, NestResponseLike, NestWithAutotelOptions, createDrainPipeline, createStructuredError, parseError, useLogger };
|
package/dist/nestjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-
|
|
1
|
+
import { i as defineFrameworkIntegration, t as applyLoggerEnrichment } from "./integration-DvibHRzI.js";
|
|
2
2
|
import { createLoggerStorage } from "./toolkit/storage.js";
|
|
3
3
|
import { createDrainPipeline, createStructuredError, parseError } from "autotel";
|
|
4
4
|
import { Observable, from, isObservable } from "rxjs";
|
|
@@ -110,5 +110,4 @@ var AutotelInterceptor = class {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
//#endregion
|
|
113
|
-
export { AutotelInterceptor, createDrainPipeline, createStructuredError, parseError, useLogger };
|
|
114
|
-
//# sourceMappingURL=nestjs.js.map
|
|
113
|
+
export { AutotelInterceptor, createDrainPipeline, createStructuredError, parseError, useLogger };
|