@interfere/types 8.0.0 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/frame.d.mts +2 -1
- package/dist/data/frame.d.mts.map +1 -1
- package/dist/data/frame.mjs +3 -2
- package/dist/data/frame.mjs.map +1 -1
- package/dist/data/session.d.mts +1 -1
- package/dist/data/session.mjs +1 -1
- package/dist/data/session.mjs.map +1 -1
- package/dist/data/source-maps.d.mts +2 -1
- package/dist/data/source-maps.d.mts.map +1 -1
- package/dist/data/source-maps.mjs +3 -2
- package/dist/data/source-maps.mjs.map +1 -1
- package/dist/events/error.d.mts +5 -4
- package/dist/events/error.d.mts.map +1 -1
- package/dist/events/error.mjs +1 -1
- package/dist/events/error.mjs.map +1 -1
- package/dist/events/pageleave.d.mts +1 -1
- package/dist/events/pageleave.mjs +1 -1
- package/dist/events/pageleave.mjs.map +1 -1
- package/dist/events/pageview.d.mts +1 -1
- package/dist/events/pageview.mjs +1 -1
- package/dist/events/pageview.mjs.map +1 -1
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/index.mjs.map +1 -1
- package/dist/integrations/platforms/github.d.mts +2 -2
- package/dist/integrations/platforms/github.mjs +1 -1
- package/dist/integrations/platforms/github.mjs.map +1 -1
- package/dist/integrations/platforms/vercel.d.mts +1 -1
- package/dist/integrations/platforms/vercel.mjs +1 -1
- package/dist/integrations/platforms/vercel.mjs.map +1 -1
- package/dist/releases/definition.d.mts +3 -3
- package/dist/releases/definition.mjs +1 -1
- package/dist/releases/definition.mjs.map +1 -1
- package/dist/sdk/env.mjs +1 -1
- package/dist/sdk/env.mjs.map +1 -1
- package/dist/sdk/envelope.d.mts +13 -12
- package/dist/sdk/envelope.d.mts.map +1 -1
- package/dist/sdk/envelope.mjs +1 -1
- package/dist/sdk/envelope.mjs.map +1 -1
- package/dist/sdk/errors.d.mts +10 -1
- package/dist/sdk/errors.d.mts.map +1 -1
- package/dist/sdk/errors.mjs +63 -5
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/geo.d.mts +10 -0
- package/dist/sdk/geo.d.mts.map +1 -0
- package/dist/sdk/geo.mjs +17 -0
- package/dist/sdk/geo.mjs.map +1 -0
- package/dist/sdk/identify.d.mts +23 -4
- package/dist/sdk/identify.d.mts.map +1 -1
- package/dist/sdk/identify.mjs +17 -4
- package/dist/sdk/identify.mjs.map +1 -1
- package/dist/sdk/plugins/context/browser.d.mts +1 -1
- package/dist/sdk/plugins/context/browser.mjs +1 -1
- package/dist/sdk/plugins/context/browser.mjs.map +1 -1
- package/dist/sdk/plugins/context/edge.d.mts +1 -1
- package/dist/sdk/plugins/context/edge.mjs +1 -1
- package/dist/sdk/plugins/context/edge.mjs.map +1 -1
- package/dist/sdk/plugins/context/next.d.mts +4 -4
- package/dist/sdk/plugins/context/next.mjs +1 -1
- package/dist/sdk/plugins/context/next.mjs.map +1 -1
- package/dist/sdk/plugins/payload/errors.d.mts +4 -2
- package/dist/sdk/plugins/payload/errors.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/errors.mjs +1 -1
- package/dist/sdk/plugins/payload/errors.mjs.map +1 -1
- package/dist/sdk/plugins/payload/page-events.d.mts +1 -1
- package/dist/sdk/plugins/payload/page-events.mjs +1 -1
- package/dist/sdk/plugins/payload/page-events.mjs.map +1 -1
- package/dist/sdk/plugins/payload/rage-click.d.mts +1 -1
- package/dist/sdk/plugins/payload/rage-click.mjs +1 -1
- package/dist/sdk/plugins/payload/rage-click.mjs.map +1 -1
- package/dist/sdk/plugins/payload/replay.d.mts +1 -1
- package/dist/sdk/plugins/payload/replay.mjs +1 -1
- package/dist/sdk/plugins/payload/replay.mjs.map +1 -1
- package/dist/sdk/runtime.d.mts +2 -2
- package/dist/sdk/runtime.mjs +1 -1
- package/dist/sdk/runtime.mjs.map +1 -1
- package/package.json +8 -8
package/dist/data/frame.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/data/frame.d.ts
|
|
4
4
|
declare const ingestedFrame: z.ZodObject<{
|
|
@@ -7,6 +7,7 @@ declare const ingestedFrame: z.ZodObject<{
|
|
|
7
7
|
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
source: z.ZodOptional<z.ZodString>;
|
|
10
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
type IngestedFrame = z.infer<typeof ingestedFrame>;
|
|
12
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.mts","names":[],"sources":["../../src/data/frame.ts"],"mappings":";;;cAEa,aAAA,EAAa,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"frame.d.mts","names":[],"sources":["../../src/data/frame.ts"],"mappings":";;;cAEa,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;KASd,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,aAAA"}
|
package/dist/data/frame.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
//#region src/data/frame.ts
|
|
3
3
|
const ingestedFrame = z.object({
|
|
4
4
|
fileName: z.string().optional(),
|
|
5
5
|
functionName: z.string().optional(),
|
|
6
6
|
lineNumber: z.number().optional(),
|
|
7
7
|
columnNumber: z.number().optional(),
|
|
8
|
-
source: z.string().optional()
|
|
8
|
+
source: z.string().optional(),
|
|
9
|
+
debugId: z.string().optional()
|
|
9
10
|
});
|
|
10
11
|
//#endregion
|
|
11
12
|
export { ingestedFrame };
|
package/dist/data/frame.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.mjs","names":[],"sources":["../../src/data/frame.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"frame.mjs","names":[],"sources":["../../src/data/frame.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ingestedFrame = z.object({\n fileName: z.string().optional(),\n functionName: z.string().optional(),\n lineNumber: z.number().optional(),\n columnNumber: z.number().optional(),\n source: z.string().optional(),\n debugId: z.string().optional(),\n});\n\nexport type IngestedFrame = z.infer<typeof ingestedFrame>;\n"],"mappings":";;AAEA,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC"}
|
package/dist/data/session.d.mts
CHANGED
package/dist/data/session.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.mjs","names":[],"sources":["../../src/data/session.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"session.mjs","names":[],"sources":["../../src/data/session.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Session IDs can be:\n// - Plain UUIDv7 (from client SDK)\n// - \"server_\" prefixed UUIDv7 (server-side fallback when no client session exists)\nexport const sessionIdSchema = z.union([\n z.uuidv7(),\n z.templateLiteral([\"server_\", z.uuidv7()]),\n]);\n\nexport type SessionId = z.infer<typeof sessionIdSchema>;\n"],"mappings":";;AAKA,MAAa,kBAAkB,EAAE,MAAM,CACrC,EAAE,QAAQ,EACV,EAAE,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAC3C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/data/source-maps.d.ts
|
|
4
4
|
declare const getSourceMapPath: ({
|
|
@@ -23,6 +23,7 @@ declare const sourceMapManifestSchema: z.ZodObject<{
|
|
|
23
23
|
generatedFile: z.ZodString;
|
|
24
24
|
hash: z.ZodString;
|
|
25
25
|
objectKey: z.ZodString;
|
|
26
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
26
27
|
}, z.core.$strip>>;
|
|
27
28
|
}, z.core.$strip>;
|
|
28
29
|
type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-maps.d.mts","names":[],"sources":["../../src/data/source-maps.ts"],"mappings":";;;cAEa,gBAAA;EAAoB,cAAA;EAAA,SAAA;EAAA,OAAA;EAAA;AAAA;EAM/B,cAAA;EACA,SAAA;EACA,OAAA;EACA,YAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"source-maps.d.mts","names":[],"sources":["../../src/data/source-maps.ts"],"mappings":";;;cAEa,gBAAA;EAAoB,cAAA;EAAA,SAAA;EAAA,OAAA;EAAA;AAAA;EAM/B,cAAA;EACA,SAAA;EACA,OAAA;EACA,YAAA;AAAA;AAAA,cAYW,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;KASxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA;AAAA,cAElC,eAAA;EAAmB,cAAA;EAAA,SAAA;EAAA;AAAA;EAK9B,cAAA;EACA,SAAA;EACA,OAAA;AAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
//#region src/data/source-maps.ts
|
|
3
3
|
const getSourceMapPath = ({ organizationId, surfaceId, buildId, relativePath }) => `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/${relativePath}`;
|
|
4
4
|
const sourceMapManifestEntrySchema = z.object({
|
|
5
5
|
relativePath: z.string(),
|
|
6
6
|
generatedFile: z.string(),
|
|
7
7
|
hash: z.string(),
|
|
8
|
-
objectKey: z.string()
|
|
8
|
+
objectKey: z.string(),
|
|
9
|
+
debugId: z.string().optional()
|
|
9
10
|
});
|
|
10
11
|
const sourceMapManifestSchema = z.object({
|
|
11
12
|
buildId: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod\";\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\nconst sourceMapManifestEntrySchema = z.object({\n relativePath: z.string(),\n generatedFile: z.string(),\n hash: z.string(),\n objectKey: z.string(),\n debugId: z.string().optional(),\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,MAAM,+BAA+B,EAAE,OAAO;CAC5C,cAAc,EAAE,QAAQ;CACxB,eAAe,EAAE,QAAQ;CACzB,MAAM,EAAE,QAAQ;CAChB,WAAW,EAAE,QAAQ;CACrB,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;AAEF,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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/events/error.d.ts
|
|
4
4
|
declare const enrichedFrameSchema: z.ZodObject<{
|
|
@@ -22,6 +22,7 @@ declare const errorFactsPayloadSchema: z.ZodObject<{
|
|
|
22
22
|
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
23
23
|
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
source: z.ZodOptional<z.ZodString>;
|
|
25
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
25
26
|
}, z.core.$strip>>;
|
|
26
27
|
enrichedFrames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
28
|
file: z.ZodNullable<z.ZodString>;
|
|
@@ -49,16 +50,16 @@ declare const errorFactsPayloadSchema: z.ZodObject<{
|
|
|
49
50
|
context: z.ZodOptional<z.ZodObject<{
|
|
50
51
|
framework: z.ZodOptional<z.ZodString>;
|
|
51
52
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
"Pages Router": "Pages Router";
|
|
53
53
|
"App Router": "App Router";
|
|
54
|
+
"Pages Router": "Pages Router";
|
|
54
55
|
}>>;
|
|
55
56
|
routePath: z.ZodOptional<z.ZodString>;
|
|
56
57
|
routeType: z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
render: "render";
|
|
58
|
-
route: "route";
|
|
59
58
|
action: "action";
|
|
60
59
|
middleware: "middleware";
|
|
61
60
|
proxy: "proxy";
|
|
61
|
+
render: "render";
|
|
62
|
+
route: "route";
|
|
62
63
|
}>>;
|
|
63
64
|
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
64
65
|
"react-server-components": "react-server-components";
|
|
@@ -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,cAkC9B,uBAAA,EAAuB,CAAA,CAAA,SAAA
|
|
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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod\";\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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageleave.mjs","names":[],"sources":["../../src/events/pageleave.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"pageleave.mjs","names":[],"sources":["../../src/events/pageleave.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageleaveFactsPayloadSchema = z.object({\n url: z.string(),\n durationMs: z.number().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageleaveFactsPayload = z.infer<typeof pageleaveFactsPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,8BAA8B,EAAE,OAAO;CAClD,KAAK,EAAE,QAAQ;CACf,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC5C,CAAC"}
|
package/dist/events/pageview.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageview.mjs","names":[],"sources":["../../src/events/pageview.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"pageview.mjs","names":[],"sources":["../../src/events/pageview.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageviewFactsPayloadSchema = z.object({\n url: z.string(),\n title: z.string().optional(),\n referrer: z.string().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageviewFactsPayload = z.infer<typeof pageviewFactsPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,6BAA6B,EAAE,OAAO;CACjD,KAAK,EAAE,QAAQ;CACf,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC5C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/integrations/index.d.ts
|
|
4
4
|
declare const releaseSourceMetadataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -26,7 +26,7 @@ declare const destinationProviderSchema: z.ZodEnum<{
|
|
|
26
26
|
vercel: "vercel";
|
|
27
27
|
}>;
|
|
28
28
|
type DestinationProvider = z.infer<typeof destinationProviderSchema>;
|
|
29
|
-
declare const releaseSourceIdEnvKeys: ("
|
|
30
|
-
declare const releaseDestinationIdEnvKeys: ("
|
|
29
|
+
declare const releaseSourceIdEnvKeys: ("GITHUB_SHA" | "INTERFERE_SOURCE_ID" | "NEXT_BUILD_ID" | "NEXT_PUBLIC_INTERFERE_BUILD_ID" | "VERCEL_GIT_COMMIT_SHA")[];
|
|
30
|
+
declare const releaseDestinationIdEnvKeys: ("GITHUB_SHA" | "INTERFERE_DESTINATION_ID" | "NEXT_PUBLIC_INTERFERE_RELEASE_ID" | "VERCEL_DEPLOYMENT_ID" | "VERCEL_GIT_COMMIT_SHA")[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { DestinationProvider, ReleaseDestinationMetadata, ReleaseSourceMetadata, SourceProvider, destinationProviderSchema, releaseDestinationIdEnvKeys, releaseDestinationMetadataSchema, releaseSourceIdEnvKeys, releaseSourceMetadataSchema, sourceProviderSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { githubSourceIdEnvKeys } from "./platforms/github.mjs";
|
|
2
2
|
import { vercelDestinationIdEnvKeys } from "./platforms/vercel.mjs";
|
|
3
|
-
import { z } from "zod
|
|
3
|
+
import { z } from "zod";
|
|
4
4
|
//#region src/integrations/index.ts
|
|
5
5
|
const releaseSourceMetadataSchema = z.discriminatedUnion("provider", [z.object({
|
|
6
6
|
provider: z.literal("github"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/integrations/index.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/integrations/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { githubSourceIdEnvKeys } from \"./platforms/github.js\";\nimport { vercelDestinationIdEnvKeys } from \"./platforms/vercel.js\";\n\nexport const releaseSourceMetadataSchema = z.discriminatedUnion(\"provider\", [\n z.object({\n provider: z.literal(\"github\"),\n commitMessage: z.string(),\n branch: z.string(),\n commitSha: z.string().nullable(),\n }),\n]);\n\nexport type ReleaseSourceMetadata = z.infer<typeof releaseSourceMetadataSchema>;\n\nexport const releaseDestinationMetadataSchema = z.discriminatedUnion(\n \"provider\",\n [\n z.object({\n provider: z.literal(\"vercel\"),\n destinationReleaseId: z.string().nullable(),\n environment: z.string().nullable(),\n deploymentId: z.string().nullable(),\n deploymentUrl: z.string().nullable(),\n environmentName: z.string().nullable(),\n environmentTarget: z.string().nullable(),\n }),\n ]\n);\n\nexport type ReleaseDestinationMetadata = z.infer<\n typeof releaseDestinationMetadataSchema\n>;\n\nexport const sourceProviderSchema = z.enum([\"github\"]);\nexport type SourceProvider = z.infer<typeof sourceProviderSchema>;\n\nexport const destinationProviderSchema = z.enum([\"vercel\"]);\nexport type DestinationProvider = z.infer<typeof destinationProviderSchema>;\n\nconst releaseSourceIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_BUILD_ID\",\n \"INTERFERE_SOURCE_ID\",\n \"NEXT_BUILD_ID\",\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseSourceIdEnvKeys = releaseSourceIdEnvKeySchema.options;\n\nconst releaseDestinationIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_RELEASE_ID\",\n \"INTERFERE_DESTINATION_ID\",\n ...vercelDestinationIdEnvKeys,\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseDestinationIdEnvKeys =\n releaseDestinationIdEnvKeySchema.options;\n"],"mappings":";;;;AAKA,MAAa,8BAA8B,EAAE,mBAAmB,YAAY,CAC1E,EAAE,OAAO;CACP,UAAU,EAAE,QAAQ,SAAS;CAC7B,eAAe,EAAE,QAAQ;CACzB,QAAQ,EAAE,QAAQ;CAClB,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC,CACH,CAAC;AAIF,MAAa,mCAAmC,EAAE,mBAChD,YACA,CACE,EAAE,OAAO;CACP,UAAU,EAAE,QAAQ,SAAS;CAC7B,sBAAsB,EAAE,QAAQ,CAAC,UAAU;CAC3C,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;CACzC,CAAC,CACH,CACF;AAMD,MAAa,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC;AAGtD,MAAa,4BAA4B,EAAE,KAAK,CAAC,SAAS,CAAC;AAS3D,MAAa,yBANuB,EAAE,KAAK;CACzC;CACA;CACA;CACA,GAAG;CACJ,CAAC,CACgE;AAQlE,MAAa,8BAN4B,EAAE,KAAK;CAC9C;CACA;CACA,GAAG;CACH,GAAG;CACJ,CAAC,CAEiC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/integrations/platforms/github.d.ts
|
|
4
|
-
declare const githubSourceIdEnvKeys: ("
|
|
4
|
+
declare const githubSourceIdEnvKeys: ("GITHUB_SHA" | "VERCEL_GIT_COMMIT_SHA")[];
|
|
5
5
|
declare const githubIntegration: z.ZodObject<{
|
|
6
6
|
name: z.ZodLiteral<"github">;
|
|
7
7
|
metadata: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst githubSourceIdEnvKeySchema = z.enum([\n \"VERCEL_GIT_COMMIT_SHA\",\n \"GITHUB_SHA\",\n]);\nexport const githubSourceIdEnvKeys = githubSourceIdEnvKeySchema.options;\n\nexport const githubIntegration = z.object({\n name: z.literal(\"github\"),\n metadata: z.object({\n accountType: z.string(),\n avatarUrl: z.string().nullable().default(null),\n repositories: z.record(z.string(), z.string()),\n installationUrl: z.string().nullable(),\n }),\n});\n"],"mappings":";AAMA,MAAa,wBAJsB,EAAE,KAAK,CACxC,yBACA,aACD,CAAC,CAC8D;AAEhE,MAAa,oBAAoB,EAAE,OAAO;CACxC,MAAM,EAAE,QAAQ,SAAS;CACzB,UAAU,EAAE,OAAO;EACjB,aAAa,EAAE,QAAQ;EACvB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK;EAC9C,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC;EAC9C,iBAAiB,EAAE,QAAQ,CAAC,UAAU;EACvC,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.mjs","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"vercel.mjs","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst vercelDestinationIdEnvKeySchema = z.enum([\"VERCEL_DEPLOYMENT_ID\"]);\nexport const vercelDestinationIdEnvKeys =\n vercelDestinationIdEnvKeySchema.options;\n\nconst vercelMetadataBase = z.object({\n avatar: z.string().nullable().default(null),\n name: z.string().nullable().default(null),\n installationUrl: z.string().nullable(),\n projects: z.record(z.string(), z.string()).default({}),\n});\n\nexport const vercelTeamMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"team\"),\n id: z.string(),\n slug: z.string(),\n});\n\nexport const vercelUserMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"user\"),\n id: z.string(),\n username: z.string(),\n email: z.string(),\n});\n\nconst vercelMetadataSchema = z.discriminatedUnion(\"accountType\", [\n vercelTeamMetadata,\n vercelUserMetadata,\n]);\n\nexport const vercelIntegration = z.object({\n name: z.literal(\"vercel\"),\n metadata: vercelMetadataSchema,\n});\n"],"mappings":";AAGA,MAAa,6BAD2B,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAEtC;AAElC,MAAM,qBAAqB,EAAE,OAAO;CAClC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK;CAC3C,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK;CACzC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC;AAEF,MAAa,qBAAqB,mBAAmB,OAAO;CAC1D,aAAa,EAAE,QAAQ,OAAO;CAC9B,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAa,qBAAqB,mBAAmB,OAAO;CAC1D,aAAa,EAAE,QAAQ,OAAO;CAC9B,IAAI,EAAE,QAAQ;CACd,UAAU,EAAE,QAAQ;CACpB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF,MAAM,uBAAuB,EAAE,mBAAmB,eAAe,CAC/D,oBACA,mBACD,CAAC;AAEF,MAAa,oBAAoB,EAAE,OAAO;CACxC,MAAM,EAAE,QAAQ,SAAS;CACzB,UAAU;CACX,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/releases/definition.d.ts
|
|
4
4
|
declare const releaseStatusSchema: z.ZodEnum<{
|
|
5
|
+
failed: "failed";
|
|
5
6
|
pending: "pending";
|
|
6
|
-
uploading: "uploading";
|
|
7
7
|
processing: "processing";
|
|
8
8
|
ready: "ready";
|
|
9
|
-
|
|
9
|
+
uploading: "uploading";
|
|
10
10
|
}>;
|
|
11
11
|
declare const createReleaseRequest: z.ZodObject<{
|
|
12
12
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod\";\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/env.mjs
CHANGED
package/dist/sdk/env.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.mjs","names":[],"sources":["../../src/sdk/env.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"env.mjs","names":[],"sources":["../../src/sdk/env.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst interfereEnvValueSchema = z.string().trim().min(1);\n\nexport function parseEnvValue(value: unknown) {\n const parsed = interfereEnvValueSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n}\n\nexport function readFirstEnvValue(\n env: Record<string, string | undefined>,\n keys: readonly string[]\n) {\n for (const key of keys) {\n const value = parseEnvValue(env[key]);\n if (value !== null) {\n return value;\n }\n }\n\n return null;\n}\n"],"mappings":";;AAEA,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;AAExD,SAAgB,cAAc,OAAgB;CAC5C,MAAM,SAAS,wBAAwB,UAAU,MAAM;AACvD,KAAI,CAAC,OAAO,QACV,QAAO;AAGT,QAAO,OAAO;;AAGhB,SAAgB,kBACd,KACA,MACA;AACA,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,QAAQ,cAAc,IAAI,KAAK;AACrC,MAAI,UAAU,KACZ,QAAO;;AAIX,QAAO"}
|
package/dist/sdk/envelope.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/envelope.d.ts
|
|
4
4
|
/**
|
|
@@ -10,10 +10,10 @@ import { z } from "zod/v4";
|
|
|
10
10
|
* - "client": Session ID was set on the client (browser SDK)
|
|
11
11
|
*/
|
|
12
12
|
declare const sessionSourceSchema: z.ZodOptional<z.ZodEnum<{
|
|
13
|
-
client: "client";
|
|
14
|
-
header: "header";
|
|
15
13
|
async_context: "async_context";
|
|
14
|
+
client: "client";
|
|
16
15
|
fallback: "fallback";
|
|
16
|
+
header: "header";
|
|
17
17
|
}>>;
|
|
18
18
|
type SessionSource = z.infer<typeof sessionSourceSchema>;
|
|
19
19
|
declare const envelopeContextSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -73,15 +73,15 @@ declare const envelopeContextSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
73
73
|
}>>;
|
|
74
74
|
routePath: z.ZodOptional<z.ZodString>;
|
|
75
75
|
routeType: z.ZodOptional<z.ZodEnum<{
|
|
76
|
-
render: "render";
|
|
77
|
-
route: "route";
|
|
78
76
|
action: "action";
|
|
79
77
|
middleware: "middleware";
|
|
80
78
|
proxy: "proxy";
|
|
79
|
+
render: "render";
|
|
80
|
+
route: "route";
|
|
81
81
|
}>>;
|
|
82
82
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
83
|
-
"Pages Router": "Pages Router";
|
|
84
83
|
"App Router": "App Router";
|
|
84
|
+
"Pages Router": "Pages Router";
|
|
85
85
|
}>>;
|
|
86
86
|
runtime: z.ZodLiteral<"nextjs">;
|
|
87
87
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -148,15 +148,15 @@ declare const envelopeSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
148
148
|
}>>;
|
|
149
149
|
routePath: z.ZodOptional<z.ZodString>;
|
|
150
150
|
routeType: z.ZodOptional<z.ZodEnum<{
|
|
151
|
-
render: "render";
|
|
152
|
-
route: "route";
|
|
153
151
|
action: "action";
|
|
154
152
|
middleware: "middleware";
|
|
155
153
|
proxy: "proxy";
|
|
154
|
+
render: "render";
|
|
155
|
+
route: "route";
|
|
156
156
|
}>>;
|
|
157
157
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
158
|
-
"Pages Router": "Pages Router";
|
|
159
158
|
"App Router": "App Router";
|
|
159
|
+
"Pages Router": "Pages Router";
|
|
160
160
|
}>>;
|
|
161
161
|
runtime: z.ZodLiteral<"nextjs">;
|
|
162
162
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -170,16 +170,16 @@ declare const envelopeSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
170
170
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
171
171
|
releaseId: z.ZodNullable<z.ZodString>;
|
|
172
172
|
runtime: z.ZodNullable<z.ZodEnum<{
|
|
173
|
-
edge: "edge";
|
|
174
173
|
browser: "browser";
|
|
174
|
+
edge: "edge";
|
|
175
175
|
node: "node";
|
|
176
176
|
}>>;
|
|
177
177
|
sessionId: z.ZodNullable<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
|
|
178
178
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
179
|
-
client: "client";
|
|
180
|
-
header: "header";
|
|
181
179
|
async_context: "async_context";
|
|
180
|
+
client: "client";
|
|
182
181
|
fallback: "fallback";
|
|
182
|
+
header: "header";
|
|
183
183
|
}>>;
|
|
184
184
|
uuid: z.ZodUUID;
|
|
185
185
|
v: z.ZodUnion<readonly [z.ZodLiteral<0>]>;
|
|
@@ -199,6 +199,7 @@ declare const envelopeSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
199
199
|
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
200
200
|
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
201
201
|
source: z.ZodOptional<z.ZodString>;
|
|
202
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
202
203
|
}, z.core.$strip>>;
|
|
203
204
|
}, z.core.$strip>>;
|
|
204
205
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.d.mts","names":[],"sources":["../../src/sdk/envelope.ts"],"mappings":";;;;;AA0BA;;;;;;cAAa,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
|
|
1
|
+
{"version":3,"file":"envelope.d.mts","names":[],"sources":["../../src/sdk/envelope.ts"],"mappings":";;;;;AA0BA;;;;;;cAAa,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"}
|
package/dist/sdk/envelope.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.mjs","names":[],"sources":["../../src/sdk/envelope.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"envelope.mjs","names":[],"sources":["../../src/sdk/envelope.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { sessionIdSchema } from \"#data/session\";\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\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"],"mappings":";;;;;;;;;;;AAgBA,MAAM,kBAAkB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;;;;;;;;;AAU/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"}
|
package/dist/sdk/errors.d.mts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/errors.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* True when the root exception has at least one stack frame whose `fileName` is
|
|
6
|
+
* a browser-extension script URL. Covers extension-only stacks, extension
|
|
7
|
+
* interceptors (extension frames above app), and app errors whose stack still
|
|
8
|
+
* includes extension code (e.g. hydration) — stacks with no filenames are
|
|
9
|
+
* unchanged (returns false).
|
|
10
|
+
*/
|
|
11
|
+
declare function shouldDropBrowserExtensionNoise(exceptions: readonly ExceptionValue[]): boolean;
|
|
4
12
|
declare function toError(error: unknown): Error;
|
|
5
13
|
declare function toExceptions(error: Error, mechanism: ErrorMechanism): ExceptionValue[];
|
|
14
|
+
declare function extractFilenameFromStack(stack: string): string | null;
|
|
6
15
|
//#endregion
|
|
7
|
-
export { toError, toExceptions };
|
|
16
|
+
export { extractFilenameFromStack, shouldDropBrowserExtensionNoise, toError, toExceptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/sdk/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/sdk/errors.ts"],"mappings":";;;;;AA8BA;;;;;iBAAgB,+BAAA,CACd,UAAA,WAAqB,cAAA;AAAA,iBAkBP,OAAA,CAAQ,KAAA,YAAiB,KAAA;AAAA,iBAYzB,YAAA,CACd,KAAA,EAAO,KAAA,EACP,SAAA,EAAW,cAAA,GACV,cAAA;AAAA,iBAwDa,wBAAA,CAAyB,KAAA"}
|
package/dist/sdk/errors.mjs
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import { parse } from "error-stack-parser-es";
|
|
2
2
|
//#region src/sdk/errors.ts
|
|
3
|
+
/** URL schemes used by browser extensions in stack frame `fileName` values. */
|
|
4
|
+
const BROWSER_EXTENSION_SCRIPT_URL_PREFIXES = [
|
|
5
|
+
"chrome-extension://",
|
|
6
|
+
"moz-extension://",
|
|
7
|
+
"safari-web-extension://",
|
|
8
|
+
"safari-extension://",
|
|
9
|
+
"ms-browser-extension://"
|
|
10
|
+
];
|
|
11
|
+
function isExtensionOriginated({ fileName }) {
|
|
12
|
+
return BROWSER_EXTENSION_SCRIPT_URL_PREFIXES.some((prefix) => fileName?.startsWith(prefix) ?? false);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* True when the root exception has at least one stack frame whose `fileName` is
|
|
16
|
+
* a browser-extension script URL. Covers extension-only stacks, extension
|
|
17
|
+
* interceptors (extension frames above app), and app errors whose stack still
|
|
18
|
+
* includes extension code (e.g. hydration) — stacks with no filenames are
|
|
19
|
+
* unchanged (returns false).
|
|
20
|
+
*/
|
|
21
|
+
function shouldDropBrowserExtensionNoise(exceptions) {
|
|
22
|
+
const frames = exceptions[0]?.frames;
|
|
23
|
+
if (!frames?.length) return false;
|
|
24
|
+
return frames.some(isExtensionOriginated);
|
|
25
|
+
}
|
|
3
26
|
const MAX_CAUSE_DEPTH = 5;
|
|
27
|
+
const PAREN_FILE_RE = /\((.+?)(?::\d+){1,2}\)/;
|
|
28
|
+
const AT_FILE_RE = /at\s+(.+?)(?::\d+){1,2}$/;
|
|
29
|
+
const SPIDERMONKEY_RE = /(?:^|@)((?:https?:\/\/|\/).+?)(?::\d+){1,2}$/;
|
|
30
|
+
const BARE_FILE_RE = /(?:^|@)(.+?)(?::\d+){1,2}$/;
|
|
4
31
|
function toError(error) {
|
|
5
32
|
if (error instanceof Error) return error;
|
|
6
33
|
if (typeof error === "string") return new Error(error);
|
|
7
34
|
return new Error(String(error));
|
|
8
35
|
}
|
|
9
36
|
function toExceptions(error, mechanism) {
|
|
37
|
+
const debugIdMap = getDebugIdMap();
|
|
10
38
|
const exceptions = [];
|
|
11
39
|
let current = error;
|
|
12
40
|
for (let depth = 0; current && depth < MAX_CAUSE_DEPTH; depth += 1) {
|
|
@@ -14,20 +42,50 @@ function toExceptions(error, mechanism) {
|
|
|
14
42
|
type: current.name,
|
|
15
43
|
value: current.message,
|
|
16
44
|
mechanism: depth === 0 ? mechanism : void 0,
|
|
17
|
-
frames: parse(current, { allowEmpty: true }).map(normalizeFrame)
|
|
45
|
+
frames: parse(current, { allowEmpty: true }).map((frame) => normalizeFrame(frame, debugIdMap))
|
|
18
46
|
});
|
|
19
47
|
current = current.cause instanceof Error ? current.cause : void 0;
|
|
20
48
|
}
|
|
21
49
|
return exceptions;
|
|
22
50
|
}
|
|
23
|
-
|
|
51
|
+
let cachedDebugIdMap;
|
|
52
|
+
let cachedDebugIdCount = 0;
|
|
53
|
+
function getDebugIdMap() {
|
|
54
|
+
const registry = globalThis["_debugIds"];
|
|
55
|
+
if (!registry) return /* @__PURE__ */ new Map();
|
|
56
|
+
const entries = Object.keys(registry);
|
|
57
|
+
if (cachedDebugIdMap && entries.length === cachedDebugIdCount) return cachedDebugIdMap;
|
|
58
|
+
const map = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const stackKey of entries) {
|
|
60
|
+
const debugId = registry[stackKey];
|
|
61
|
+
if (!debugId) continue;
|
|
62
|
+
const filename = extractFilenameFromStack(stackKey);
|
|
63
|
+
if (filename) map.set(filename, debugId);
|
|
64
|
+
}
|
|
65
|
+
cachedDebugIdMap = map;
|
|
66
|
+
cachedDebugIdCount = entries.length;
|
|
67
|
+
return map;
|
|
68
|
+
}
|
|
69
|
+
function extractFilenameFromStack(stack) {
|
|
70
|
+
const lines = stack.split("\n");
|
|
71
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
72
|
+
const line = lines[i];
|
|
73
|
+
if (!line) continue;
|
|
74
|
+
const match = line.match(PAREN_FILE_RE) ?? line.match(AT_FILE_RE) ?? line.match(SPIDERMONKEY_RE) ?? line.match(BARE_FILE_RE);
|
|
75
|
+
if (match?.[1]) return match[1].trim();
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
function normalizeFrame(frame, debugIdMap) {
|
|
80
|
+
const fileName = typeof frame.fileName === "string" ? frame.fileName : void 0;
|
|
24
81
|
return {
|
|
25
|
-
fileName
|
|
82
|
+
fileName,
|
|
26
83
|
functionName: typeof frame.functionName === "string" ? frame.functionName : void 0,
|
|
27
84
|
lineNumber: typeof frame.lineNumber === "number" ? frame.lineNumber : void 0,
|
|
28
85
|
columnNumber: typeof frame.columnNumber === "number" ? frame.columnNumber : void 0,
|
|
29
|
-
source: typeof frame.source === "string" ? frame.source : void 0
|
|
86
|
+
source: typeof frame.source === "string" ? frame.source : void 0,
|
|
87
|
+
debugId: fileName ? debugIdMap.get(fileName) : void 0
|
|
30
88
|
};
|
|
31
89
|
}
|
|
32
90
|
//#endregion
|
|
33
|
-
export { toError, toExceptions };
|
|
91
|
+
export { extractFilenameFromStack, shouldDropBrowserExtensionNoise, toError, toExceptions };
|
package/dist/sdk/errors.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../src/sdk/errors.ts"],"sourcesContent":["import { parse } from \"error-stack-parser-es\";\n\nimport type { IngestedFrame } from \"#data/frame\";\nimport type {\n ErrorMechanism,\n ExceptionValue,\n} from \"#sdk/plugins/payload/errors\";\n\nconst MAX_CAUSE_DEPTH = 5;\n\nexport function toError(error: unknown): Error {\n if (error instanceof Error) {\n return error;\n }\n\n if (typeof error === \"string\") {\n return new Error(error);\n }\n\n return new Error(String(error));\n}\n\nexport function toExceptions(\n error: Error,\n mechanism: ErrorMechanism\n): ExceptionValue[] {\n const exceptions: ExceptionValue[] = [];\n let current: Error | undefined = error;\n\n for (let depth = 0; current && depth < MAX_CAUSE_DEPTH; depth += 1) {\n exceptions.push({\n type: current.name,\n value: current.message,\n mechanism: depth === 0 ? mechanism : undefined,\n frames: parse(current, { allowEmpty: true }).map(normalizeFrame),\n });\n\n current = current.cause instanceof Error ? current.cause : undefined;\n }\n\n return exceptions;\n}\n\nfunction normalizeFrame(frame: {\n
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../src/sdk/errors.ts"],"sourcesContent":["import { parse } from \"error-stack-parser-es\";\n\nimport type { IngestedFrame } from \"#data/frame\";\nimport type {\n ErrorMechanism,\n ExceptionValue,\n} from \"#sdk/plugins/payload/errors\";\n\n/** URL schemes used by browser extensions in stack frame `fileName` values. */\nconst BROWSER_EXTENSION_SCRIPT_URL_PREFIXES: readonly string[] = [\n \"chrome-extension://\",\n \"moz-extension://\",\n \"safari-web-extension://\",\n \"safari-extension://\",\n \"ms-browser-extension://\",\n];\n\nfunction isExtensionOriginated({ fileName }: IngestedFrame): boolean {\n return BROWSER_EXTENSION_SCRIPT_URL_PREFIXES.some(\n (prefix) => fileName?.startsWith(prefix) ?? false\n );\n}\n\n/**\n * True when the root exception has at least one stack frame whose `fileName` is\n * a browser-extension script URL. Covers extension-only stacks, extension\n * interceptors (extension frames above app), and app errors whose stack still\n * includes extension code (e.g. hydration) — stacks with no filenames are\n * unchanged (returns false).\n */\nexport function shouldDropBrowserExtensionNoise(\n exceptions: readonly ExceptionValue[]\n): boolean {\n const frames = exceptions[0]?.frames;\n\n if (!frames?.length) {\n return false;\n }\n\n return frames.some(isExtensionOriginated);\n}\n\nconst MAX_CAUSE_DEPTH = 5;\n\nconst PAREN_FILE_RE = /\\((.+?)(?::\\d+){1,2}\\)/;\nconst AT_FILE_RE = /at\\s+(.+?)(?::\\d+){1,2}$/;\nconst SPIDERMONKEY_RE = /(?:^|@)((?:https?:\\/\\/|\\/).+?)(?::\\d+){1,2}$/;\nconst BARE_FILE_RE = /(?:^|@)(.+?)(?::\\d+){1,2}$/;\n\nexport function toError(error: unknown): Error {\n if (error instanceof Error) {\n return error;\n }\n\n if (typeof error === \"string\") {\n return new Error(error);\n }\n\n return new Error(String(error));\n}\n\nexport function toExceptions(\n error: Error,\n mechanism: ErrorMechanism\n): ExceptionValue[] {\n const debugIdMap = getDebugIdMap();\n const exceptions: ExceptionValue[] = [];\n let current: Error | undefined = error;\n\n for (let depth = 0; current && depth < MAX_CAUSE_DEPTH; depth += 1) {\n exceptions.push({\n type: current.name,\n value: current.message,\n mechanism: depth === 0 ? mechanism : undefined,\n frames: parse(current, { allowEmpty: true }).map((frame) =>\n normalizeFrame(frame, debugIdMap)\n ),\n });\n\n current = current.cause instanceof Error ? current.cause : undefined;\n }\n\n return exceptions;\n}\n\nlet cachedDebugIdMap: Map<string, string> | undefined;\nlet cachedDebugIdCount = 0;\n\nfunction getDebugIdMap(): Map<string, string> {\n const registry = (globalThis as Record<string, unknown>)[\"_debugIds\"] as\n | Record<string, string>\n | undefined;\n\n if (!registry) {\n return new Map();\n }\n\n const entries = Object.keys(registry);\n if (cachedDebugIdMap && entries.length === cachedDebugIdCount) {\n return cachedDebugIdMap;\n }\n\n const map = new Map<string, string>();\n for (const stackKey of entries) {\n const debugId = registry[stackKey];\n if (!debugId) {\n continue;\n }\n\n const filename = extractFilenameFromStack(stackKey);\n if (filename) {\n map.set(filename, debugId);\n }\n }\n\n cachedDebugIdMap = map;\n cachedDebugIdCount = entries.length;\n return map;\n}\n\nexport function extractFilenameFromStack(stack: string): string | null {\n const lines = stack.split(\"\\n\");\n for (let i = lines.length - 1; i >= 0; i--) {\n const line = lines[i];\n if (!line) {\n continue;\n }\n const match =\n line.match(PAREN_FILE_RE) ??\n line.match(AT_FILE_RE) ??\n line.match(SPIDERMONKEY_RE) ??\n line.match(BARE_FILE_RE);\n\n if (match?.[1]) {\n return match[1].trim();\n }\n }\n return null;\n}\n\nfunction normalizeFrame(\n frame: {\n fileName?: unknown;\n functionName?: unknown;\n lineNumber?: unknown;\n columnNumber?: unknown;\n source?: unknown;\n },\n debugIdMap: Map<string, string>\n): IngestedFrame {\n const fileName =\n typeof frame.fileName === \"string\" ? frame.fileName : undefined;\n\n return {\n fileName,\n functionName:\n typeof frame.functionName === \"string\" ? frame.functionName : undefined,\n lineNumber:\n typeof frame.lineNumber === \"number\" ? frame.lineNumber : undefined,\n columnNumber:\n typeof frame.columnNumber === \"number\" ? frame.columnNumber : undefined,\n source: typeof frame.source === \"string\" ? frame.source : undefined,\n debugId: fileName ? debugIdMap.get(fileName) : undefined,\n };\n}\n"],"mappings":";;;AASA,MAAM,wCAA2D;CAC/D;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,sBAAsB,EAAE,YAAoC;AACnE,QAAO,sCAAsC,MAC1C,WAAW,UAAU,WAAW,OAAO,IAAI,MAC7C;;;;;;;;;AAUH,SAAgB,gCACd,YACS;CACT,MAAM,SAAS,WAAW,IAAI;AAE9B,KAAI,CAAC,QAAQ,OACX,QAAO;AAGT,QAAO,OAAO,KAAK,sBAAsB;;AAG3C,MAAM,kBAAkB;AAExB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,eAAe;AAErB,SAAgB,QAAQ,OAAuB;AAC7C,KAAI,iBAAiB,MACnB,QAAO;AAGT,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,MAAM,MAAM;AAGzB,QAAO,IAAI,MAAM,OAAO,MAAM,CAAC;;AAGjC,SAAgB,aACd,OACA,WACkB;CAClB,MAAM,aAAa,eAAe;CAClC,MAAM,aAA+B,EAAE;CACvC,IAAI,UAA6B;AAEjC,MAAK,IAAI,QAAQ,GAAG,WAAW,QAAQ,iBAAiB,SAAS,GAAG;AAClE,aAAW,KAAK;GACd,MAAM,QAAQ;GACd,OAAO,QAAQ;GACf,WAAW,UAAU,IAAI,YAAY,KAAA;GACrC,QAAQ,MAAM,SAAS,EAAE,YAAY,MAAM,CAAC,CAAC,KAAK,UAChD,eAAe,OAAO,WAAW,CAClC;GACF,CAAC;AAEF,YAAU,QAAQ,iBAAiB,QAAQ,QAAQ,QAAQ,KAAA;;AAG7D,QAAO;;AAGT,IAAI;AACJ,IAAI,qBAAqB;AAEzB,SAAS,gBAAqC;CAC5C,MAAM,WAAY,WAAuC;AAIzD,KAAI,CAAC,SACH,wBAAO,IAAI,KAAK;CAGlB,MAAM,UAAU,OAAO,KAAK,SAAS;AACrC,KAAI,oBAAoB,QAAQ,WAAW,mBACzC,QAAO;CAGT,MAAM,sBAAM,IAAI,KAAqB;AACrC,MAAK,MAAM,YAAY,SAAS;EAC9B,MAAM,UAAU,SAAS;AACzB,MAAI,CAAC,QACH;EAGF,MAAM,WAAW,yBAAyB,SAAS;AACnD,MAAI,SACF,KAAI,IAAI,UAAU,QAAQ;;AAI9B,oBAAmB;AACnB,sBAAqB,QAAQ;AAC7B,QAAO;;AAGT,SAAgB,yBAAyB,OAA8B;CACrE,MAAM,QAAQ,MAAM,MAAM,KAAK;AAC/B,MAAK,IAAI,IAAI,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK;EAC1C,MAAM,OAAO,MAAM;AACnB,MAAI,CAAC,KACH;EAEF,MAAM,QACJ,KAAK,MAAM,cAAc,IACzB,KAAK,MAAM,WAAW,IACtB,KAAK,MAAM,gBAAgB,IAC3B,KAAK,MAAM,aAAa;AAE1B,MAAI,QAAQ,GACV,QAAO,MAAM,GAAG,MAAM;;AAG1B,QAAO;;AAGT,SAAS,eACP,OAOA,YACe;CACf,MAAM,WACJ,OAAO,MAAM,aAAa,WAAW,MAAM,WAAW,KAAA;AAExD,QAAO;EACL;EACA,cACE,OAAO,MAAM,iBAAiB,WAAW,MAAM,eAAe,KAAA;EAChE,YACE,OAAO,MAAM,eAAe,WAAW,MAAM,aAAa,KAAA;EAC5D,cACE,OAAO,MAAM,iBAAiB,WAAW,MAAM,eAAe,KAAA;EAChE,QAAQ,OAAO,MAAM,WAAW,WAAW,MAAM,SAAS,KAAA;EAC1D,SAAS,WAAW,WAAW,IAAI,SAAS,GAAG,KAAA;EAChD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/sdk/geo.d.ts
|
|
4
|
+
declare const cloudflareTraceSchema: z.ZodObject<{
|
|
5
|
+
loc: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;
|
|
8
|
+
declare function extractCountryHeader(request: Request): string | null;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo.d.mts","names":[],"sources":["../../src/sdk/geo.ts"],"mappings":";;;cAEa,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;KAItB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,iBAQ7B,oBAAA,CAAqB,OAAA,EAAS,OAAA"}
|
package/dist/sdk/geo.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/geo.ts
|
|
3
|
+
const cloudflareTraceSchema = z.object({ loc: z.string().length(2) }).passthrough();
|
|
4
|
+
const GEO_COUNTRY_HEADERS = [
|
|
5
|
+
"cf-ipcountry",
|
|
6
|
+
"x-vercel-ip-country",
|
|
7
|
+
"x-country-code"
|
|
8
|
+
];
|
|
9
|
+
function extractCountryHeader(request) {
|
|
10
|
+
for (const header of GEO_COUNTRY_HEADERS) {
|
|
11
|
+
const value = request.headers.get(header);
|
|
12
|
+
if (value && value.length === 2) return value.toUpperCase();
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { cloudflareTraceSchema, extractCountryHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo.mjs","names":[],"sources":["../../src/sdk/geo.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const cloudflareTraceSchema = z\n .object({ loc: z.string().length(2) })\n .passthrough();\n\nexport type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;\n\nconst GEO_COUNTRY_HEADERS = [\n \"cf-ipcountry\",\n \"x-vercel-ip-country\",\n \"x-country-code\",\n] as const;\n\nexport function extractCountryHeader(request: Request): string | null {\n for (const header of GEO_COUNTRY_HEADERS) {\n const value = request.headers.get(header);\n if (value && value.length === 2) {\n return value.toUpperCase();\n }\n }\n return null;\n}\n"],"mappings":";;AAEA,MAAa,wBAAwB,EAClC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CACrC,aAAa;AAIhB,MAAM,sBAAsB;CAC1B;CACA;CACA;CACD;AAED,SAAgB,qBAAqB,SAAiC;AACpE,MAAK,MAAM,UAAU,qBAAqB;EACxC,MAAM,QAAQ,QAAQ,QAAQ,IAAI,OAAO;AACzC,MAAI,SAAS,MAAM,WAAW,EAC5B,QAAO,MAAM,aAAa;;AAG9B,QAAO"}
|
package/dist/sdk/identify.d.mts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/identify.d.ts
|
|
4
|
+
declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"clerk">;
|
|
6
|
+
name: z.ZodLiteral<"Clerk">;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"auth0">;
|
|
9
|
+
name: z.ZodLiteral<"Auth0">;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"custom">;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
}, z.core.$strip>], "type">;
|
|
14
|
+
type IdentifySource = z.infer<typeof identifySourceSchema>;
|
|
4
15
|
declare const identifyParamsSchema: z.ZodObject<{
|
|
5
16
|
avatar: z.ZodOptional<z.ZodString>;
|
|
6
|
-
country: z.ZodOptional<z.ZodString>;
|
|
7
17
|
email: z.ZodOptional<z.ZodString>;
|
|
8
18
|
identifier: z.ZodString;
|
|
9
19
|
name: z.ZodOptional<z.ZodString>;
|
|
10
|
-
source: z.
|
|
20
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"clerk">;
|
|
22
|
+
name: z.ZodLiteral<"Clerk">;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"auth0">;
|
|
25
|
+
name: z.ZodLiteral<"Auth0">;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"custom">;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
}, z.core.$strip>], "type">;
|
|
11
30
|
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
12
31
|
}, z.core.$strip>;
|
|
13
32
|
type IdentifyParams = z.infer<typeof identifyParamsSchema>;
|
|
14
33
|
//#endregion
|
|
15
|
-
export { IdentifyParams, identifyParamsSchema };
|
|
34
|
+
export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify.d.mts","names":[],"sources":["../../src/sdk/identify.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"identify.d.mts","names":[],"sources":["../../src/sdk/identify.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;KAMrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;KASrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA"}
|
package/dist/sdk/identify.mjs
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/identify.ts
|
|
3
|
+
const identifySourceSchema = z.discriminatedUnion("type", [
|
|
4
|
+
z.object({
|
|
5
|
+
type: z.literal("clerk"),
|
|
6
|
+
name: z.literal("Clerk")
|
|
7
|
+
}),
|
|
8
|
+
z.object({
|
|
9
|
+
type: z.literal("auth0"),
|
|
10
|
+
name: z.literal("Auth0")
|
|
11
|
+
}),
|
|
12
|
+
z.object({
|
|
13
|
+
type: z.literal("custom"),
|
|
14
|
+
name: z.string()
|
|
15
|
+
})
|
|
16
|
+
]);
|
|
3
17
|
const identifyParamsSchema = z.object({
|
|
4
18
|
avatar: z.string().optional(),
|
|
5
|
-
country: z.string().max(2).optional(),
|
|
6
19
|
email: z.string().optional(),
|
|
7
20
|
identifier: z.string(),
|
|
8
21
|
name: z.string().optional(),
|
|
9
|
-
source:
|
|
22
|
+
source: identifySourceSchema,
|
|
10
23
|
traits: z.record(z.string(), z.unknown()).optional()
|
|
11
24
|
});
|
|
12
25
|
//#endregion
|
|
13
|
-
export { identifyParamsSchema };
|
|
26
|
+
export { identifyParamsSchema, identifySourceSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify.mjs","names":[],"sources":["../../src/sdk/identify.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"identify.mjs","names":[],"sources":["../../src/sdk/identify.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const identifySourceSchema = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"clerk\"), name: z.literal(\"Clerk\") }),\n z.object({ type: z.literal(\"auth0\"), name: z.literal(\"Auth0\") }),\n z.object({ type: z.literal(\"custom\"), name: z.string() }),\n]);\n\nexport type IdentifySource = z.infer<typeof identifySourceSchema>;\n\nexport const identifyParamsSchema = z.object({\n avatar: z.string().optional(),\n email: z.string().optional(),\n identifier: z.string(),\n name: z.string().optional(),\n source: identifySourceSchema,\n traits: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type IdentifyParams = z.infer<typeof identifyParamsSchema>;\n"],"mappings":";;AAEA,MAAa,uBAAuB,EAAE,mBAAmB,QAAQ;CAC/D,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ,QAAQ;EAAE,MAAM,EAAE,QAAQ,QAAQ;EAAE,CAAC;CAChE,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ,QAAQ;EAAE,MAAM,EAAE,QAAQ,QAAQ;EAAE,CAAC;CAChE,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ,SAAS;EAAE,MAAM,EAAE,QAAQ;EAAE,CAAC;CAC1D,CAAC;AAIF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,YAAY,EAAE,QAAQ;CACtB,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,QAAQ;CACR,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,UAAU;CACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/browser.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/browser.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const deviceMetadataSchema = z.object({\n browser: z.object({\n major: z.string().optional(),\n name: z.string().optional(),\n type: z.string().optional(),\n version: z.string().optional(),\n }),\n cpu: z.object({\n architecture: z.string().optional(),\n }),\n device: z.object({\n model: z.string().optional(),\n type: z.string().optional(),\n vendor: z.string().optional(),\n }),\n engine: z.object({\n name: z.string().optional(),\n version: z.string().optional(),\n }),\n os: z.object({\n name: z.string().optional(),\n version: z.string().optional(),\n }),\n ua: z.string(),\n});\n\nexport type DeviceMetadata = z.infer<typeof deviceMetadataSchema>;\n\nconst browserMetadataSchema = z.object({\n language: z.string().optional(),\n timezone: z.string().optional(),\n display: z.object({\n screen: z.object({\n height: z.number(),\n width: z.number(),\n orientation: z.string().optional(),\n }),\n }),\n});\n\nexport type BrowserMetadata = z.infer<typeof browserMetadataSchema>;\n\nexport const browserContextSchema = z.object({\n runtime: z.literal(\"browser\"),\n browser: browserMetadataSchema.nullable(),\n device: deviceMetadataSchema.nullable(),\n});\n\nexport type BrowserContext = z.infer<typeof browserContextSchema>;\n"],"mappings":";;AAEA,MAAa,uBAAuB,EAAE,OAAO;CAC3C,SAAS,EAAE,OAAO;EAChB,OAAO,EAAE,QAAQ,CAAC,UAAU;EAC5B,MAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,MAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC/B,CAAC;CACF,KAAK,EAAE,OAAO,EACZ,cAAc,EAAE,QAAQ,CAAC,UAAU,EACpC,CAAC;CACF,QAAQ,EAAE,OAAO;EACf,OAAO,EAAE,QAAQ,CAAC,UAAU;EAC5B,MAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,QAAQ,EAAE,QAAQ,CAAC,UAAU;EAC9B,CAAC;CACF,QAAQ,EAAE,OAAO;EACf,MAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC/B,CAAC;CACF,IAAI,EAAE,OAAO;EACX,MAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC/B,CAAC;CACF,IAAI,EAAE,QAAQ;CACf,CAAC;AAIF,MAAM,wBAAwB,EAAE,OAAO;CACrC,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,SAAS,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO;EACf,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,QAAQ;EACjB,aAAa,EAAE,QAAQ,CAAC,UAAU;EACnC,CAAC,EACH,CAAC;CACH,CAAC;AAIF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,SAAS,EAAE,QAAQ,UAAU;CAC7B,SAAS,sBAAsB,UAAU;CACzC,QAAQ,qBAAqB,UAAU;CACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"edge.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const edgeContextSchema = z.object({\n runtime: z.literal(\"edge\"),\n});\n\nexport type EdgeContext = z.infer<typeof edgeContextSchema>;\n"],"mappings":";;AAEA,MAAa,oBAAoB,EAAE,OAAO,EACxC,SAAS,EAAE,QAAQ,OAAO,EAC3B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/plugins/context/next.d.ts
|
|
4
4
|
declare const nextjsContextSchema: z.ZodObject<{
|
|
@@ -20,15 +20,15 @@ declare const nextjsContextSchema: z.ZodObject<{
|
|
|
20
20
|
}>>;
|
|
21
21
|
routePath: z.ZodOptional<z.ZodString>;
|
|
22
22
|
routeType: z.ZodOptional<z.ZodEnum<{
|
|
23
|
-
render: "render";
|
|
24
|
-
route: "route";
|
|
25
23
|
action: "action";
|
|
26
24
|
middleware: "middleware";
|
|
27
25
|
proxy: "proxy";
|
|
26
|
+
render: "render";
|
|
27
|
+
route: "route";
|
|
28
28
|
}>>;
|
|
29
29
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
30
|
-
"Pages Router": "Pages Router";
|
|
31
30
|
"App Router": "App Router";
|
|
31
|
+
"Pages Router": "Pages Router";
|
|
32
32
|
}>>;
|
|
33
33
|
runtime: z.ZodLiteral<"nextjs">;
|
|
34
34
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"next.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const nextjsContextSchema = z.object({\n errorDigest: z.string().optional(),\n renderSource: z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .optional(),\n renderType: z.enum([\"dynamic\", \"dynamic-resume\"]).optional(),\n requestMethod: z.string().optional(),\n requestPath: z.string().optional(),\n revalidateReason: z.enum([\"on-demand\", \"stale\"]).optional(),\n routePath: z.string().optional(),\n routeType: z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .optional(),\n routerKind: z.enum([\"Pages Router\", \"App Router\"]).optional(),\n runtime: z.literal(\"nextjs\"),\n});\n\nexport type NextjsContext = z.infer<typeof nextjsContextSchema>;\n"],"mappings":";;AAEA,MAAa,sBAAsB,EAAE,OAAO;CAC1C,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,cAAc,EACX,KAAK;EACJ;EACA;EACA;EACD,CAAC,CACD,UAAU;CACb,YAAY,EAAE,KAAK,CAAC,WAAW,iBAAiB,CAAC,CAAC,UAAU;CAC5D,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,kBAAkB,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC,CAAC,UAAU;CAC3D,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,WAAW,EACR,KAAK;EAAC;EAAU;EAAS;EAAU;EAAc;EAAQ,CAAC,CAC1D,UAAU;CACb,YAAY,EAAE,KAAK,CAAC,gBAAgB,aAAa,CAAC,CAAC,UAAU;CAC7D,SAAS,EAAE,QAAQ,SAAS;CAC7B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/plugins/payload/errors.d.ts
|
|
4
4
|
declare const errorSourceSchema: z.ZodEnum<{
|
|
5
|
-
edge: "edge";
|
|
6
5
|
client: "client";
|
|
6
|
+
edge: "edge";
|
|
7
7
|
server: "server";
|
|
8
8
|
}>;
|
|
9
9
|
type ErrorSource = z.infer<typeof errorSourceSchema>;
|
|
@@ -27,6 +27,7 @@ declare const exceptionValueSchema: z.ZodObject<{
|
|
|
27
27
|
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
28
28
|
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
source: z.ZodOptional<z.ZodString>;
|
|
30
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
30
31
|
}, z.core.$strip>>;
|
|
31
32
|
}, z.core.$strip>;
|
|
32
33
|
type ExceptionValue = z.infer<typeof exceptionValueSchema>;
|
|
@@ -45,6 +46,7 @@ declare const errorEnvelopePayloadSchema: z.ZodObject<{
|
|
|
45
46
|
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
46
47
|
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
47
48
|
source: z.ZodOptional<z.ZodString>;
|
|
49
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
48
50
|
}, z.core.$strip>>;
|
|
49
51
|
}, z.core.$strip>>;
|
|
50
52
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAIa,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;KAElB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,cAE5B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAMrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,oBAAA,EAAoB,CAAA,CAAA,SAAA
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAIa,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;KAElB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,cAE5B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAMrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;KAOrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;KAI3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\nexport const errorSourceSchema = z.enum([\"client\", \"server\", \"edge\"]);\n\nexport type ErrorSource = z.infer<typeof errorSourceSchema>;\n\nexport const errorMechanismSchema = z.object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n});\n\nexport type ErrorMechanism = z.infer<typeof errorMechanismSchema>;\n\nexport const exceptionValueSchema = z.object({\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n frames: z.array(ingestedFrame),\n});\n\nexport type ExceptionValue = z.infer<typeof exceptionValueSchema>;\n\nexport const errorEnvelopePayloadSchema = z.object({\n exceptions: z.array(exceptionValueSchema).min(1),\n});\n\nexport type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;\n"],"mappings":";;;AAIA,MAAa,oBAAoB,EAAE,KAAK;CAAC;CAAU;CAAU;CAAO,CAAC;AAIrE,MAAa,uBAAuB,EAAE,OAAO;CAC3C,MAAM,EAAE,QAAQ;CAChB,SAAS,EAAE,SAAS;CACpB,WAAW,EAAE,SAAS,CAAC,UAAU;CAClC,CAAC;AAIF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,MAAM,EAAE,QAAQ;CAChB,OAAO,EAAE,QAAQ;CACjB,WAAW,qBAAqB,UAAU;CAC1C,QAAQ,EAAE,MAAM,cAAc;CAC/B,CAAC;AAIF,MAAa,6BAA6B,EAAE,OAAO,EACjD,YAAY,EAAE,MAAM,qBAAqB,CAAC,IAAI,EAAE,EACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-events.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"page-events.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const uiEventPayloadSchema = z.object({\n event: z.record(z.string(), z.unknown()),\n});\n\nexport type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;\n\nexport const pageviewPayloadSchema = z.object({\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;\n\nexport const pageleavePayloadSchema = z.object({\n url: z.string(),\n durationMs: z.number().optional(),\n});\n\nexport type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;\n"],"mappings":";;AAEA,MAAa,uBAAuB,EAAE,OAAO,EAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,EACzC,CAAC;AAIF,MAAa,wBAAwB,EAAE,OAAO;CAC5C,KAAK,EAAE,QAAQ;CACf,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;AAIF,MAAa,yBAAyB,EAAE,OAAO;CAC7C,KAAK,EAAE,QAAQ;CACf,YAAY,EAAE,QAAQ,CAAC,UAAU;CAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rage-click.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"rage-click.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const rageClickPayloadSchema = z.object({\n count: z.number(),\n timeWindow: z.number(),\n selector: z.string(),\n text: z.string(),\n x: z.number(),\n y: z.number(),\n timestamp: z.number(),\n});\n\nexport type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,yBAAyB,EAAE,OAAO;CAC7C,OAAO,EAAE,QAAQ;CACjB,YAAY,EAAE,QAAQ;CACtB,UAAU,EAAE,QAAQ;CACpB,MAAM,EAAE,QAAQ;CAChB,GAAG,EAAE,QAAQ;CACb,GAAG,EAAE,QAAQ;CACb,WAAW,EAAE,QAAQ;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"replay.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const replayChunkPayloadSchema = z.object({\n ts: z.number(),\n count: z.number(),\n events: z.array(z.string()),\n /** First rrweb event timestamp (ms) in this chunk – actual recording start */\n first_event_ts: z.number().optional(),\n /** Last rrweb event timestamp (ms) in this chunk – actual recording end */\n last_event_ts: z.number().optional(),\n});\n\nexport type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,2BAA2B,EAAE,OAAO;CAC/C,IAAI,EAAE,QAAQ;CACd,OAAO,EAAE,QAAQ;CACjB,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;CAE3B,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CAErC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACrC,CAAC"}
|
package/dist/sdk/runtime.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/runtime.d.ts
|
|
4
4
|
declare const envSchema: z.ZodNullable<z.ZodEnum<{
|
|
@@ -8,8 +8,8 @@ declare const envSchema: z.ZodNullable<z.ZodEnum<{
|
|
|
8
8
|
}>>;
|
|
9
9
|
type Env = z.infer<typeof envSchema>;
|
|
10
10
|
declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
|
|
11
|
-
edge: "edge";
|
|
12
11
|
browser: "browser";
|
|
12
|
+
edge: "edge";
|
|
13
13
|
node: "node";
|
|
14
14
|
}>>;
|
|
15
15
|
type Runtime = z.infer<typeof runtimeSchema>;
|
package/dist/sdk/runtime.mjs
CHANGED
package/dist/sdk/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/sdk/runtime.ts"],"sourcesContent":["import { z } from \"zod
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/sdk/runtime.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const envSchema = z\n .enum([\"development\", \"preview\", \"production\"])\n .nullable();\n\nexport type Env = z.infer<typeof envSchema>;\n\nexport const runtimeSchema = z.enum([\"browser\", \"node\", \"edge\"]).nullable();\n\nexport type Runtime = z.infer<typeof runtimeSchema>;\n\nexport function inferRuntime(options?: {\n readonly nextRuntime?: unknown;\n}): Runtime {\n // Browser\n if (\n typeof window !== \"undefined\" &&\n typeof document !== \"undefined\" &&\n typeof navigator !== \"undefined\"\n ) {\n return \"browser\";\n }\n\n // Edge (Vercel sets globalThis.EdgeRuntime = \"edge-runtime\")\n if (\n typeof (globalThis as { EdgeRuntime?: unknown }).EdgeRuntime === \"string\"\n ) {\n return \"edge\";\n }\n\n // Next.js Edge (explicit signal)\n if (options?.nextRuntime === \"edge\") {\n return \"edge\";\n }\n\n // Node\n if (\n typeof process !== \"undefined\" &&\n typeof process.versions?.node === \"string\"\n ) {\n return \"node\";\n }\n\n return null;\n}\n\nexport function normalizeEnv(value: unknown): Env {\n if (typeof value !== \"string\") {\n return null;\n }\n\n const env = value.toLowerCase();\n\n if (envSchema.safeParse(env).success) {\n return env as Env;\n }\n\n return null;\n}\n"],"mappings":";;AAEA,MAAa,YAAY,EACtB,KAAK;CAAC;CAAe;CAAW;CAAa,CAAC,CAC9C,UAAU;AAIb,MAAa,gBAAgB,EAAE,KAAK;CAAC;CAAW;CAAQ;CAAO,CAAC,CAAC,UAAU;AAI3E,SAAgB,aAAa,SAEjB;AAEV,KACE,OAAO,WAAW,eAClB,OAAO,aAAa,eACpB,OAAO,cAAc,YAErB,QAAO;AAIT,KACE,OAAQ,WAAyC,gBAAgB,SAEjE,QAAO;AAIT,KAAI,SAAS,gBAAgB,OAC3B,QAAO;AAIT,KACE,OAAO,YAAY,eACnB,OAAO,QAAQ,UAAU,SAAS,SAElC,QAAO;AAGT,QAAO;;AAGT,SAAgB,aAAa,OAAqB;AAChD,KAAI,OAAO,UAAU,SACnB,QAAO;CAGT,MAAM,MAAM,MAAM,aAAa;AAE/B,KAAI,UAAU,UAAU,IAAI,CAAC,QAC3B,QAAO;AAGT,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
@@ -106,17 +106,17 @@
|
|
|
106
106
|
"typecheck": "tsc --noEmit --incremental"
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@interfere/constants": "^8.
|
|
109
|
+
"@interfere/constants": "^8.1.0",
|
|
110
110
|
"error-stack-parser-es": "^1.0.5",
|
|
111
111
|
"zod": "^4.3.6"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@interfere/
|
|
115
|
-
"@interfere/
|
|
114
|
+
"@interfere/test-utils": "^1.0.0",
|
|
115
|
+
"@interfere/typescript-config": "^8.1.0",
|
|
116
116
|
"@types/node": "^24.12.0",
|
|
117
|
-
"@vitest/coverage-v8": "^4.
|
|
118
|
-
"tsdown": "^0.21.
|
|
119
|
-
"typescript": "
|
|
120
|
-
"vitest": "^4.
|
|
117
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
118
|
+
"tsdown": "^0.21.7",
|
|
119
|
+
"typescript": "6.0.2",
|
|
120
|
+
"vitest": "^4.1.3"
|
|
121
121
|
}
|
|
122
122
|
}
|