@stainlessdev/xray-emitter 0.2.0 → 0.3.1-dev.3f4598d
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 +1 -2
- package/dist/{chunk-2HW4AEKB.cjs → chunk-55YD27PV.cjs} +28 -28
- package/dist/chunk-55YD27PV.cjs.map +1 -0
- package/dist/{chunk-YVMMCTXW.js → chunk-7KT6EPVZ.js} +1 -1
- package/dist/{chunk-YVMMCTXW.js.map → chunk-7KT6EPVZ.js.map} +1 -1
- package/dist/{chunk-GNSXLLEC.cjs → chunk-CPHFCOA5.cjs} +9 -9
- package/dist/{chunk-GNSXLLEC.cjs.map → chunk-CPHFCOA5.cjs.map} +1 -1
- package/dist/{chunk-JKW6E4L3.cjs → chunk-DNBARLGB.cjs} +1 -1
- package/dist/{chunk-JKW6E4L3.cjs.map → chunk-DNBARLGB.cjs.map} +1 -1
- package/dist/{chunk-ZP5OEA4I.js → chunk-DV3MVQBB.js} +4 -4
- package/dist/chunk-DV3MVQBB.js.map +1 -0
- package/dist/{chunk-WTHVUHGI.js → chunk-FGXXKIF7.js} +4 -4
- package/dist/chunk-FGXXKIF7.js.map +1 -0
- package/dist/{chunk-TSCMZ5TV.js → chunk-GYXI3DWB.js} +35 -3
- package/dist/chunk-GYXI3DWB.js.map +1 -0
- package/dist/{chunk-6UH43LVD.js → chunk-NTIUR3OC.js} +2 -2
- package/dist/{chunk-DBI3HXNR.cjs → chunk-SUVCVINA.cjs} +47 -47
- package/dist/chunk-SUVCVINA.cjs.map +1 -0
- package/dist/{chunk-XO6YWDFL.cjs → chunk-UJWD5CFA.cjs} +53 -21
- package/dist/chunk-UJWD5CFA.cjs.map +1 -0
- package/dist/effect.cjs +19 -19
- package/dist/effect.cjs.map +1 -1
- package/dist/effect.d.cts +30 -3
- package/dist/effect.d.ts +30 -3
- package/dist/effect.js +4 -4
- package/dist/effect.js.map +1 -1
- package/dist/emitter-Bi_m_w5h.d.cts +10 -0
- package/dist/emitter-Dy7bRGTq.d.ts +10 -0
- package/dist/express.cjs +7 -7
- package/dist/express.cjs.map +1 -1
- package/dist/express.d.cts +9 -2
- package/dist/express.d.ts +9 -2
- package/dist/express.js +4 -4
- package/dist/express.js.map +1 -1
- package/dist/fastify.cjs +10 -10
- package/dist/fastify.cjs.map +1 -1
- package/dist/fastify.d.cts +9 -2
- package/dist/fastify.d.ts +9 -2
- package/dist/fastify.js +4 -4
- package/dist/fastify.js.map +1 -1
- package/dist/fetch.cjs +5 -5
- package/dist/fetch.d.cts +39 -2
- package/dist/fetch.d.ts +39 -2
- package/dist/fetch.js +4 -4
- package/dist/hono.cjs +9 -9
- package/dist/hono.cjs.map +1 -1
- package/dist/hono.d.cts +15 -3
- package/dist/hono.d.ts +15 -3
- package/dist/hono.js +4 -4
- package/dist/hono.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +2 -2
- package/dist/internal.cjs +3 -3
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +2 -2
- package/dist/next.cjs +7 -7
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +9 -3
- package/dist/next.d.ts +9 -3
- package/dist/next.js +4 -4
- package/dist/next.js.map +1 -1
- package/dist/node.cjs +5 -5
- package/dist/node.d.cts +42 -1
- package/dist/node.d.ts +42 -1
- package/dist/node.js +4 -4
- package/dist/remix.cjs +7 -7
- package/dist/remix.cjs.map +1 -1
- package/dist/remix.d.cts +10 -3
- package/dist/remix.d.ts +10 -3
- package/dist/remix.js +4 -4
- package/dist/remix.js.map +1 -1
- package/dist/types-BrKvhHbn.d.cts +446 -0
- package/dist/types-BrKvhHbn.d.ts +446 -0
- package/package.json +1 -1
- package/dist/chunk-2HW4AEKB.cjs.map +0 -1
- package/dist/chunk-DBI3HXNR.cjs.map +0 -1
- package/dist/chunk-TSCMZ5TV.js.map +0 -1
- package/dist/chunk-WTHVUHGI.js.map +0 -1
- package/dist/chunk-XO6YWDFL.cjs.map +0 -1
- package/dist/chunk-ZP5OEA4I.js.map +0 -1
- package/dist/emitter-BqfrGIod.d.cts +0 -5
- package/dist/emitter-CScYhwGA.d.ts +0 -5
- package/dist/types-Z1nirh-F.d.cts +0 -149
- package/dist/types-Z1nirh-F.d.ts +0 -149
- /package/dist/{chunk-6UH43LVD.js.map → chunk-NTIUR3OC.js.map} +0 -0
package/dist/node.d.cts
CHANGED
|
@@ -1,20 +1,61 @@
|
|
|
1
|
-
import { j as XrayRuntimeConfig, a as XrayEmitter, e as CaptureConfig, f as RedactionConfig, d as XrayContext, R as RequestLog } from './types-
|
|
1
|
+
import { j as XrayRuntimeConfig, a as XrayEmitter, e as CaptureConfig, f as RedactionConfig, d as XrayContext, R as RequestLog } from './types-BrKvhHbn.cjs';
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import '@opentelemetry/sdk-trace-base';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Create a Node runtime emitter using OTLP HTTP transport by default.
|
|
7
|
+
*
|
|
8
|
+
* Pass `config.exporter.instance` to provide a custom `SpanExporter`.
|
|
9
|
+
*/
|
|
5
10
|
declare function createEmitter(config: XrayRuntimeConfig): XrayEmitter;
|
|
6
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Handler signature for `node:http` request listeners.
|
|
14
|
+
*/
|
|
7
15
|
type NodeHttpHandler = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Per-handler overrides for `wrapHttpHandler`.
|
|
18
|
+
*/
|
|
8
19
|
interface WrapOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Explicit route pattern for this handler (for example `/users/:id`).
|
|
22
|
+
*/
|
|
9
23
|
route?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Explicit request ID. Skips header lookup/generation when provided.
|
|
26
|
+
*/
|
|
10
27
|
requestId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Per-handler capture overrides.
|
|
30
|
+
*/
|
|
11
31
|
capture?: Partial<CaptureConfig>;
|
|
32
|
+
/**
|
|
33
|
+
* Per-handler redaction overrides.
|
|
34
|
+
*/
|
|
12
35
|
redaction?: Partial<RedactionConfig>;
|
|
36
|
+
/**
|
|
37
|
+
* Hook called after request context is created.
|
|
38
|
+
*/
|
|
13
39
|
onRequest?: (ctx: XrayContext) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Hook called after the request has been finalized and logged.
|
|
42
|
+
*/
|
|
14
43
|
onResponse?: (ctx: XrayContext, log: RequestLog) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Hook called when request handling fails.
|
|
46
|
+
*/
|
|
15
47
|
onError?: (ctx: XrayContext, err: unknown) => void;
|
|
16
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Wrap a `node:http` request handler with X-ray instrumentation.
|
|
51
|
+
*
|
|
52
|
+
* The wrapper binds `XrayContext` to both `req` and `res`, captures configured
|
|
53
|
+
* request/response metadata, and ensures a response request ID header is set.
|
|
54
|
+
*/
|
|
17
55
|
declare function wrapHttpHandler(handler: NodeHttpHandler, xray: XrayEmitter, options?: WrapOptions): NodeHttpHandler;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve the `XrayContext` bound to a Node `IncomingMessage`.
|
|
58
|
+
*/
|
|
18
59
|
declare function getXrayContext(req: IncomingMessage): XrayContext | undefined;
|
|
19
60
|
|
|
20
61
|
export { type NodeHttpHandler, type WrapOptions, createEmitter, getXrayContext, wrapHttpHandler };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,20 +1,61 @@
|
|
|
1
|
-
import { j as XrayRuntimeConfig, a as XrayEmitter, e as CaptureConfig, f as RedactionConfig, d as XrayContext, R as RequestLog } from './types-
|
|
1
|
+
import { j as XrayRuntimeConfig, a as XrayEmitter, e as CaptureConfig, f as RedactionConfig, d as XrayContext, R as RequestLog } from './types-BrKvhHbn.js';
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
import '@opentelemetry/sdk-trace-base';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Create a Node runtime emitter using OTLP HTTP transport by default.
|
|
7
|
+
*
|
|
8
|
+
* Pass `config.exporter.instance` to provide a custom `SpanExporter`.
|
|
9
|
+
*/
|
|
5
10
|
declare function createEmitter(config: XrayRuntimeConfig): XrayEmitter;
|
|
6
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Handler signature for `node:http` request listeners.
|
|
14
|
+
*/
|
|
7
15
|
type NodeHttpHandler = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Per-handler overrides for `wrapHttpHandler`.
|
|
18
|
+
*/
|
|
8
19
|
interface WrapOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Explicit route pattern for this handler (for example `/users/:id`).
|
|
22
|
+
*/
|
|
9
23
|
route?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Explicit request ID. Skips header lookup/generation when provided.
|
|
26
|
+
*/
|
|
10
27
|
requestId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Per-handler capture overrides.
|
|
30
|
+
*/
|
|
11
31
|
capture?: Partial<CaptureConfig>;
|
|
32
|
+
/**
|
|
33
|
+
* Per-handler redaction overrides.
|
|
34
|
+
*/
|
|
12
35
|
redaction?: Partial<RedactionConfig>;
|
|
36
|
+
/**
|
|
37
|
+
* Hook called after request context is created.
|
|
38
|
+
*/
|
|
13
39
|
onRequest?: (ctx: XrayContext) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Hook called after the request has been finalized and logged.
|
|
42
|
+
*/
|
|
14
43
|
onResponse?: (ctx: XrayContext, log: RequestLog) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Hook called when request handling fails.
|
|
46
|
+
*/
|
|
15
47
|
onError?: (ctx: XrayContext, err: unknown) => void;
|
|
16
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Wrap a `node:http` request handler with X-ray instrumentation.
|
|
51
|
+
*
|
|
52
|
+
* The wrapper binds `XrayContext` to both `req` and `res`, captures configured
|
|
53
|
+
* request/response metadata, and ensures a response request ID header is set.
|
|
54
|
+
*/
|
|
17
55
|
declare function wrapHttpHandler(handler: NodeHttpHandler, xray: XrayEmitter, options?: WrapOptions): NodeHttpHandler;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve the `XrayContext` bound to a Node `IncomingMessage`.
|
|
58
|
+
*/
|
|
18
59
|
declare function getXrayContext(req: IncomingMessage): XrayContext | undefined;
|
|
19
60
|
|
|
20
61
|
export { type NodeHttpHandler, type WrapOptions, createEmitter, getXrayContext, wrapHttpHandler };
|
package/dist/node.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
createEmitter,
|
|
3
3
|
getXrayContext,
|
|
4
4
|
wrapHttpHandler
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FGXXKIF7.js";
|
|
6
|
+
import "./chunk-GYXI3DWB.js";
|
|
7
|
+
import "./chunk-NTIUR3OC.js";
|
|
8
|
+
import "./chunk-7KT6EPVZ.js";
|
|
9
9
|
export {
|
|
10
10
|
createEmitter,
|
|
11
11
|
getXrayContext,
|
package/dist/remix.cjs
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
5
|
+
var _chunkSUVCVINAcjs = require('./chunk-SUVCVINA.cjs');
|
|
6
|
+
require('./chunk-UJWD5CFA.cjs');
|
|
7
|
+
require('./chunk-CPHFCOA5.cjs');
|
|
8
|
+
require('./chunk-DNBARLGB.cjs');
|
|
9
9
|
|
|
10
10
|
// src/remix/remix.ts
|
|
11
11
|
function createEmitter2(config, options) {
|
|
12
|
-
const emitter =
|
|
12
|
+
const emitter = _chunkSUVCVINAcjs.createEmitter.call(void 0, config);
|
|
13
13
|
const wrap = ((handler) => wrapRemixRequestHandler(handler, emitter, options));
|
|
14
14
|
wrap.flush = emitter.flush;
|
|
15
15
|
wrap.shutdown = emitter.shutdown;
|
|
@@ -17,7 +17,7 @@ function createEmitter2(config, options) {
|
|
|
17
17
|
}
|
|
18
18
|
function wrapRemixRequestHandler(handler, xray, options) {
|
|
19
19
|
return (request, loadContext) => {
|
|
20
|
-
const wrapped =
|
|
20
|
+
const wrapped = _chunkSUVCVINAcjs.wrapFetchPreserve.call(void 0, (req) => handler(req, loadContext), xray, options);
|
|
21
21
|
return wrapped(request);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -26,5 +26,5 @@ function wrapRemixRequestHandler(handler, xray, options) {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.createCoreEmitter =
|
|
29
|
+
exports.createCoreEmitter = _chunkSUVCVINAcjs.createEmitter; exports.createEmitter = createEmitter2; exports.getXrayContext = _chunkSUVCVINAcjs.getXrayContext; exports.wrapRemixRequestHandler = wrapRemixRequestHandler;
|
|
30
30
|
//# sourceMappingURL=remix.cjs.map
|
package/dist/remix.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/xray-emitter-js/xray-emitter-js/dist/remix.cjs","../src/remix/remix.ts"],"names":["createEmitter"],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/xray-emitter-js/xray-emitter-js/dist/remix.cjs","../src/remix/remix.ts"],"names":["createEmitter"],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACwBO,SAASA,cAAAA,CAAc,MAAA,EAA2B,OAAA,EAAqC;AAC5F,EAAA,MAAM,QAAA,EAAU,6CAAA,MAAyB,CAAA;AACzC,EAAA,MAAM,KAAA,EAAA,CAAQ,CAAC,OAAA,EAAA,GACb,uBAAA,CAAwB,OAAA,EAAS,OAAA,EAAS,OAAO,CAAA,CAAA;AACnD,EAAA,IAAA,CAAK,MAAA,EAAQ,OAAA,CAAQ,KAAA;AACrB,EAAA,IAAA,CAAK,SAAA,EAAW,OAAA,CAAQ,QAAA;AACxB,EAAA,OAAO,IAAA;AACT;AAKO,SAAS,uBAAA,CACd,OAAA,EACA,IAAA,EACA,OAAA,EACgB;AAChB,EAAA,OAAO,CAAC,OAAA,EAAS,WAAA,EAAA,GAAgB;AAC/B,IAAA,MAAM,QAAA,EAAU,iDAAA,CAAmB,GAAA,EAAA,GAAiB,OAAA,CAAQ,GAAA,EAAK,WAAW,CAAA,EAAG,IAAA,EAAM,OAAO,CAAA;AAC5F,IAAA,OAAO,OAAA,CAAQ,OAAO,CAAA;AAAA,EACxB,CAAA;AACF;AD/BA;AACE;AACA;AACA;AACA;AACF,0NAAC","file":"/home/runner/work/xray-emitter-js/xray-emitter-js/dist/remix.cjs","sourcesContent":[null,"import type { XrayEmitter, XrayRuntimeConfig } from '../core/index';\nimport {\n createEmitter as createFetchEmitter,\n getXrayContext,\n wrapFetchPreserve,\n type WrapOptions,\n} from '../fetch/fetch';\n\nexport { createFetchEmitter as createCoreEmitter };\nexport type {\n CaptureConfig,\n RedactionConfig,\n RequestLog,\n XrayConfig,\n XrayContext,\n XrayEmitter,\n XrayRuntimeConfig,\n} from '../core/index';\nexport type { WrapOptions } from '../fetch/fetch';\nexport { getXrayContext };\n\n// copy type from react-router to avoid a package dependency\ntype RequestHandler = (request: Request, loadContext?: unknown) => Response | Promise<Response>;\n\ntype RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {\n flush: XrayEmitter['flush'];\n shutdown: XrayEmitter['shutdown'];\n};\n\n/**\n * Create a Remix/React Router request-handler wrapper and expose\n * `flush()`/`shutdown()`.\n */\nexport function createEmitter(config: XrayRuntimeConfig, options?: WrapOptions): RemixEmitter {\n const emitter = createFetchEmitter(config);\n const wrap = ((handler: RequestHandler) =>\n wrapRemixRequestHandler(handler, emitter, options)) as RemixEmitter;\n wrap.flush = emitter.flush;\n wrap.shutdown = emitter.shutdown;\n return wrap;\n}\n\n/**\n * Wrap a Remix request handler using an existing core `XrayEmitter`.\n */\nexport function wrapRemixRequestHandler(\n handler: RequestHandler,\n xray: XrayEmitter,\n options?: WrapOptions,\n): RequestHandler {\n return (request, loadContext) => {\n const wrapped = wrapFetchPreserve((req: Request) => handler(req, loadContext), xray, options);\n return wrapped(request);\n };\n}\n"]}
|
package/dist/remix.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as XrayRuntimeConfig, a as XrayEmitter } from './types-
|
|
2
|
-
export { e as CaptureConfig, f as RedactionConfig, R as RequestLog, X as XrayConfig, d as XrayContext } from './types-
|
|
3
|
-
export { c as createCoreEmitter } from './emitter-
|
|
1
|
+
import { j as XrayRuntimeConfig, a as XrayEmitter } from './types-BrKvhHbn.cjs';
|
|
2
|
+
export { e as CaptureConfig, f as RedactionConfig, R as RequestLog, X as XrayConfig, d as XrayContext } from './types-BrKvhHbn.cjs';
|
|
3
|
+
export { c as createCoreEmitter } from './emitter-Bi_m_w5h.cjs';
|
|
4
4
|
import { WrapOptions } from './fetch.cjs';
|
|
5
5
|
export { getXrayContext } from './fetch.cjs';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -10,7 +10,14 @@ type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {
|
|
|
10
10
|
flush: XrayEmitter['flush'];
|
|
11
11
|
shutdown: XrayEmitter['shutdown'];
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Create a Remix/React Router request-handler wrapper and expose
|
|
15
|
+
* `flush()`/`shutdown()`.
|
|
16
|
+
*/
|
|
13
17
|
declare function createEmitter(config: XrayRuntimeConfig, options?: WrapOptions): RemixEmitter;
|
|
18
|
+
/**
|
|
19
|
+
* Wrap a Remix request handler using an existing core `XrayEmitter`.
|
|
20
|
+
*/
|
|
14
21
|
declare function wrapRemixRequestHandler(handler: RequestHandler, xray: XrayEmitter, options?: WrapOptions): RequestHandler;
|
|
15
22
|
|
|
16
23
|
export { WrapOptions, XrayEmitter, XrayRuntimeConfig, createEmitter, wrapRemixRequestHandler };
|
package/dist/remix.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as XrayRuntimeConfig, a as XrayEmitter } from './types-
|
|
2
|
-
export { e as CaptureConfig, f as RedactionConfig, R as RequestLog, X as XrayConfig, d as XrayContext } from './types-
|
|
3
|
-
export { c as createCoreEmitter } from './emitter-
|
|
1
|
+
import { j as XrayRuntimeConfig, a as XrayEmitter } from './types-BrKvhHbn.js';
|
|
2
|
+
export { e as CaptureConfig, f as RedactionConfig, R as RequestLog, X as XrayConfig, d as XrayContext } from './types-BrKvhHbn.js';
|
|
3
|
+
export { c as createCoreEmitter } from './emitter-Dy7bRGTq.js';
|
|
4
4
|
import { WrapOptions } from './fetch.js';
|
|
5
5
|
export { getXrayContext } from './fetch.js';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -10,7 +10,14 @@ type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {
|
|
|
10
10
|
flush: XrayEmitter['flush'];
|
|
11
11
|
shutdown: XrayEmitter['shutdown'];
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Create a Remix/React Router request-handler wrapper and expose
|
|
15
|
+
* `flush()`/`shutdown()`.
|
|
16
|
+
*/
|
|
13
17
|
declare function createEmitter(config: XrayRuntimeConfig, options?: WrapOptions): RemixEmitter;
|
|
18
|
+
/**
|
|
19
|
+
* Wrap a Remix request handler using an existing core `XrayEmitter`.
|
|
20
|
+
*/
|
|
14
21
|
declare function wrapRemixRequestHandler(handler: RequestHandler, xray: XrayEmitter, options?: WrapOptions): RequestHandler;
|
|
15
22
|
|
|
16
23
|
export { WrapOptions, XrayEmitter, XrayRuntimeConfig, createEmitter, wrapRemixRequestHandler };
|
package/dist/remix.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
createEmitter,
|
|
3
3
|
getXrayContext,
|
|
4
4
|
wrapFetchPreserve
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-DV3MVQBB.js";
|
|
6
|
+
import "./chunk-GYXI3DWB.js";
|
|
7
|
+
import "./chunk-NTIUR3OC.js";
|
|
8
|
+
import "./chunk-7KT6EPVZ.js";
|
|
9
9
|
|
|
10
10
|
// src/remix/remix.ts
|
|
11
11
|
function createEmitter2(config, options) {
|
package/dist/remix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/remix/remix.ts"],"sourcesContent":["import type { XrayEmitter, XrayRuntimeConfig } from '../core/index';\nimport {\n createEmitter as createFetchEmitter,\n getXrayContext,\n wrapFetchPreserve,\n type WrapOptions,\n} from '../fetch/fetch';\n\nexport { createFetchEmitter as createCoreEmitter };\nexport type {\n CaptureConfig,\n RedactionConfig,\n RequestLog,\n XrayConfig,\n XrayContext,\n XrayEmitter,\n XrayRuntimeConfig,\n} from '../core/index';\nexport type { WrapOptions } from '../fetch/fetch';\nexport { getXrayContext };\n\n// copy type from react-router to avoid a package dependency\ntype RequestHandler = (request: Request, loadContext?: unknown) => Response | Promise<Response>;\n\ntype RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {\n flush: XrayEmitter['flush'];\n shutdown: XrayEmitter['shutdown'];\n};\n\nexport function createEmitter(config: XrayRuntimeConfig, options?: WrapOptions): RemixEmitter {\n const emitter = createFetchEmitter(config);\n const wrap = ((handler: RequestHandler) =>\n wrapRemixRequestHandler(handler, emitter, options)) as RemixEmitter;\n wrap.flush = emitter.flush;\n wrap.shutdown = emitter.shutdown;\n return wrap;\n}\n\nexport function wrapRemixRequestHandler(\n handler: RequestHandler,\n xray: XrayEmitter,\n options?: WrapOptions,\n): RequestHandler {\n return (request, loadContext) => {\n const wrapped = wrapFetchPreserve((req: Request) => handler(req, loadContext), xray, options);\n return wrapped(request);\n };\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/remix/remix.ts"],"sourcesContent":["import type { XrayEmitter, XrayRuntimeConfig } from '../core/index';\nimport {\n createEmitter as createFetchEmitter,\n getXrayContext,\n wrapFetchPreserve,\n type WrapOptions,\n} from '../fetch/fetch';\n\nexport { createFetchEmitter as createCoreEmitter };\nexport type {\n CaptureConfig,\n RedactionConfig,\n RequestLog,\n XrayConfig,\n XrayContext,\n XrayEmitter,\n XrayRuntimeConfig,\n} from '../core/index';\nexport type { WrapOptions } from '../fetch/fetch';\nexport { getXrayContext };\n\n// copy type from react-router to avoid a package dependency\ntype RequestHandler = (request: Request, loadContext?: unknown) => Response | Promise<Response>;\n\ntype RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {\n flush: XrayEmitter['flush'];\n shutdown: XrayEmitter['shutdown'];\n};\n\n/**\n * Create a Remix/React Router request-handler wrapper and expose\n * `flush()`/`shutdown()`.\n */\nexport function createEmitter(config: XrayRuntimeConfig, options?: WrapOptions): RemixEmitter {\n const emitter = createFetchEmitter(config);\n const wrap = ((handler: RequestHandler) =>\n wrapRemixRequestHandler(handler, emitter, options)) as RemixEmitter;\n wrap.flush = emitter.flush;\n wrap.shutdown = emitter.shutdown;\n return wrap;\n}\n\n/**\n * Wrap a Remix request handler using an existing core `XrayEmitter`.\n */\nexport function wrapRemixRequestHandler(\n handler: RequestHandler,\n xray: XrayEmitter,\n options?: WrapOptions,\n): RequestHandler {\n return (request, loadContext) => {\n const wrapped = wrapFetchPreserve((req: Request) => handler(req, loadContext), xray, options);\n return wrapped(request);\n };\n}\n"],"mappings":";;;;;;;;;;AAiCO,SAASA,eAAc,QAA2B,SAAqC;AAC5F,QAAM,UAAU,cAAmB,MAAM;AACzC,QAAM,QAAQ,CAAC,YACb,wBAAwB,SAAS,SAAS,OAAO;AACnD,OAAK,QAAQ,QAAQ;AACrB,OAAK,WAAW,QAAQ;AACxB,SAAO;AACT;AAKO,SAAS,wBACd,SACA,MACA,SACgB;AAChB,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,UAAU,kBAAkB,CAAC,QAAiB,QAAQ,KAAK,WAAW,GAAG,MAAM,OAAO;AAC5F,WAAO,QAAQ,OAAO;AAAA,EACxB;AACF;","names":["createEmitter"]}
|