@ihyeon/browser-error-log-protocol 0.2.14 → 0.2.16
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.ko.md +1 -1
- package/README.md +1 -1
- package/ai/docs/ai.md +2 -0
- package/ai/manifest.json +4 -4
- package/ai/skills/browser-error-log/SKILL.md +2 -0
- package/ai/skills/browser-error-log/references/integration.md +6 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -10,7 +10,7 @@ Browser Error Log SDK·수집기·뷰어를 위한 버전이 있는 TypeScript
|
|
|
10
10
|
npm install @ihyeon/browser-error-log-protocol
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
게시 패키지 대신 로컬 소스 tarball을 사용하려면 Node.js 24에서 `npm ci`, `npm run check:package`를 실행하고 `output/packages/ihyeon-browser-error-log-protocol-0.2.
|
|
13
|
+
게시 패키지 대신 로컬 소스 tarball을 사용하려면 Node.js 24에서 `npm ci`, `npm run check:package`를 실행하고 `output/packages/ihyeon-browser-error-log-protocol-0.2.16.tgz`를 절대 경로로 설치합니다. [SDK 가이드](https://github.com/hyeonse-swing/browser-error-log/blob/main/docs/ko/personal-sdk.md)를 참고하세요.
|
|
14
14
|
|
|
15
15
|
## 이벤트·조회 계약
|
|
16
16
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Install directly when implementing your own collector or viewer; `@ihyeon/browse
|
|
|
10
10
|
npm install @ihyeon/browser-error-log-protocol
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
For local source-checkout development, use Node.js 24, `npm ci`, and `npm run check:package`, then install `output/packages/ihyeon-browser-error-log-protocol-0.2.
|
|
13
|
+
For local source-checkout development, use Node.js 24, `npm ci`, and `npm run check:package`, then install `output/packages/ihyeon-browser-error-log-protocol-0.2.16.tgz` by absolute path. See the [SDK guide](https://github.com/hyeonse-swing/browser-error-log/blob/main/docs/personal-sdk.md).
|
|
14
14
|
|
|
15
15
|
## Event and query contracts
|
|
16
16
|
|
package/ai/docs/ai.md
CHANGED
|
@@ -20,6 +20,8 @@ Example request:
|
|
|
20
20
|
|
|
21
21
|
> Use the browser-error-log skill. Add manual error collection to this app with the collector URL I supplied. Keep automatic monitoring off, retain a synthetic event ID, and verify the receiving record. Tell me what you could actually verify.
|
|
22
22
|
|
|
23
|
+
For a recent-ID delivery diagnostic, ask the agent to enable `deliveryStatusLimit`, capture an ID, and read `getDeliveryStatus(id)` before checking the collector. The status reports SDK work or transport acceptance. Collector lookup is still needed for storage confirmation. The installed `.d.ts` determines whether that API is available in the version used by the app.
|
|
24
|
+
|
|
23
25
|
## Find the right evidence
|
|
24
26
|
|
|
25
27
|
- Browser/React integration and preset selection: the skill's `references/integration.md`.
|
package/ai/manifest.json
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@ihyeon/browser-error-log-protocol",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.16"
|
|
6
6
|
},
|
|
7
7
|
"benchmarkSdkVersion": "0.2.13",
|
|
8
8
|
"files": {
|
|
9
|
-
"docs/ai.md": "
|
|
9
|
+
"docs/ai.md": "9d5176e71718316ec51d9b140e62f32c6b06f6092e447daf25d99cd6f3c82d1e",
|
|
10
10
|
"docs/benchmarks/2026-11-17-presets/raw.json": "32a4573ff8d51f76f3452a3132fd078cc0110bdc6ffd794e346adefef27ae1ea",
|
|
11
11
|
"docs/benchmarks/2026-11-17-presets/summary.json": "4814b6b48296bc758ae56ef1f5a8b1334b858cc6626d80e5ae1ce1ae4b5a5452",
|
|
12
12
|
"docs/preset-performance-2026-11-17.ko.md": "d92593e6302a84fcbe2cf5391cf3e96b527e8159f24de4d94018f4813c2bf62d",
|
|
13
13
|
"llms.txt": "f4ce3243998e63f62dbe8bdba2e462d24778ebafe2f43c80cd5a5e3e7bab2281",
|
|
14
14
|
"scripts/benchmark-sdk-presets.mjs": "f3365fb8b2df02b8a08e672a6b74c9d7b8dc3f43633acc0df18489c4e32d20f1",
|
|
15
15
|
"scripts/fixtures/sdk-preset-benchmark.js": "02ba5b9e685e08459dbd3a18d039e95b07355ce3c926ae871661cc7785524e03",
|
|
16
|
-
"skills/browser-error-log/SKILL.md": "
|
|
16
|
+
"skills/browser-error-log/SKILL.md": "7d7f1617d77f994e70fbc0488c0ef544c0b99f30686a4bf6e425fc922f910e6e",
|
|
17
17
|
"skills/browser-error-log/agents/openai.yaml": "059ddd95348df72054ae2648edcd7b31cd88c232b348c0c0324b70c72f648a0c",
|
|
18
18
|
"skills/browser-error-log/references/collector.md": "244f9e1b65b9ef2eace5761707235fb33f3526f7f30b46529f9f33d43c4d8012",
|
|
19
|
-
"skills/browser-error-log/references/integration.md": "
|
|
19
|
+
"skills/browser-error-log/references/integration.md": "53848951283d300f6d2037fa1c8e76e683bb5b4bb6f5022e519b996ff7be0e8f"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -21,6 +21,8 @@ Before describing performance, read the measurement conditions in the installed
|
|
|
21
21
|
|
|
22
22
|
Use synthetic records and a collector the user authorized. Capture one fresh Error, retain the returned ID, await `flush()`, inspect `getDiagnostics()`, and check the collector for that same `(project, eventId)`. An ID proves queue admission; `sent` or a resolved flush does not prove durable server storage. A server/SSR no-op test is not browser proof.
|
|
23
23
|
|
|
24
|
+
When diagnosing one event's delivery, check the installed declaration for `deliveryStatusLimit` and `getDeliveryStatus()`. If available, opt into a small ID history and inspect its state after capture and flush. See [browser integration](references/integration.md) for the meanings of `transport-accepted`, `beacon-queued`, `dropped`, and `unknown`. Confirm storage at the collector separately.
|
|
25
|
+
|
|
24
26
|
Check the selected mode's behavior: for minimal, a synthetic automatic error should not be collected while manual capture still works. Check an explicit override if the app uses one. If no collector or browser is available, complete the local/type checks and state exactly what could not be verified.
|
|
25
27
|
|
|
26
28
|
Keep SDK initialization and cleanup owned by the app's lifecycle. Flush while the client is active when needed, then destroy it; destroy clears pending in-memory work. Configuration is fixed at initialization. Do not create a client on each render or promise unload-time delivery.
|
|
@@ -17,6 +17,7 @@ const errors = init({
|
|
|
17
17
|
environment: 'development',
|
|
18
18
|
release: 'local-smoke',
|
|
19
19
|
preset: 'minimal',
|
|
20
|
+
deliveryStatusLimit: 20,
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
errors.addBreadcrumb({ category: 'action', message: 'Synthetic save click' });
|
|
@@ -25,12 +26,15 @@ const eventId = errors.captureException(new Error('Synthetic integration check')
|
|
|
25
26
|
});
|
|
26
27
|
await errors.flush();
|
|
27
28
|
const diagnostics = errors.getDiagnostics();
|
|
29
|
+
const delivery = eventId ? errors.getDeliveryStatus(eventId) : { state: 'unknown' };
|
|
28
30
|
// Check the authorized collector for (project, eventId), not just diagnostics.sent.
|
|
29
31
|
// At app/HMR teardown, after any intended flush:
|
|
30
32
|
errors.destroy();
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
`init()` infers `
|
|
35
|
+
`init()` infers `BrowserErrorLogDeliveryClient`. Older interfaces intentionally retain their shapes; use the inferred return type or `BrowserErrorLogCaptureClient` when a caller needs the returned ID. A filtered, duplicated, or rejected event may return `undefined`.
|
|
36
|
+
|
|
37
|
+
The optional `deliveryStatusLimit` retains at most 100 recently admitted IDs in this client's memory; it defaults to zero. `getDeliveryStatus(id)` is available on the inferred `BrowserErrorLogDeliveryClient` return type. `queued` and `in-flight` describe SDK work, `transport-accepted` means HTTP 2xx or a resolved custom transport, `beacon-queued` means `sendBeacon()` accepted browser queue work, and `dropped` includes the SDK drop reason. `unknown` includes disabled tracking, unknown IDs, and entries evicted from this bounded history. Neither accepted state proves durable storage. Keep the actual collector lookup in the verification step.
|
|
34
38
|
|
|
35
39
|
## Collection choices
|
|
36
40
|
|
|
@@ -65,7 +69,7 @@ const protectedView = (
|
|
|
65
69
|
|
|
66
70
|
## Verification and interpretation
|
|
67
71
|
|
|
68
|
-
- Match an admitted ID with an actual collector record and compare `queued`, `inFlight`, `sent`, `dropped`, `filtered`, and `deduplicated` around the synthetic run.
|
|
72
|
+
- Match an admitted ID with an actual collector record and compare its optional delivery status plus `queued`, `inFlight`, `sent`, `dropped`, `filtered`, and `deduplicated` around the synthetic run.
|
|
69
73
|
- Default HTTP transport omits credentials. Do not assume an existing cookie-authenticated endpoint will accept it. Use the product's intended ingest design.
|
|
70
74
|
- Do not reuse the same Error object for repeated smoke events: object identity is deduplicated.
|
|
71
75
|
- `captureStack: false` omits stack/componentStack even if a pre-send hook tries to restore them. It does not scrub arbitrary text from custom context or manual breadcrumb messages.
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},m=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of c(e))!g.call(r,t)&&t!==n&&a(r,t,{get:()=>e[t],enumerable:!(o=i(e,t))||o.enumerable});return r};var p=r=>m(a({},"__esModule",{value:!0}),r);var b={};u(b,{BREADCRUMB_LIMITS:()=>s,EVENT_LABELS:()=>f,SCHEMA_VERSION:()=>d,SDK_VERSION:()=>l,isBreadcrumbTrail:()=>y});module.exports=p(b);var d=1,l="0.2.
|
|
1
|
+
"use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},m=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of c(e))!g.call(r,t)&&t!==n&&a(r,t,{get:()=>e[t],enumerable:!(o=i(e,t))||o.enumerable});return r};var p=r=>m(a({},"__esModule",{value:!0}),r);var b={};u(b,{BREADCRUMB_LIMITS:()=>s,EVENT_LABELS:()=>f,SCHEMA_VERSION:()=>d,SDK_VERSION:()=>l,isBreadcrumbTrail:()=>y});module.exports=p(b);var d=1,l="0.2.16",s={count:20,bytes:12e3,category:40,message:256,dataKeys:6,dataKey:80,dataString:200};function y(r){try{if(!Array.isArray(r)||r.length>s.count)return!1;for(let e of r){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>!["occurredAt","category","message","data"].includes(n))||typeof e.occurredAt!="string"||!Number.isFinite(Date.parse(e.occurredAt))||new Date(e.occurredAt).toISOString()!==e.occurredAt||typeof e.category!="string"||!e.category.trim()||e.category.length>s.category||typeof e.message!="string"||!e.message.trim()||e.message.length>s.message)return!1;if(e.data!==void 0){if(!e.data||typeof e.data!="object"||Array.isArray(e.data))return!1;let n=Object.entries(e.data);if(n.length>s.dataKeys||n.some(([o,t])=>o.length>s.dataKey||!(t===null||typeof t=="boolean"||typeof t=="string"&&t.length<=s.dataString||typeof t=="number"&&Number.isFinite(t))))return!1}}return new TextEncoder().encode(JSON.stringify(r)).length<=s.bytes}catch{return!1}}var f={javascript:"JavaScript",promise:"Promise",react:"React",console:"Console",http:"HTTP error",network:"Network failure",resource:"Resource failure",manual:"Manual"};
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export const SCHEMA_VERSION = 1 as const;\nexport const SDK_VERSION = '0.2.
|
|
4
|
+
"sourcesContent": ["export const SCHEMA_VERSION = 1 as const;\nexport const SDK_VERSION = '0.2.16';\n\nexport type EventType = 'javascript' | 'promise' | 'react' | 'console' | 'http' | 'network' | 'resource' | 'manual';\nexport type Runtime = 'browser' | 'webview-ios' | 'webview-android' | 'unknown';\n\nexport const BREADCRUMB_LIMITS = {\n count: 20, bytes: 12_000, category: 40, message: 256,\n dataKeys: 6, dataKey: 80, dataString: 200,\n} as const;\n\nexport interface Breadcrumb {\n occurredAt: string;\n category: string;\n message: string;\n data?: Record<string, string | number | boolean | null>;\n}\n\n/** Validates the bounded, canonical UTC breadcrumb representation on the wire. */\nexport function isBreadcrumbTrail(value: unknown): value is Breadcrumb[] {\n try {\n if (!Array.isArray(value) || value.length > BREADCRUMB_LIMITS.count) return false;\n for (const item of value) {\n if (!item || typeof item !== 'object' || Array.isArray(item)) return false;\n if (Object.keys(item).some(key => !['occurredAt', 'category', 'message', 'data'].includes(key))) return false;\n if (typeof item.occurredAt !== 'string' || !Number.isFinite(Date.parse(item.occurredAt)) ||\n new Date(item.occurredAt).toISOString() !== item.occurredAt) return false;\n if (typeof item.category !== 'string' || !item.category.trim() || item.category.length > BREADCRUMB_LIMITS.category ||\n typeof item.message !== 'string' || !item.message.trim() || item.message.length > BREADCRUMB_LIMITS.message) return false;\n if (item.data !== undefined) {\n if (!item.data || typeof item.data !== 'object' || Array.isArray(item.data)) return false;\n const entries = Object.entries(item.data);\n if (entries.length > BREADCRUMB_LIMITS.dataKeys || entries.some(([key, field]) =>\n key.length > BREADCRUMB_LIMITS.dataKey || !(field === null || typeof field === 'boolean' ||\n (typeof field === 'string' && field.length <= BREADCRUMB_LIMITS.dataString) ||\n (typeof field === 'number' && Number.isFinite(field))))) return false;\n }\n }\n return new TextEncoder().encode(JSON.stringify(value)).length <= BREADCRUMB_LIMITS.bytes;\n } catch { return false; }\n}\n\nexport interface ErrorEventRecord {\n schemaVersion: 1;\n eventId: string;\n project: string;\n environment: string;\n release: string;\n sdkVersion: string;\n occurredAt: string;\n receivedAt?: string;\n viewId: string;\n sequence: number;\n elapsedMs: number;\n type: EventType;\n message: string;\n name?: string;\n stack?: string;\n componentStack?: string;\n page: string;\n runtime: Runtime;\n browser?: string;\n context?: Record<string, string | number | boolean | null>;\n breadcrumbs?: Breadcrumb[];\n network?: { method: string; url: string; status?: number; durationMs: number };\n}\n\nexport interface EventBatch { schemaVersion: 1; events: ErrorEventRecord[] }\nexport interface EventFilter {\n project?: string;\n environment?: string;\n type?: EventType;\n query?: string;\n from?: string;\n to?: string;\n cursor?: string;\n limit?: number;\n}\nexport interface EventPage { events: ErrorEventRecord[]; nextCursor?: string }\nexport interface EventDataSource {\n listEvents(filter: EventFilter, signal?: AbortSignal): Promise<EventPage>;\n getEvent(project: string, eventId: string, signal?: AbortSignal): Promise<ErrorEventRecord | null>;\n}\n\nexport const EVENT_LABELS: Record<EventType, string> = {\n javascript: 'JavaScript', promise: 'Promise', react: 'React', console: 'Console',\n http: 'HTTP error', network: 'Network failure', resource: 'Resource failure', manual: 'Manual',\n};\n"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAP,GAAO,IAAMI,EAAiB,EACjBC,EAAc,SAKdH,EAAoB,CAC/B,MAAO,GAAI,MAAO,KAAQ,SAAU,GAAI,QAAS,IACjD,SAAU,EAAG,QAAS,GAAI,WAAY,GACxC,EAUO,SAASI,EAAkBE,EAAuC,CACvE,GAAI,CACF,GAAI,CAAC,MAAM,QAAQA,CAAK,GAAKA,EAAM,OAASN,EAAkB,MAAO,MAAO,GAC5E,QAAWO,KAAQD,EAAO,CAKxB,GAJI,CAACC,GAAQ,OAAOA,GAAS,UAAY,MAAM,QAAQA,CAAI,GACvD,OAAO,KAAKA,CAAI,EAAE,KAAKC,GAAO,CAAC,CAAC,aAAc,WAAY,UAAW,MAAM,EAAE,SAASA,CAAG,CAAC,GAC1F,OAAOD,EAAK,YAAe,UAAY,CAAC,OAAO,SAAS,KAAK,MAAMA,EAAK,UAAU,CAAC,GACnF,IAAI,KAAKA,EAAK,UAAU,EAAE,YAAY,IAAMA,EAAK,YACjD,OAAOA,EAAK,UAAa,UAAY,CAACA,EAAK,SAAS,KAAK,GAAKA,EAAK,SAAS,OAASP,EAAkB,UACvG,OAAOO,EAAK,SAAY,UAAY,CAACA,EAAK,QAAQ,KAAK,GAAKA,EAAK,QAAQ,OAASP,EAAkB,QAAS,MAAO,GACxH,GAAIO,EAAK,OAAS,OAAW,CAC3B,GAAI,CAACA,EAAK,MAAQ,OAAOA,EAAK,MAAS,UAAY,MAAM,QAAQA,EAAK,IAAI,EAAG,MAAO,GACpF,IAAME,EAAU,OAAO,QAAQF,EAAK,IAAI,EACxC,GAAIE,EAAQ,OAAST,EAAkB,UAAYS,EAAQ,KAAK,CAAC,CAACD,EAAKE,CAAK,IAC1EF,EAAI,OAASR,EAAkB,SAAW,EAAEU,IAAU,MAAQ,OAAOA,GAAU,WAC5E,OAAOA,GAAU,UAAYA,EAAM,QAAUV,EAAkB,YAC/D,OAAOU,GAAU,UAAY,OAAO,SAASA,CAAK,EAAG,EAAG,MAAO,EACtE,CACF,CACA,OAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAUJ,CAAK,CAAC,EAAE,QAAUN,EAAkB,KACrF,MAAQ,CAAE,MAAO,EAAO,CAC1B,CA4CO,IAAMC,EAA0C,CACrD,WAAY,aAAc,QAAS,UAAW,MAAO,QAAS,QAAS,UACvE,KAAM,aAAc,QAAS,kBAAmB,SAAU,mBAAoB,OAAQ,QACxF",
|
|
6
6
|
"names": ["index_exports", "__export", "BREADCRUMB_LIMITS", "EVENT_LABELS", "SCHEMA_VERSION", "SDK_VERSION", "isBreadcrumbTrail", "__toCommonJS", "value", "item", "key", "entries", "field"]
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const SCHEMA_VERSION: 1;
|
|
2
|
-
export declare const SDK_VERSION = "0.2.
|
|
2
|
+
export declare const SDK_VERSION = "0.2.16";
|
|
3
3
|
export type EventType = 'javascript' | 'promise' | 'react' | 'console' | 'http' | 'network' | 'resource' | 'manual';
|
|
4
4
|
export type Runtime = 'browser' | 'webview-ios' | 'webview-android' | 'unknown';
|
|
5
5
|
export declare const BREADCRUMB_LIMITS: {
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var a=1,i="0.2.
|
|
1
|
+
var a=1,i="0.2.16",r={count:20,bytes:12e3,category:40,message:256,dataKeys:6,dataKey:80,dataString:200};function c(n){try{if(!Array.isArray(n)||n.length>r.count)return!1;for(let e of n){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(s=>!["occurredAt","category","message","data"].includes(s))||typeof e.occurredAt!="string"||!Number.isFinite(Date.parse(e.occurredAt))||new Date(e.occurredAt).toISOString()!==e.occurredAt||typeof e.category!="string"||!e.category.trim()||e.category.length>r.category||typeof e.message!="string"||!e.message.trim()||e.message.length>r.message)return!1;if(e.data!==void 0){if(!e.data||typeof e.data!="object"||Array.isArray(e.data))return!1;let s=Object.entries(e.data);if(s.length>r.dataKeys||s.some(([o,t])=>o.length>r.dataKey||!(t===null||typeof t=="boolean"||typeof t=="string"&&t.length<=r.dataString||typeof t=="number"&&Number.isFinite(t))))return!1}}return new TextEncoder().encode(JSON.stringify(n)).length<=r.bytes}catch{return!1}}var g={javascript:"JavaScript",promise:"Promise",react:"React",console:"Console",http:"HTTP error",network:"Network failure",resource:"Resource failure",manual:"Manual"};export{r as BREADCRUMB_LIMITS,g as EVENT_LABELS,a as SCHEMA_VERSION,i as SDK_VERSION,c as isBreadcrumbTrail};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export const SCHEMA_VERSION = 1 as const;\nexport const SDK_VERSION = '0.2.
|
|
4
|
+
"sourcesContent": ["export const SCHEMA_VERSION = 1 as const;\nexport const SDK_VERSION = '0.2.16';\n\nexport type EventType = 'javascript' | 'promise' | 'react' | 'console' | 'http' | 'network' | 'resource' | 'manual';\nexport type Runtime = 'browser' | 'webview-ios' | 'webview-android' | 'unknown';\n\nexport const BREADCRUMB_LIMITS = {\n count: 20, bytes: 12_000, category: 40, message: 256,\n dataKeys: 6, dataKey: 80, dataString: 200,\n} as const;\n\nexport interface Breadcrumb {\n occurredAt: string;\n category: string;\n message: string;\n data?: Record<string, string | number | boolean | null>;\n}\n\n/** Validates the bounded, canonical UTC breadcrumb representation on the wire. */\nexport function isBreadcrumbTrail(value: unknown): value is Breadcrumb[] {\n try {\n if (!Array.isArray(value) || value.length > BREADCRUMB_LIMITS.count) return false;\n for (const item of value) {\n if (!item || typeof item !== 'object' || Array.isArray(item)) return false;\n if (Object.keys(item).some(key => !['occurredAt', 'category', 'message', 'data'].includes(key))) return false;\n if (typeof item.occurredAt !== 'string' || !Number.isFinite(Date.parse(item.occurredAt)) ||\n new Date(item.occurredAt).toISOString() !== item.occurredAt) return false;\n if (typeof item.category !== 'string' || !item.category.trim() || item.category.length > BREADCRUMB_LIMITS.category ||\n typeof item.message !== 'string' || !item.message.trim() || item.message.length > BREADCRUMB_LIMITS.message) return false;\n if (item.data !== undefined) {\n if (!item.data || typeof item.data !== 'object' || Array.isArray(item.data)) return false;\n const entries = Object.entries(item.data);\n if (entries.length > BREADCRUMB_LIMITS.dataKeys || entries.some(([key, field]) =>\n key.length > BREADCRUMB_LIMITS.dataKey || !(field === null || typeof field === 'boolean' ||\n (typeof field === 'string' && field.length <= BREADCRUMB_LIMITS.dataString) ||\n (typeof field === 'number' && Number.isFinite(field))))) return false;\n }\n }\n return new TextEncoder().encode(JSON.stringify(value)).length <= BREADCRUMB_LIMITS.bytes;\n } catch { return false; }\n}\n\nexport interface ErrorEventRecord {\n schemaVersion: 1;\n eventId: string;\n project: string;\n environment: string;\n release: string;\n sdkVersion: string;\n occurredAt: string;\n receivedAt?: string;\n viewId: string;\n sequence: number;\n elapsedMs: number;\n type: EventType;\n message: string;\n name?: string;\n stack?: string;\n componentStack?: string;\n page: string;\n runtime: Runtime;\n browser?: string;\n context?: Record<string, string | number | boolean | null>;\n breadcrumbs?: Breadcrumb[];\n network?: { method: string; url: string; status?: number; durationMs: number };\n}\n\nexport interface EventBatch { schemaVersion: 1; events: ErrorEventRecord[] }\nexport interface EventFilter {\n project?: string;\n environment?: string;\n type?: EventType;\n query?: string;\n from?: string;\n to?: string;\n cursor?: string;\n limit?: number;\n}\nexport interface EventPage { events: ErrorEventRecord[]; nextCursor?: string }\nexport interface EventDataSource {\n listEvents(filter: EventFilter, signal?: AbortSignal): Promise<EventPage>;\n getEvent(project: string, eventId: string, signal?: AbortSignal): Promise<ErrorEventRecord | null>;\n}\n\nexport const EVENT_LABELS: Record<EventType, string> = {\n javascript: 'JavaScript', promise: 'Promise', react: 'React', console: 'Console',\n http: 'HTTP error', network: 'Network failure', resource: 'Resource failure', manual: 'Manual',\n};\n"],
|
|
5
5
|
"mappings": "AAAO,IAAMA,EAAiB,EACjBC,EAAc,SAKdC,EAAoB,CAC/B,MAAO,GAAI,MAAO,KAAQ,SAAU,GAAI,QAAS,IACjD,SAAU,EAAG,QAAS,GAAI,WAAY,GACxC,EAUO,SAASC,EAAkBC,EAAuC,CACvE,GAAI,CACF,GAAI,CAAC,MAAM,QAAQA,CAAK,GAAKA,EAAM,OAASF,EAAkB,MAAO,MAAO,GAC5E,QAAWG,KAAQD,EAAO,CAKxB,GAJI,CAACC,GAAQ,OAAOA,GAAS,UAAY,MAAM,QAAQA,CAAI,GACvD,OAAO,KAAKA,CAAI,EAAE,KAAKC,GAAO,CAAC,CAAC,aAAc,WAAY,UAAW,MAAM,EAAE,SAASA,CAAG,CAAC,GAC1F,OAAOD,EAAK,YAAe,UAAY,CAAC,OAAO,SAAS,KAAK,MAAMA,EAAK,UAAU,CAAC,GACnF,IAAI,KAAKA,EAAK,UAAU,EAAE,YAAY,IAAMA,EAAK,YACjD,OAAOA,EAAK,UAAa,UAAY,CAACA,EAAK,SAAS,KAAK,GAAKA,EAAK,SAAS,OAASH,EAAkB,UACvG,OAAOG,EAAK,SAAY,UAAY,CAACA,EAAK,QAAQ,KAAK,GAAKA,EAAK,QAAQ,OAASH,EAAkB,QAAS,MAAO,GACxH,GAAIG,EAAK,OAAS,OAAW,CAC3B,GAAI,CAACA,EAAK,MAAQ,OAAOA,EAAK,MAAS,UAAY,MAAM,QAAQA,EAAK,IAAI,EAAG,MAAO,GACpF,IAAME,EAAU,OAAO,QAAQF,EAAK,IAAI,EACxC,GAAIE,EAAQ,OAASL,EAAkB,UAAYK,EAAQ,KAAK,CAAC,CAACD,EAAKE,CAAK,IAC1EF,EAAI,OAASJ,EAAkB,SAAW,EAAEM,IAAU,MAAQ,OAAOA,GAAU,WAC5E,OAAOA,GAAU,UAAYA,EAAM,QAAUN,EAAkB,YAC/D,OAAOM,GAAU,UAAY,OAAO,SAASA,CAAK,EAAG,EAAG,MAAO,EACtE,CACF,CACA,OAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAUJ,CAAK,CAAC,EAAE,QAAUF,EAAkB,KACrF,MAAQ,CAAE,MAAO,EAAO,CAC1B,CA4CO,IAAMO,EAA0C,CACrD,WAAY,aAAc,QAAS,UAAW,MAAO,QAAS,QAAS,UACvE,KAAM,aAAc,QAAS,kBAAmB,SAAU,mBAAoB,OAAQ,QACxF",
|
|
6
6
|
"names": ["SCHEMA_VERSION", "SDK_VERSION", "BREADCRUMB_LIMITS", "isBreadcrumbTrail", "value", "item", "key", "entries", "field", "EVENT_LABELS"]
|
|
7
7
|
}
|