@interfere/types 4.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.
- package/dist/data/source-maps.d.mts +2 -2
- package/dist/data/source-maps.mjs +1 -1
- package/dist/data/source-maps.mjs.map +1 -1
- package/dist/events/error.d.mts +2 -1
- package/dist/events/error.d.mts.map +1 -1
- package/dist/events/error.mjs +3 -2
- package/dist/events/error.mjs.map +1 -1
- package/dist/events/replay-chunk.d.mts +1 -0
- package/dist/events/replay-chunk.d.mts.map +1 -1
- package/dist/events/replay-chunk.mjs +2 -1
- package/dist/events/replay-chunk.mjs.map +1 -1
- package/dist/releases/definition.d.mts +1 -0
- package/dist/releases/definition.d.mts.map +1 -1
- package/dist/releases/definition.mjs +2 -1
- package/dist/releases/definition.mjs.map +1 -1
- package/dist/sdk/config.d.mts +6 -6
- package/dist/sdk/envelope.d.mts +2 -0
- package/dist/sdk/envelope.d.mts.map +1 -1
- package/dist/sdk/envelope.mjs +1 -0
- package/dist/sdk/envelope.mjs.map +1 -1
- package/dist/sdk/plugins/manifest.d.mts +1 -1
- package/dist/sdk/plugins/manifest.mjs +1 -1
- package/dist/sdk/plugins/manifest.mjs.map +1 -1
- package/dist/sdk/remote-config.d.mts +11 -0
- package/dist/sdk/remote-config.d.mts.map +1 -0
- package/dist/sdk/remote-config.mjs +5 -0
- package/dist/sdk/remote-config.mjs.map +1 -0
- package/package.json +5 -5
- package/dist/events/index.d.mts +0 -392
- package/dist/events/index.d.mts.map +0 -1
- package/dist/events/index.mjs +0 -82
- package/dist/events/index.mjs.map +0 -1
|
@@ -16,7 +16,7 @@ declare const sourceMapManifestEntrySchema: z.ZodObject<{
|
|
|
16
16
|
relativePath: z.ZodString;
|
|
17
17
|
generatedFile: z.ZodString;
|
|
18
18
|
hash: z.ZodString;
|
|
19
|
-
|
|
19
|
+
objectKey: z.ZodString;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
type SourceMapManifestEntry = z.infer<typeof sourceMapManifestEntrySchema>;
|
|
22
22
|
declare const sourceMapManifestSchema: z.ZodObject<{
|
|
@@ -29,7 +29,7 @@ declare const sourceMapManifestSchema: z.ZodObject<{
|
|
|
29
29
|
relativePath: z.ZodString;
|
|
30
30
|
generatedFile: z.ZodString;
|
|
31
31
|
hash: z.ZodString;
|
|
32
|
-
|
|
32
|
+
objectKey: z.ZodString;
|
|
33
33
|
}, z.core.$strip>>;
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nexport const getSourceMapPath = ({\n organizationId,\n surfaceId,\n buildId,\n relativePath,\n}: {\n organizationId: string;\n surfaceId: string;\n buildId: string;\n relativePath: string;\n}) =>\n `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/${relativePath}`;\n\nexport const sourceMapManifestEntrySchema = z.object({\n relativePath: z.string(),\n generatedFile: z.string(),\n hash: z.string(),\n
|
|
1
|
+
{"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nexport const getSourceMapPath = ({\n organizationId,\n surfaceId,\n buildId,\n relativePath,\n}: {\n organizationId: string;\n surfaceId: string;\n buildId: string;\n relativePath: string;\n}) =>\n `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/${relativePath}`;\n\nexport const sourceMapManifestEntrySchema = z.object({\n relativePath: z.string(),\n generatedFile: z.string(),\n hash: z.string(),\n objectKey: z.string(),\n});\n\nexport type SourceMapManifestEntry = z.infer<\n typeof sourceMapManifestEntrySchema\n>;\n\nexport const sourceMapManifestSchema = z.object({\n buildId: z.string(),\n releaseId: z.string().optional(),\n surfaceId: z.string(),\n organizationId: z.string(),\n createdAt: z.number(),\n files: z.array(sourceMapManifestEntrySchema),\n});\n\nexport type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;\n\nexport const getManifestPath = ({\n organizationId,\n surfaceId,\n buildId,\n}: {\n organizationId: string;\n surfaceId: string;\n buildId: string;\n}) =>\n `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/_manifest.json`;\n"],"mappings":";;AAEA,MAAa,oBAAoB,EAC/B,gBACA,WACA,SACA,mBAOA,oBAAoB,eAAe,YAAY,UAAU,UAAU,QAAQ,GAAG;AAEhF,MAAa,+BAA+B,EAAE,OAAO;CACnD,cAAc,EAAE,QAAQ;CACxB,eAAe,EAAE,QAAQ;CACzB,MAAM,EAAE,QAAQ;CAChB,WAAW,EAAE,QAAQ;CACtB,CAAC;AAMF,MAAa,0BAA0B,EAAE,OAAO;CAC9C,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,WAAW,EAAE,QAAQ;CACrB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,OAAO,EAAE,MAAM,6BAA6B;CAC7C,CAAC;AAIF,MAAa,mBAAmB,EAC9B,gBACA,WACA,cAMA,oBAAoB,eAAe,YAAY,UAAU,UAAU,QAAQ"}
|
package/dist/events/error.d.mts
CHANGED
|
@@ -46,7 +46,8 @@ declare const errorFactsPayloadSchema: z.ZodObject<{
|
|
|
46
46
|
handled: z.ZodBoolean;
|
|
47
47
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
}, z.core.$strip>>;
|
|
49
|
-
|
|
49
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
50
51
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
51
52
|
"Pages Router": "Pages Router";
|
|
52
53
|
"App Router": "App Router";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/events/error.ts"],"mappings":";;;cAIM,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;KAcb,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/events/error.ts"],"mappings":";;;cAIM,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;KAcb,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAkC9B,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgBxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA"}
|
package/dist/events/error.mjs
CHANGED
|
@@ -19,7 +19,8 @@ const errorMechanismSchema = z.object({
|
|
|
19
19
|
handled: z.boolean(),
|
|
20
20
|
synthetic: z.boolean().optional()
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const errorContextSchema = z.object({
|
|
23
|
+
framework: z.string().optional(),
|
|
23
24
|
routerKind: z.enum(["Pages Router", "App Router"]).optional(),
|
|
24
25
|
routePath: z.string().optional(),
|
|
25
26
|
routeType: z.enum([
|
|
@@ -53,7 +54,7 @@ const errorFactsPayloadSchema = z.object({
|
|
|
53
54
|
name: z.string().nullable(),
|
|
54
55
|
stack: z.string().nullable(),
|
|
55
56
|
mechanism: errorMechanismSchema.optional(),
|
|
56
|
-
|
|
57
|
+
context: errorContextSchema.optional(),
|
|
57
58
|
captureSource: z.string().optional(),
|
|
58
59
|
fingerprintComponents: fingerprintSchema.optional(),
|
|
59
60
|
runtime: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\nconst enrichedFrameSchema = z.object({\n file: z.string().nullable(),\n line: z.number().nullable(),\n column: z.number().nullable(),\n fn: z.string().nullable(),\n originalFile: z.string().nullable(),\n originalLine: z.number().nullable(),\n originalColumn: z.number().nullable(),\n originalName: z.string().nullable(),\n sourceMapFound: z.boolean(),\n inApp: z.boolean(),\n rawId: z.string(),\n});\n\nexport type EnrichedFrame = z.infer<typeof enrichedFrameSchema>;\n\nconst errorMechanismSchema = z.object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n});\n\nconst
|
|
1
|
+
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\nconst enrichedFrameSchema = z.object({\n file: z.string().nullable(),\n line: z.number().nullable(),\n column: z.number().nullable(),\n fn: z.string().nullable(),\n originalFile: z.string().nullable(),\n originalLine: z.number().nullable(),\n originalColumn: z.number().nullable(),\n originalName: z.string().nullable(),\n sourceMapFound: z.boolean(),\n inApp: z.boolean(),\n rawId: z.string(),\n});\n\nexport type EnrichedFrame = z.infer<typeof enrichedFrameSchema>;\n\nconst errorMechanismSchema = z.object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n});\n\nconst errorContextSchema = z.object({\n framework: z.string().optional(),\n routerKind: z.enum([\"Pages Router\", \"App Router\"]).optional(),\n routePath: z.string().optional(),\n routeType: z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .optional(),\n renderSource: z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .optional(),\n revalidateReason: z.enum([\"on-demand\", \"stale\"]).optional(),\n renderType: z.enum([\"dynamic\", \"dynamic-resume\"]).optional(),\n requestPath: z.string().optional(),\n requestMethod: z.string().optional(),\n errorDigest: z.string().optional(),\n});\n\nconst fingerprintSchema = z.object({\n hash: z.string(),\n components: z.array(z.string()),\n});\n\nexport const errorFactsPayloadSchema = z.object({\n frames: z.array(ingestedFrame),\n enrichedFrames: z.array(enrichedFrameSchema).optional(),\n frameCount: z.number().optional(),\n enrichedFrameCount: z.number().optional(),\n message: z.string().nullable(),\n name: z.string().nullable(),\n stack: z.string().nullable(),\n mechanism: errorMechanismSchema.optional(),\n context: errorContextSchema.optional(),\n captureSource: z.string().optional(),\n fingerprintComponents: fingerprintSchema.optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type ErrorFactsPayload = z.infer<typeof errorFactsPayloadSchema>;\n"],"mappings":";;;AAIA,MAAM,sBAAsB,EAAE,OAAO;CACnC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,IAAI,EAAE,QAAQ,CAAC,UAAU;CACzB,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,gBAAgB,EAAE,SAAS;CAC3B,OAAO,EAAE,SAAS;CAClB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAIF,MAAM,uBAAuB,EAAE,OAAO;CACpC,MAAM,EAAE,QAAQ;CAChB,SAAS,EAAE,SAAS;CACpB,WAAW,EAAE,SAAS,CAAC,UAAU;CAClC,CAAC;AAEF,MAAM,qBAAqB,EAAE,OAAO;CAClC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,YAAY,EAAE,KAAK,CAAC,gBAAgB,aAAa,CAAC,CAAC,UAAU;CAC7D,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,WAAW,EACR,KAAK;EAAC;EAAU;EAAS;EAAU;EAAc;EAAQ,CAAC,CAC1D,UAAU;CACb,cAAc,EACX,KAAK;EACJ;EACA;EACA;EACD,CAAC,CACD,UAAU;CACb,kBAAkB,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC,CAAC,UAAU;CAC3D,YAAY,EAAE,KAAK,CAAC,WAAW,iBAAiB,CAAC,CAAC,UAAU;CAC5D,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,aAAa,EAAE,QAAQ,CAAC,UAAU;CACnC,CAAC;AAEF,MAAM,oBAAoB,EAAE,OAAO;CACjC,MAAM,EAAE,QAAQ;CAChB,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC;CAChC,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO;CAC9C,QAAQ,EAAE,MAAM,cAAc;CAC9B,gBAAgB,EAAE,MAAM,oBAAoB,CAAC,UAAU;CACvD,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,oBAAoB,EAAE,QAAQ,CAAC,UAAU;CACzC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,WAAW,qBAAqB,UAAU;CAC1C,SAAS,mBAAmB,UAAU;CACtC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,uBAAuB,kBAAkB,UAAU;CACnD,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC5C,CAAC"}
|
|
@@ -9,6 +9,7 @@ declare const replayChunkFactsPayloadSchema: z.ZodObject<{
|
|
|
9
9
|
chunk_count: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
runtime: z.ZodOptional<z.ZodString>;
|
|
11
11
|
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
objectKey: z.ZodOptional<z.ZodString>;
|
|
12
13
|
}, z.core.$strip>;
|
|
13
14
|
type ReplayChunkFactsPayload = z.infer<typeof replayChunkFactsPayloadSchema>;
|
|
14
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay-chunk.d.mts","names":[],"sources":["../../src/events/replay-chunk.ts"],"mappings":";;;cAEa,6BAAA,EAA6B,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"replay-chunk.d.mts","names":[],"sources":["../../src/events/replay-chunk.ts"],"mappings":";;;cAEa,6BAAA,EAA6B,CAAA,CAAA,SAAA;;;;;;;;;;KAW9B,uBAAA,GAA0B,CAAA,CAAE,KAAA,QAC/B,6BAAA"}
|
|
@@ -7,7 +7,8 @@ const replayChunkFactsPayloadSchema = z.object({
|
|
|
7
7
|
last_event_ts: z.number().optional(),
|
|
8
8
|
chunk_count: z.number().optional(),
|
|
9
9
|
runtime: z.string().optional(),
|
|
10
|
-
releaseId: z.string().nullable().optional()
|
|
10
|
+
releaseId: z.string().nullable().optional(),
|
|
11
|
+
objectKey: z.string().optional()
|
|
11
12
|
});
|
|
12
13
|
//#endregion
|
|
13
14
|
export { replayChunkFactsPayloadSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay-chunk.mjs","names":[],"sources":["../../src/events/replay-chunk.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nexport const replayChunkFactsPayloadSchema = z.object({\n ts: z.number(),\n count: z.number(),\n first_event_ts: z.number().optional(),\n last_event_ts: z.number().optional(),\n chunk_count: z.number().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type ReplayChunkFactsPayload = z.infer<\n typeof replayChunkFactsPayloadSchema\n>;\n"],"mappings":";;AAEA,MAAa,gCAAgC,EAAE,OAAO;CACpD,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"replay-chunk.mjs","names":[],"sources":["../../src/events/replay-chunk.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nexport const replayChunkFactsPayloadSchema = z.object({\n ts: z.number(),\n count: z.number(),\n first_event_ts: z.number().optional(),\n last_event_ts: z.number().optional(),\n chunk_count: z.number().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n objectKey: z.string().optional(),\n});\n\nexport type ReplayChunkFactsPayload = z.infer<\n typeof replayChunkFactsPayloadSchema\n>;\n"],"mappings":";;AAEA,MAAa,gCAAgC,EAAE,OAAO;CACpD,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC3C,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC"}
|
|
@@ -25,6 +25,7 @@ declare const createReleaseRequest: z.ZodObject<{
|
|
|
25
25
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
26
26
|
}, z.core.$strip>], "provider">>;
|
|
27
27
|
buildId: z.ZodString;
|
|
28
|
+
producerVersion: z.ZodOptional<z.ZodString>;
|
|
28
29
|
}, z.core.$strip>;
|
|
29
30
|
type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
30
31
|
declare const createReleaseResponse: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.mts","names":[],"sources":["../../src/releases/definition.ts"],"mappings":";;;cAOa,mBAAA,EAAmB,CAAA,CAAA,OAAA;;;;;;;cAQnB,oBAAA,EAAoB,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"definition.d.mts","names":[],"sources":["../../src/releases/definition.ts"],"mappings":";;;cAOa,mBAAA,EAAmB,CAAA,CAAA,OAAA;;;;;;;cAQnB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;KAOrB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAErC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KAsBtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA"}
|
|
@@ -11,7 +11,8 @@ const releaseStatusSchema = z.enum([
|
|
|
11
11
|
const createReleaseRequest = z.object({
|
|
12
12
|
source: releaseSourceMetadataSchema,
|
|
13
13
|
destination: releaseDestinationMetadataSchema.nullable(),
|
|
14
|
-
buildId: z.string()
|
|
14
|
+
buildId: z.string(),
|
|
15
|
+
producerVersion: z.string().optional()
|
|
15
16
|
});
|
|
16
17
|
const createReleaseResponse = z.object({
|
|
17
18
|
org: z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport {\n releaseDestinationMetadataSchema,\n releaseSourceMetadataSchema,\n} from \"../integrations\";\n\nexport const releaseStatusSchema = z.enum([\n \"pending\",\n \"uploading\",\n \"processing\",\n \"ready\",\n \"failed\",\n]);\n\nexport const createReleaseRequest = z.object({\n source: releaseSourceMetadataSchema,\n destination: releaseDestinationMetadataSchema.nullable(),\n buildId: z.string(),\n});\n\nexport type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;\n\nexport const createReleaseResponse = z.object({\n org: z.object({\n id: z.string(),\n slug: z.string(),\n }),\n surface: z.object({\n id: z.string(),\n slug: z.string(),\n }),\n source: z.object({\n id: z.string(),\n }),\n destination: z.object({\n id: z.string(),\n slug: z.string(),\n environment: z.string().nullable(),\n }),\n build: z.object({\n hash: z.string(),\n }),\n});\n\nexport type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;\n"],"mappings":";;;AAOA,MAAa,sBAAsB,EAAE,KAAK;CACxC;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,QAAQ;CACR,aAAa,iCAAiC,UAAU;CACxD,SAAS,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport {\n releaseDestinationMetadataSchema,\n releaseSourceMetadataSchema,\n} from \"../integrations\";\n\nexport const releaseStatusSchema = z.enum([\n \"pending\",\n \"uploading\",\n \"processing\",\n \"ready\",\n \"failed\",\n]);\n\nexport const createReleaseRequest = z.object({\n source: releaseSourceMetadataSchema,\n destination: releaseDestinationMetadataSchema.nullable(),\n buildId: z.string(),\n producerVersion: z.string().optional(),\n});\n\nexport type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;\n\nexport const createReleaseResponse = z.object({\n org: z.object({\n id: z.string(),\n slug: z.string(),\n }),\n surface: z.object({\n id: z.string(),\n slug: z.string(),\n }),\n source: z.object({\n id: z.string(),\n }),\n destination: z.object({\n id: z.string(),\n slug: z.string(),\n environment: z.string().nullable(),\n }),\n build: z.object({\n hash: z.string(),\n }),\n});\n\nexport type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;\n"],"mappings":";;;AAOA,MAAa,sBAAsB,EAAE,KAAK;CACxC;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,QAAQ;CACR,aAAa,iCAAiC,UAAU;CACxD,SAAS,EAAE,QAAQ;CACnB,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACvC,CAAC;AAIF,MAAa,wBAAwB,EAAE,OAAO;CAC5C,KAAK,EAAE,OAAO;EACZ,IAAI,EAAE,QAAQ;EACd,MAAM,EAAE,QAAQ;EACjB,CAAC;CACF,SAAS,EAAE,OAAO;EAChB,IAAI,EAAE,QAAQ;EACd,MAAM,EAAE,QAAQ;EACjB,CAAC;CACF,QAAQ,EAAE,OAAO,EACf,IAAI,EAAE,QAAQ,EACf,CAAC;CACF,aAAa,EAAE,OAAO;EACpB,IAAI,EAAE,QAAQ;EACd,MAAM,EAAE,QAAQ;EAChB,aAAa,EAAE,QAAQ,CAAC,UAAU;EACnC,CAAC;CACF,OAAO,EAAE,OAAO,EACd,MAAM,EAAE,QAAQ,EACjB,CAAC;CACH,CAAC"}
|
package/dist/sdk/config.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ declare const apiBaseUrlSchema: z.ZodUnion<readonly [z.ZodString, z.ZodEnum<{
|
|
|
12
12
|
}>]>;
|
|
13
13
|
declare const featuresSchema: z.ZodDefault<z.ZodObject<{
|
|
14
14
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
15
|
-
|
|
15
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
16
16
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
17
17
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
18
18
|
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -21,7 +21,7 @@ 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
23
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
24
|
-
|
|
24
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
25
25
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
26
26
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
27
27
|
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -57,7 +57,7 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
57
57
|
}, z.core.$strip>]>>, z.ZodTransform<({
|
|
58
58
|
features: {
|
|
59
59
|
errors?: boolean | undefined;
|
|
60
|
-
|
|
60
|
+
device?: boolean | undefined;
|
|
61
61
|
pageEvents?: boolean | undefined;
|
|
62
62
|
rageClick?: boolean | undefined;
|
|
63
63
|
replay?: boolean | undefined;
|
|
@@ -82,7 +82,7 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
82
82
|
}) | ({
|
|
83
83
|
features: {
|
|
84
84
|
errors?: boolean | undefined;
|
|
85
|
-
|
|
85
|
+
device?: boolean | undefined;
|
|
86
86
|
pageEvents?: boolean | undefined;
|
|
87
87
|
rageClick?: boolean | undefined;
|
|
88
88
|
replay?: boolean | undefined;
|
|
@@ -108,7 +108,7 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
108
108
|
}), {
|
|
109
109
|
features: {
|
|
110
110
|
errors?: boolean | undefined;
|
|
111
|
-
|
|
111
|
+
device?: boolean | undefined;
|
|
112
112
|
pageEvents?: boolean | undefined;
|
|
113
113
|
rageClick?: boolean | undefined;
|
|
114
114
|
replay?: boolean | undefined;
|
|
@@ -138,7 +138,7 @@ 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
140
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
141
|
-
|
|
141
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
142
142
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
143
143
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
144
144
|
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
package/dist/sdk/envelope.d.mts
CHANGED
|
@@ -169,6 +169,7 @@ declare const envelopeSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
169
169
|
preview: "preview";
|
|
170
170
|
production: "production";
|
|
171
171
|
}>>;
|
|
172
|
+
producerVersion: z.ZodOptional<z.ZodString>;
|
|
172
173
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
173
174
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
174
175
|
browser: "browser";
|
|
@@ -327,6 +328,7 @@ declare const stampedEnvelopeSchema: z.ZodIntersection<z.ZodIntersection<z.ZodOb
|
|
|
327
328
|
preview: "preview";
|
|
328
329
|
production: "production";
|
|
329
330
|
}>>;
|
|
331
|
+
producerVersion: z.ZodOptional<z.ZodString>;
|
|
330
332
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
331
333
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
332
334
|
browser: "browser";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.d.mts","names":[],"sources":["../../src/sdk/envelope.ts"],"mappings":";;;cAiBM,eAAA,EAAe,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,UAAA;AAAA,KAET,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,eAAA;AAnBlB;;;;;;;;AAAA,cA6Bd,mBAAA,EAAmB,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;;KAIpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAE9B,qBAAA,EAAqB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"envelope.d.mts","names":[],"sources":["../../src/sdk/envelope.ts"],"mappings":";;;cAiBM,eAAA,EAAe,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,UAAA;AAAA,KAET,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,eAAA;AAnBlB;;;;;;;;AAAA,cA6Bd,mBAAA,EAAmB,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;;KAIpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAE9B,qBAAA,EAAqB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAgBhC,cAAA,EAAc,CAAA,CAAA,eAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BtB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,KAEvB,SAAA,GAAY,YAAA;AAAA,KAEZ,QAAA,WAAmB,SAAA,4BAC7B,CAAA,SAAU,SAAA,GAAY,OAAA,CAAQ,YAAA;EAAgB,IAAA,EAAM,CAAA;AAAA,KAAO,YAAA;AAAA,KAEjD,eAAA,WAA0B,SAAA,IAAa,QAAA,CAAS,CAAA;AAAA,cAE/C,qBAAA,EAAqB,CAAA,CAAA,eAAA,CAAA,CAAA,CAAA,eAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA"}
|
package/dist/sdk/envelope.mjs
CHANGED
|
@@ -35,6 +35,7 @@ const envelopeSchema = z.object({
|
|
|
35
35
|
clientTs: z.int(),
|
|
36
36
|
context: envelopeContextSchema.optional(),
|
|
37
37
|
environment: envSchema,
|
|
38
|
+
producerVersion: z.string().optional(),
|
|
38
39
|
releaseId: z.string().nullable(),
|
|
39
40
|
runtime: runtimeSchema,
|
|
40
41
|
sessionId: sessionIdSchema.nullable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.mjs","names":[],"sources":["../../src/sdk/envelope.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport { sessionIdSchema } from \"#data/session\";\nimport { surfaceSlugSchema } from \"#data/surface\";\nimport { browserContextSchema } from \"#sdk/plugins/context/browser\";\nimport { edgeContextSchema } from \"#sdk/plugins/context/edge\";\nimport { nextjsContextSchema } from \"#sdk/plugins/context/next\";\nimport { errorEnvelopePayloadSchema } from \"#sdk/plugins/payload/errors\";\nimport {\n pageleavePayloadSchema,\n pageviewPayloadSchema,\n uiEventPayloadSchema,\n} from \"#sdk/plugins/payload/page-events\";\nimport { rageClickPayloadSchema } from \"#sdk/plugins/payload/rage-click\";\nimport { replayChunkPayloadSchema } from \"#sdk/plugins/payload/replay\";\nimport { envSchema, runtimeSchema } from \"#sdk/runtime\";\n\nconst envelopeVersion = z.union([z.literal(0)]);\n\nexport type EnvelopeVersion = z.infer<typeof envelopeVersion>;\n\n/**\n * Indicates how the sessionId was resolved on the server.\n *\n * - \"header\": Extracted from x-interfere-request header (ideal case)\n * - \"async_context\": Retrieved from AsyncLocalStorage context\n * - \"fallback\": Generated as server-side fallback (breaks session continuity)\n * - \"client\": Session ID was set on the client (browser SDK)\n */\nexport const sessionSourceSchema = z\n .enum([\"header\", \"async_context\", \"fallback\", \"client\"])\n .optional();\n\nexport type SessionSource = z.infer<typeof sessionSourceSchema>;\n\nexport const envelopeContextSchema = z.discriminatedUnion(\"runtime\", [\n browserContextSchema,\n nextjsContextSchema,\n edgeContextSchema,\n]);\n\nexport type EnvelopeContext = z.infer<typeof envelopeContextSchema>;\n\nconst envelopeHeadersSchema = z.object({\n buildId: z.string(),\n clientTs: z.int(),\n context: envelopeContextSchema.optional(),\n environment: envSchema,\n releaseId: z.string().nullable(),\n runtime: runtimeSchema,\n sessionId: sessionIdSchema.nullable(),\n sessionSource: sessionSourceSchema,\n uuid: z.uuidv7(),\n v: envelopeVersion,\n});\n\nexport const envelopeSchema = envelopeHeadersSchema.and(\n z.discriminatedUnion(\"type\", [\n z.object({\n payload: errorEnvelopePayloadSchema,\n type: z.literal(\"error\"),\n }),\n z.object({\n payload: pageviewPayloadSchema,\n type: z.literal(\"pageview\"),\n }),\n z.object({\n payload: pageleavePayloadSchema,\n type: z.literal(\"pageleave\"),\n }),\n z.object({\n payload: uiEventPayloadSchema,\n type: z.literal(\"ui_event\"),\n }),\n z.object({\n payload: replayChunkPayloadSchema,\n type: z.literal(\"replay_chunk\"),\n }),\n z.object({\n payload: rageClickPayloadSchema,\n type: z.literal(\"rage_click\"),\n }),\n ])\n);\n\ntype EnvelopeBase = z.infer<typeof envelopeSchema>;\n\nexport type EventType = EnvelopeBase[\"type\"];\n\nexport type Envelope<T extends EventType | undefined = undefined> =\n T extends EventType ? Extract<EnvelopeBase, { type: T }> : EnvelopeBase;\n\nexport type EnvelopePayload<T extends EventType> = Envelope<T>[\"payload\"];\n\nexport const stampedEnvelopeSchema = z.intersection(\n envelopeSchema,\n z.object({\n surfaceSlug: surfaceSlugSchema,\n })\n);\n\nexport type StampedEnvelope = z.infer<typeof stampedEnvelopeSchema>;\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAM,kBAAkB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;;;;;;;;;AAY/C,MAAa,sBAAsB,EAChC,KAAK;CAAC;CAAU;CAAiB;CAAY;CAAS,CAAC,CACvD,UAAU;AAIb,MAAa,wBAAwB,EAAE,mBAAmB,WAAW;CACnE;CACA;CACA;CACD,CAAC;
|
|
1
|
+
{"version":3,"file":"envelope.mjs","names":[],"sources":["../../src/sdk/envelope.ts"],"sourcesContent":["import { z } from \"zod/v4\";\n\nimport { sessionIdSchema } from \"#data/session\";\nimport { surfaceSlugSchema } from \"#data/surface\";\nimport { browserContextSchema } from \"#sdk/plugins/context/browser\";\nimport { edgeContextSchema } from \"#sdk/plugins/context/edge\";\nimport { nextjsContextSchema } from \"#sdk/plugins/context/next\";\nimport { errorEnvelopePayloadSchema } from \"#sdk/plugins/payload/errors\";\nimport {\n pageleavePayloadSchema,\n pageviewPayloadSchema,\n uiEventPayloadSchema,\n} from \"#sdk/plugins/payload/page-events\";\nimport { rageClickPayloadSchema } from \"#sdk/plugins/payload/rage-click\";\nimport { replayChunkPayloadSchema } from \"#sdk/plugins/payload/replay\";\nimport { envSchema, runtimeSchema } from \"#sdk/runtime\";\n\nconst envelopeVersion = z.union([z.literal(0)]);\n\nexport type EnvelopeVersion = z.infer<typeof envelopeVersion>;\n\n/**\n * Indicates how the sessionId was resolved on the server.\n *\n * - \"header\": Extracted from x-interfere-request header (ideal case)\n * - \"async_context\": Retrieved from AsyncLocalStorage context\n * - \"fallback\": Generated as server-side fallback (breaks session continuity)\n * - \"client\": Session ID was set on the client (browser SDK)\n */\nexport const sessionSourceSchema = z\n .enum([\"header\", \"async_context\", \"fallback\", \"client\"])\n .optional();\n\nexport type SessionSource = z.infer<typeof sessionSourceSchema>;\n\nexport const envelopeContextSchema = z.discriminatedUnion(\"runtime\", [\n browserContextSchema,\n nextjsContextSchema,\n edgeContextSchema,\n]);\n\nexport type EnvelopeContext = z.infer<typeof envelopeContextSchema>;\n\nconst envelopeHeadersSchema = z.object({\n buildId: z.string(),\n clientTs: z.int(),\n context: envelopeContextSchema.optional(),\n environment: envSchema,\n producerVersion: z.string().optional(),\n releaseId: z.string().nullable(),\n runtime: runtimeSchema,\n sessionId: sessionIdSchema.nullable(),\n sessionSource: sessionSourceSchema,\n uuid: z.uuidv7(),\n v: envelopeVersion,\n});\n\nexport const envelopeSchema = envelopeHeadersSchema.and(\n z.discriminatedUnion(\"type\", [\n z.object({\n payload: errorEnvelopePayloadSchema,\n type: z.literal(\"error\"),\n }),\n z.object({\n payload: pageviewPayloadSchema,\n type: z.literal(\"pageview\"),\n }),\n z.object({\n payload: pageleavePayloadSchema,\n type: z.literal(\"pageleave\"),\n }),\n z.object({\n payload: uiEventPayloadSchema,\n type: z.literal(\"ui_event\"),\n }),\n z.object({\n payload: replayChunkPayloadSchema,\n type: z.literal(\"replay_chunk\"),\n }),\n z.object({\n payload: rageClickPayloadSchema,\n type: z.literal(\"rage_click\"),\n }),\n ])\n);\n\ntype EnvelopeBase = z.infer<typeof envelopeSchema>;\n\nexport type EventType = EnvelopeBase[\"type\"];\n\nexport type Envelope<T extends EventType | undefined = undefined> =\n T extends EventType ? Extract<EnvelopeBase, { type: T }> : EnvelopeBase;\n\nexport type EnvelopePayload<T extends EventType> = Envelope<T>[\"payload\"];\n\nexport const stampedEnvelopeSchema = z.intersection(\n envelopeSchema,\n z.object({\n surfaceSlug: surfaceSlugSchema,\n })\n);\n\nexport type StampedEnvelope = z.infer<typeof stampedEnvelopeSchema>;\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAM,kBAAkB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;;;;;;;;;AAY/C,MAAa,sBAAsB,EAChC,KAAK;CAAC;CAAU;CAAiB;CAAY;CAAS,CAAC,CACvD,UAAU;AAIb,MAAa,wBAAwB,EAAE,mBAAmB,WAAW;CACnE;CACA;CACA;CACD,CAAC;AAkBF,MAAa,iBAdiB,EAAE,OAAO;CACrC,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,KAAK;CACjB,SAAS,sBAAsB,UAAU;CACzC,aAAa;CACb,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,SAAS;CACT,WAAW,gBAAgB,UAAU;CACrC,eAAe;CACf,MAAM,EAAE,QAAQ;CAChB,GAAG;CACJ,CAAC,CAEkD,IAClD,EAAE,mBAAmB,QAAQ;CAC3B,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,QAAQ;EACzB,CAAC;CACF,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,WAAW;EAC5B,CAAC;CACF,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,YAAY;EAC7B,CAAC;CACF,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,WAAW;EAC5B,CAAC;CACF,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,eAAe;EAChC,CAAC;CACF,EAAE,OAAO;EACP,SAAS;EACT,MAAM,EAAE,QAAQ,aAAa;EAC9B,CAAC;CACH,CAAC,CACH;AAWD,MAAa,wBAAwB,EAAE,aACrC,gBACA,EAAE,OAAO,EACP,aAAa,mBACd,CAAC,CACH"}
|
|
@@ -13,7 +13,7 @@ declare const PLUGIN_MANIFEST: readonly [{
|
|
|
13
13
|
readonly consentCategory: "analytics";
|
|
14
14
|
readonly defaultEnabled: true;
|
|
15
15
|
readonly events: readonly [];
|
|
16
|
-
readonly name: "
|
|
16
|
+
readonly name: "device";
|
|
17
17
|
}, {
|
|
18
18
|
readonly consentCategory: "analytics";
|
|
19
19
|
readonly defaultEnabled: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../../src/sdk/plugins/manifest.ts"],"sourcesContent":["export const CONSENT_CATEGORIES = [\"necessary\", \"analytics\", \"replay\"] as const;\n\ntype AtLeastOne<T> = {\n [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>;\n}[keyof T];\n\nexport const PLUGIN_MANIFEST = [\n {\n consentCategory: \"necessary\",\n defaultEnabled: true,\n events: [{ enrich: true, name: \"error\" }],\n name: \"errors\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [],\n name: \"
|
|
1
|
+
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../../src/sdk/plugins/manifest.ts"],"sourcesContent":["export const CONSENT_CATEGORIES = [\"necessary\", \"analytics\", \"replay\"] as const;\n\ntype AtLeastOne<T> = {\n [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>;\n}[keyof T];\n\nexport const PLUGIN_MANIFEST = [\n {\n consentCategory: \"necessary\",\n defaultEnabled: true,\n events: [{ enrich: true, name: \"error\" }],\n name: \"errors\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [],\n name: \"device\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [\n { enrich: true, name: \"pageview\" },\n { enrich: true, name: \"pageleave\" },\n { enrich: true, name: \"ui_event\" },\n ],\n name: \"pageEvents\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [{ enrich: true, name: \"rage_click\" }],\n name: \"rageClick\",\n },\n {\n consentCategory: \"replay\",\n defaultEnabled: true,\n events: [{ enrich: false, name: \"replay_chunk\" }],\n name: \"replay\",\n },\n] as const;\n\nexport type PluginManifest = typeof PLUGIN_MANIFEST;\n\nexport type ConsentCategory = (typeof CONSENT_CATEGORIES)[number];\nexport type PluginKey = PluginManifest[number][\"name\"];\nexport type GateableCategory = Exclude<ConsentCategory, \"necessary\">;\nexport type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;\n"],"mappings":";AAAA,MAAa,qBAAqB;CAAC;CAAa;CAAa;CAAS;AAMtE,MAAa,kBAAkB;CAC7B;EACE,iBAAiB;EACjB,gBAAgB;EAChB,QAAQ,CAAC;GAAE,QAAQ;GAAM,MAAM;GAAS,CAAC;EACzC,MAAM;EACP;CACD;EACE,iBAAiB;EACjB,gBAAgB;EAChB,QAAQ,EAAE;EACV,MAAM;EACP;CACD;EACE,iBAAiB;EACjB,gBAAgB;EAChB,QAAQ;GACN;IAAE,QAAQ;IAAM,MAAM;IAAY;GAClC;IAAE,QAAQ;IAAM,MAAM;IAAa;GACnC;IAAE,QAAQ;IAAM,MAAM;IAAY;GACnC;EACD,MAAM;EACP;CACD;EACE,iBAAiB;EACjB,gBAAgB;EAChB,QAAQ,CAAC;GAAE,QAAQ;GAAM,MAAM;GAAc,CAAC;EAC9C,MAAM;EACP;CACD;EACE,iBAAiB;EACjB,gBAAgB;EAChB,QAAQ,CAAC;GAAE,QAAQ;GAAO,MAAM;GAAgB,CAAC;EACjD,MAAM;EACP;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventType } from "./envelope.mjs";
|
|
2
|
+
import { PluginKey } from "./plugins/manifest.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/sdk/remote-config.d.ts
|
|
5
|
+
type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;
|
|
6
|
+
interface RemoteConfig {
|
|
7
|
+
plugins: Record<PluginKey, boolean>;
|
|
8
|
+
}
|
|
9
|
+
declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-config.d.mts","names":[],"sources":["../../src/sdk/remote-config.ts"],"mappings":";;;;KAGY,kBAAA,GAAqB,OAAA,CAAQ,MAAA,CAAO,SAAA;AAAA,UAE/B,YAAA;EACf,OAAA,EAAS,MAAA,CAAO,SAAA;AAAA;AAAA,cAGL,oBAAA,EAAsB,MAAA,CAAO,SAAA,EAAW,SAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PLUGIN_MANIFEST } from "./plugins/manifest.mjs";
|
|
2
|
+
//#region src/sdk/remote-config.ts
|
|
3
|
+
const EVENT_TYPE_TO_PLUGIN = Object.fromEntries(PLUGIN_MANIFEST.flatMap((plugin) => plugin.events.map((event) => [event.name, plugin.name])));
|
|
4
|
+
//#endregion
|
|
5
|
+
export { EVENT_TYPE_TO_PLUGIN };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-config.mjs","names":[],"sources":["../../src/sdk/remote-config.ts"],"sourcesContent":["import type { EventType } from \"./envelope.js\";\nimport { PLUGIN_MANIFEST, type PluginKey } from \"./plugins/manifest.js\";\n\nexport type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;\n\nexport interface RemoteConfig {\n plugins: Record<PluginKey, boolean>;\n}\n\nexport const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey> =\n Object.fromEntries(\n PLUGIN_MANIFEST.flatMap((plugin) =>\n plugin.events.map((event) => [event.name, plugin.name])\n )\n ) as Record<EventType, PluginKey>;\n"],"mappings":";;AASA,MAAa,uBACX,OAAO,YACL,gBAAgB,SAAS,WACvB,OAAO,OAAO,KAAK,UAAU,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,CACxD,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "
|
|
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": "^
|
|
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": "^
|
|
115
|
-
"@interfere/vitest-config": "^
|
|
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.
|
|
118
|
+
"tsdown": "^0.21.4",
|
|
119
119
|
"typescript": "5.9.3",
|
|
120
120
|
"vitest": "^4.0.18"
|
|
121
121
|
}
|
package/dist/events/index.d.mts
DELETED
|
@@ -1,392 +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
|
-
nextjs: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
38
|
-
"Pages Router": "Pages Router";
|
|
39
|
-
"App Router": "App Router";
|
|
40
|
-
}>>;
|
|
41
|
-
routePath: z.ZodOptional<z.ZodString>;
|
|
42
|
-
routeType: z.ZodOptional<z.ZodEnum<{
|
|
43
|
-
render: "render";
|
|
44
|
-
route: "route";
|
|
45
|
-
action: "action";
|
|
46
|
-
middleware: "middleware";
|
|
47
|
-
proxy: "proxy";
|
|
48
|
-
}>>;
|
|
49
|
-
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
50
|
-
"react-server-components": "react-server-components";
|
|
51
|
-
"react-server-components-payload": "react-server-components-payload";
|
|
52
|
-
"server-rendering": "server-rendering";
|
|
53
|
-
}>>;
|
|
54
|
-
revalidateReason: z.ZodOptional<z.ZodEnum<{
|
|
55
|
-
"on-demand": "on-demand";
|
|
56
|
-
stale: "stale";
|
|
57
|
-
}>>;
|
|
58
|
-
renderType: z.ZodOptional<z.ZodEnum<{
|
|
59
|
-
dynamic: "dynamic";
|
|
60
|
-
"dynamic-resume": "dynamic-resume";
|
|
61
|
-
}>>;
|
|
62
|
-
requestPath: z.ZodOptional<z.ZodString>;
|
|
63
|
-
requestMethod: z.ZodOptional<z.ZodString>;
|
|
64
|
-
errorDigest: z.ZodOptional<z.ZodString>;
|
|
65
|
-
}, z.core.$strip>>;
|
|
66
|
-
captureSource: z.ZodOptional<z.ZodString>;
|
|
67
|
-
fingerprintComponents: z.ZodOptional<z.ZodObject<{
|
|
68
|
-
hash: z.ZodString;
|
|
69
|
-
components: z.ZodArray<z.ZodString>;
|
|
70
|
-
}, z.core.$strip>>;
|
|
71
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
72
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
readonly pageview: z.ZodObject<{
|
|
75
|
-
url: z.ZodString;
|
|
76
|
-
title: z.ZodOptional<z.ZodString>;
|
|
77
|
-
referrer: z.ZodOptional<z.ZodString>;
|
|
78
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
79
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
readonly pageleave: z.ZodObject<{
|
|
82
|
-
url: z.ZodString;
|
|
83
|
-
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
85
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
-
}, z.core.$strip>;
|
|
87
|
-
readonly ui_event: z.ZodObject<{
|
|
88
|
-
event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
89
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
90
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
readonly replay_chunk: z.ZodObject<{
|
|
93
|
-
ts: z.ZodNumber;
|
|
94
|
-
count: z.ZodNumber;
|
|
95
|
-
first_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
96
|
-
last_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
chunk_count: z.ZodOptional<z.ZodNumber>;
|
|
98
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
99
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
readonly session_summary: z.ZodObject<{
|
|
102
|
-
summary: z.ZodString;
|
|
103
|
-
pageTitle: z.ZodString;
|
|
104
|
-
pageUrl: z.ZodString;
|
|
105
|
-
contentLength: z.ZodNumber;
|
|
106
|
-
timestamp: z.ZodNumber;
|
|
107
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
108
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
readonly rage_click: z.ZodObject<{
|
|
111
|
-
count: z.ZodNumber;
|
|
112
|
-
timeWindow: z.ZodNumber;
|
|
113
|
-
selector: z.ZodString;
|
|
114
|
-
text: z.ZodString;
|
|
115
|
-
x: z.ZodNumber;
|
|
116
|
-
y: z.ZodNumber;
|
|
117
|
-
timestamp: z.ZodNumber;
|
|
118
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
119
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
readonly identify: z.ZodObject<{
|
|
122
|
-
identifier: z.ZodString;
|
|
123
|
-
email: z.ZodOptional<z.ZodString>;
|
|
124
|
-
name: z.ZodOptional<z.ZodString>;
|
|
125
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
126
|
-
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
127
|
-
}, z.core.$strip>;
|
|
128
|
-
};
|
|
129
|
-
type FactsEventType = keyof typeof factsPayloadSchemas;
|
|
130
|
-
declare const factsEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
131
|
-
uuid: z.ZodString;
|
|
132
|
-
organizationId: z.ZodString;
|
|
133
|
-
surfaceId: z.ZodString;
|
|
134
|
-
environment: z.ZodString;
|
|
135
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
136
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
137
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
138
|
-
edge: "edge";
|
|
139
|
-
client: "client";
|
|
140
|
-
server: "server";
|
|
141
|
-
}>>;
|
|
142
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
143
|
-
timestamp: z.ZodDate;
|
|
144
|
-
createdAt: z.ZodDate;
|
|
145
|
-
insertedAt: z.ZodDate;
|
|
146
|
-
event: z.ZodLiteral<"error">;
|
|
147
|
-
payload: z.ZodObject<{
|
|
148
|
-
frames: z.ZodArray<z.ZodObject<{
|
|
149
|
-
fileName: z.ZodOptional<z.ZodString>;
|
|
150
|
-
functionName: z.ZodOptional<z.ZodString>;
|
|
151
|
-
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
153
|
-
source: z.ZodOptional<z.ZodString>;
|
|
154
|
-
}, z.core.$strip>>;
|
|
155
|
-
enrichedFrames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
156
|
-
file: z.ZodNullable<z.ZodString>;
|
|
157
|
-
line: z.ZodNullable<z.ZodNumber>;
|
|
158
|
-
column: z.ZodNullable<z.ZodNumber>;
|
|
159
|
-
fn: z.ZodNullable<z.ZodString>;
|
|
160
|
-
originalFile: z.ZodNullable<z.ZodString>;
|
|
161
|
-
originalLine: z.ZodNullable<z.ZodNumber>;
|
|
162
|
-
originalColumn: z.ZodNullable<z.ZodNumber>;
|
|
163
|
-
originalName: z.ZodNullable<z.ZodString>;
|
|
164
|
-
sourceMapFound: z.ZodBoolean;
|
|
165
|
-
inApp: z.ZodBoolean;
|
|
166
|
-
rawId: z.ZodString;
|
|
167
|
-
}, z.core.$strip>>>;
|
|
168
|
-
frameCount: z.ZodOptional<z.ZodNumber>;
|
|
169
|
-
enrichedFrameCount: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
message: z.ZodNullable<z.ZodString>;
|
|
171
|
-
name: z.ZodNullable<z.ZodString>;
|
|
172
|
-
stack: z.ZodNullable<z.ZodString>;
|
|
173
|
-
mechanism: z.ZodOptional<z.ZodObject<{
|
|
174
|
-
type: z.ZodString;
|
|
175
|
-
handled: z.ZodBoolean;
|
|
176
|
-
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
-
}, z.core.$strip>>;
|
|
178
|
-
nextjs: z.ZodOptional<z.ZodObject<{
|
|
179
|
-
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
180
|
-
"Pages Router": "Pages Router";
|
|
181
|
-
"App Router": "App Router";
|
|
182
|
-
}>>;
|
|
183
|
-
routePath: z.ZodOptional<z.ZodString>;
|
|
184
|
-
routeType: z.ZodOptional<z.ZodEnum<{
|
|
185
|
-
render: "render";
|
|
186
|
-
route: "route";
|
|
187
|
-
action: "action";
|
|
188
|
-
middleware: "middleware";
|
|
189
|
-
proxy: "proxy";
|
|
190
|
-
}>>;
|
|
191
|
-
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
192
|
-
"react-server-components": "react-server-components";
|
|
193
|
-
"react-server-components-payload": "react-server-components-payload";
|
|
194
|
-
"server-rendering": "server-rendering";
|
|
195
|
-
}>>;
|
|
196
|
-
revalidateReason: z.ZodOptional<z.ZodEnum<{
|
|
197
|
-
"on-demand": "on-demand";
|
|
198
|
-
stale: "stale";
|
|
199
|
-
}>>;
|
|
200
|
-
renderType: z.ZodOptional<z.ZodEnum<{
|
|
201
|
-
dynamic: "dynamic";
|
|
202
|
-
"dynamic-resume": "dynamic-resume";
|
|
203
|
-
}>>;
|
|
204
|
-
requestPath: z.ZodOptional<z.ZodString>;
|
|
205
|
-
requestMethod: z.ZodOptional<z.ZodString>;
|
|
206
|
-
errorDigest: z.ZodOptional<z.ZodString>;
|
|
207
|
-
}, z.core.$strip>>;
|
|
208
|
-
captureSource: z.ZodOptional<z.ZodString>;
|
|
209
|
-
fingerprintComponents: z.ZodOptional<z.ZodObject<{
|
|
210
|
-
hash: z.ZodString;
|
|
211
|
-
components: z.ZodArray<z.ZodString>;
|
|
212
|
-
}, z.core.$strip>>;
|
|
213
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
214
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
-
}, z.core.$strip>;
|
|
216
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
217
|
-
uuid: z.ZodString;
|
|
218
|
-
organizationId: z.ZodString;
|
|
219
|
-
surfaceId: z.ZodString;
|
|
220
|
-
environment: z.ZodString;
|
|
221
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
222
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
223
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
224
|
-
edge: "edge";
|
|
225
|
-
client: "client";
|
|
226
|
-
server: "server";
|
|
227
|
-
}>>;
|
|
228
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
229
|
-
timestamp: z.ZodDate;
|
|
230
|
-
createdAt: z.ZodDate;
|
|
231
|
-
insertedAt: z.ZodDate;
|
|
232
|
-
event: z.ZodLiteral<"pageview">;
|
|
233
|
-
payload: z.ZodObject<{
|
|
234
|
-
url: z.ZodString;
|
|
235
|
-
title: z.ZodOptional<z.ZodString>;
|
|
236
|
-
referrer: z.ZodOptional<z.ZodString>;
|
|
237
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
238
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
-
}, z.core.$strip>;
|
|
240
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
-
uuid: z.ZodString;
|
|
242
|
-
organizationId: z.ZodString;
|
|
243
|
-
surfaceId: z.ZodString;
|
|
244
|
-
environment: z.ZodString;
|
|
245
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
246
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
247
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
248
|
-
edge: "edge";
|
|
249
|
-
client: "client";
|
|
250
|
-
server: "server";
|
|
251
|
-
}>>;
|
|
252
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
253
|
-
timestamp: z.ZodDate;
|
|
254
|
-
createdAt: z.ZodDate;
|
|
255
|
-
insertedAt: z.ZodDate;
|
|
256
|
-
event: z.ZodLiteral<"pageleave">;
|
|
257
|
-
payload: z.ZodObject<{
|
|
258
|
-
url: z.ZodString;
|
|
259
|
-
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
260
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
261
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
262
|
-
}, z.core.$strip>;
|
|
263
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
-
uuid: z.ZodString;
|
|
265
|
-
organizationId: z.ZodString;
|
|
266
|
-
surfaceId: z.ZodString;
|
|
267
|
-
environment: z.ZodString;
|
|
268
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
269
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
270
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
271
|
-
edge: "edge";
|
|
272
|
-
client: "client";
|
|
273
|
-
server: "server";
|
|
274
|
-
}>>;
|
|
275
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
276
|
-
timestamp: z.ZodDate;
|
|
277
|
-
createdAt: z.ZodDate;
|
|
278
|
-
insertedAt: z.ZodDate;
|
|
279
|
-
event: z.ZodLiteral<"ui_event">;
|
|
280
|
-
payload: z.ZodObject<{
|
|
281
|
-
event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
282
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
283
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
-
}, z.core.$strip>;
|
|
285
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
-
uuid: z.ZodString;
|
|
287
|
-
organizationId: z.ZodString;
|
|
288
|
-
surfaceId: z.ZodString;
|
|
289
|
-
environment: z.ZodString;
|
|
290
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
291
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
292
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
293
|
-
edge: "edge";
|
|
294
|
-
client: "client";
|
|
295
|
-
server: "server";
|
|
296
|
-
}>>;
|
|
297
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
298
|
-
timestamp: z.ZodDate;
|
|
299
|
-
createdAt: z.ZodDate;
|
|
300
|
-
insertedAt: z.ZodDate;
|
|
301
|
-
event: z.ZodLiteral<"replay_chunk">;
|
|
302
|
-
payload: z.ZodObject<{
|
|
303
|
-
ts: z.ZodNumber;
|
|
304
|
-
count: z.ZodNumber;
|
|
305
|
-
first_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
306
|
-
last_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
307
|
-
chunk_count: z.ZodOptional<z.ZodNumber>;
|
|
308
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
309
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
310
|
-
}, z.core.$strip>;
|
|
311
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
312
|
-
uuid: z.ZodString;
|
|
313
|
-
organizationId: z.ZodString;
|
|
314
|
-
surfaceId: z.ZodString;
|
|
315
|
-
environment: z.ZodString;
|
|
316
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
317
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
318
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
319
|
-
edge: "edge";
|
|
320
|
-
client: "client";
|
|
321
|
-
server: "server";
|
|
322
|
-
}>>;
|
|
323
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
324
|
-
timestamp: z.ZodDate;
|
|
325
|
-
createdAt: z.ZodDate;
|
|
326
|
-
insertedAt: z.ZodDate;
|
|
327
|
-
event: z.ZodLiteral<"session_summary">;
|
|
328
|
-
payload: z.ZodObject<{
|
|
329
|
-
summary: z.ZodString;
|
|
330
|
-
pageTitle: z.ZodString;
|
|
331
|
-
pageUrl: z.ZodString;
|
|
332
|
-
contentLength: z.ZodNumber;
|
|
333
|
-
timestamp: z.ZodNumber;
|
|
334
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
335
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
336
|
-
}, z.core.$strip>;
|
|
337
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
338
|
-
uuid: z.ZodString;
|
|
339
|
-
organizationId: z.ZodString;
|
|
340
|
-
surfaceId: z.ZodString;
|
|
341
|
-
environment: z.ZodString;
|
|
342
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
343
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
344
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
345
|
-
edge: "edge";
|
|
346
|
-
client: "client";
|
|
347
|
-
server: "server";
|
|
348
|
-
}>>;
|
|
349
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
350
|
-
timestamp: z.ZodDate;
|
|
351
|
-
createdAt: z.ZodDate;
|
|
352
|
-
insertedAt: z.ZodDate;
|
|
353
|
-
event: z.ZodLiteral<"rage_click">;
|
|
354
|
-
payload: z.ZodObject<{
|
|
355
|
-
count: z.ZodNumber;
|
|
356
|
-
timeWindow: z.ZodNumber;
|
|
357
|
-
selector: z.ZodString;
|
|
358
|
-
text: z.ZodString;
|
|
359
|
-
x: z.ZodNumber;
|
|
360
|
-
y: z.ZodNumber;
|
|
361
|
-
timestamp: z.ZodNumber;
|
|
362
|
-
runtime: z.ZodOptional<z.ZodString>;
|
|
363
|
-
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
364
|
-
}, z.core.$strip>;
|
|
365
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
366
|
-
uuid: z.ZodString;
|
|
367
|
-
organizationId: z.ZodString;
|
|
368
|
-
surfaceId: z.ZodString;
|
|
369
|
-
environment: z.ZodString;
|
|
370
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
371
|
-
fingerprint: z.ZodNullable<z.ZodString>;
|
|
372
|
-
errorSource: z.ZodNullable<z.ZodEnum<{
|
|
373
|
-
edge: "edge";
|
|
374
|
-
client: "client";
|
|
375
|
-
server: "server";
|
|
376
|
-
}>>;
|
|
377
|
-
buildId: z.ZodNullable<z.ZodString>;
|
|
378
|
-
timestamp: z.ZodDate;
|
|
379
|
-
createdAt: z.ZodDate;
|
|
380
|
-
insertedAt: z.ZodDate;
|
|
381
|
-
event: z.ZodLiteral<"identify">;
|
|
382
|
-
payload: z.ZodObject<{
|
|
383
|
-
identifier: z.ZodString;
|
|
384
|
-
email: z.ZodOptional<z.ZodString>;
|
|
385
|
-
name: z.ZodOptional<z.ZodString>;
|
|
386
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
387
|
-
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
388
|
-
}, z.core.$strip>;
|
|
389
|
-
}, z.core.$strip>], "event">;
|
|
390
|
-
type FactsEvent = z.infer<typeof factsEventSchema>;
|
|
391
|
-
//#endregion
|
|
392
|
-
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"}
|
package/dist/events/index.mjs
DELETED
|
@@ -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"}
|