@interfere/types 4.0.0 → 5.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/index.d.mts +6 -2
- package/dist/events/index.d.mts.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 +17 -17
- package/dist/sdk/envelope.d.mts +4 -2
- 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/dist/sdk/runtime.d.mts +1 -1
- package/package.json +4 -4
|
@@ -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"}
|
package/dist/events/index.d.mts
CHANGED
|
@@ -33,7 +33,8 @@ declare const factsPayloadSchemas: {
|
|
|
33
33
|
handled: z.ZodBoolean;
|
|
34
34
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
35
35
|
}, z.core.$strip>>;
|
|
36
|
-
|
|
36
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
37
38
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
38
39
|
"Pages Router": "Pages Router";
|
|
39
40
|
"App Router": "App Router";
|
|
@@ -97,6 +98,7 @@ declare const factsPayloadSchemas: {
|
|
|
97
98
|
chunk_count: z.ZodOptional<z.ZodNumber>;
|
|
98
99
|
runtime: z.ZodOptional<z.ZodString>;
|
|
99
100
|
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
objectKey: z.ZodOptional<z.ZodString>;
|
|
100
102
|
}, z.core.$strip>;
|
|
101
103
|
readonly session_summary: z.ZodObject<{
|
|
102
104
|
summary: z.ZodString;
|
|
@@ -175,7 +177,8 @@ declare const factsEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
175
177
|
handled: z.ZodBoolean;
|
|
176
178
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
177
179
|
}, z.core.$strip>>;
|
|
178
|
-
|
|
180
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
179
182
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
180
183
|
"Pages Router": "Pages Router";
|
|
181
184
|
"App Router": "App Router";
|
|
@@ -307,6 +310,7 @@ declare const factsEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
307
310
|
chunk_count: z.ZodOptional<z.ZodNumber>;
|
|
308
311
|
runtime: z.ZodOptional<z.ZodString>;
|
|
309
312
|
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
objectKey: z.ZodOptional<z.ZodString>;
|
|
310
314
|
}, z.core.$strip>;
|
|
311
315
|
}, z.core.$strip>, z.ZodObject<{
|
|
312
316
|
uuid: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/events/index.ts"],"mappings":";;;cAWa,mBAAA;EAAA
|
|
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"}
|
|
@@ -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
|
@@ -11,20 +11,20 @@ declare const apiBaseUrlSchema: z.ZodUnion<readonly [z.ZodString, z.ZodEnum<{
|
|
|
11
11
|
"http://localhost:3001": "http://localhost:3001";
|
|
12
12
|
}>]>;
|
|
13
13
|
declare const featuresSchema: z.ZodDefault<z.ZodObject<{
|
|
14
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
15
|
+
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
14
16
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
15
|
-
fingerprint: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
16
17
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
17
18
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
18
|
-
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
20
|
type Features = z.infer<typeof featuresSchema>;
|
|
21
21
|
declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
22
22
|
features: z.ZodDefault<z.ZodObject<{
|
|
23
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
24
|
+
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
23
25
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
24
|
-
fingerprint: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
25
26
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
26
27
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
27
|
-
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
28
28
|
}, z.core.$strip>>;
|
|
29
29
|
metadata: z.ZodObject<{
|
|
30
30
|
buildId: z.ZodNullable<z.ZodString>;
|
|
@@ -36,8 +36,8 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
36
36
|
}>>;
|
|
37
37
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
38
38
|
browser: "browser";
|
|
39
|
-
node: "node";
|
|
40
39
|
edge: "edge";
|
|
40
|
+
node: "node";
|
|
41
41
|
}>>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
batch: z.ZodDefault<z.ZodObject<{
|
|
@@ -56,17 +56,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
56
56
|
surfaceToken: z.ZodString;
|
|
57
57
|
}, z.core.$strip>]>>, z.ZodTransform<({
|
|
58
58
|
features: {
|
|
59
|
+
device?: boolean | undefined;
|
|
60
|
+
replay?: boolean | undefined;
|
|
59
61
|
errors?: boolean | undefined;
|
|
60
|
-
fingerprint?: boolean | undefined;
|
|
61
62
|
pageEvents?: boolean | undefined;
|
|
62
63
|
rageClick?: boolean | undefined;
|
|
63
|
-
replay?: boolean | undefined;
|
|
64
64
|
};
|
|
65
65
|
metadata: {
|
|
66
66
|
buildId: string | null;
|
|
67
67
|
releaseId: string | null;
|
|
68
68
|
environment: "development" | "preview" | "production" | null;
|
|
69
|
-
runtime: "browser" | "
|
|
69
|
+
runtime: "browser" | "edge" | "node" | null;
|
|
70
70
|
};
|
|
71
71
|
batch: {
|
|
72
72
|
size: number;
|
|
@@ -81,17 +81,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
81
81
|
proxyUrl: string;
|
|
82
82
|
}) | ({
|
|
83
83
|
features: {
|
|
84
|
+
device?: boolean | undefined;
|
|
85
|
+
replay?: boolean | undefined;
|
|
84
86
|
errors?: boolean | undefined;
|
|
85
|
-
fingerprint?: boolean | undefined;
|
|
86
87
|
pageEvents?: boolean | undefined;
|
|
87
88
|
rageClick?: boolean | undefined;
|
|
88
|
-
replay?: boolean | undefined;
|
|
89
89
|
};
|
|
90
90
|
metadata: {
|
|
91
91
|
buildId: string | null;
|
|
92
92
|
releaseId: string | null;
|
|
93
93
|
environment: "development" | "preview" | "production" | null;
|
|
94
|
-
runtime: "browser" | "
|
|
94
|
+
runtime: "browser" | "edge" | "node" | null;
|
|
95
95
|
};
|
|
96
96
|
batch: {
|
|
97
97
|
size: number;
|
|
@@ -107,17 +107,17 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
107
107
|
surfaceToken: string;
|
|
108
108
|
}), {
|
|
109
109
|
features: {
|
|
110
|
+
device?: boolean | undefined;
|
|
111
|
+
replay?: boolean | undefined;
|
|
110
112
|
errors?: boolean | undefined;
|
|
111
|
-
fingerprint?: boolean | undefined;
|
|
112
113
|
pageEvents?: boolean | undefined;
|
|
113
114
|
rageClick?: boolean | undefined;
|
|
114
|
-
replay?: boolean | undefined;
|
|
115
115
|
};
|
|
116
116
|
metadata: {
|
|
117
117
|
buildId: string | null;
|
|
118
118
|
releaseId: string | null;
|
|
119
119
|
environment: "development" | "preview" | "production" | null;
|
|
120
|
-
runtime: "browser" | "
|
|
120
|
+
runtime: "browser" | "edge" | "node" | null;
|
|
121
121
|
};
|
|
122
122
|
batch: {
|
|
123
123
|
size: number;
|
|
@@ -137,11 +137,11 @@ declare const configSchema: z.ZodPipe<z.ZodIntersection<z.ZodObject<{
|
|
|
137
137
|
type Config = z.output<typeof configSchema>;
|
|
138
138
|
declare const configInputSchema: z.ZodIntersection<z.ZodObject<{
|
|
139
139
|
features: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
140
|
+
device: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
141
|
+
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
140
142
|
errors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
141
|
-
fingerprint: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
142
143
|
pageEvents: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
143
144
|
rageClick: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
144
|
-
replay: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
145
145
|
}, z.core.$strip>>>;
|
|
146
146
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
147
147
|
buildId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -153,8 +153,8 @@ declare const configInputSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
153
153
|
}>>>;
|
|
154
154
|
runtime: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
155
155
|
browser: "browser";
|
|
156
|
-
node: "node";
|
|
157
156
|
edge: "edge";
|
|
157
|
+
node: "node";
|
|
158
158
|
}>>>;
|
|
159
159
|
}, z.core.$strip>>;
|
|
160
160
|
batch: z.ZodOptional<z.ZodObject<{
|
package/dist/sdk/envelope.d.mts
CHANGED
|
@@ -169,11 +169,12 @@ 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";
|
|
175
|
-
node: "node";
|
|
176
176
|
edge: "edge";
|
|
177
|
+
node: "node";
|
|
177
178
|
}>>;
|
|
178
179
|
sessionId: z.ZodNullable<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
|
|
179
180
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
@@ -327,11 +328,12 @@ 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";
|
|
333
|
-
node: "node";
|
|
334
335
|
edge: "edge";
|
|
336
|
+
node: "node";
|
|
335
337
|
}>>;
|
|
336
338
|
sessionId: z.ZodNullable<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
|
|
337
339
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
@@ -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/dist/sdk/runtime.d.mts
CHANGED
|
@@ -9,8 +9,8 @@ declare const envSchema: z.ZodNullable<z.ZodEnum<{
|
|
|
9
9
|
type Env = z.infer<typeof envSchema>;
|
|
10
10
|
declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
|
|
11
11
|
browser: "browser";
|
|
12
|
-
node: "node";
|
|
13
12
|
edge: "edge";
|
|
13
|
+
node: "node";
|
|
14
14
|
}>>;
|
|
15
15
|
type Runtime = z.infer<typeof runtimeSchema>;
|
|
16
16
|
declare function inferRuntime(options?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
"typecheck": "tsc --noEmit --incremental"
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@interfere/constants": "^
|
|
109
|
+
"@interfere/constants": "^5.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": "^5.0.0",
|
|
115
|
+
"@interfere/vitest-config": "^5.0.0",
|
|
116
116
|
"@types/node": "^24.12.0",
|
|
117
117
|
"@vitest/coverage-v8": "^4.0.18",
|
|
118
118
|
"tsdown": "^0.21.3",
|