@ihyeon/browser-error-log-protocol 0.2.33 → 0.2.34
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/llms.txt +1 -0
- package/ai/manifest.json +2 -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.34.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.34.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/llms.txt
CHANGED
|
@@ -7,3 +7,4 @@ Self-hostable browser error collection. Read the installed package version and d
|
|
|
7
7
|
- [Browser integration reference](skills/browser-error-log/references/integration.md): presets, lifecycle and verification.
|
|
8
8
|
- [Collector contract](skills/browser-error-log/references/collector.md): batch acknowledgement and protocol boundaries.
|
|
9
9
|
- [Preset performance report](docs/preset-performance-2026-11-17.ko.md): synthetic 0.2.13 CPU, heap, RSS and payload measurements.
|
|
10
|
+
- [@ihyeon QA Suite compatibility hub](https://qa.hyeonse.dev/): standalone usage and optional package pairing across all six `@ihyeon` npm packages.
|
package/ai/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@ihyeon/browser-error-log-protocol",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.34"
|
|
6
6
|
},
|
|
7
7
|
"benchmarkSdkVersion": "0.2.13",
|
|
8
8
|
"files": {
|
|
@@ -10,7 +10,7 @@
|
|
|
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
|
-
"llms.txt": "
|
|
13
|
+
"llms.txt": "fffe70154f8c76902efb58b6d2a9a08b4d2a1e39234ea43483071d6a1bcbde6e",
|
|
14
14
|
"scripts/benchmark-sdk-presets.mjs": "f3365fb8b2df02b8a08e672a6b74c9d7b8dc3f43633acc0df18489c4e32d20f1",
|
|
15
15
|
"scripts/fixtures/sdk-preset-benchmark.js": "02ba5b9e685e08459dbd3a18d039e95b07355ce3c926ae871661cc7785524e03",
|
|
16
16
|
"skills/browser-error-log/SKILL.md": "7d7f1617d77f994e70fbc0488c0ef544c0b99f30686a4bf6e425fc922f910e6e",
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of g(e))!p.call(t,n)&&n!==r&&i(t,n,{get:()=>e[n],enumerable:!(o=u(e,n))||o.enumerable});return t};var y=t=>d(i({},"__esModule",{value:!0}),t);var x={};f(x,{BREADCRUMB_LIMITS:()=>s,EVENT_LABELS:()=>c,SCHEMA_VERSION:()=>m,SDK_VERSION:()=>l,formatEventReference:()=>b,getEventReference:()=>E,isBreadcrumbTrail:()=>v,isEventType:()=>w,parseEventReference:()=>a});module.exports=y(x);var m=1,l="0.2.
|
|
1
|
+
"use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of g(e))!p.call(t,n)&&n!==r&&i(t,n,{get:()=>e[n],enumerable:!(o=u(e,n))||o.enumerable});return t};var y=t=>d(i({},"__esModule",{value:!0}),t);var x={};f(x,{BREADCRUMB_LIMITS:()=>s,EVENT_LABELS:()=>c,SCHEMA_VERSION:()=>m,SDK_VERSION:()=>l,formatEventReference:()=>b,getEventReference:()=>E,isBreadcrumbTrail:()=>v,isEventType:()=>w,parseEventReference:()=>a});module.exports=y(x);var m=1,l="0.2.34",s={count:20,bytes:12e3,category:40,message:256,dataKeys:6,dataKey:80,dataString:200};function v(t){try{if(!Array.isArray(t)||t.length>s.count)return!1;for(let e of t){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(r=>!["occurredAt","category","message","data"].includes(r))||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 r=Object.entries(e.data);if(r.length>s.dataKeys||r.some(([o,n])=>o.length>s.dataKey||!(n===null||typeof n=="boolean"||typeof n=="string"&&n.length<=s.dataString||typeof n=="number"&&Number.isFinite(n))))return!1}}return new TextEncoder().encode(JSON.stringify(t)).length<=s.bytes}catch{return!1}}function E({project:t,eventId:e}){return{project:t,eventId:e}}function a(t){try{let e=typeof t=="string"?JSON.parse(t.replace(/^\uFEFF/,"")):t;if(!e||typeof e!="object"||Array.isArray(e))return;let r=Object.getOwnPropertyDescriptor(e,"project")?.value,o=Object.getOwnPropertyDescriptor(e,"eventId")?.value;return typeof r!="string"||!r.trim()||typeof o!="string"||!o.trim()?void 0:{project:r,eventId:o}}catch{return}}function b(t){let e=a(t);return e?JSON.stringify(e):void 0}var c={javascript:"JavaScript",promise:"Promise",react:"React",console:"Console",http:"HTTP error",network:"Network failure",resource:"Resource failure",manual:"Manual"},R=new Set(Object.keys(c));function w(t){return typeof t=="string"&&R.has(t)}
|
|
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.34';\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\n/** Fields used together to look up a stored event within its project. */\nexport type EventReference = Pick<ErrorEventRecord, 'project' | 'eventId'>;\n\nexport function getEventReference({ project, eventId }: EventReference): EventReference {\n return { project, eventId };\n}\n\n/** Read lookup fields from a JSON object or a single pasted JSON string. */\nexport function parseEventReference(value: unknown): EventReference | undefined {\n try {\n const input: unknown = typeof value === 'string' ? JSON.parse(value.replace(/^\\uFEFF/, '')) : value;\n if (!input || typeof input !== 'object' || Array.isArray(input)) return undefined;\n const project = Object.getOwnPropertyDescriptor(input, 'project')?.value;\n const eventId = Object.getOwnPropertyDescriptor(input, 'eventId')?.value;\n if (typeof project !== 'string' || !project.trim() || typeof eventId !== 'string' || !eventId.trim()) return undefined;\n return { project, eventId };\n } catch {\n return undefined;\n }\n}\n\n/** Serialize only the two lookup fields for a support handoff. */\nexport function formatEventReference(value: unknown): string | undefined {\n const reference = parseEventReference(value);\n return reference ? JSON.stringify(reference) : undefined;\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\nconst eventTypes = new Set(Object.keys(EVENT_LABELS));\n\n/** Check the wire identifier before using an unknown value as an EventType. */\nexport function isEvent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AO,KAAKlB,CAAY,CAAC,EAG7C,SAASM,EAAYG,EAAoC,CAC9D,OAAO,OAAOA,GAAU,UAAYS,EAAW,IAAIT,CAAK,CAC1D",
|
|
6
6
|
"names": ["index_exports", "__export", "BREADCRUMB_LIMITS", "EVENT_LABELS", "SCHEMA_VERSION", "SDK_VERSION", "formatEventReference", "getEventReference", "isBreadcrumbTrail", "isEventType", "parseEventReference", "__toCommonJS", "value", "item", "key", "entries", "field", "project", "eventId", "input", "reference", "eventTypes"]
|
|
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.34";
|
|
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 u=1,g="0.2.
|
|
1
|
+
var u=1,g="0.2.34",n={count:20,bytes:12e3,category:40,message:256,dataKeys:6,dataKey:80,dataString:200};function p(t){try{if(!Array.isArray(t)||t.length>n.count)return!1;for(let e of t){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(r=>!["occurredAt","category","message","data"].includes(r))||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>n.category||typeof e.message!="string"||!e.message.trim()||e.message.length>n.message)return!1;if(e.data!==void 0){if(!e.data||typeof e.data!="object"||Array.isArray(e.data))return!1;let r=Object.entries(e.data);if(r.length>n.dataKeys||r.some(([s,o])=>s.length>n.dataKey||!(o===null||typeof o=="boolean"||typeof o=="string"&&o.length<=n.dataString||typeof o=="number"&&Number.isFinite(o))))return!1}}return new TextEncoder().encode(JSON.stringify(t)).length<=n.bytes}catch{return!1}}function f({project:t,eventId:e}){return{project:t,eventId:e}}function i(t){try{let e=typeof t=="string"?JSON.parse(t.replace(/^\uFEFF/,"")):t;if(!e||typeof e!="object"||Array.isArray(e))return;let r=Object.getOwnPropertyDescriptor(e,"project")?.value,s=Object.getOwnPropertyDescriptor(e,"eventId")?.value;return typeof r!="string"||!r.trim()||typeof s!="string"||!s.trim()?void 0:{project:r,eventId:s}}catch{return}}function d(t){let e=i(t);return e?JSON.stringify(e):void 0}var a={javascript:"JavaScript",promise:"Promise",react:"React",console:"Console",http:"HTTP error",network:"Network failure",resource:"Resource failure",manual:"Manual"},c=new Set(Object.keys(a));function y(t){return typeof t=="string"&&c.has(t)}export{n as BREADCRUMB_LIMITS,a as EVENT_LABELS,u as SCHEMA_VERSION,g as SDK_VERSION,d as formatEventReference,f as getEventReference,p as isBreadcrumbTrail,y as isEventType,i as parseEventReference};
|
|
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.34';\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\n/** Fields used together to look up a stored event within its project. */\nexport type EventReference = Pick<ErrorEventRecord, 'project' | 'eventId'>;\n\nexport function getEventReference({ project, eventId }: EventReference): EventReference {\n return { project, eventId };\n}\n\n/** Read lookup fields from a JSON object or a single pasted JSON string. */\nexport function parseEventReference(value: unknown): EventReference | undefined {\n try {\n const input: unknown = typeof value === 'string' ? JSON.parse(value.replace(/^\\uFEFF/, '')) : value;\n if (!input || typeof input !== 'object' || Array.isArray(input)) return undefined;\n const project = Object.getOwnPropertyDescriptor(input, 'project')?.value;\n const eventId = Object.getOwnPropertyDescriptor(input, 'eventId')?.value;\n if (typeof project !== 'string' || !project.trim() || typeof eventId !== 'string' || !eventId.trim()) return undefined;\n return { project, eventId };\n } catch {\n return undefined;\n }\n}\n\n/** Serialize only the two lookup fields for a support handoff. */\nexport function formatEventReference(value: unknown): string | undefined {\n const reference = parseEventReference(value);\n return reference ? JSON.stringify(reference) : undefined;\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\nconst eventTypes = new Set(Object.keys(EVENT_LABELS));\n\n/** Check the wire identifier before using an unknown value as an EventType. */\nexport function isEventType(value: unknown): value is EventType {\n return typeof value === 'string' && eventTypes.has(value);\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,O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ASC,EAAoBR,EAA4C,CAC9E,GAAI,CACF,IAAMS,EAAiB,OAAOT,GAAU,SAAW,KAAK,MAAMA,EAAM,QAAQ,UAAW,EAAE,CAAC,EAAIA,EAC9F,GAAI,CAACS,GAAS,OAAOA,GAAU,UAAY,MAAM,QAAQA,CAAK,EAAG,OACjE,IAAMH,EAAU,OAAO,yBAAyBG,EAAO,SAAS,GAAG,MAC7DF,EAAU,OAAO,yBAAyBE,EAAO,SAAS,GAAG,MACnE,OAAI,OAAOH,GAAY,UAAY,CAACA,EAAQ,KAAK,GAAK,OAAOC,GAAY,UAAY,CAACA,EAAQ,KAAK,EAAG,OAC/F,CAAE,QAAAD,EAAS,QAAAC,CAAQ,CAC5B,MAAQ,CACN,MACF,CACF,CAGO,SAASG,EAAqBV,EAAoC,CACvE,IAAMW,EAAYH,EAAoBR,CAAK,EAC3C,OAAOW,EAAY,KAAK,UAAUA,CAAS,EAAI,MACjD,CAmBO,IAAMC,EAA0C,CACrD,WAAY,aAAc,QAAS,UAAW,MAAO,QAAS,QAAS,UACvE,KAAM,aAAc,QAAS,kBAAmB,SAAU,mBAAoB,OAAQ,QACxF,EAEMC,EAAa,IAAI,IAAI,OAAO,KAAKD,CAAY,CAAC,EAG7C,SAASE,EAAYd,EAAoC,CAC9D,OAAO,OAAOA,GAAU,UAAYa,EAAW,IAAIb,CAAK,CAC1D",
|
|
6
6
|
"names": ["SCHEMA_VERSION", "SDK_VERSION", "BREADCRUMB_LIMITS", "isBreadcrumbTrail", "value", "item", "key", "entries", "field", "getEventReference", "project", "eventId", "parseEventReference", "input", "formatEventReference", "reference", "EVENT_LABELS", "eventTypes", "isEventType"]
|
|
7
7
|
}
|