@scalebun-release/protocol 2.0.3
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/LICENSE +21 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/enums.d.ts +23 -0
- package/dist/internal/enums.d.ts.map +1 -0
- package/dist/internal/enums.js +28 -0
- package/dist/internal/enums.js.map +1 -0
- package/dist/internal/envelope.d.ts +4501 -0
- package/dist/internal/envelope.d.ts.map +1 -0
- package/dist/internal/envelope.js +56 -0
- package/dist/internal/envelope.js.map +1 -0
- package/dist/internal/frames.d.ts +390 -0
- package/dist/internal/frames.d.ts.map +1 -0
- package/dist/internal/frames.js +89 -0
- package/dist/internal/frames.js.map +1 -0
- package/dist/internal/items.d.ts +5900 -0
- package/dist/internal/items.d.ts.map +1 -0
- package/dist/internal/items.js +334 -0
- package/dist/internal/items.js.map +1 -0
- package/dist/internal/validation.d.ts +18 -0
- package/dist/internal/validation.d.ts.map +1 -0
- package/dist/internal/validation.js +32 -0
- package/dist/internal/validation.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/internal/items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;gCAQb,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;gCAUb,CAAC;AAEjB,+FAA+F;AAC/F,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMR,CAAC;AAEjB,eAAO,MAAM,eAAe;;;;;;;IAQxB,iEAAiE;;IAEjE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AO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RendererSchema, TimestampSchema } from './enums.js';
|
|
3
|
+
/**
|
|
4
|
+
* The item union. Each item carries a `kind` discriminator and maps to one backend handler/table.
|
|
5
|
+
* Web and mobile emit the SAME shapes — the only renderer-specific divergence lives on `frame`
|
|
6
|
+
* (see frames.ts). Every item is `.passthrough()` so unknown/forward-compat fields survive.
|
|
7
|
+
*
|
|
8
|
+
* The `frame` member is a flattened superset (all renderer fields optional) so the outer union can
|
|
9
|
+
* remain a clean `discriminatedUnion('kind')`. The strict renderer-specific checks are applied by
|
|
10
|
+
* `FrameSchema` via `parseEnvelope()` in validation.ts.
|
|
11
|
+
*/
|
|
12
|
+
const redactable = z.unknown(); // request/response bodies — already redacted client-side
|
|
13
|
+
/**
|
|
14
|
+
* A single parsed stack frame. The SDK parses the raw `stack` string into these client-side so the
|
|
15
|
+
* backend can symbolicate (source-map) against `file:line:col` without re-parsing browser-specific
|
|
16
|
+
* stack dialects. All fields optional/additive; the raw `stack` string is always kept as a fallback.
|
|
17
|
+
*/
|
|
18
|
+
export const StackFrameSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
function: z.string().optional(),
|
|
21
|
+
file: z.string().optional(),
|
|
22
|
+
line: z.number().optional(),
|
|
23
|
+
col: z.number().optional(),
|
|
24
|
+
inApp: z.boolean().optional(), // app code vs node_modules / 3rd-party / browser-internal
|
|
25
|
+
})
|
|
26
|
+
.passthrough();
|
|
27
|
+
/**
|
|
28
|
+
* A breadcrumb — one event in the trail leading up to an error (console/network/navigation/click/
|
|
29
|
+
* custom). The SDK attaches the recent trail to each error. Additive; consumers ignore unknown fields.
|
|
30
|
+
*/
|
|
31
|
+
export const BreadcrumbSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
ts: z.number(),
|
|
34
|
+
category: z.string(), // 'console' | 'navigation' | 'network' | 'ui.click' | 'error' | 'custom'
|
|
35
|
+
type: z.string().optional(),
|
|
36
|
+
level: z.enum(['debug', 'info', 'warning', 'error']).optional(),
|
|
37
|
+
message: z.string().optional(),
|
|
38
|
+
data: z.record(z.unknown()).optional(),
|
|
39
|
+
count: z.number().optional(), // consecutive identical crumbs collapsed
|
|
40
|
+
})
|
|
41
|
+
.passthrough();
|
|
42
|
+
/** A cause in the chain below the head error (`error.cause` / `AggregateError.errors`), M4. */
|
|
43
|
+
export const CauseSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
type: z.string().optional(),
|
|
46
|
+
message: z.string(),
|
|
47
|
+
frames: z.array(StackFrameSchema).optional(),
|
|
48
|
+
})
|
|
49
|
+
.passthrough();
|
|
50
|
+
export const ErrorItemSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
kind: z.literal('error'),
|
|
53
|
+
type: z.enum(['handled', 'fatal', 'crash', 'anr', 'unhandledrejection']),
|
|
54
|
+
message: z.string(),
|
|
55
|
+
stack: z.string().optional(),
|
|
56
|
+
source: z.enum(['js', 'native', 'console']).optional(),
|
|
57
|
+
fingerprint: z.string().optional(),
|
|
58
|
+
/** How the error reached the SDK — provenance (additive, M0). */
|
|
59
|
+
mechanism: z.enum(['onerror', 'onunhandledrejection', 'captureError', 'resource']).optional(),
|
|
60
|
+
/** Client-parsed stack frames (additive, M1 — raw `stack` kept as fallback). */
|
|
61
|
+
frames: z.array(StackFrameSchema).optional(),
|
|
62
|
+
/** The trail of events before this error (additive, M3). */
|
|
63
|
+
breadcrumbs: z.array(BreadcrumbSchema).optional(),
|
|
64
|
+
/** Cause chain below the head error (additive, M4). */
|
|
65
|
+
causes: z.array(CauseSchema).optional(),
|
|
66
|
+
/** Severity (additive, M4 — from scope / captureError opts). */
|
|
67
|
+
level: z.enum(['fatal', 'error', 'warning', 'info']).optional(),
|
|
68
|
+
/** Indexed, searchable tags (additive, M4). */
|
|
69
|
+
tags: z.record(z.string()).optional(),
|
|
70
|
+
/** Arbitrary structured context (additive, M4). */
|
|
71
|
+
context: z.record(z.unknown()).optional(),
|
|
72
|
+
/** WHERE the session replay was when this error fired — deep-link to the exact frame (additive, M5). */
|
|
73
|
+
replay: z.object({ seq: z.number().optional(), segmentId: z.string().optional() }).passthrough().optional(),
|
|
74
|
+
screenName: z.string().optional(),
|
|
75
|
+
timestamp: TimestampSchema,
|
|
76
|
+
})
|
|
77
|
+
.passthrough();
|
|
78
|
+
/**
|
|
79
|
+
* GraphQL operation metadata parsed from a request body (additive, N2). Lets the dashboard group/
|
|
80
|
+
* triage a `POST /graphql` by operation rather than URL, and surface GraphQL `errors[]` even on a
|
|
81
|
+
* transport-level HTTP 200. All fields optional/additive.
|
|
82
|
+
*/
|
|
83
|
+
export const NetworkGraphqlSchema = z
|
|
84
|
+
.object({
|
|
85
|
+
operationName: z.string().optional(),
|
|
86
|
+
operationType: z.enum(['query', 'mutation', 'subscription']).optional(),
|
|
87
|
+
hasErrors: z.boolean().optional(), // GraphQL response carried an `errors[]` array (200-with-errors)
|
|
88
|
+
batched: z.boolean().optional(), // request body was an array of operations
|
|
89
|
+
})
|
|
90
|
+
.passthrough();
|
|
91
|
+
/**
|
|
92
|
+
* `PerformanceResourceTiming` breakdown merged into the request (additive, N1). Network owns request
|
|
93
|
+
* capture; this enriches it with the network-stack phases (ms) the interceptor can't see.
|
|
94
|
+
*/
|
|
95
|
+
export const NetworkTimingSchema = z
|
|
96
|
+
.object({
|
|
97
|
+
dns: z.number().optional(), // domainLookupEnd − domainLookupStart
|
|
98
|
+
tcp: z.number().optional(), // connectEnd − connectStart
|
|
99
|
+
tls: z.number().optional(), // connectEnd − secureConnectionStart
|
|
100
|
+
ttfb: z.number().optional(), // responseStart − requestStart
|
|
101
|
+
download: z.number().optional(), // responseEnd − responseStart
|
|
102
|
+
})
|
|
103
|
+
.passthrough();
|
|
104
|
+
/**
|
|
105
|
+
* WebSocket / SSE lifecycle counters (additive, N3). A long-lived stream is a different shape than a
|
|
106
|
+
* request/response — one item per connection, settled on close, carrying message/byte counters.
|
|
107
|
+
*/
|
|
108
|
+
export const NetworkWsSchema = z
|
|
109
|
+
.object({
|
|
110
|
+
messagesSent: z.number().optional(),
|
|
111
|
+
messagesReceived: z.number().optional(),
|
|
112
|
+
bytesSent: z.number().optional(),
|
|
113
|
+
bytesReceived: z.number().optional(),
|
|
114
|
+
closeCode: z.number().optional(),
|
|
115
|
+
closeReason: z.string().optional(),
|
|
116
|
+
})
|
|
117
|
+
.passthrough();
|
|
118
|
+
export const NetworkItemSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
kind: z.literal('network'),
|
|
121
|
+
method: z.string(),
|
|
122
|
+
url: z.string(),
|
|
123
|
+
status: z.number().optional(),
|
|
124
|
+
startedAt: TimestampSchema.optional(),
|
|
125
|
+
duration: z.number().optional(),
|
|
126
|
+
requestSize: z.number().optional(),
|
|
127
|
+
responseSize: z.number().optional(),
|
|
128
|
+
error: z.string().optional(),
|
|
129
|
+
traceId: z.string().optional(),
|
|
130
|
+
/** Transport (additive, N3). 'http' when absent — backward-compatible default. */
|
|
131
|
+
protocol: z.enum(['http', 'ws', 'sse', 'beacon']).optional(),
|
|
132
|
+
/** Templated grouping key — ids/uuids stripped to `/users/:id` (additive, N0). */
|
|
133
|
+
route: z.string().optional(),
|
|
134
|
+
/** Classified failure taxonomy (additive, N0). Absent ⇒ the request succeeded. */
|
|
135
|
+
failure: z.enum(['http_4xx', 'http_5xx', 'network_error', 'timeout', 'cors', 'abort']).optional(),
|
|
136
|
+
/** Exceeded the slow-request threshold (additive, N0). */
|
|
137
|
+
slow: z.boolean().optional(),
|
|
138
|
+
/** Actual bytes over the wire from ResourceTiming (chunked/compressed-accurate) (additive, N1). */
|
|
139
|
+
transferSize: z.number().optional(),
|
|
140
|
+
graphql: NetworkGraphqlSchema.optional(), // N2
|
|
141
|
+
timing: NetworkTimingSchema.optional(), // N1
|
|
142
|
+
ws: NetworkWsSchema.optional(), // N3
|
|
143
|
+
request: z.object({ headers: z.record(z.string()).optional(), body: redactable }).partial().optional(),
|
|
144
|
+
response: z.object({ headers: z.record(z.string()).optional(), body: redactable }).partial().optional(),
|
|
145
|
+
timestamp: TimestampSchema,
|
|
146
|
+
})
|
|
147
|
+
.passthrough();
|
|
148
|
+
/**
|
|
149
|
+
* Optional Web-Vitals attribution — the "why" behind an LCP/CLS/INP number (the element/cause to
|
|
150
|
+
* fix). All fields are optional and additive; older consumers ignore them. The web SDK fills the
|
|
151
|
+
* arm matching `metric`. `.passthrough()` keeps any future sub-fields forward-compatible.
|
|
152
|
+
*/
|
|
153
|
+
const RectSchema = z
|
|
154
|
+
.object({ x: z.number(), y: z.number(), width: z.number(), height: z.number() })
|
|
155
|
+
.passthrough();
|
|
156
|
+
export const PerfAttributionSchema = z
|
|
157
|
+
.object({
|
|
158
|
+
// LCP — the largest element and its load/render timing.
|
|
159
|
+
element: z.string().optional(), // stable CSS selector of the LCP/INP/shift element
|
|
160
|
+
elementTag: z.string().optional(), // tagName (e.g. "img", "h1")
|
|
161
|
+
url: z.string().optional(), // image/resource URL if the LCP element is media
|
|
162
|
+
loadTime: z.number().optional(), // resource load time (ms)
|
|
163
|
+
renderTime: z.number().optional(), // paint/render time (ms)
|
|
164
|
+
// LCP timing breakdown (A5): TTFB → resourceLoadDelay → resourceLoadTime → elementRenderDelay (ms).
|
|
165
|
+
phases: z
|
|
166
|
+
.object({
|
|
167
|
+
ttfb: z.number(),
|
|
168
|
+
resourceLoadDelay: z.number(),
|
|
169
|
+
resourceLoadTime: z.number(),
|
|
170
|
+
elementRenderDelay: z.number(),
|
|
171
|
+
})
|
|
172
|
+
.optional(),
|
|
173
|
+
// CLS — the shift sources that moved the most.
|
|
174
|
+
sources: z
|
|
175
|
+
.array(z
|
|
176
|
+
.object({
|
|
177
|
+
selector: z.string().optional(),
|
|
178
|
+
previousRect: RectSchema.optional(),
|
|
179
|
+
currentRect: RectSchema.optional(),
|
|
180
|
+
})
|
|
181
|
+
.passthrough())
|
|
182
|
+
.optional(),
|
|
183
|
+
largestShiftValue: z.number().optional(), // value of the single largest layout shift
|
|
184
|
+
// TTFB phase breakdown (P4). Read from the SAME navigation entry as the metric itself, so it costs
|
|
185
|
+
// no extra observer. Before this, TTFB arrived as a bare number with 0% attribution and the only
|
|
186
|
+
// possible advice was "look at your server" — a redirect chain, a cold service worker, slow DNS and
|
|
187
|
+
// a slow server were indistinguishable. Deliberately a separate key from `phases`, whose four LCP
|
|
188
|
+
// fields are required: reusing it would fail validation for a differently-shaped breakdown.
|
|
189
|
+
ttfbPhases: z
|
|
190
|
+
.object({
|
|
191
|
+
redirect: z.number(),
|
|
192
|
+
worker: z.number(),
|
|
193
|
+
dns: z.number(),
|
|
194
|
+
tcp: z.number(),
|
|
195
|
+
tls: z.number(),
|
|
196
|
+
request: z.number(),
|
|
197
|
+
})
|
|
198
|
+
.optional(),
|
|
199
|
+
// INP — the slowest interaction's target + phase breakdown.
|
|
200
|
+
eventType: z.string().optional(), // e.g. "pointerdown", "click", "keydown"
|
|
201
|
+
inputDelay: z.number().optional(), // ms before processing started
|
|
202
|
+
processingTime: z.number().optional(), // ms spent in event handlers
|
|
203
|
+
presentationDelay: z.number().optional(), // ms from processing end to next paint
|
|
204
|
+
// INP × LoAF (A6): the longest script in the Long-Animation-Frame overlapping the interaction.
|
|
205
|
+
//
|
|
206
|
+
// The four P4 fields below are NOT decorative: `url` alone points at a minified bundle, so a
|
|
207
|
+
// finding could say "app.js is slow" and nothing more. `fn` + `pos` are what a source map turns
|
|
208
|
+
// into a real function and line (P5), and `forcedLayout` is the only direct measurement of a
|
|
209
|
+
// forced synchronous reflow the platform offers.
|
|
210
|
+
//
|
|
211
|
+
// This object is a plain z.object, which STRIPS undeclared keys — so unlike the passthrough parent,
|
|
212
|
+
// adding a field to the SDK without declaring it here would silently drop it in transit.
|
|
213
|
+
loafScript: z
|
|
214
|
+
.object({
|
|
215
|
+
url: z.string(),
|
|
216
|
+
duration: z.number(),
|
|
217
|
+
/** `sourceFunctionName` — the function the browser blamed. */
|
|
218
|
+
fn: z.string().optional(),
|
|
219
|
+
/** `sourceCharPosition` — character offset into the source, for the symbolication join. */
|
|
220
|
+
pos: z.number().optional(),
|
|
221
|
+
/** `forcedStyleAndLayoutDuration` — ms this script spent in a forced synchronous layout. */
|
|
222
|
+
forcedLayout: z.number().optional(),
|
|
223
|
+
/** `invokerType`: event-listener | user-callback | resolve-promise | classic-script | … */
|
|
224
|
+
invokerType: z.string().optional(),
|
|
225
|
+
})
|
|
226
|
+
.optional(),
|
|
227
|
+
})
|
|
228
|
+
.passthrough();
|
|
229
|
+
export const PerformanceItemSchema = z
|
|
230
|
+
.object({
|
|
231
|
+
kind: z.literal('performance'),
|
|
232
|
+
metric: z.string(), // web vitals (lcp|inp|cls|fcp|ttfb) and mobile (app_launch|screen_load|frame)
|
|
233
|
+
value: z.number(),
|
|
234
|
+
unit: z.string().optional(),
|
|
235
|
+
screenName: z.string().optional(),
|
|
236
|
+
attribution: PerfAttributionSchema.optional(), // web-vitals "cause to fix" (optional, additive)
|
|
237
|
+
timestamp: TimestampSchema,
|
|
238
|
+
})
|
|
239
|
+
.passthrough();
|
|
240
|
+
export const FrameItemSchema = z
|
|
241
|
+
.object({
|
|
242
|
+
kind: z.literal('frame'),
|
|
243
|
+
renderer: RendererSchema,
|
|
244
|
+
frameId: z.string().optional(),
|
|
245
|
+
seq: z.number().optional(),
|
|
246
|
+
frameType: z.enum(['keyframe', 'delta']).optional(),
|
|
247
|
+
baseFrameId: z.string().optional(),
|
|
248
|
+
trigger: z.string().optional(),
|
|
249
|
+
masked: z.boolean().optional(),
|
|
250
|
+
screenName: z.string().optional(),
|
|
251
|
+
timestamp: TimestampSchema.optional(),
|
|
252
|
+
// screenshot arm
|
|
253
|
+
imageData: z.string().optional(),
|
|
254
|
+
storageKey: z.string().optional(),
|
|
255
|
+
contentType: z.string().optional(),
|
|
256
|
+
format: z.string().optional(),
|
|
257
|
+
width: z.number().optional(),
|
|
258
|
+
height: z.number().optional(),
|
|
259
|
+
sizeBytes: z.number().optional(),
|
|
260
|
+
// dom arm
|
|
261
|
+
snapshot: z.unknown().optional(),
|
|
262
|
+
mutations: z.array(z.unknown()).optional(),
|
|
263
|
+
adoptedStyles: z.array(z.string()).optional(),
|
|
264
|
+
viewport: z.object({ width: z.number(), height: z.number() }).optional(),
|
|
265
|
+
href: z.string().optional(),
|
|
266
|
+
// view-hierarchy / canvas arms
|
|
267
|
+
tree: z.unknown().optional(),
|
|
268
|
+
bitmapKey: z.string().optional(),
|
|
269
|
+
})
|
|
270
|
+
.passthrough();
|
|
271
|
+
export const EventItemSchema = z
|
|
272
|
+
.object({
|
|
273
|
+
kind: z.literal('event'),
|
|
274
|
+
name: z.string(),
|
|
275
|
+
props: z.record(z.unknown()).optional(),
|
|
276
|
+
screenName: z.string().optional(),
|
|
277
|
+
timestamp: TimestampSchema,
|
|
278
|
+
// A0 (unified event spine) — additive. The session-lane event now carries full product context
|
|
279
|
+
// + a replay coordinate, so one event answers both "what happened" and "show me the replay",
|
|
280
|
+
// and the backend can populate the rich Event spine from a session-lane item. All optional →
|
|
281
|
+
// no existing producer/consumer changes.
|
|
282
|
+
anonymousId: z.string().optional(),
|
|
283
|
+
userId: z.string().optional(),
|
|
284
|
+
groups: z.record(z.string()).optional(), // A4 — { company:'acme', workspace:'x' }
|
|
285
|
+
revenue: z.number().optional(), // A4
|
|
286
|
+
currency: z.string().optional(), // A4
|
|
287
|
+
replay: z
|
|
288
|
+
.object({ seq: z.number().optional(), segmentId: z.string().optional() })
|
|
289
|
+
.passthrough()
|
|
290
|
+
.optional(), // A0 — event → replay-frame deep-link
|
|
291
|
+
sampled: z.boolean().optional(), // A6
|
|
292
|
+
})
|
|
293
|
+
.passthrough();
|
|
294
|
+
export const RatingItemSchema = z
|
|
295
|
+
.object({
|
|
296
|
+
kind: z.literal('rating'),
|
|
297
|
+
score: z.number(),
|
|
298
|
+
comment: z.string().optional(),
|
|
299
|
+
surveyId: z.string().optional(),
|
|
300
|
+
timestamp: TimestampSchema,
|
|
301
|
+
})
|
|
302
|
+
.passthrough();
|
|
303
|
+
export const LogItemSchema = z
|
|
304
|
+
.object({
|
|
305
|
+
kind: z.literal('log'),
|
|
306
|
+
level: z.enum(['debug', 'info', 'warn', 'error']),
|
|
307
|
+
message: z.string(),
|
|
308
|
+
timestamp: TimestampSchema,
|
|
309
|
+
})
|
|
310
|
+
.passthrough();
|
|
311
|
+
export const IdentifyItemSchema = z
|
|
312
|
+
.object({
|
|
313
|
+
kind: z.literal('identify'),
|
|
314
|
+
userId: z.string().optional(),
|
|
315
|
+
anonymousId: z.string().optional(),
|
|
316
|
+
traits: z.record(z.unknown()).optional(),
|
|
317
|
+
timestamp: TimestampSchema.optional(),
|
|
318
|
+
// A1 (identity primitives) — additive. `previousId` links two identities (alias: anon→known /
|
|
319
|
+
// cross-device merge); `reset` marks a logout so the backend can close the prior association.
|
|
320
|
+
previousId: z.string().optional(),
|
|
321
|
+
reset: z.boolean().optional(),
|
|
322
|
+
})
|
|
323
|
+
.passthrough();
|
|
324
|
+
export const ItemSchema = z.discriminatedUnion('kind', [
|
|
325
|
+
ErrorItemSchema,
|
|
326
|
+
NetworkItemSchema,
|
|
327
|
+
PerformanceItemSchema,
|
|
328
|
+
FrameItemSchema,
|
|
329
|
+
EventItemSchema,
|
|
330
|
+
RatingItemSchema,
|
|
331
|
+
LogItemSchema,
|
|
332
|
+
IdentifyItemSchema,
|
|
333
|
+
]);
|
|
334
|
+
//# sourceMappingURL=items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../src/internal/items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,yDAAyD;AAEzF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MA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|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: z.ZodError;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Validate a raw payload as a SessionEnvelope. The canonical entry point for BOTH the SDKs (before
|
|
12
|
+
* send) and the backend (on ingest). Additionally applies the renderer-specific frame checks
|
|
13
|
+
* (imageData XOR storageKey, snapshot XOR mutations) that the flattened item union can't express.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseEnvelope(input: unknown): ParseResult<SessionEnvelope>;
|
|
16
|
+
/** Throwing variant for call sites that prefer exceptions. */
|
|
17
|
+
export declare function assertEnvelope(input: unknown): SessionEnvelope;
|
|
18
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/internal/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAGzE,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAA;CAAE,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,eAAe,CAAC,CAiB1E;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAI9D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SessionEnvelopeSchema } from './envelope.js';
|
|
3
|
+
import { FrameSchema } from './frames.js';
|
|
4
|
+
/**
|
|
5
|
+
* Validate a raw payload as a SessionEnvelope. The canonical entry point for BOTH the SDKs (before
|
|
6
|
+
* send) and the backend (on ingest). Additionally applies the renderer-specific frame checks
|
|
7
|
+
* (imageData XOR storageKey, snapshot XOR mutations) that the flattened item union can't express.
|
|
8
|
+
*/
|
|
9
|
+
export function parseEnvelope(input) {
|
|
10
|
+
const base = SessionEnvelopeSchema.safeParse(input);
|
|
11
|
+
if (!base.success)
|
|
12
|
+
return { ok: false, error: base.error };
|
|
13
|
+
for (let i = 0; i < base.data.items.length; i++) {
|
|
14
|
+
const item = base.data.items[i];
|
|
15
|
+
if (item && item.kind === 'frame') {
|
|
16
|
+
const frame = FrameSchema.safeParse(item);
|
|
17
|
+
if (!frame.success) {
|
|
18
|
+
const reIssued = new z.ZodError(frame.error.issues.map((iss) => ({ ...iss, path: ['items', i, ...iss.path] })));
|
|
19
|
+
return { ok: false, error: reIssued };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { ok: true, value: base.data };
|
|
24
|
+
}
|
|
25
|
+
/** Throwing variant for call sites that prefer exceptions. */
|
|
26
|
+
export function assertEnvelope(input) {
|
|
27
|
+
const res = parseEnvelope(input);
|
|
28
|
+
if (!res.ok)
|
|
29
|
+
throw res.error;
|
|
30
|
+
return res.value;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/internal/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAwB,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMvC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,MAAM,IAAI,GAAG,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,EAAE,E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ol",
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"description": "Versioned Zod wire schemas for the ScaleBun unified ingestion protocol. Pure schemas, zero platform deps — every SDK (web, RN, Flutter, native) and the backend validate against this.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json && node ../../scripts/fix-esm-extensions.mjs dist",
|
|
20
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
21
|
+
"test": "vitest run"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"zod": "^3.23.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"typescript": "^5.6.0",
|
|
28
|
+
"vitest": "^2.1.0"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/scalebun/scalebun-web-sdk.git",
|
|
37
|
+
"directory": "packages/protocol"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://scalebun.com/docs/web-sdk",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/scalebun/scalebun-web-sdk/issues"
|
|
42
|
+
}
|
|
43
|
+
}
|