@stainlessdev/xray-remix 0.1.0-dev.c66866e → 0.1.0-dev.d01fd73
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/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -20,13 +20,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
|
|
23
|
+
createCoreEmitter: () => import_xray_core.createEmitter,
|
|
24
|
+
createEmitter: () => createEmitter,
|
|
24
25
|
getXrayContext: () => import_xray_fetch.getXrayContext,
|
|
25
26
|
wrapRemixRequestHandler: () => wrapRemixRequestHandler
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(index_exports);
|
|
28
29
|
var import_xray_core = require("@stainlessdev/xray-core");
|
|
29
30
|
var import_xray_fetch = require("@stainlessdev/xray-fetch");
|
|
31
|
+
function createEmitter(config, options) {
|
|
32
|
+
const emitter = (0, import_xray_core.createEmitter)(config);
|
|
33
|
+
const wrap = ((handler) => wrapRemixRequestHandler(handler, emitter, options));
|
|
34
|
+
wrap.flush = emitter.flush;
|
|
35
|
+
wrap.shutdown = emitter.shutdown;
|
|
36
|
+
return wrap;
|
|
37
|
+
}
|
|
30
38
|
function wrapRemixRequestHandler(handler, xray, options) {
|
|
31
39
|
return (request, loadContext) => {
|
|
32
40
|
const wrapped = (0, import_xray_fetch.wrapFetchPreserve)((req) => handler(req, loadContext), xray, options);
|
|
@@ -35,6 +43,7 @@ function wrapRemixRequestHandler(handler, xray, options) {
|
|
|
35
43
|
}
|
|
36
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
45
|
0 && (module.exports = {
|
|
46
|
+
createCoreEmitter,
|
|
38
47
|
createEmitter,
|
|
39
48
|
getXrayContext,
|
|
40
49
|
wrapRemixRequestHandler
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { RequestHandler } from 'react-router';\nimport type { XrayEmitter } from '@stainlessdev/xray-core';\nimport { createEmitter } from '@stainlessdev/xray-core';\nimport { getXrayContext, wrapFetchPreserve, type WrapOptions } from '@stainlessdev/xray-fetch';\n\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { RequestHandler } from 'react-router';\nimport type { XrayEmitter, XrayConfig } from '@stainlessdev/xray-core';\nimport { createEmitter as createCoreEmitter } from '@stainlessdev/xray-core';\nimport { getXrayContext, wrapFetchPreserve, type WrapOptions } from '@stainlessdev/xray-fetch';\n\nexport { createCoreEmitter };\nexport type {\n CaptureConfig,\n RedactionConfig,\n RequestLog,\n XrayConfig,\n XrayContext,\n XrayEmitter,\n} from '@stainlessdev/xray-core';\nexport type { WrapOptions } from '@stainlessdev/xray-fetch';\nexport { getXrayContext };\n\nexport type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {\n flush: XrayEmitter['flush'];\n shutdown: XrayEmitter['shutdown'];\n};\n\nexport function createEmitter(config: XrayConfig, options?: WrapOptions): RemixEmitter {\n const emitter = createCoreEmitter(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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4CAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAmD;AACnD,wBAAoE;AAmB7D,SAAS,cAAc,QAAoB,SAAqC;AACrF,QAAM,cAAU,iBAAAC,eAAkB,MAAM;AACxC,QAAM,QAAQ,CAAC,YACb,wBAAwB,SAAS,SAAS,OAAO;AACnD,OAAK,QAAQ,QAAQ;AACrB,OAAK,WAAW,QAAQ;AACxB,SAAO;AACT;AAEO,SAAS,wBACd,SACA,MACA,SACgB;AAChB,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,cAAU,qCAAkB,CAAC,QAAiB,QAAQ,KAAK,WAAW,GAAG,MAAM,OAAO;AAC5F,WAAO,QAAQ,OAAO;AAAA,EACxB;AACF;","names":["createCoreEmitter","createCoreEmitter"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { RequestHandler } from 'react-router';
|
|
2
|
-
import { XrayEmitter } from '@stainlessdev/xray-core';
|
|
3
|
-
export { CaptureConfig, RedactionConfig, RequestLog, XrayConfig, XrayContext, XrayEmitter, createEmitter } from '@stainlessdev/xray-core';
|
|
2
|
+
import { XrayEmitter, XrayConfig } from '@stainlessdev/xray-core';
|
|
3
|
+
export { CaptureConfig, RedactionConfig, RequestLog, XrayConfig, XrayContext, XrayEmitter, createEmitter as createCoreEmitter } from '@stainlessdev/xray-core';
|
|
4
4
|
import { WrapOptions } from '@stainlessdev/xray-fetch';
|
|
5
5
|
export { WrapOptions, getXrayContext } from '@stainlessdev/xray-fetch';
|
|
6
6
|
|
|
7
|
+
type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {
|
|
8
|
+
flush: XrayEmitter['flush'];
|
|
9
|
+
shutdown: XrayEmitter['shutdown'];
|
|
10
|
+
};
|
|
11
|
+
declare function createEmitter(config: XrayConfig, options?: WrapOptions): RemixEmitter;
|
|
7
12
|
declare function wrapRemixRequestHandler(handler: RequestHandler, xray: XrayEmitter, options?: WrapOptions): RequestHandler;
|
|
8
13
|
|
|
9
|
-
export { wrapRemixRequestHandler };
|
|
14
|
+
export { type RemixEmitter, createEmitter, wrapRemixRequestHandler };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { RequestHandler } from 'react-router';
|
|
2
|
-
import { XrayEmitter } from '@stainlessdev/xray-core';
|
|
3
|
-
export { CaptureConfig, RedactionConfig, RequestLog, XrayConfig, XrayContext, XrayEmitter, createEmitter } from '@stainlessdev/xray-core';
|
|
2
|
+
import { XrayEmitter, XrayConfig } from '@stainlessdev/xray-core';
|
|
3
|
+
export { CaptureConfig, RedactionConfig, RequestLog, XrayConfig, XrayContext, XrayEmitter, createEmitter as createCoreEmitter } from '@stainlessdev/xray-core';
|
|
4
4
|
import { WrapOptions } from '@stainlessdev/xray-fetch';
|
|
5
5
|
export { WrapOptions, getXrayContext } from '@stainlessdev/xray-fetch';
|
|
6
6
|
|
|
7
|
+
type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {
|
|
8
|
+
flush: XrayEmitter['flush'];
|
|
9
|
+
shutdown: XrayEmitter['shutdown'];
|
|
10
|
+
};
|
|
11
|
+
declare function createEmitter(config: XrayConfig, options?: WrapOptions): RemixEmitter;
|
|
7
12
|
declare function wrapRemixRequestHandler(handler: RequestHandler, xray: XrayEmitter, options?: WrapOptions): RequestHandler;
|
|
8
13
|
|
|
9
|
-
export { wrapRemixRequestHandler };
|
|
14
|
+
export { type RemixEmitter, createEmitter, wrapRemixRequestHandler };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { createEmitter } from "@stainlessdev/xray-core";
|
|
2
|
+
import { createEmitter as createCoreEmitter } from "@stainlessdev/xray-core";
|
|
3
3
|
import { getXrayContext, wrapFetchPreserve } from "@stainlessdev/xray-fetch";
|
|
4
|
+
function createEmitter(config, options) {
|
|
5
|
+
const emitter = createCoreEmitter(config);
|
|
6
|
+
const wrap = ((handler) => wrapRemixRequestHandler(handler, emitter, options));
|
|
7
|
+
wrap.flush = emitter.flush;
|
|
8
|
+
wrap.shutdown = emitter.shutdown;
|
|
9
|
+
return wrap;
|
|
10
|
+
}
|
|
4
11
|
function wrapRemixRequestHandler(handler, xray, options) {
|
|
5
12
|
return (request, loadContext) => {
|
|
6
13
|
const wrapped = wrapFetchPreserve((req) => handler(req, loadContext), xray, options);
|
|
@@ -8,6 +15,7 @@ function wrapRemixRequestHandler(handler, xray, options) {
|
|
|
8
15
|
};
|
|
9
16
|
}
|
|
10
17
|
export {
|
|
18
|
+
createCoreEmitter,
|
|
11
19
|
createEmitter,
|
|
12
20
|
getXrayContext,
|
|
13
21
|
wrapRemixRequestHandler
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { RequestHandler } from 'react-router';\nimport type { XrayEmitter } from '@stainlessdev/xray-core';\nimport { createEmitter } from '@stainlessdev/xray-core';\nimport { getXrayContext, wrapFetchPreserve, type WrapOptions } from '@stainlessdev/xray-fetch';\n\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { RequestHandler } from 'react-router';\nimport type { XrayEmitter, XrayConfig } from '@stainlessdev/xray-core';\nimport { createEmitter as createCoreEmitter } from '@stainlessdev/xray-core';\nimport { getXrayContext, wrapFetchPreserve, type WrapOptions } from '@stainlessdev/xray-fetch';\n\nexport { createCoreEmitter };\nexport type {\n CaptureConfig,\n RedactionConfig,\n RequestLog,\n XrayConfig,\n XrayContext,\n XrayEmitter,\n} from '@stainlessdev/xray-core';\nexport type { WrapOptions } from '@stainlessdev/xray-fetch';\nexport { getXrayContext };\n\nexport type RemixEmitter = ((handler: RequestHandler) => RequestHandler) & {\n flush: XrayEmitter['flush'];\n shutdown: XrayEmitter['shutdown'];\n};\n\nexport function createEmitter(config: XrayConfig, options?: WrapOptions): RemixEmitter {\n const emitter = createCoreEmitter(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":";AAEA,SAAS,iBAAiB,yBAAyB;AACnD,SAAS,gBAAgB,yBAA2C;AAmB7D,SAAS,cAAc,QAAoB,SAAqC;AACrF,QAAM,UAAU,kBAAkB,MAAM;AACxC,QAAM,QAAQ,CAAC,YACb,wBAAwB,SAAS,SAAS,OAAO;AACnD,OAAK,QAAQ,QAAQ;AACrB,OAAK,WAAW,QAAQ;AACxB,SAAO;AACT;AAEO,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainlessdev/xray-remix",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.d01fd73",
|
|
4
4
|
"description": "Remix integration for Stainless X-ray request logging",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@stainlessdev/xray-core": "0.1.0-dev.
|
|
24
|
-
"@stainlessdev/xray-fetch": "0.1.0-dev.
|
|
23
|
+
"@stainlessdev/xray-core": "0.1.0-dev.d01fd73",
|
|
24
|
+
"@stainlessdev/xray-fetch": "0.1.0-dev.d01fd73"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@opentelemetry/api": "^1.9.0",
|