@softprobe/web-record 0.1.7 → 0.1.8
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 +29 -34
- package/dist/http-interceptor.d.ts +21 -9
- package/dist/http-interceptor.d.ts.map +1 -1
- package/dist/http-interceptor.js +334 -67
- package/dist/http-interceptor.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/otlp.d.ts +21 -0
- package/dist/otlp.d.ts.map +1 -1
- package/dist/otlp.js +48 -0
- package/dist/otlp.js.map +1 -1
- package/dist/sdk.d.ts +20 -3
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +201 -12
- package/dist/sdk.js.map +1 -1
- package/dist/types.d.ts +31 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -24,7 +24,10 @@ export type Tags = {
|
|
|
24
24
|
[key: string]: string | undefined;
|
|
25
25
|
};
|
|
26
26
|
export type WebRecordCredentials = {
|
|
27
|
-
|
|
27
|
+
/** Existing Agent-owned ingest-only API key. */
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
/** @deprecated Use apiKey for Agent-owned ingest keys. */
|
|
30
|
+
publicKey?: string;
|
|
28
31
|
baseUrl: string;
|
|
29
32
|
/** Defaults to `{baseUrl}/v1/traces`. */
|
|
30
33
|
otlpEndpoint?: string;
|
|
@@ -32,11 +35,30 @@ export type WebRecordCredentials = {
|
|
|
32
35
|
userId?: string;
|
|
33
36
|
serviceName?: string;
|
|
34
37
|
};
|
|
38
|
+
export type HttpBodyCaptureRoute = {
|
|
39
|
+
/** Exact HTTP(S) origin already listed in `apiOrigins`. */
|
|
40
|
+
origin: string;
|
|
41
|
+
method: string;
|
|
42
|
+
/** Exact URL path without query string or fragment. */
|
|
43
|
+
path: string;
|
|
44
|
+
/** JSONPath property paths such as `$.paymentDetails.cardNumber`. */
|
|
45
|
+
redactJsonPaths?: string[];
|
|
46
|
+
};
|
|
47
|
+
export type HttpBodyCaptureOptions = {
|
|
48
|
+
/** Bodies larger than this many bytes are omitted. Defaults to 64 KiB. */
|
|
49
|
+
maxBodyBytes?: number;
|
|
50
|
+
/** Only listed JSON routes can export body content. */
|
|
51
|
+
routes: HttpBodyCaptureRoute[];
|
|
52
|
+
};
|
|
35
53
|
export type WebRecordInitOptions = WebRecordCredentials & {
|
|
36
54
|
/** Correlate with LLM / OpenCode session (`sp.session.id`). */
|
|
37
55
|
sessionId?: string;
|
|
38
56
|
/** Flush interval in ms (minimum 5000). */
|
|
39
57
|
interval?: number;
|
|
58
|
+
/** Exact HTTP(S) origins that may receive traceparent/tracestate headers. */
|
|
59
|
+
apiOrigins?: string[];
|
|
60
|
+
/** Opt-in JSON body capture for exact routes. Disabled when omitted. */
|
|
61
|
+
httpBodyCapture?: HttpBodyCaptureOptions;
|
|
40
62
|
/** When true, do not auto-start rrweb. */
|
|
41
63
|
manual?: boolean;
|
|
42
64
|
tags?: Tags;
|
|
@@ -45,9 +67,16 @@ export type WebRecordInitOptions = WebRecordCredentials & {
|
|
|
45
67
|
softDisable?: boolean;
|
|
46
68
|
/** rrweb: mask all inputs. Default true for agent IDEs. */
|
|
47
69
|
maskAllInputs?: boolean;
|
|
70
|
+
/** CSS selector for visible text that rrweb should mask. */
|
|
71
|
+
maskTextSelector?: string;
|
|
72
|
+
/** CSS selector for page regions that rrweb should block from recording. */
|
|
73
|
+
blockSelector?: string;
|
|
74
|
+
/** Receives best-effort recording upload state changes. */
|
|
75
|
+
onUploadStatus?: (status: RecordingUploadStatus) => void;
|
|
48
76
|
/** Extra rrweb record options (emit is owned by the SDK). */
|
|
49
77
|
recordOptions?: Record<string, unknown>;
|
|
50
78
|
};
|
|
79
|
+
export type RecordingUploadStatus = "idle" | "pending" | "uploaded" | "failed" | "incomplete";
|
|
51
80
|
export type CompressedRrwebEvent = {
|
|
52
81
|
type: number;
|
|
53
82
|
data: string;
|
|
@@ -67,6 +96,7 @@ export type RecordingHandle = {
|
|
|
67
96
|
export type WebRecordController = {
|
|
68
97
|
readonly enabled: boolean;
|
|
69
98
|
readonly sessionId: string;
|
|
99
|
+
readonly uploadStatus: RecordingUploadStatus;
|
|
70
100
|
record: (opts?: {
|
|
71
101
|
tags?: Tags;
|
|
72
102
|
}) => RecordingHandle | null;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.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EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,IAAI,CAAA;KAAE,KAAK,eAAe,GAAG,IAAI,CAAC;IAC3D,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,uEAAuE;IACvE,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softprobe/web-record",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Browser session recording SDK that exports rrweb batches to Softprobe via OTLP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@rrweb/types": "2.0.0-alpha.4",
|
|
29
|
-
"@softprobe/tracing": "0.1.
|
|
29
|
+
"@softprobe/tracing": "0.1.8",
|
|
30
30
|
"rrweb": "2.0.0-alpha.4",
|
|
31
31
|
"ua-parser-js": "^2.0.3"
|
|
32
32
|
},
|