@interfere/types 5.0.0 → 6.0.0

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.
@@ -11,20 +11,20 @@ declare const apiBaseUrlSchema: z.ZodUnion<readonly [z.ZodString, z.ZodEnum<{
11
11
  "http://localhost:3001": "http://localhost:3001";
12
12
  }>]>;
13
13
  declare const featuresSchema: z.ZodDefault<z.ZodObject<{
14
- device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
15
- replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
16
14
  errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
15
+ device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
17
16
  pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
18
17
  rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
18
+ replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
19
19
  }, z.core.$strip>>;
20
20
  type Features = z.infer<typeof featuresSchema>;
21
21
  declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
22
22
  features: z.ZodDefault<z.ZodObject<{
23
- device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
24
- replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
25
23
  errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
24
+ device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
26
25
  pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
27
26
  rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
27
+ replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
28
28
  }, z.core.$strip>>;
29
29
  metadata: z.ZodObject<{
30
30
  buildId: z.ZodNullable<z.ZodString>;
@@ -36,8 +36,8 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
36
36
  }>>;
37
37
  runtime: z.ZodNullable<z.ZodEnum<{
38
38
  browser: "browser";
39
- edge: "edge";
40
39
  node: "node";
40
+ edge: "edge";
41
41
  }>>;
42
42
  }, z.core.$strip>;
43
43
  batch: z.ZodDefault<z.ZodObject<{
@@ -56,17 +56,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
56
56
  surfaceToken: z.ZodString;
57
57
  }, z.core.$strip>]>>, z.ZodTransform<({
58
58
  features: {
59
- device?: boolean | undefined;
60
- replay?: boolean | undefined;
61
59
  errors?: boolean | undefined;
60
+ device?: boolean | undefined;
62
61
  pageEvents?: boolean | undefined;
63
62
  rageClick?: boolean | undefined;
63
+ replay?: boolean | undefined;
64
64
  };
65
65
  metadata: {
66
66
  buildId: string | null;
67
67
  releaseId: string | null;
68
68
  environment: "development" | "preview" | "production" | null;
69
- runtime: "browser" | "edge" | "node" | null;
69
+ runtime: "browser" | "node" | "edge" | null;
70
70
  };
71
71
  batch: {
72
72
  size: number;
@@ -81,17 +81,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
81
81
  proxyUrl: string;
82
82
  }) | ({
83
83
  features: {
84
- device?: boolean | undefined;
85
- replay?: boolean | undefined;
86
84
  errors?: boolean | undefined;
85
+ device?: boolean | undefined;
87
86
  pageEvents?: boolean | undefined;
88
87
  rageClick?: boolean | undefined;
88
+ replay?: boolean | undefined;
89
89
  };
90
90
  metadata: {
91
91
  buildId: string | null;
92
92
  releaseId: string | null;
93
93
  environment: "development" | "preview" | "production" | null;
94
- runtime: "browser" | "edge" | "node" | null;
94
+ runtime: "browser" | "node" | "edge" | null;
95
95
  };
96
96
  batch: {
97
97
  size: number;
@@ -107,17 +107,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
107
107
  surfaceToken: string;
108
108
  }), {
109
109
  features: {
110
- device?: boolean | undefined;
111
- replay?: boolean | undefined;
112
110
  errors?: boolean | undefined;
111
+ device?: boolean | undefined;
113
112
  pageEvents?: boolean | undefined;
114
113
  rageClick?: boolean | undefined;
114
+ replay?: boolean | undefined;
115
115
  };
116
116
  metadata: {
117
117
  buildId: string | null;
118
118
  releaseId: string | null;
119
119
  environment: "development" | "preview" | "production" | null;
120
- runtime: "browser" | "edge" | "node" | null;
120
+ runtime: "browser" | "node" | "edge" | null;
121
121
  };
122
122
  batch: {
123
123
  size: number;
@@ -137,11 +137,11 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
137
137
  type Config = z.output<typeof configSchema>;
138
138
  declare const configInputSchema: z.ZodIntersection<z.ZodObject<{
139
139
  features: z.ZodOptional<z.ZodDefault<z.ZodObject<{
140
- device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
141
- replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
142
140
  errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
141
+ device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
143
142
  pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
144
143
  rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
144
+ replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
145
145
  }, z.core.$strip>>>;
146
146
  metadata: z.ZodOptional<z.ZodObject<{
147
147
  buildId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -153,8 +153,8 @@ declare const configInputSchema: z.ZodIntersection<z.ZodObject<{
153
153
  }>>>;
154
154
  runtime: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
155
155
  browser: "browser";
156
- edge: "edge";
157
156
  node: "node";
157
+ edge: "edge";
158
158
  }>>>;
159
159
  }, z.core.$strip>>;
160
160
  batch: z.ZodOptional<z.ZodObject<{
@@ -173,8 +173,8 @@ declare const envelopeSchema: z.ZodIntersection<z.ZodObject<{
173
173
  releaseId: z.ZodNullable<z.ZodString>;
174
174
  runtime: z.ZodNullable<z.ZodEnum<{
175
175
  browser: "browser";
176
- edge: "edge";
177
176
  node: "node";
177
+ edge: "edge";
178
178
  }>>;
179
179
  sessionId: z.ZodNullable<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
180
180
  sessionSource: z.ZodOptional<z.ZodEnum<{
@@ -332,8 +332,8 @@ declare const stampedEnvelopeSchema: z.ZodIntersection<z.ZodIntersection<z.ZodOb
332
332
  releaseId: z.ZodNullable<z.ZodString>;
333
333
  runtime: z.ZodNullable<z.ZodEnum<{
334
334
  browser: "browser";
335
- edge: "edge";
336
335
  node: "node";
336
+ edge: "edge";
337
337
  }>>;
338
338
  sessionId: z.ZodNullable<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
339
339
  sessionSource: z.ZodOptional<z.ZodEnum<{
@@ -9,8 +9,8 @@ declare const envSchema: z.ZodNullable<z.ZodEnum<{
9
9
  type Env = z.infer<typeof envSchema>;
10
10
  declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
11
11
  browser: "browser";
12
- edge: "edge";
13
12
  node: "node";
13
+ edge: "edge";
14
14
  }>>;
15
15
  type Runtime = z.infer<typeof runtimeSchema>;
16
16
  declare function inferRuntime(options?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfere/types",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "license": "MIT",
5
5
  "description": "TypeScript & Zod types for Interfere",
6
6
  "keywords": [
@@ -106,16 +106,16 @@
106
106
  "typecheck": "tsc --noEmit --incremental"
107
107
  },
108
108
  "dependencies": {
109
- "@interfere/constants": "^5.0.0",
109
+ "@interfere/constants": "^6.0.0",
110
110
  "error-stack-parser-es": "^1.0.5",
111
111
  "zod": "^4.3.6"
112
112
  },
113
113
  "devDependencies": {
114
- "@interfere/typescript-config": "^5.0.0",
115
- "@interfere/vitest-config": "^5.0.0",
114
+ "@interfere/typescript-config": "^6.0.0",
115
+ "@interfere/vitest-config": "^6.0.0",
116
116
  "@types/node": "^24.12.0",
117
117
  "@vitest/coverage-v8": "^4.0.18",
118
- "tsdown": "^0.21.3",
118
+ "tsdown": "^0.21.4",
119
119
  "typescript": "5.9.3",
120
120
  "vitest": "^4.0.18"
121
121
  }
@@ -1,396 +0,0 @@
1
- import { z } from "zod/v4";
2
-
3
- //#region src/events/index.d.ts
4
- declare const factsPayloadSchemas: {
5
- readonly error: z.ZodObject<{
6
- frames: z.ZodArray<z.ZodObject<{
7
- fileName: z.ZodOptional<z.ZodString>;
8
- functionName: z.ZodOptional<z.ZodString>;
9
- lineNumber: z.ZodOptional<z.ZodNumber>;
10
- columnNumber: z.ZodOptional<z.ZodNumber>;
11
- source: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>>;
13
- enrichedFrames: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
- file: z.ZodNullable<z.ZodString>;
15
- line: z.ZodNullable<z.ZodNumber>;
16
- column: z.ZodNullable<z.ZodNumber>;
17
- fn: z.ZodNullable<z.ZodString>;
18
- originalFile: z.ZodNullable<z.ZodString>;
19
- originalLine: z.ZodNullable<z.ZodNumber>;
20
- originalColumn: z.ZodNullable<z.ZodNumber>;
21
- originalName: z.ZodNullable<z.ZodString>;
22
- sourceMapFound: z.ZodBoolean;
23
- inApp: z.ZodBoolean;
24
- rawId: z.ZodString;
25
- }, z.core.$strip>>>;
26
- frameCount: z.ZodOptional<z.ZodNumber>;
27
- enrichedFrameCount: z.ZodOptional<z.ZodNumber>;
28
- message: z.ZodNullable<z.ZodString>;
29
- name: z.ZodNullable<z.ZodString>;
30
- stack: z.ZodNullable<z.ZodString>;
31
- mechanism: z.ZodOptional<z.ZodObject<{
32
- type: z.ZodString;
33
- handled: z.ZodBoolean;
34
- synthetic: z.ZodOptional<z.ZodBoolean>;
35
- }, z.core.$strip>>;
36
- context: z.ZodOptional<z.ZodObject<{
37
- framework: z.ZodOptional<z.ZodString>;
38
- routerKind: z.ZodOptional<z.ZodEnum<{
39
- "Pages Router": "Pages Router";
40
- "App Router": "App Router";
41
- }>>;
42
- routePath: z.ZodOptional<z.ZodString>;
43
- routeType: z.ZodOptional<z.ZodEnum<{
44
- render: "render";
45
- route: "route";
46
- action: "action";
47
- middleware: "middleware";
48
- proxy: "proxy";
49
- }>>;
50
- renderSource: z.ZodOptional<z.ZodEnum<{
51
- "react-server-components": "react-server-components";
52
- "react-server-components-payload": "react-server-components-payload";
53
- "server-rendering": "server-rendering";
54
- }>>;
55
- revalidateReason: z.ZodOptional<z.ZodEnum<{
56
- "on-demand": "on-demand";
57
- stale: "stale";
58
- }>>;
59
- renderType: z.ZodOptional<z.ZodEnum<{
60
- dynamic: "dynamic";
61
- "dynamic-resume": "dynamic-resume";
62
- }>>;
63
- requestPath: z.ZodOptional<z.ZodString>;
64
- requestMethod: z.ZodOptional<z.ZodString>;
65
- errorDigest: z.ZodOptional<z.ZodString>;
66
- }, z.core.$strip>>;
67
- captureSource: z.ZodOptional<z.ZodString>;
68
- fingerprintComponents: z.ZodOptional<z.ZodObject<{
69
- hash: z.ZodString;
70
- components: z.ZodArray<z.ZodString>;
71
- }, z.core.$strip>>;
72
- runtime: z.ZodOptional<z.ZodString>;
73
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
- }, z.core.$strip>;
75
- readonly pageview: z.ZodObject<{
76
- url: z.ZodString;
77
- title: z.ZodOptional<z.ZodString>;
78
- referrer: z.ZodOptional<z.ZodString>;
79
- runtime: z.ZodOptional<z.ZodString>;
80
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
- }, z.core.$strip>;
82
- readonly pageleave: z.ZodObject<{
83
- url: z.ZodString;
84
- durationMs: z.ZodOptional<z.ZodNumber>;
85
- runtime: z.ZodOptional<z.ZodString>;
86
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
- }, z.core.$strip>;
88
- readonly ui_event: z.ZodObject<{
89
- event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
90
- runtime: z.ZodOptional<z.ZodString>;
91
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
- }, z.core.$strip>;
93
- readonly replay_chunk: z.ZodObject<{
94
- ts: z.ZodNumber;
95
- count: z.ZodNumber;
96
- first_event_ts: z.ZodOptional<z.ZodNumber>;
97
- last_event_ts: z.ZodOptional<z.ZodNumber>;
98
- chunk_count: z.ZodOptional<z.ZodNumber>;
99
- runtime: z.ZodOptional<z.ZodString>;
100
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
- objectKey: z.ZodOptional<z.ZodString>;
102
- }, z.core.$strip>;
103
- readonly session_summary: z.ZodObject<{
104
- summary: z.ZodString;
105
- pageTitle: z.ZodString;
106
- pageUrl: z.ZodString;
107
- contentLength: z.ZodNumber;
108
- timestamp: z.ZodNumber;
109
- runtime: z.ZodOptional<z.ZodString>;
110
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
- }, z.core.$strip>;
112
- readonly rage_click: z.ZodObject<{
113
- count: z.ZodNumber;
114
- timeWindow: z.ZodNumber;
115
- selector: z.ZodString;
116
- text: z.ZodString;
117
- x: z.ZodNumber;
118
- y: z.ZodNumber;
119
- timestamp: z.ZodNumber;
120
- runtime: z.ZodOptional<z.ZodString>;
121
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
- }, z.core.$strip>;
123
- readonly identify: z.ZodObject<{
124
- identifier: z.ZodString;
125
- email: z.ZodOptional<z.ZodString>;
126
- name: z.ZodOptional<z.ZodString>;
127
- avatar: z.ZodOptional<z.ZodString>;
128
- traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
- }, z.core.$strip>;
130
- };
131
- type FactsEventType = keyof typeof factsPayloadSchemas;
132
- declare const factsEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
133
- uuid: z.ZodString;
134
- organizationId: z.ZodString;
135
- surfaceId: z.ZodString;
136
- environment: z.ZodString;
137
- sessionId: z.ZodNullable<z.ZodString>;
138
- fingerprint: z.ZodNullable<z.ZodString>;
139
- errorSource: z.ZodNullable<z.ZodEnum<{
140
- edge: "edge";
141
- client: "client";
142
- server: "server";
143
- }>>;
144
- buildId: z.ZodNullable<z.ZodString>;
145
- timestamp: z.ZodDate;
146
- createdAt: z.ZodDate;
147
- insertedAt: z.ZodDate;
148
- event: z.ZodLiteral<"error">;
149
- payload: z.ZodObject<{
150
- frames: z.ZodArray<z.ZodObject<{
151
- fileName: z.ZodOptional<z.ZodString>;
152
- functionName: z.ZodOptional<z.ZodString>;
153
- lineNumber: z.ZodOptional<z.ZodNumber>;
154
- columnNumber: z.ZodOptional<z.ZodNumber>;
155
- source: z.ZodOptional<z.ZodString>;
156
- }, z.core.$strip>>;
157
- enrichedFrames: z.ZodOptional<z.ZodArray<z.ZodObject<{
158
- file: z.ZodNullable<z.ZodString>;
159
- line: z.ZodNullable<z.ZodNumber>;
160
- column: z.ZodNullable<z.ZodNumber>;
161
- fn: z.ZodNullable<z.ZodString>;
162
- originalFile: z.ZodNullable<z.ZodString>;
163
- originalLine: z.ZodNullable<z.ZodNumber>;
164
- originalColumn: z.ZodNullable<z.ZodNumber>;
165
- originalName: z.ZodNullable<z.ZodString>;
166
- sourceMapFound: z.ZodBoolean;
167
- inApp: z.ZodBoolean;
168
- rawId: z.ZodString;
169
- }, z.core.$strip>>>;
170
- frameCount: z.ZodOptional<z.ZodNumber>;
171
- enrichedFrameCount: z.ZodOptional<z.ZodNumber>;
172
- message: z.ZodNullable<z.ZodString>;
173
- name: z.ZodNullable<z.ZodString>;
174
- stack: z.ZodNullable<z.ZodString>;
175
- mechanism: z.ZodOptional<z.ZodObject<{
176
- type: z.ZodString;
177
- handled: z.ZodBoolean;
178
- synthetic: z.ZodOptional<z.ZodBoolean>;
179
- }, z.core.$strip>>;
180
- context: z.ZodOptional<z.ZodObject<{
181
- framework: z.ZodOptional<z.ZodString>;
182
- routerKind: z.ZodOptional<z.ZodEnum<{
183
- "Pages Router": "Pages Router";
184
- "App Router": "App Router";
185
- }>>;
186
- routePath: z.ZodOptional<z.ZodString>;
187
- routeType: z.ZodOptional<z.ZodEnum<{
188
- render: "render";
189
- route: "route";
190
- action: "action";
191
- middleware: "middleware";
192
- proxy: "proxy";
193
- }>>;
194
- renderSource: z.ZodOptional<z.ZodEnum<{
195
- "react-server-components": "react-server-components";
196
- "react-server-components-payload": "react-server-components-payload";
197
- "server-rendering": "server-rendering";
198
- }>>;
199
- revalidateReason: z.ZodOptional<z.ZodEnum<{
200
- "on-demand": "on-demand";
201
- stale: "stale";
202
- }>>;
203
- renderType: z.ZodOptional<z.ZodEnum<{
204
- dynamic: "dynamic";
205
- "dynamic-resume": "dynamic-resume";
206
- }>>;
207
- requestPath: z.ZodOptional<z.ZodString>;
208
- requestMethod: z.ZodOptional<z.ZodString>;
209
- errorDigest: z.ZodOptional<z.ZodString>;
210
- }, z.core.$strip>>;
211
- captureSource: z.ZodOptional<z.ZodString>;
212
- fingerprintComponents: z.ZodOptional<z.ZodObject<{
213
- hash: z.ZodString;
214
- components: z.ZodArray<z.ZodString>;
215
- }, z.core.$strip>>;
216
- runtime: z.ZodOptional<z.ZodString>;
217
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
- }, z.core.$strip>;
219
- }, z.core.$strip>, z.ZodObject<{
220
- uuid: z.ZodString;
221
- organizationId: z.ZodString;
222
- surfaceId: z.ZodString;
223
- environment: z.ZodString;
224
- sessionId: z.ZodNullable<z.ZodString>;
225
- fingerprint: z.ZodNullable<z.ZodString>;
226
- errorSource: z.ZodNullable<z.ZodEnum<{
227
- edge: "edge";
228
- client: "client";
229
- server: "server";
230
- }>>;
231
- buildId: z.ZodNullable<z.ZodString>;
232
- timestamp: z.ZodDate;
233
- createdAt: z.ZodDate;
234
- insertedAt: z.ZodDate;
235
- event: z.ZodLiteral<"pageview">;
236
- payload: z.ZodObject<{
237
- url: z.ZodString;
238
- title: z.ZodOptional<z.ZodString>;
239
- referrer: z.ZodOptional<z.ZodString>;
240
- runtime: z.ZodOptional<z.ZodString>;
241
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
242
- }, z.core.$strip>;
243
- }, z.core.$strip>, z.ZodObject<{
244
- uuid: z.ZodString;
245
- organizationId: z.ZodString;
246
- surfaceId: z.ZodString;
247
- environment: z.ZodString;
248
- sessionId: z.ZodNullable<z.ZodString>;
249
- fingerprint: z.ZodNullable<z.ZodString>;
250
- errorSource: z.ZodNullable<z.ZodEnum<{
251
- edge: "edge";
252
- client: "client";
253
- server: "server";
254
- }>>;
255
- buildId: z.ZodNullable<z.ZodString>;
256
- timestamp: z.ZodDate;
257
- createdAt: z.ZodDate;
258
- insertedAt: z.ZodDate;
259
- event: z.ZodLiteral<"pageleave">;
260
- payload: z.ZodObject<{
261
- url: z.ZodString;
262
- durationMs: z.ZodOptional<z.ZodNumber>;
263
- runtime: z.ZodOptional<z.ZodString>;
264
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
- }, z.core.$strip>;
266
- }, z.core.$strip>, z.ZodObject<{
267
- uuid: z.ZodString;
268
- organizationId: z.ZodString;
269
- surfaceId: z.ZodString;
270
- environment: z.ZodString;
271
- sessionId: z.ZodNullable<z.ZodString>;
272
- fingerprint: z.ZodNullable<z.ZodString>;
273
- errorSource: z.ZodNullable<z.ZodEnum<{
274
- edge: "edge";
275
- client: "client";
276
- server: "server";
277
- }>>;
278
- buildId: z.ZodNullable<z.ZodString>;
279
- timestamp: z.ZodDate;
280
- createdAt: z.ZodDate;
281
- insertedAt: z.ZodDate;
282
- event: z.ZodLiteral<"ui_event">;
283
- payload: z.ZodObject<{
284
- event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
285
- runtime: z.ZodOptional<z.ZodString>;
286
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
- }, z.core.$strip>;
288
- }, z.core.$strip>, z.ZodObject<{
289
- uuid: z.ZodString;
290
- organizationId: z.ZodString;
291
- surfaceId: z.ZodString;
292
- environment: z.ZodString;
293
- sessionId: z.ZodNullable<z.ZodString>;
294
- fingerprint: z.ZodNullable<z.ZodString>;
295
- errorSource: z.ZodNullable<z.ZodEnum<{
296
- edge: "edge";
297
- client: "client";
298
- server: "server";
299
- }>>;
300
- buildId: z.ZodNullable<z.ZodString>;
301
- timestamp: z.ZodDate;
302
- createdAt: z.ZodDate;
303
- insertedAt: z.ZodDate;
304
- event: z.ZodLiteral<"replay_chunk">;
305
- payload: z.ZodObject<{
306
- ts: z.ZodNumber;
307
- count: z.ZodNumber;
308
- first_event_ts: z.ZodOptional<z.ZodNumber>;
309
- last_event_ts: z.ZodOptional<z.ZodNumber>;
310
- chunk_count: z.ZodOptional<z.ZodNumber>;
311
- runtime: z.ZodOptional<z.ZodString>;
312
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
- objectKey: z.ZodOptional<z.ZodString>;
314
- }, z.core.$strip>;
315
- }, z.core.$strip>, z.ZodObject<{
316
- uuid: z.ZodString;
317
- organizationId: z.ZodString;
318
- surfaceId: z.ZodString;
319
- environment: z.ZodString;
320
- sessionId: z.ZodNullable<z.ZodString>;
321
- fingerprint: z.ZodNullable<z.ZodString>;
322
- errorSource: z.ZodNullable<z.ZodEnum<{
323
- edge: "edge";
324
- client: "client";
325
- server: "server";
326
- }>>;
327
- buildId: z.ZodNullable<z.ZodString>;
328
- timestamp: z.ZodDate;
329
- createdAt: z.ZodDate;
330
- insertedAt: z.ZodDate;
331
- event: z.ZodLiteral<"session_summary">;
332
- payload: z.ZodObject<{
333
- summary: z.ZodString;
334
- pageTitle: z.ZodString;
335
- pageUrl: z.ZodString;
336
- contentLength: z.ZodNumber;
337
- timestamp: z.ZodNumber;
338
- runtime: z.ZodOptional<z.ZodString>;
339
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
340
- }, z.core.$strip>;
341
- }, z.core.$strip>, z.ZodObject<{
342
- uuid: z.ZodString;
343
- organizationId: z.ZodString;
344
- surfaceId: z.ZodString;
345
- environment: z.ZodString;
346
- sessionId: z.ZodNullable<z.ZodString>;
347
- fingerprint: z.ZodNullable<z.ZodString>;
348
- errorSource: z.ZodNullable<z.ZodEnum<{
349
- edge: "edge";
350
- client: "client";
351
- server: "server";
352
- }>>;
353
- buildId: z.ZodNullable<z.ZodString>;
354
- timestamp: z.ZodDate;
355
- createdAt: z.ZodDate;
356
- insertedAt: z.ZodDate;
357
- event: z.ZodLiteral<"rage_click">;
358
- payload: z.ZodObject<{
359
- count: z.ZodNumber;
360
- timeWindow: z.ZodNumber;
361
- selector: z.ZodString;
362
- text: z.ZodString;
363
- x: z.ZodNumber;
364
- y: z.ZodNumber;
365
- timestamp: z.ZodNumber;
366
- runtime: z.ZodOptional<z.ZodString>;
367
- releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
368
- }, z.core.$strip>;
369
- }, z.core.$strip>, z.ZodObject<{
370
- uuid: z.ZodString;
371
- organizationId: z.ZodString;
372
- surfaceId: z.ZodString;
373
- environment: z.ZodString;
374
- sessionId: z.ZodNullable<z.ZodString>;
375
- fingerprint: z.ZodNullable<z.ZodString>;
376
- errorSource: z.ZodNullable<z.ZodEnum<{
377
- edge: "edge";
378
- client: "client";
379
- server: "server";
380
- }>>;
381
- buildId: z.ZodNullable<z.ZodString>;
382
- timestamp: z.ZodDate;
383
- createdAt: z.ZodDate;
384
- insertedAt: z.ZodDate;
385
- event: z.ZodLiteral<"identify">;
386
- payload: z.ZodObject<{
387
- identifier: z.ZodString;
388
- email: z.ZodOptional<z.ZodString>;
389
- name: z.ZodOptional<z.ZodString>;
390
- avatar: z.ZodOptional<z.ZodString>;
391
- traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
392
- }, z.core.$strip>;
393
- }, z.core.$strip>], "event">;
394
- type FactsEvent = z.infer<typeof factsEventSchema>;
395
- //#endregion
396
- export { FactsEvent, FactsEventType, factsEventSchema, factsPayloadSchemas };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/events/index.ts"],"mappings":";;;cAWa,mBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAWD,cAAA,gBAA8B,mBAAA;AAAA,cAkB7B,gBAAA,EAAgB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2CjB,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA"}
@@ -1,82 +0,0 @@
1
- import { errorFactsPayloadSchema } from "./error.mjs";
2
- import { identifyFactsPayloadSchema } from "./identify.mjs";
3
- import { pageleaveFactsPayloadSchema } from "./pageleave.mjs";
4
- import { pageviewFactsPayloadSchema } from "./pageview.mjs";
5
- import { rageClickFactsPayloadSchema } from "./rage-click.mjs";
6
- import { replayChunkFactsPayloadSchema } from "./replay-chunk.mjs";
7
- import { sessionSummaryFactsPayloadSchema } from "./session-summary.mjs";
8
- import { uiEventFactsPayloadSchema } from "./ui-event.mjs";
9
- import { z } from "zod/v4";
10
- //#region src/events/index.ts
11
- const factsPayloadSchemas = {
12
- error: errorFactsPayloadSchema,
13
- pageview: pageviewFactsPayloadSchema,
14
- pageleave: pageleaveFactsPayloadSchema,
15
- ui_event: uiEventFactsPayloadSchema,
16
- replay_chunk: replayChunkFactsPayloadSchema,
17
- session_summary: sessionSummaryFactsPayloadSchema,
18
- rage_click: rageClickFactsPayloadSchema,
19
- identify: identifyFactsPayloadSchema
20
- };
21
- const errorSourceSchema = z.enum([
22
- "client",
23
- "server",
24
- "edge"
25
- ]);
26
- const commonFactsFields = {
27
- uuid: z.string(),
28
- organizationId: z.string(),
29
- surfaceId: z.string(),
30
- environment: z.string(),
31
- sessionId: z.string().nullable(),
32
- fingerprint: z.string().nullable(),
33
- errorSource: errorSourceSchema.nullable(),
34
- buildId: z.string().nullable(),
35
- timestamp: z.date(),
36
- createdAt: z.date(),
37
- insertedAt: z.date()
38
- };
39
- const factsEventSchema = z.discriminatedUnion("event", [
40
- z.object({
41
- event: z.literal("error"),
42
- payload: errorFactsPayloadSchema,
43
- ...commonFactsFields
44
- }),
45
- z.object({
46
- event: z.literal("pageview"),
47
- payload: pageviewFactsPayloadSchema,
48
- ...commonFactsFields
49
- }),
50
- z.object({
51
- event: z.literal("pageleave"),
52
- payload: pageleaveFactsPayloadSchema,
53
- ...commonFactsFields
54
- }),
55
- z.object({
56
- event: z.literal("ui_event"),
57
- payload: uiEventFactsPayloadSchema,
58
- ...commonFactsFields
59
- }),
60
- z.object({
61
- event: z.literal("replay_chunk"),
62
- payload: replayChunkFactsPayloadSchema,
63
- ...commonFactsFields
64
- }),
65
- z.object({
66
- event: z.literal("session_summary"),
67
- payload: sessionSummaryFactsPayloadSchema,
68
- ...commonFactsFields
69
- }),
70
- z.object({
71
- event: z.literal("rage_click"),
72
- payload: rageClickFactsPayloadSchema,
73
- ...commonFactsFields
74
- }),
75
- z.object({
76
- event: z.literal("identify"),
77
- payload: identifyFactsPayloadSchema,
78
- ...commonFactsFields
79
- })
80
- ]);
81
- //#endregion
82
- export { factsEventSchema, factsPayloadSchemas };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/events/index.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport { errorFactsPayloadSchema } from \"./error.js\";\nimport { identifyFactsPayloadSchema } from \"./identify.js\";\nimport { pageleaveFactsPayloadSchema } from \"./pageleave.js\";\nimport { pageviewFactsPayloadSchema } from \"./pageview.js\";\nimport { rageClickFactsPayloadSchema } from \"./rage-click.js\";\nimport { replayChunkFactsPayloadSchema } from \"./replay-chunk.js\";\nimport { sessionSummaryFactsPayloadSchema } from \"./session-summary.js\";\nimport { uiEventFactsPayloadSchema } from \"./ui-event.js\";\n\nexport const factsPayloadSchemas = {\n error: errorFactsPayloadSchema,\n pageview: pageviewFactsPayloadSchema,\n pageleave: pageleaveFactsPayloadSchema,\n ui_event: uiEventFactsPayloadSchema,\n replay_chunk: replayChunkFactsPayloadSchema,\n session_summary: sessionSummaryFactsPayloadSchema,\n rage_click: rageClickFactsPayloadSchema,\n identify: identifyFactsPayloadSchema,\n} as const;\n\nexport type FactsEventType = keyof typeof factsPayloadSchemas;\n\nconst errorSourceSchema = z.enum([\"client\", \"server\", \"edge\"]);\n\nconst commonFactsFields = {\n uuid: z.string(),\n organizationId: z.string(),\n surfaceId: z.string(),\n environment: z.string(),\n sessionId: z.string().nullable(),\n fingerprint: z.string().nullable(),\n errorSource: errorSourceSchema.nullable(),\n buildId: z.string().nullable(),\n timestamp: z.date(),\n createdAt: z.date(),\n insertedAt: z.date(),\n};\n\nexport const factsEventSchema = z.discriminatedUnion(\"event\", [\n z.object({\n event: z.literal(\"error\"),\n payload: errorFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"pageview\"),\n payload: pageviewFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"pageleave\"),\n payload: pageleaveFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"ui_event\"),\n payload: uiEventFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"replay_chunk\"),\n payload: replayChunkFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"session_summary\"),\n payload: sessionSummaryFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"rage_click\"),\n payload: rageClickFactsPayloadSchema,\n ...commonFactsFields,\n }),\n z.object({\n event: z.literal(\"identify\"),\n payload: identifyFactsPayloadSchema,\n ...commonFactsFields,\n }),\n]);\n\nexport type FactsEvent = z.infer<typeof factsEventSchema>;\n"],"mappings":";;;;;;;;;;AAWA,MAAa,sBAAsB;CACjC,OAAO;CACP,UAAU;CACV,WAAW;CACX,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,YAAY;CACZ,UAAU;CACX;AAID,MAAM,oBAAoB,EAAE,KAAK;CAAC;CAAU;CAAU;CAAO,CAAC;AAE9D,MAAM,oBAAoB;CACxB,MAAM,EAAE,QAAQ;CAChB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,aAAa,EAAE,QAAQ;CACvB,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,aAAa,kBAAkB,UAAU;CACzC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM;CACnB,YAAY,EAAE,MAAM;CACrB;AAED,MAAa,mBAAmB,EAAE,mBAAmB,SAAS;CAC5D,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,QAAQ;EACzB,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,WAAW;EAC5B,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,YAAY;EAC7B,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,WAAW;EAC5B,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,eAAe;EAChC,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,kBAAkB;EACnC,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,aAAa;EAC9B,SAAS;EACT,GAAG;EACJ,CAAC;CACF,EAAE,OAAO;EACP,OAAO,EAAE,QAAQ,WAAW;EAC5B,SAAS;EACT,GAAG;EACJ,CAAC;CACH,CAAC"}