@interfere/types 9.0.2 → 9.0.3-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/data/frame.cjs +1 -0
- package/dist/data/frame.d.cts +27 -0
- package/dist/data/frame.d.mts +2 -1
- package/dist/data/frame.mjs +2 -1
- package/dist/data/session.cjs +1 -0
- package/dist/data/session.d.cts +8 -0
- package/dist/data/session.d.mts +2 -1
- package/dist/data/session.mjs +2 -1
- package/dist/data/source-maps.cjs +1 -0
- package/dist/data/source-maps.d.cts +151 -0
- package/dist/data/source-maps.d.mts +7 -2
- package/dist/data/source-maps.mjs +2 -1
- package/dist/events/error.cjs +1 -0
- package/dist/events/error.d.cts +196 -0
- package/dist/events/error.d.mts +2 -1
- package/dist/events/error.mjs +2 -1
- package/dist/events/pageleave.cjs +1 -0
- package/dist/events/pageleave.d.cts +13 -0
- package/dist/events/pageleave.d.mts +2 -1
- package/dist/events/pageleave.mjs +2 -1
- package/dist/events/pageview.cjs +1 -0
- package/dist/events/pageview.d.cts +14 -0
- package/dist/events/pageview.d.mts +2 -1
- package/dist/events/pageview.mjs +2 -1
- package/dist/integrations/index.cjs +1 -0
- package/dist/integrations/index.d.cts +77 -0
- package/dist/integrations/index.d.mts +31 -1
- package/dist/integrations/index.mjs +2 -1
- package/dist/integrations/platforms/cli.cjs +1 -0
- package/dist/integrations/platforms/cli.d.cts +12 -0
- package/dist/integrations/platforms/cli.d.mts +12 -0
- package/dist/integrations/platforms/cli.mjs +2 -0
- package/dist/integrations/platforms/github.cjs +1 -0
- package/dist/integrations/platforms/github.d.cts +77 -0
- package/dist/integrations/platforms/github.d.mts +63 -1
- package/dist/integrations/platforms/github.mjs +2 -1
- package/dist/integrations/platforms/slack.cjs +1 -0
- package/dist/integrations/platforms/slack.d.cts +33 -0
- package/dist/integrations/platforms/slack.d.mts +2 -1
- package/dist/integrations/platforms/slack.mjs +2 -1
- package/dist/integrations/platforms/vercel.cjs +1 -0
- package/dist/integrations/platforms/vercel.d.cts +47 -0
- package/dist/integrations/platforms/vercel.d.mts +2 -1
- package/dist/integrations/platforms/vercel.mjs +2 -1
- package/dist/releases/definition.cjs +1 -0
- package/dist/releases/definition.d.cts +71 -0
- package/dist/releases/definition.d.mts +16 -1
- package/dist/releases/definition.mjs +2 -1
- package/dist/releases/slug.cjs +1 -0
- package/dist/releases/slug.d.cts +24 -0
- package/dist/releases/slug.d.mts +3 -1
- package/dist/releases/slug.mjs +2 -1
- package/dist/sdk/env.cjs +1 -0
- package/dist/sdk/env.d.cts +6 -0
- package/dist/sdk/env.d.mts +2 -1
- package/dist/sdk/env.mjs +2 -1
- package/dist/sdk/envelope.cjs +1 -0
- package/dist/sdk/envelope.d.cts +1441 -0
- package/dist/sdk/envelope.d.mts +14 -61
- package/dist/sdk/envelope.mjs +2 -1
- package/dist/sdk/errors.cjs +2 -0
- package/dist/sdk/errors.d.cts +156 -0
- package/dist/sdk/errors.d.mts +4 -1
- package/dist/sdk/errors.mjs +3 -2
- package/dist/sdk/geo.cjs +1 -0
- package/dist/sdk/geo.d.cts +11 -0
- package/dist/sdk/geo.d.mts +2 -1
- package/dist/sdk/geo.mjs +2 -1
- package/dist/sdk/identify.cjs +1 -0
- package/dist/sdk/identify.d.cts +35 -0
- package/dist/sdk/identify.d.mts +2 -1
- package/dist/sdk/identify.mjs +2 -1
- package/dist/sdk/plugins/context/browser.cjs +1 -0
- package/dist/sdk/plugins/context/browser.d.cts +92 -0
- package/dist/sdk/plugins/context/browser.d.mts +2 -1
- package/dist/sdk/plugins/context/browser.mjs +2 -1
- package/dist/sdk/plugins/context/edge.cjs +1 -0
- package/dist/sdk/plugins/context/edge.d.cts +10 -0
- package/dist/sdk/plugins/context/edge.d.mts +2 -1
- package/dist/sdk/plugins/context/edge.mjs +2 -1
- package/dist/sdk/plugins/context/next.cjs +1 -0
- package/dist/sdk/plugins/context/next.d.cts +62 -0
- package/dist/sdk/plugins/context/next.d.mts +2 -1
- package/dist/sdk/plugins/context/next.mjs +2 -1
- package/dist/sdk/plugins/context/node.cjs +1 -0
- package/dist/sdk/plugins/context/node.d.cts +13 -0
- package/dist/sdk/plugins/context/node.d.mts +2 -1
- package/dist/sdk/plugins/context/node.mjs +2 -1
- package/dist/sdk/plugins/manifest.cjs +1 -0
- package/dist/sdk/plugins/manifest.d.cts +60 -0
- package/dist/sdk/plugins/manifest.d.mts +2 -1
- package/dist/sdk/plugins/manifest.mjs +2 -1
- package/dist/sdk/plugins/payload/errors.cjs +1 -0
- package/dist/sdk/plugins/payload/errors.d.cts +65 -0
- package/dist/sdk/plugins/payload/errors.d.mts +2 -1
- package/dist/sdk/plugins/payload/errors.mjs +2 -1
- package/dist/sdk/plugins/payload/page-events.cjs +1 -0
- package/dist/sdk/plugins/payload/page-events.d.cts +20 -0
- package/dist/sdk/plugins/payload/page-events.d.mts +2 -1
- package/dist/sdk/plugins/payload/page-events.mjs +2 -1
- package/dist/sdk/plugins/payload/rage-click.cjs +1 -0
- package/dist/sdk/plugins/payload/rage-click.d.cts +16 -0
- package/dist/sdk/plugins/payload/rage-click.d.mts +2 -1
- package/dist/sdk/plugins/payload/rage-click.mjs +2 -1
- package/dist/sdk/plugins/payload/replay.cjs +1 -0
- package/dist/sdk/plugins/payload/replay.d.cts +14 -0
- package/dist/sdk/plugins/payload/replay.d.mts +2 -1
- package/dist/sdk/plugins/payload/replay.mjs +2 -1
- package/dist/sdk/remote-config.cjs +1 -0
- package/dist/sdk/remote-config.d.cts +39 -0
- package/dist/sdk/remote-config.d.mts +2 -1
- package/dist/sdk/remote-config.mjs +2 -1
- package/dist/sdk/runtime.cjs +1 -0
- package/dist/sdk/runtime.d.cts +41 -0
- package/dist/sdk/runtime.d.mts +27 -7
- package/dist/sdk/runtime.mjs +2 -1
- package/package.json +120 -45
- package/dist/data/frame.d.mts.map +0 -1
- package/dist/data/frame.mjs.map +0 -1
- package/dist/data/session.d.mts.map +0 -1
- package/dist/data/session.mjs.map +0 -1
- package/dist/data/source-maps.d.mts.map +0 -1
- package/dist/data/source-maps.mjs.map +0 -1
- package/dist/events/error.d.mts.map +0 -1
- package/dist/events/error.mjs.map +0 -1
- package/dist/events/pageleave.d.mts.map +0 -1
- package/dist/events/pageleave.mjs.map +0 -1
- package/dist/events/pageview.d.mts.map +0 -1
- package/dist/events/pageview.mjs.map +0 -1
- package/dist/integrations/index.d.mts.map +0 -1
- package/dist/integrations/index.mjs.map +0 -1
- package/dist/integrations/platforms/github.d.mts.map +0 -1
- package/dist/integrations/platforms/github.mjs.map +0 -1
- package/dist/integrations/platforms/slack.d.mts.map +0 -1
- package/dist/integrations/platforms/slack.mjs.map +0 -1
- package/dist/integrations/platforms/vercel.d.mts.map +0 -1
- package/dist/integrations/platforms/vercel.mjs.map +0 -1
- package/dist/releases/definition.d.mts.map +0 -1
- package/dist/releases/definition.mjs.map +0 -1
- package/dist/releases/slug.d.mts.map +0 -1
- package/dist/releases/slug.mjs.map +0 -1
- package/dist/sdk/env.d.mts.map +0 -1
- package/dist/sdk/env.mjs.map +0 -1
- package/dist/sdk/envelope.d.mts.map +0 -1
- package/dist/sdk/envelope.mjs.map +0 -1
- package/dist/sdk/errors.d.mts.map +0 -1
- package/dist/sdk/errors.mjs.map +0 -1
- package/dist/sdk/geo.d.mts.map +0 -1
- package/dist/sdk/geo.mjs.map +0 -1
- package/dist/sdk/identify.d.mts.map +0 -1
- package/dist/sdk/identify.mjs.map +0 -1
- package/dist/sdk/plugins/context/browser.d.mts.map +0 -1
- package/dist/sdk/plugins/context/browser.mjs.map +0 -1
- package/dist/sdk/plugins/context/edge.d.mts.map +0 -1
- package/dist/sdk/plugins/context/edge.mjs.map +0 -1
- package/dist/sdk/plugins/context/next.d.mts.map +0 -1
- package/dist/sdk/plugins/context/next.mjs.map +0 -1
- package/dist/sdk/plugins/context/node.d.mts.map +0 -1
- package/dist/sdk/plugins/context/node.mjs.map +0 -1
- package/dist/sdk/plugins/manifest.d.mts.map +0 -1
- package/dist/sdk/plugins/manifest.mjs.map +0 -1
- package/dist/sdk/plugins/payload/errors.d.mts.map +0 -1
- package/dist/sdk/plugins/payload/errors.mjs.map +0 -1
- package/dist/sdk/plugins/payload/page-events.d.mts.map +0 -1
- package/dist/sdk/plugins/payload/page-events.mjs.map +0 -1
- package/dist/sdk/plugins/payload/rage-click.d.mts.map +0 -1
- package/dist/sdk/plugins/payload/rage-click.mjs.map +0 -1
- package/dist/sdk/plugins/payload/replay.d.mts.map +0 -1
- package/dist/sdk/plugins/payload/replay.mjs.map +0 -1
- package/dist/sdk/remote-config.d.mts.map +0 -1
- package/dist/sdk/remote-config.mjs.map +0 -1
- package/dist/sdk/runtime.d.mts.map +0 -1
- package/dist/sdk/runtime.mjs.map +0 -1
package/dist/sdk/envelope.d.mts
CHANGED
|
@@ -180,11 +180,7 @@ declare const errorEnvelopeSchema: z.ZodObject<{
|
|
|
180
180
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
181
181
|
runtime: z.ZodLiteral<"node">;
|
|
182
182
|
}, z.core.$strip>], "runtime">>;
|
|
183
|
-
environment: z.ZodNullable<z.
|
|
184
|
-
development: "development";
|
|
185
|
-
preview: "preview";
|
|
186
|
-
production: "production";
|
|
187
|
-
}>>;
|
|
183
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
188
184
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
189
185
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
190
186
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -311,11 +307,7 @@ declare const pageviewEnvelopeSchema: z.ZodObject<{
|
|
|
311
307
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
312
308
|
runtime: z.ZodLiteral<"node">;
|
|
313
309
|
}, z.core.$strip>], "runtime">>;
|
|
314
|
-
environment: z.ZodNullable<z.
|
|
315
|
-
development: "development";
|
|
316
|
-
preview: "preview";
|
|
317
|
-
production: "production";
|
|
318
|
-
}>>;
|
|
310
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
319
311
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
320
312
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
321
313
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -422,11 +414,7 @@ declare const pageleaveEnvelopeSchema: z.ZodObject<{
|
|
|
422
414
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
423
415
|
runtime: z.ZodLiteral<"node">;
|
|
424
416
|
}, z.core.$strip>], "runtime">>;
|
|
425
|
-
environment: z.ZodNullable<z.
|
|
426
|
-
development: "development";
|
|
427
|
-
preview: "preview";
|
|
428
|
-
production: "production";
|
|
429
|
-
}>>;
|
|
417
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
430
418
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
431
419
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
432
420
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -533,11 +521,7 @@ declare const uiEventEnvelopeSchema: z.ZodObject<{
|
|
|
533
521
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
534
522
|
runtime: z.ZodLiteral<"node">;
|
|
535
523
|
}, z.core.$strip>], "runtime">>;
|
|
536
|
-
environment: z.ZodNullable<z.
|
|
537
|
-
development: "development";
|
|
538
|
-
preview: "preview";
|
|
539
|
-
production: "production";
|
|
540
|
-
}>>;
|
|
524
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
541
525
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
542
526
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
543
527
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -643,11 +627,7 @@ declare const replayChunkEnvelopeSchema: z.ZodObject<{
|
|
|
643
627
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
644
628
|
runtime: z.ZodLiteral<"node">;
|
|
645
629
|
}, z.core.$strip>], "runtime">>;
|
|
646
|
-
environment: z.ZodNullable<z.
|
|
647
|
-
development: "development";
|
|
648
|
-
preview: "preview";
|
|
649
|
-
production: "production";
|
|
650
|
-
}>>;
|
|
630
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
651
631
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
652
632
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
653
633
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -757,11 +737,7 @@ declare const rageClickEnvelopeSchema: z.ZodObject<{
|
|
|
757
737
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
758
738
|
runtime: z.ZodLiteral<"node">;
|
|
759
739
|
}, z.core.$strip>], "runtime">>;
|
|
760
|
-
environment: z.ZodNullable<z.
|
|
761
|
-
development: "development";
|
|
762
|
-
preview: "preview";
|
|
763
|
-
production: "production";
|
|
764
|
-
}>>;
|
|
740
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
765
741
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
766
742
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
767
743
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -873,11 +849,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
873
849
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
874
850
|
runtime: z.ZodLiteral<"node">;
|
|
875
851
|
}, z.core.$strip>], "runtime">>;
|
|
876
|
-
environment: z.ZodNullable<z.
|
|
877
|
-
development: "development";
|
|
878
|
-
preview: "preview";
|
|
879
|
-
production: "production";
|
|
880
|
-
}>>;
|
|
852
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
881
853
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
882
854
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
883
855
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1003,11 +975,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1003
975
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
1004
976
|
runtime: z.ZodLiteral<"node">;
|
|
1005
977
|
}, z.core.$strip>], "runtime">>;
|
|
1006
|
-
environment: z.ZodNullable<z.
|
|
1007
|
-
development: "development";
|
|
1008
|
-
preview: "preview";
|
|
1009
|
-
production: "production";
|
|
1010
|
-
}>>;
|
|
978
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1011
979
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
1012
980
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
1013
981
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1113,11 +1081,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1113
1081
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
1114
1082
|
runtime: z.ZodLiteral<"node">;
|
|
1115
1083
|
}, z.core.$strip>], "runtime">>;
|
|
1116
|
-
environment: z.ZodNullable<z.
|
|
1117
|
-
development: "development";
|
|
1118
|
-
preview: "preview";
|
|
1119
|
-
production: "production";
|
|
1120
|
-
}>>;
|
|
1084
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1121
1085
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
1122
1086
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
1123
1087
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1223,11 +1187,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1223
1187
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
1224
1188
|
runtime: z.ZodLiteral<"node">;
|
|
1225
1189
|
}, z.core.$strip>], "runtime">>;
|
|
1226
|
-
environment: z.ZodNullable<z.
|
|
1227
|
-
development: "development";
|
|
1228
|
-
preview: "preview";
|
|
1229
|
-
production: "production";
|
|
1230
|
-
}>>;
|
|
1190
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1231
1191
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
1232
1192
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
1233
1193
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1332,11 +1292,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1332
1292
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
1333
1293
|
runtime: z.ZodLiteral<"node">;
|
|
1334
1294
|
}, z.core.$strip>], "runtime">>;
|
|
1335
|
-
environment: z.ZodNullable<z.
|
|
1336
|
-
development: "development";
|
|
1337
|
-
preview: "preview";
|
|
1338
|
-
production: "production";
|
|
1339
|
-
}>>;
|
|
1295
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1340
1296
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
1341
1297
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
1342
1298
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1445,11 +1401,7 @@ declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1445
1401
|
requestPath: z.ZodOptional<z.ZodString>;
|
|
1446
1402
|
runtime: z.ZodLiteral<"node">;
|
|
1447
1403
|
}, z.core.$strip>], "runtime">>;
|
|
1448
|
-
environment: z.ZodNullable<z.
|
|
1449
|
-
development: "development";
|
|
1450
|
-
preview: "preview";
|
|
1451
|
-
production: "production";
|
|
1452
|
-
}>>;
|
|
1404
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1453
1405
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
1454
1406
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
1455
1407
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1485,4 +1437,5 @@ type Envelope<T extends EventType | undefined = undefined> = T extends EventType
|
|
|
1485
1437
|
}> : EnvelopeBase;
|
|
1486
1438
|
type EnvelopePayload<T extends EventType> = Envelope<T>["payload"];
|
|
1487
1439
|
//#endregion
|
|
1488
|
-
export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
|
|
1440
|
+
export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
|
|
1441
|
+
//# sourceMappingURL=envelope.d.mts.map
|
package/dist/sdk/envelope.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{z
|
|
1
|
+
import{z}from"zod";import{sessionIdSchema}from"#data/session";import{browserContextSchema}from"#sdk/plugins/context/browser";import{edgeContextSchema}from"#sdk/plugins/context/edge";import{nextjsContextSchema}from"#sdk/plugins/context/next";import{nodeContextSchema}from"#sdk/plugins/context/node";import{errorEnvelopePayloadSchema}from"#sdk/plugins/payload/errors";import{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema}from"#sdk/plugins/payload/page-events";import{rageClickPayloadSchema}from"#sdk/plugins/payload/rage-click";import{replayChunkPayloadSchema}from"#sdk/plugins/payload/replay";import{envSchema,runtimeSchema}from"#sdk/runtime";const sessionSourceSchema=z.enum([`header`,`async_context`,`fallback`,`client`]).optional().meta({id:`SessionSource`,title:`SessionSource`,description:`How the server resolved the sessionId for this envelope.`}),envelopeContextSchema=z.discriminatedUnion(`runtime`,[browserContextSchema,nextjsContextSchema,edgeContextSchema,nodeContextSchema]).meta({id:`EnvelopeContext`,title:`EnvelopeContext`,description:`Runtime-specific request context attached to every envelope.`}),envelopeHeadersShape={buildId:z.string(),clientTs:z.int(),context:envelopeContextSchema.optional(),environment:envSchema,producerVersion:z.string().optional(),releaseId:z.string().nullable(),runtime:runtimeSchema,sdkStack:z.array(z.string()).optional(),sessionId:sessionIdSchema.nullable(),sessionSource:sessionSourceSchema,uuid:z.uuidv7(),v:z.literal(0)},errorEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`error`),payload:errorEnvelopePayloadSchema}).meta({id:`ErrorEnvelope`,title:`ErrorEnvelope`}),pageviewEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageview`),payload:pageviewPayloadSchema}).meta({id:`PageviewEnvelope`,title:`PageviewEnvelope`}),pageleaveEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageleave`),payload:pageleavePayloadSchema}).meta({id:`PageleaveEnvelope`,title:`PageleaveEnvelope`}),uiEventEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`ui_event`),payload:uiEventPayloadSchema}).meta({id:`UiEventEnvelope`,title:`UiEventEnvelope`}),replayChunkEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`replay_chunk`),payload:replayChunkPayloadSchema}).meta({id:`ReplayChunkEnvelope`,title:`ReplayChunkEnvelope`}),rageClickEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`rage_click`),payload:rageClickPayloadSchema}).meta({id:`RageClickEnvelope`,title:`RageClickEnvelope`}),envelopeSchema=z.discriminatedUnion(`type`,[errorEnvelopeSchema,pageviewEnvelopeSchema,pageleaveEnvelopeSchema,uiEventEnvelopeSchema,replayChunkEnvelopeSchema,rageClickEnvelopeSchema]).meta({id:`Envelope`,title:`Envelope`,description:`A single event envelope accepted by the collector.`});export{envelopeContextSchema,envelopeSchema,errorEnvelopeSchema,pageleaveEnvelopeSchema,pageviewEnvelopeSchema,rageClickEnvelopeSchema,replayChunkEnvelopeSchema,sessionSourceSchema,uiEventEnvelopeSchema};
|
|
2
|
+
//# sourceMappingURL=envelope.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,xhrFailedResponse:`auto.browser.xhr.failed_response`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
2
|
+
`)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}exports.MECHANISM_TYPE=MECHANISM_TYPE,exports.isNonErrorException=isNonErrorException,exports.parseReactComponentStack=parseReactComponentStack,exports.shouldDropBrowserExtensionNoise=shouldDropBrowserExtensionNoise,exports.shouldDropUnresolvableStack=shouldDropUnresolvableStack,exports.toError=toError,exports.toException=toException,exports.toExceptions=toExceptions;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { IngestedFrame } from "#data/frame";
|
|
2
|
+
import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
|
|
3
|
+
|
|
4
|
+
//#region src/sdk/errors.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Structured taxonomy of capture sources, tagged onto each
|
|
7
|
+
* `ErrorMechanism.type`. Follows the `auto.<surface>.<library>.<method>`
|
|
8
|
+
* convention Sentry also uses, so downstream analytics / classification can
|
|
9
|
+
* group on common prefixes:
|
|
10
|
+
*
|
|
11
|
+
* `auto.browser.*` — captured by SDK global handlers in the browser
|
|
12
|
+
* `auto.function.*` — captured by SDK functions (boundaries, callbacks,
|
|
13
|
+
* server wrappers)
|
|
14
|
+
*
|
|
15
|
+
* Leaves (`.onerror`, `.error_boundary`, `.on_request_error`, …) identify
|
|
16
|
+
* the specific capture site, which lets the agent's skill classifier reason
|
|
17
|
+
* about what "kind" of event this is without string-matching loose names.
|
|
18
|
+
*/
|
|
19
|
+
declare const MECHANISM_TYPE: {
|
|
20
|
+
readonly browser: {
|
|
21
|
+
readonly onerror: "auto.browser.global_handlers.onerror";
|
|
22
|
+
readonly onunhandledrejection: "auto.browser.global_handlers.onunhandledrejection";
|
|
23
|
+
readonly consoleError: "auto.browser.console.error";
|
|
24
|
+
readonly fetchFailedResponse: "auto.browser.fetch.failed_response";
|
|
25
|
+
readonly xhrFailedResponse: "auto.browser.xhr.failed_response";
|
|
26
|
+
};
|
|
27
|
+
readonly react: {
|
|
28
|
+
readonly errorBoundary: "auto.function.react.error_boundary";
|
|
29
|
+
readonly captureBoundary: "auto.function.react.capture_boundary";
|
|
30
|
+
readonly caughtError: "auto.function.react.caught_error";
|
|
31
|
+
readonly uncaughtError: "auto.function.react.uncaught_error";
|
|
32
|
+
readonly recoverableError: "auto.function.react.recoverable_error";
|
|
33
|
+
};
|
|
34
|
+
readonly nextjs: {
|
|
35
|
+
readonly onRequestError: "auto.function.nextjs.on_request_error";
|
|
36
|
+
readonly captureError: "auto.function.nextjs.capture_error";
|
|
37
|
+
};
|
|
38
|
+
readonly node: {
|
|
39
|
+
readonly captureError: "auto.function.node.capture_error";
|
|
40
|
+
readonly uncaughtException: "auto.node.global_handlers.uncaught_exception";
|
|
41
|
+
readonly unhandledRejection: "auto.node.global_handlers.unhandled_rejection";
|
|
42
|
+
};
|
|
43
|
+
readonly manual: {
|
|
44
|
+
/** Customer called `capture(error)` from `@interfere/react/api`. */readonly capture: "manual.api.capture";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* True when the raw stack mentions any browser-extension URL scheme
|
|
49
|
+
* anywhere. Catches extension-only stacks, extension interceptors
|
|
50
|
+
* (extension frames above app), and app errors whose stack still
|
|
51
|
+
* includes extension code (e.g. extension hydration). Cause-chain
|
|
52
|
+
* variants are caught by passing the chain entries' stacks to this
|
|
53
|
+
* check separately.
|
|
54
|
+
*
|
|
55
|
+
* Server-side parsing has full structured fidelity, but the noise
|
|
56
|
+
* filter runs at capture time before a parsed stack exists — regex
|
|
57
|
+
* over the raw string is sufficient and avoids pulling a parser into
|
|
58
|
+
* the customer bundle.
|
|
59
|
+
*/
|
|
60
|
+
declare function shouldDropBrowserExtensionNoise(stacks: readonly string[]): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* True when **none** of the supplied stacks (head + cause chain entries)
|
|
63
|
+
* carries any source-location anchor. Non-Error rejections (no stack at
|
|
64
|
+
* all) are exempt at the call site — they ship structured payloads the
|
|
65
|
+
* agent can reason over without frames.
|
|
66
|
+
*/
|
|
67
|
+
declare function shouldDropUnresolvableStack(stacks: readonly string[]): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Parses a React `errorInfo.componentStack` string into synthetic frames.
|
|
70
|
+
* Server-side stack parsing handles JS frames; component-stack frames are
|
|
71
|
+
* supplementary context React emits separately and have a different shape,
|
|
72
|
+
* so they're parsed at capture time and shipped via `appendFrames`.
|
|
73
|
+
*
|
|
74
|
+
* React produces different formats across versions:
|
|
75
|
+
* - React 16–18 legacy: ` in ComponentName`
|
|
76
|
+
* ` in ComponentName (created by Parent)`
|
|
77
|
+
* - React 19 owner stacks: ` at ComponentName`
|
|
78
|
+
* ` at ComponentName (file.tsx:10:5)`
|
|
79
|
+
*/
|
|
80
|
+
declare function parseReactComponentStack(componentStack: string): IngestedFrame[];
|
|
81
|
+
/**
|
|
82
|
+
* Coerces any thrown value into an `Error` instance, preferring a nested
|
|
83
|
+
* `Error` inside a plain-object rejection over a stringified fallback.
|
|
84
|
+
*
|
|
85
|
+
* Motivated by the common `Promise.reject({ error: realErr })` pattern
|
|
86
|
+
* (tRPC, GraphQL clients, some fetch wrappers). Without this, the captured
|
|
87
|
+
* exception would be `new Error("[object Object]")` and the nested Error's
|
|
88
|
+
* stack/message would be lost entirely.
|
|
89
|
+
*
|
|
90
|
+
* When multiple candidate Error values exist on the object, the first one
|
|
91
|
+
* found (in declaration order) wins. `cause` is preferred if present, since
|
|
92
|
+
* it's the documented ES2022 convention.
|
|
93
|
+
*/
|
|
94
|
+
declare function toError(error: unknown): Error;
|
|
95
|
+
/**
|
|
96
|
+
* Capture-side variant for thrown values that aren't Errors and don't
|
|
97
|
+
* carry a nested Error (e.g. `Promise.reject({ code: 401, body: "..." })`,
|
|
98
|
+
* `Promise.reject(42)`). The structured payload rides on `serialized`
|
|
99
|
+
* so downstream consumers can render the original shape instead of
|
|
100
|
+
* parsing JSON back out of an Error's message string.
|
|
101
|
+
*
|
|
102
|
+
* Strings are *not* represented here — `Promise.reject("boom")` maps
|
|
103
|
+
* cleanly to `new Error("boom")` without lying about the shape, so it
|
|
104
|
+
* goes through `toException`'s Error branch.
|
|
105
|
+
*/
|
|
106
|
+
interface NonErrorException {
|
|
107
|
+
readonly kind: "non-error";
|
|
108
|
+
/**
|
|
109
|
+
* Original payload, depth-bounded and circular-safe. Anything beyond
|
|
110
|
+
* `MAX_NON_ERROR_DEPTH` is collapsed to `"[depth-limit]"`; circular
|
|
111
|
+
* back-edges become `"[circular]"`. Primitives pass through unchanged.
|
|
112
|
+
*/
|
|
113
|
+
readonly serialized: unknown;
|
|
114
|
+
/**
|
|
115
|
+
* Stable label for grouping. `"PlainObject"` / `"Array"` / `"number"`
|
|
116
|
+
* etc. — derived from the value's structural class, not its content,
|
|
117
|
+
* so two `Promise.reject({ code: 401 })` calls land in the same group
|
|
118
|
+
* regardless of which keys the object carries.
|
|
119
|
+
*/
|
|
120
|
+
readonly type: string;
|
|
121
|
+
/**
|
|
122
|
+
* Best-effort one-liner. For objects: a sorted list of keys. For
|
|
123
|
+
* primitives: `String(value)`. The dashboard shows this; the
|
|
124
|
+
* `serialized` field carries the actual payload.
|
|
125
|
+
*/
|
|
126
|
+
readonly value: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Coerces any thrown value into either an `Error` (when one is
|
|
130
|
+
* recoverable — direct Error, or nested Error inside an object via
|
|
131
|
+
* `cause` / first-Error-valued property — or a string, which maps
|
|
132
|
+
* cleanly to `new Error(str)`) or a structured `NonErrorException`
|
|
133
|
+
* carrying the original payload.
|
|
134
|
+
*
|
|
135
|
+
* Replaces `toError` for capture sites that handle both branches
|
|
136
|
+
* (today: `unhandledrejection`). `toError` is kept for callers that
|
|
137
|
+
* specifically need an `Error` (`<ErrorBoundary>` interop, browser
|
|
138
|
+
* APIs that take Error-typed args).
|
|
139
|
+
*/
|
|
140
|
+
declare function toException(value: unknown): Error | NonErrorException;
|
|
141
|
+
declare function isNonErrorException(value: unknown): value is NonErrorException;
|
|
142
|
+
/**
|
|
143
|
+
* Walks `Error.cause` to flatten the chain into the wire shape the
|
|
144
|
+
* collector expects. Each entry carries `type` / `value` / `mechanism?`
|
|
145
|
+
* plus the raw `stack` string — the SDK ships **no parsed frames**.
|
|
146
|
+
* Server-side ingest parses `stack` into structured `IngestedFrame[]`
|
|
147
|
+
* via the collector's stack parser (see
|
|
148
|
+
* `src/services/collector/src/lib/stack-parser.ts`).
|
|
149
|
+
*
|
|
150
|
+
* Non-Error rejections short-circuit to a single `kind: "non-error"`
|
|
151
|
+
* entry with the structured payload on `serialized`.
|
|
152
|
+
*/
|
|
153
|
+
declare function toExceptions(value: Error | NonErrorException, mechanism: ErrorMechanism): ExceptionValue[];
|
|
154
|
+
//#endregion
|
|
155
|
+
export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
|
|
156
|
+
//# sourceMappingURL=errors.d.cts.map
|
package/dist/sdk/errors.d.mts
CHANGED
|
@@ -21,6 +21,8 @@ declare const MECHANISM_TYPE: {
|
|
|
21
21
|
readonly onerror: "auto.browser.global_handlers.onerror";
|
|
22
22
|
readonly onunhandledrejection: "auto.browser.global_handlers.onunhandledrejection";
|
|
23
23
|
readonly consoleError: "auto.browser.console.error";
|
|
24
|
+
readonly fetchFailedResponse: "auto.browser.fetch.failed_response";
|
|
25
|
+
readonly xhrFailedResponse: "auto.browser.xhr.failed_response";
|
|
24
26
|
};
|
|
25
27
|
readonly react: {
|
|
26
28
|
readonly errorBoundary: "auto.function.react.error_boundary";
|
|
@@ -150,4 +152,5 @@ declare function isNonErrorException(value: unknown): value is NonErrorException
|
|
|
150
152
|
*/
|
|
151
153
|
declare function toExceptions(value: Error | NonErrorException, mechanism: ErrorMechanism): ExceptionValue[];
|
|
152
154
|
//#endregion
|
|
153
|
-
export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
|
|
155
|
+
export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
|
|
156
|
+
//# sourceMappingURL=errors.d.mts.map
|
package/dist/sdk/errors.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
`)){let
|
|
1
|
+
const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,xhrFailedResponse:`auto.browser.xhr.failed_response`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
2
|
+
`)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}export{MECHANISM_TYPE,isNonErrorException,parseReactComponentStack,shouldDropBrowserExtensionNoise,shouldDropUnresolvableStack,toError,toException,toExceptions};
|
|
3
|
+
//# sourceMappingURL=errors.mjs.map
|
package/dist/sdk/geo.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const cloudflareTraceSchema=zod.z.object({loc:zod.z.string().length(2)}).loose(),GEO_COUNTRY_HEADERS=[`cf-ipcountry`,`x-vercel-ip-country`,`x-country-code`];function extractCountryHeader(request){for(let header of GEO_COUNTRY_HEADERS){let value=request.headers.get(header);if(value&&value.length===2)return value.toUpperCase()}return null}exports.cloudflareTraceSchema=cloudflareTraceSchema,exports.extractCountryHeader=extractCountryHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/sdk/geo.d.ts
|
|
4
|
+
declare const cloudflareTraceSchema: z.ZodObject<{
|
|
5
|
+
loc: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;
|
|
8
|
+
declare function extractCountryHeader(request: Request): string | null;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
|
|
11
|
+
//# sourceMappingURL=geo.d.cts.map
|
package/dist/sdk/geo.d.mts
CHANGED
|
@@ -7,4 +7,5 @@ declare const cloudflareTraceSchema: z.ZodObject<{
|
|
|
7
7
|
type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;
|
|
8
8
|
declare function extractCountryHeader(request: Request): string | null;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
|
|
10
|
+
export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
|
|
11
|
+
//# sourceMappingURL=geo.d.mts.map
|
package/dist/sdk/geo.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{z
|
|
1
|
+
import{z}from"zod";const cloudflareTraceSchema=z.object({loc:z.string().length(2)}).loose(),GEO_COUNTRY_HEADERS=[`cf-ipcountry`,`x-vercel-ip-country`,`x-country-code`];function extractCountryHeader(request){for(let header of GEO_COUNTRY_HEADERS){let value=request.headers.get(header);if(value&&value.length===2)return value.toUpperCase()}return null}export{cloudflareTraceSchema,extractCountryHeader};
|
|
2
|
+
//# sourceMappingURL=geo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const identifySourceSchema=zod.z.discriminatedUnion(`type`,[zod.z.object({type:zod.z.literal(`clerk`),name:zod.z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),zod.z.object({type:zod.z.literal(`auth0`),name:zod.z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),zod.z.object({type:zod.z.literal(`custom`),name:zod.z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=zod.z.record(zod.z.string(),zod.z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=zod.z.object({avatar:zod.z.string().optional(),email:zod.z.email().optional(),identifier:zod.z.string(),name:zod.z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});exports.identifyParamsSchema=identifyParamsSchema,exports.identifySourceSchema=identifySourceSchema;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/sdk/identify.d.ts
|
|
4
|
+
declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"clerk">;
|
|
6
|
+
name: z.ZodLiteral<"Clerk">;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"auth0">;
|
|
9
|
+
name: z.ZodLiteral<"Auth0">;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"custom">;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
}, z.core.$strip>], "type">;
|
|
14
|
+
type IdentifySource = z.infer<typeof identifySourceSchema>;
|
|
15
|
+
declare const identifyParamsSchema: z.ZodObject<{
|
|
16
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
17
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
18
|
+
identifier: z.ZodString;
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"clerk">;
|
|
22
|
+
name: z.ZodLiteral<"Clerk">;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"auth0">;
|
|
25
|
+
name: z.ZodLiteral<"Auth0">;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"custom">;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
}, z.core.$strip>], "type">;
|
|
30
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
type IdentifyParams = z.infer<typeof identifyParamsSchema>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
|
|
35
|
+
//# sourceMappingURL=identify.d.cts.map
|
package/dist/sdk/identify.d.mts
CHANGED
|
@@ -31,4 +31,5 @@ declare const identifyParamsSchema: z.ZodObject<{
|
|
|
31
31
|
}, z.core.$strip>;
|
|
32
32
|
type IdentifyParams = z.infer<typeof identifyParamsSchema>;
|
|
33
33
|
//#endregion
|
|
34
|
-
export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
|
|
34
|
+
export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
|
|
35
|
+
//# sourceMappingURL=identify.d.mts.map
|
package/dist/sdk/identify.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{z
|
|
1
|
+
import{z}from"zod";const identifySourceSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`clerk`),name:z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),z.object({type:z.literal(`auth0`),name:z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),z.object({type:z.literal(`custom`),name:z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=z.record(z.string(),z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=z.object({avatar:z.string().optional(),email:z.email().optional(),identifier:z.string(),name:z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});export{identifyParamsSchema,identifySourceSchema};
|
|
2
|
+
//# sourceMappingURL=identify.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const deviceBrowserSchema=zod.z.object({major:zod.z.string().optional(),name:zod.z.string().optional(),type:zod.z.string().optional(),version:zod.z.string().optional(),fullVersion:zod.z.string().optional()}).meta({id:`DeviceBrowser`,title:`DeviceBrowser`}),deviceCpuSchema=zod.z.object({architecture:zod.z.string().optional(),bitness:zod.z.string().optional()}).meta({id:`DeviceCpu`,title:`DeviceCpu`}),deviceInfoSchema=zod.z.object({model:zod.z.string().optional(),type:zod.z.string().optional(),vendor:zod.z.string().optional()}).meta({id:`DeviceInfo`,title:`DeviceInfo`}),deviceEngineSchema=zod.z.object({name:zod.z.string().optional(),version:zod.z.string().optional()}).meta({id:`DeviceEngine`,title:`DeviceEngine`}),deviceOsSchema=zod.z.object({name:zod.z.string().optional(),version:zod.z.string().optional(),versionFull:zod.z.string().optional()}).meta({id:`DeviceOs`,title:`DeviceOs`}),deviceMetadataSchema=zod.z.object({browser:deviceBrowserSchema,cpu:deviceCpuSchema,device:deviceInfoSchema,engine:deviceEngineSchema,os:deviceOsSchema,ua:zod.z.string(),frozenUa:zod.z.boolean().optional()}).meta({id:`DeviceMetadata`,title:`DeviceMetadata`,description:`Device/browser metadata extracted from the user agent.`}),displayScreenSchema=zod.z.object({height:zod.z.number(),width:zod.z.number(),orientation:zod.z.string().optional()}).meta({id:`Screen`,title:`Screen`}),displaySchema=zod.z.object({screen:displayScreenSchema}).meta({id:`Display`,title:`Display`}),browserMetadataSchema=zod.z.object({language:zod.z.string().optional(),timezone:zod.z.string().optional(),display:displaySchema}).meta({id:`BrowserMetadata`,title:`BrowserMetadata`,description:`Browser locale and display metadata.`}),browserContextSchema=zod.z.object({runtime:zod.z.literal(`browser`),browser:browserMetadataSchema.nullable(),device:deviceMetadataSchema.nullable()}).meta({id:`BrowserContext`,title:`BrowserContext`,description:`Request context for the browser runtime.`});exports.browserContextSchema=browserContextSchema,exports.deviceMetadataSchema=deviceMetadataSchema;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/sdk/plugins/context/browser.d.ts
|
|
4
|
+
declare const deviceMetadataSchema: z.ZodObject<{
|
|
5
|
+
browser: z.ZodObject<{
|
|
6
|
+
major: z.ZodOptional<z.ZodString>;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
type: z.ZodOptional<z.ZodString>;
|
|
9
|
+
version: z.ZodOptional<z.ZodString>;
|
|
10
|
+
fullVersion: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
cpu: z.ZodObject<{
|
|
13
|
+
architecture: z.ZodOptional<z.ZodString>;
|
|
14
|
+
bitness: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
device: z.ZodObject<{
|
|
17
|
+
model: z.ZodOptional<z.ZodString>;
|
|
18
|
+
type: z.ZodOptional<z.ZodString>;
|
|
19
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
engine: z.ZodObject<{
|
|
22
|
+
name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
version: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
os: z.ZodObject<{
|
|
26
|
+
name: z.ZodOptional<z.ZodString>;
|
|
27
|
+
version: z.ZodOptional<z.ZodString>;
|
|
28
|
+
versionFull: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
ua: z.ZodString;
|
|
31
|
+
frozenUa: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type DeviceMetadata = z.infer<typeof deviceMetadataSchema>;
|
|
34
|
+
declare const browserMetadataSchema: z.ZodObject<{
|
|
35
|
+
language: z.ZodOptional<z.ZodString>;
|
|
36
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
37
|
+
display: z.ZodObject<{
|
|
38
|
+
screen: z.ZodObject<{
|
|
39
|
+
height: z.ZodNumber;
|
|
40
|
+
width: z.ZodNumber;
|
|
41
|
+
orientation: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
type BrowserMetadata = z.infer<typeof browserMetadataSchema>;
|
|
46
|
+
declare const browserContextSchema: z.ZodObject<{
|
|
47
|
+
runtime: z.ZodLiteral<"browser">;
|
|
48
|
+
browser: z.ZodNullable<z.ZodObject<{
|
|
49
|
+
language: z.ZodOptional<z.ZodString>;
|
|
50
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
51
|
+
display: z.ZodObject<{
|
|
52
|
+
screen: z.ZodObject<{
|
|
53
|
+
height: z.ZodNumber;
|
|
54
|
+
width: z.ZodNumber;
|
|
55
|
+
orientation: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
device: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
browser: z.ZodObject<{
|
|
61
|
+
major: z.ZodOptional<z.ZodString>;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
type: z.ZodOptional<z.ZodString>;
|
|
64
|
+
version: z.ZodOptional<z.ZodString>;
|
|
65
|
+
fullVersion: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
cpu: z.ZodObject<{
|
|
68
|
+
architecture: z.ZodOptional<z.ZodString>;
|
|
69
|
+
bitness: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
device: z.ZodObject<{
|
|
72
|
+
model: z.ZodOptional<z.ZodString>;
|
|
73
|
+
type: z.ZodOptional<z.ZodString>;
|
|
74
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
engine: z.ZodObject<{
|
|
77
|
+
name: z.ZodOptional<z.ZodString>;
|
|
78
|
+
version: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
os: z.ZodObject<{
|
|
81
|
+
name: z.ZodOptional<z.ZodString>;
|
|
82
|
+
version: z.ZodOptional<z.ZodString>;
|
|
83
|
+
versionFull: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
ua: z.ZodString;
|
|
86
|
+
frozenUa: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
type BrowserContext = z.infer<typeof browserContextSchema>;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
|
|
92
|
+
//# sourceMappingURL=browser.d.cts.map
|
|
@@ -88,4 +88,5 @@ declare const browserContextSchema: z.ZodObject<{
|
|
|
88
88
|
}, z.core.$strip>;
|
|
89
89
|
type BrowserContext = z.infer<typeof browserContextSchema>;
|
|
90
90
|
//#endregion
|
|
91
|
-
export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
|
|
91
|
+
export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
|
|
92
|
+
//# sourceMappingURL=browser.d.mts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{z
|
|
1
|
+
import{z}from"zod";const deviceBrowserSchema=z.object({major:z.string().optional(),name:z.string().optional(),type:z.string().optional(),version:z.string().optional(),fullVersion:z.string().optional()}).meta({id:`DeviceBrowser`,title:`DeviceBrowser`}),deviceCpuSchema=z.object({architecture:z.string().optional(),bitness:z.string().optional()}).meta({id:`DeviceCpu`,title:`DeviceCpu`}),deviceInfoSchema=z.object({model:z.string().optional(),type:z.string().optional(),vendor:z.string().optional()}).meta({id:`DeviceInfo`,title:`DeviceInfo`}),deviceEngineSchema=z.object({name:z.string().optional(),version:z.string().optional()}).meta({id:`DeviceEngine`,title:`DeviceEngine`}),deviceOsSchema=z.object({name:z.string().optional(),version:z.string().optional(),versionFull:z.string().optional()}).meta({id:`DeviceOs`,title:`DeviceOs`}),deviceMetadataSchema=z.object({browser:deviceBrowserSchema,cpu:deviceCpuSchema,device:deviceInfoSchema,engine:deviceEngineSchema,os:deviceOsSchema,ua:z.string(),frozenUa:z.boolean().optional()}).meta({id:`DeviceMetadata`,title:`DeviceMetadata`,description:`Device/browser metadata extracted from the user agent.`}),displayScreenSchema=z.object({height:z.number(),width:z.number(),orientation:z.string().optional()}).meta({id:`Screen`,title:`Screen`}),displaySchema=z.object({screen:displayScreenSchema}).meta({id:`Display`,title:`Display`}),browserMetadataSchema=z.object({language:z.string().optional(),timezone:z.string().optional(),display:displaySchema}).meta({id:`BrowserMetadata`,title:`BrowserMetadata`,description:`Browser locale and display metadata.`}),browserContextSchema=z.object({runtime:z.literal(`browser`),browser:browserMetadataSchema.nullable(),device:deviceMetadataSchema.nullable()}).meta({id:`BrowserContext`,title:`BrowserContext`,description:`Request context for the browser runtime.`});export{browserContextSchema,deviceMetadataSchema};
|
|
2
|
+
//# sourceMappingURL=browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const edgeContextSchema=zod.z.object({runtime:zod.z.literal(`edge`)}).meta({id:`EdgeContext`,title:`EdgeContext`,description:`Request context for the Edge runtime.`});exports.edgeContextSchema=edgeContextSchema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/sdk/plugins/context/edge.d.ts
|
|
4
|
+
declare const edgeContextSchema: z.ZodObject<{
|
|
5
|
+
runtime: z.ZodLiteral<"edge">;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type EdgeContext = z.infer<typeof edgeContextSchema>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { EdgeContext, edgeContextSchema };
|
|
10
|
+
//# sourceMappingURL=edge.d.cts.map
|