@interfere/types 8.1.6 → 9.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/data/frame.d.mts +16 -4
- package/dist/data/frame.d.mts.map +1 -1
- package/dist/data/frame.mjs +1 -16
- package/dist/data/frame.mjs.map +1 -1
- package/dist/data/session.d.mts +1 -1
- package/dist/data/session.d.mts.map +1 -1
- package/dist/data/session.mjs +1 -9
- package/dist/data/session.mjs.map +1 -1
- package/dist/data/source-maps.d.mts +133 -27
- package/dist/data/source-maps.d.mts.map +1 -1
- package/dist/data/source-maps.mjs +1 -21
- package/dist/data/source-maps.mjs.map +1 -1
- package/dist/events/error.d.mts +139 -35
- package/dist/events/error.d.mts.map +1 -1
- package/dist/events/error.mjs +1 -64
- package/dist/events/error.mjs.map +1 -1
- package/dist/events/pageleave.d.mts +1 -1
- package/dist/events/pageleave.mjs +1 -10
- package/dist/events/pageleave.mjs.map +1 -1
- package/dist/events/pageview.d.mts +1 -1
- package/dist/events/pageview.d.mts.map +1 -1
- package/dist/events/pageview.mjs +1 -11
- package/dist/events/pageview.mjs.map +1 -1
- package/dist/integrations/index.mjs +1 -57
- package/dist/integrations/index.mjs.map +1 -1
- package/dist/integrations/platforms/github.mjs +1 -13
- package/dist/integrations/platforms/github.mjs.map +1 -1
- package/dist/integrations/platforms/slack.d.mts +32 -0
- package/dist/integrations/platforms/slack.d.mts.map +1 -0
- package/dist/integrations/platforms/slack.mjs +1 -0
- package/dist/integrations/platforms/slack.mjs.map +1 -0
- package/dist/integrations/platforms/vercel.mjs +1 -26
- package/dist/integrations/platforms/vercel.mjs.map +1 -1
- package/dist/releases/definition.d.mts +2 -1
- package/dist/releases/definition.d.mts.map +1 -1
- package/dist/releases/definition.mjs +1 -63
- package/dist/releases/definition.mjs.map +1 -1
- package/dist/releases/slug.d.mts +22 -0
- package/dist/releases/slug.d.mts.map +1 -0
- package/dist/releases/slug.mjs +1 -0
- package/dist/releases/slug.mjs.map +1 -0
- package/dist/sdk/env.mjs +1 -17
- package/dist/sdk/env.mjs.map +1 -1
- package/dist/sdk/envelope.d.mts +161 -34
- package/dist/sdk/envelope.d.mts.map +1 -1
- package/dist/sdk/envelope.mjs +1 -114
- package/dist/sdk/envelope.mjs.map +1 -1
- package/dist/sdk/errors.d.mts +87 -30
- package/dist/sdk/errors.d.mts.map +1 -1
- package/dist/sdk/errors.mjs +2 -253
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/geo.mjs +1 -17
- package/dist/sdk/geo.mjs.map +1 -1
- package/dist/sdk/identify.d.mts +1 -1
- package/dist/sdk/identify.d.mts.map +1 -1
- package/dist/sdk/identify.mjs +1 -43
- package/dist/sdk/identify.mjs.map +1 -1
- package/dist/sdk/plugins/context/browser.d.mts +8 -0
- package/dist/sdk/plugins/context/browser.d.mts.map +1 -1
- package/dist/sdk/plugins/context/browser.mjs +1 -81
- package/dist/sdk/plugins/context/browser.mjs.map +1 -1
- package/dist/sdk/plugins/context/edge.mjs +1 -9
- package/dist/sdk/plugins/context/edge.mjs.map +1 -1
- package/dist/sdk/plugins/context/next.mjs +1 -50
- package/dist/sdk/plugins/context/next.mjs.map +1 -1
- package/dist/sdk/plugins/context/node.d.mts +12 -0
- package/dist/sdk/plugins/context/node.d.mts.map +1 -0
- package/dist/sdk/plugins/context/node.mjs +1 -0
- package/dist/sdk/plugins/context/node.mjs.map +1 -0
- package/dist/sdk/plugins/manifest.d.mts +5 -0
- package/dist/sdk/plugins/manifest.d.mts.map +1 -1
- package/dist/sdk/plugins/manifest.mjs +1 -62
- package/dist/sdk/plugins/manifest.mjs.map +1 -1
- package/dist/sdk/plugins/payload/errors.d.mts +27 -18
- package/dist/sdk/plugins/payload/errors.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/errors.mjs +1 -37
- package/dist/sdk/plugins/payload/errors.mjs.map +1 -1
- package/dist/sdk/plugins/payload/page-events.d.mts +2 -2
- package/dist/sdk/plugins/payload/page-events.mjs +1 -25
- package/dist/sdk/plugins/payload/page-events.mjs.map +1 -1
- package/dist/sdk/plugins/payload/rage-click.mjs +1 -17
- package/dist/sdk/plugins/payload/rage-click.mjs.map +1 -1
- package/dist/sdk/plugins/payload/replay.mjs +1 -17
- package/dist/sdk/plugins/payload/replay.mjs.map +1 -1
- package/dist/sdk/remote-config.d.mts +31 -4
- package/dist/sdk/remote-config.d.mts.map +1 -1
- package/dist/sdk/remote-config.mjs +1 -5
- package/dist/sdk/remote-config.mjs.map +1 -1
- package/dist/sdk/runtime.mjs +1 -35
- package/dist/sdk/runtime.mjs.map +1 -1
- package/package.json +12 -18
package/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<a href="https://interfere.com">
|
|
3
3
|
<picture>
|
|
4
4
|
<source media="(prefers-color-scheme: dark)" srcset="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-dark.png">
|
|
5
|
-
<img src="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-light.png" height="64">
|
|
5
|
+
<img src="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-light.png" height="64" alt="Interfere">
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
8
|
<h1 align="center">@interfere/types</h1>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@interfere/types"><img src="https://img.shields.io/npm/v/@interfere/types.svg" /></a>
|
|
13
|
-
<a href="https://github.com/interfere-inc/interfere/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@interfere/types.svg" /></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@interfere/types"><img src="https://img.shields.io/npm/v/@interfere/types.svg" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/interfere-inc/interfere/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@interfere/types.svg" alt="License" /></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
package/dist/data/frame.d.mts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/data/frame.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* One stack frame as it lands at the collector — pre-source-map
|
|
6
|
+
* resolution. Produced by the collector's stack parser from the OTel
|
|
7
|
+
* `exception.stacktrace` string, supplemented by SDK-side parsed
|
|
8
|
+
* frames (React component stack, `window.onerror` fallback).
|
|
9
|
+
*
|
|
10
|
+
* Field names match the post-resolution `EnrichedFrame` shape so
|
|
11
|
+
* consumers reading "the file the frame is in" don't have to remember
|
|
12
|
+
* which lifecycle stage they're at. The wire format is the same
|
|
13
|
+
* across SDK + collector + enrichment + storage.
|
|
14
|
+
*/
|
|
4
15
|
declare const ingestedFrame: z.ZodObject<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
id: z.ZodOptional<z.ZodString>;
|
|
17
|
+
file: z.ZodOptional<z.ZodString>;
|
|
18
|
+
fn: z.ZodOptional<z.ZodString>;
|
|
19
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
9
21
|
source: z.ZodOptional<z.ZodString>;
|
|
10
22
|
debugId: z.ZodOptional<z.ZodString>;
|
|
11
23
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.mts","names":[],"sources":["../../src/data/frame.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"frame.d.mts","names":[],"sources":["../../src/data/frame.ts"],"mappings":";;;;;AAaA;;;;;;;;;cAAa,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;;KA+Bd,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,aAAA"}
|
package/dist/data/frame.mjs
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/data/frame.ts
|
|
3
|
-
const ingestedFrame = z.object({
|
|
4
|
-
fileName: z.string().optional(),
|
|
5
|
-
functionName: z.string().optional(),
|
|
6
|
-
lineNumber: z.number().optional(),
|
|
7
|
-
columnNumber: z.number().optional(),
|
|
8
|
-
source: z.string().optional(),
|
|
9
|
-
debugId: z.string().optional()
|
|
10
|
-
}).meta({
|
|
11
|
-
id: "Frame",
|
|
12
|
-
title: "Frame",
|
|
13
|
-
description: "A single stack frame captured from an error."
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
export { ingestedFrame };
|
|
1
|
+
import{z as e}from"zod";const t=e.object({id:e.string().optional(),file:e.string().optional(),fn:e.string().optional(),line:e.number().optional(),column:e.number().optional(),source:e.string().optional(),debugId:e.string().optional()}).meta({id:`Frame`,title:`Frame`,description:`A single stack frame captured from an error.`});export{t as 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\";\n\nexport const ingestedFrame = z\n .object({\n
|
|
1
|
+
{"version":3,"file":"frame.mjs","names":[],"sources":["../../src/data/frame.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * One stack frame as it lands at the collector — pre-source-map\n * resolution. Produced by the collector's stack parser from the OTel\n * `exception.stacktrace` string, supplemented by SDK-side parsed\n * frames (React component stack, `window.onerror` fallback).\n *\n * Field names match the post-resolution `EnrichedFrame` shape so\n * consumers reading \"the file the frame is in\" don't have to remember\n * which lifecycle stage they're at. The wire format is the same\n * across SDK + collector + enrichment + storage.\n */\nexport const ingestedFrame = z\n .object({\n /**\n * Stable id within a payload's `frames[]`. The collector mapper\n * sets this to the array index it produced (`\"frame-0\"`,\n * `\"frame-1\"`, ...) so post-resolution frames can reference back\n * to their pre-resolution origin via `EnrichedFrame.ingestedId`.\n */\n id: z.string().optional(),\n /** URL or path of the JS file the frame is in. */\n file: z.string().optional(),\n /** Function name. */\n fn: z.string().optional(),\n line: z.number().optional(),\n column: z.number().optional(),\n /** Pre-context source code line, when the SDK happened to capture it. */\n source: z.string().optional(),\n /**\n * Build-time injected debug id (webpack/turbopack/rollup). When\n * present, enrichment uses this to look up the source map from the\n * release manifest directly; absent, it falls back to suffix-\n * matching `file` against `manifest.files[].chunkUrl`.\n */\n debugId: z.string().optional(),\n })\n .meta({\n id: \"Frame\",\n title: \"Frame\",\n description: \"A single stack frame captured from an error.\",\n });\n\nexport type IngestedFrame = z.infer<typeof ingestedFrame>;\n"],"mappings":"wBAaA,MAAa,EAAgB,EAC1B,OAAO,CAON,GAAI,EAAE,QAAQ,CAAC,UAAU,CAEzB,KAAM,EAAE,QAAQ,CAAC,UAAU,CAE3B,GAAI,EAAE,QAAQ,CAAC,UAAU,CACzB,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAE7B,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAO7B,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC/B,CAAC,CACD,KAAK,CACJ,GAAI,QACJ,MAAO,QACP,YAAa,+CACd,CAAC"}
|
package/dist/data/session.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/data/session.d.ts
|
|
4
|
-
declare const sessionIdSchema: z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>;
|
|
4
|
+
declare const sessionIdSchema: z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>, "SessionId", "out">;
|
|
5
5
|
type SessionId = z.infer<typeof sessionIdSchema>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SessionId, sessionIdSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.mts","names":[],"sources":["../../src/data/session.ts"],"mappings":";;;cAKa,eAAA,EAAe,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,OAAA,EAAA,CAAA,CAAA,kBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"session.d.mts","names":[],"sources":["../../src/data/session.ts"],"mappings":";;;cAKa,eAAA,EAAe,CAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,OAAA,EAAA,CAAA,CAAA,kBAAA;AAAA,KAUhB,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA"}
|
package/dist/data/session.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/data/session.ts
|
|
3
|
-
const sessionIdSchema = z.union([z.uuidv7(), z.templateLiteral(["server_", z.uuidv7()])]).meta({
|
|
4
|
-
id: "SessionId",
|
|
5
|
-
title: "SessionId",
|
|
6
|
-
description: "UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback)."
|
|
7
|
-
});
|
|
8
|
-
//#endregion
|
|
9
|
-
export { sessionIdSchema };
|
|
1
|
+
import{z as e}from"zod";const t=e.union([e.uuidv7(),e.templateLiteral([`server_`,e.uuidv7()])]).meta({id:`SessionId`,title:`SessionId`,description:`UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback).`}).brand();export{t as sessionIdSchema};
|
|
@@ -1 +1 @@
|
|
|
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\n .union([z.uuidv7(), z.templateLiteral([\"server_\", z.uuidv7()])])\n .meta({\n id: \"SessionId\",\n title: \"SessionId\",\n description:\n \"UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback).\",\n });\n\nexport type SessionId = z.infer<typeof sessionIdSchema>;\n"],"mappings":"
|
|
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\n .union([z.uuidv7(), z.templateLiteral([\"server_\", z.uuidv7()])])\n .meta({\n id: \"SessionId\",\n title: \"SessionId\",\n description:\n \"UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback).\",\n })\n .brand<\"SessionId\">();\n\nexport type SessionId = z.infer<typeof sessionIdSchema>;\n"],"mappings":"wBAKA,MAAa,EAAkB,EAC5B,MAAM,CAAC,EAAE,QAAQ,CAAE,EAAE,gBAAgB,CAAC,UAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC/D,KAAK,CACJ,GAAI,YACJ,MAAO,YACP,YACE,0EACH,CAAC,CACD,OAAoB"}
|
|
@@ -1,40 +1,146 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/data/source-maps.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Bundler that produced this source-map upload. Reported back in the
|
|
6
|
+
* SDK `bundler` upload metric for diagnostics. Mandatory now —
|
|
7
|
+
* server-side suffix-matching against `chunkUrl` is uniform across
|
|
8
|
+
* bundlers, but knowing which bundler produced the manifest is still
|
|
9
|
+
* useful for diagnostics (different bundlers exhibit different stack
|
|
10
|
+
* shapes; we want that pivot when investigating resolution issues).
|
|
11
|
+
*/
|
|
12
|
+
declare const manifestBundlerSchema: z.ZodEnum<{
|
|
13
|
+
tsc: "tsc";
|
|
14
|
+
turbopack: "turbopack";
|
|
15
|
+
webpack: "webpack";
|
|
16
|
+
}>;
|
|
17
|
+
type ManifestBundler = z.infer<typeof manifestBundlerSchema>;
|
|
15
18
|
declare const sourceMapManifestSchema: z.ZodObject<{
|
|
16
|
-
|
|
17
|
-
releaseId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
releaseSlug: z.ZodString;
|
|
18
20
|
surfaceId: z.ZodString;
|
|
19
21
|
organizationId: z.ZodString;
|
|
22
|
+
bundler: z.ZodEnum<{
|
|
23
|
+
tsc: "tsc";
|
|
24
|
+
turbopack: "turbopack";
|
|
25
|
+
webpack: "webpack";
|
|
26
|
+
}>;
|
|
20
27
|
createdAt: z.ZodNumber;
|
|
21
28
|
files: z.ZodArray<z.ZodObject<{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hash: z.ZodString;
|
|
29
|
+
chunkUrl: z.ZodString;
|
|
30
|
+
debugId: z.ZodString;
|
|
25
31
|
objectKey: z.ZodString;
|
|
26
|
-
|
|
32
|
+
mapHash: z.ZodString;
|
|
27
33
|
}, z.core.$strip>>;
|
|
28
34
|
}, z.core.$strip>;
|
|
29
35
|
type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Per-entry metadata for the legacy multipart upload endpoint
|
|
38
|
+
* (`POST /v1/releases/:slug/source-maps`). One entry per source-map file
|
|
39
|
+
* in the multipart body, paired by `path` matching the multipart filename.
|
|
40
|
+
*
|
|
41
|
+
* Every entry carries `chunkUrl` (the public URL the runtime loads the
|
|
42
|
+
* chunk from) and `debugId` — both mandatory now. The legacy multipart
|
|
43
|
+
* endpoint accepts the same shape as the new presigned-URL flow.
|
|
44
|
+
*/
|
|
45
|
+
declare const uploadSourceMapEntry: z.ZodObject<{
|
|
46
|
+
path: z.ZodString;
|
|
47
|
+
hash: z.ZodString;
|
|
48
|
+
debugId: z.ZodString;
|
|
49
|
+
chunkUrl: z.ZodString;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
type UploadSourceMapEntry = z.infer<typeof uploadSourceMapEntry>;
|
|
52
|
+
/**
|
|
53
|
+
* Multipart metadata for the legacy upload endpoint. The `files` field
|
|
54
|
+
* carries the actual JSON bodies as multipart File parts; this `metadata`
|
|
55
|
+
* object travels alongside as a JSON-encoded form field.
|
|
56
|
+
*
|
|
57
|
+
* This endpoint is deprecated in favour of the `/sign` + direct R2 PUT
|
|
58
|
+
* + `/complete` flow, which scales beyond the body-size limits of any
|
|
59
|
+
* worker / load balancer in front of the collector. Kept for backwards
|
|
60
|
+
* compatibility with deployed SDKs during the deprecation window.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated
|
|
63
|
+
*/
|
|
64
|
+
declare const uploadSourceMapsMetadata: z.ZodObject<{
|
|
65
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
66
|
+
path: z.ZodString;
|
|
67
|
+
hash: z.ZodString;
|
|
68
|
+
debugId: z.ZodString;
|
|
69
|
+
chunkUrl: z.ZodString;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
sourceFileCount: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
bundler: z.ZodEnum<{
|
|
73
|
+
tsc: "tsc";
|
|
74
|
+
turbopack: "turbopack";
|
|
75
|
+
webpack: "webpack";
|
|
76
|
+
}>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
type UploadSourceMapsMetadata = z.infer<typeof uploadSourceMapsMetadata>;
|
|
79
|
+
declare const uploadSourceMapsResponse: z.ZodObject<{
|
|
80
|
+
ok: z.ZodBoolean;
|
|
81
|
+
processed: z.ZodNumber;
|
|
82
|
+
message: z.ZodString;
|
|
83
|
+
fileCount: z.ZodNumber;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
type UploadSourceMapsResponse = z.infer<typeof uploadSourceMapsResponse>;
|
|
86
|
+
declare const signSourceMapFile: z.ZodObject<{
|
|
87
|
+
path: z.ZodString;
|
|
88
|
+
sizeBytes: z.ZodNumber;
|
|
89
|
+
hasSourcesContent: z.ZodBoolean;
|
|
90
|
+
hasNames: z.ZodBoolean;
|
|
91
|
+
hasFile: z.ZodBoolean;
|
|
92
|
+
mappingsPresent: z.ZodBoolean;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
declare const signSourceMapsRequest: z.ZodObject<{
|
|
95
|
+
files: z.ZodArray<z.ZodObject<{
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
sizeBytes: z.ZodNumber;
|
|
98
|
+
hasSourcesContent: z.ZodBoolean;
|
|
99
|
+
hasNames: z.ZodBoolean;
|
|
100
|
+
hasFile: z.ZodBoolean;
|
|
101
|
+
mappingsPresent: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
type SignSourceMapsRequest = z.infer<typeof signSourceMapsRequest>;
|
|
105
|
+
declare const signSourceMapUpload: z.ZodObject<{
|
|
106
|
+
path: z.ZodString;
|
|
107
|
+
objectKey: z.ZodString;
|
|
108
|
+
presignedUrl: z.ZodString;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
declare const signSourceMapsResponse: z.ZodObject<{
|
|
111
|
+
uploads: z.ZodArray<z.ZodObject<{
|
|
112
|
+
path: z.ZodString;
|
|
113
|
+
objectKey: z.ZodString;
|
|
114
|
+
presignedUrl: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
expiresAt: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
type SignSourceMapsResponse = z.infer<typeof signSourceMapsResponse>;
|
|
119
|
+
declare const completeSourceMapFile: z.ZodObject<{
|
|
120
|
+
path: z.ZodString;
|
|
121
|
+
hash: z.ZodString;
|
|
122
|
+
debugId: z.ZodString;
|
|
123
|
+
chunkUrl: z.ZodString;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
declare const completeSourceMapsRequest: z.ZodObject<{
|
|
126
|
+
files: z.ZodArray<z.ZodObject<{
|
|
127
|
+
path: z.ZodString;
|
|
128
|
+
hash: z.ZodString;
|
|
129
|
+
debugId: z.ZodString;
|
|
130
|
+
chunkUrl: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
sourceFileCount: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
bundler: z.ZodEnum<{
|
|
134
|
+
tsc: "tsc";
|
|
135
|
+
turbopack: "turbopack";
|
|
136
|
+
webpack: "webpack";
|
|
137
|
+
}>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
type CompleteSourceMapsRequest = z.infer<typeof completeSourceMapsRequest>;
|
|
140
|
+
declare const completeSourceMapsResponse: z.ZodObject<{
|
|
141
|
+
ok: z.ZodBoolean;
|
|
142
|
+
fileCount: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
type CompleteSourceMapsResponse = z.infer<typeof completeSourceMapsResponse>;
|
|
39
145
|
//#endregion
|
|
40
|
-
export { SourceMapManifest,
|
|
146
|
+
export { CompleteSourceMapsRequest, CompleteSourceMapsResponse, ManifestBundler, SignSourceMapsRequest, SignSourceMapsResponse, SourceMapManifest, UploadSourceMapEntry, UploadSourceMapsMetadata, UploadSourceMapsResponse, completeSourceMapFile, completeSourceMapsRequest, completeSourceMapsResponse, manifestBundlerSchema, signSourceMapFile, signSourceMapUpload, signSourceMapsRequest, signSourceMapsResponse, sourceMapManifestSchema, uploadSourceMapEntry, uploadSourceMapsMetadata, uploadSourceMapsResponse };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-maps.d.mts","names":[],"sources":["../../src/data/source-maps.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-maps.d.mts","names":[],"sources":["../../src/data/source-maps.ts"],"mappings":";;;;;AAkBA;;;;;;cAAa,qBAAA,EAAqB,CAAA,CAAA,OAAA;;;;;KAItB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAgChC,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;KASxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA;;;;;;;;;;cAWlC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;KAcrB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,oBAAA;;;;;;;;;;;;;cAcrC,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;KAYzB,wBAAA,GAA2B,CAAA,CAAE,KAAA,QAAa,wBAAA;AAAA,cAEzC,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;KASzB,wBAAA,GAA2B,CAAA,CAAE,KAAA,QAAa,wBAAA;AAAA,cAEzC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;cAWjB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;KAWtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEtC,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;cAQnB,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;KAUvB,sBAAA,GAAyB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,cAEvC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;cAgBrB,yBAAA,EAAyB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;KAa1B,yBAAA,GAA4B,CAAA,CAAE,KAAA,QACjC,yBAAA;AAAA,cAGI,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;KAU3B,0BAAA,GAA6B,CAAA,CAAE,KAAA,QAClC,0BAAA"}
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/data/source-maps.ts
|
|
3
|
-
const getSourceMapPath = ({ organizationId, surfaceId, buildId, relativePath }) => `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/${relativePath}`;
|
|
4
|
-
const sourceMapManifestEntrySchema = z.object({
|
|
5
|
-
relativePath: z.string(),
|
|
6
|
-
generatedFile: z.string(),
|
|
7
|
-
hash: z.string(),
|
|
8
|
-
objectKey: z.string(),
|
|
9
|
-
debugId: z.string().optional()
|
|
10
|
-
});
|
|
11
|
-
const sourceMapManifestSchema = z.object({
|
|
12
|
-
buildId: z.string(),
|
|
13
|
-
releaseId: z.string().optional(),
|
|
14
|
-
surfaceId: z.string(),
|
|
15
|
-
organizationId: z.string(),
|
|
16
|
-
createdAt: z.number(),
|
|
17
|
-
files: z.array(sourceMapManifestEntrySchema)
|
|
18
|
-
});
|
|
19
|
-
const getManifestPath = ({ organizationId, surfaceId, buildId }) => `source-maps/orgs/${organizationId}/surfaces/${surfaceId}/builds/${buildId}/_manifest.json`;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { getManifestPath, getSourceMapPath, sourceMapManifestSchema };
|
|
1
|
+
import{z as e}from"zod";const t=e.enum([`webpack`,`turbopack`,`tsc`]).meta({id:`ManifestBundler`,title:`ManifestBundler`}),n=e.object({chunkUrl:e.string(),debugId:e.string(),objectKey:e.string(),mapHash:e.string()}),r=e.object({releaseSlug:e.string(),surfaceId:e.string(),organizationId:e.string(),bundler:t,createdAt:e.number(),files:e.array(n)}),i=e.object({path:e.string().min(1),hash:e.string(),debugId:e.string(),chunkUrl:e.string()}).meta({id:`UploadSourceMapEntry`,title:`UploadSourceMapEntry`}),a=e.object({entries:e.array(i),sourceFileCount:e.number().int().nonnegative().optional(),bundler:t}).meta({id:`UploadSourceMapsMetadata`,title:`UploadSourceMapsMetadata`,description:`Metadata attached alongside uploaded source map files.`}),o=e.object({ok:e.boolean(),processed:e.number().int().nonnegative(),message:e.string(),fileCount:e.number().int().nonnegative()}).meta({id:`UploadSourceMapsResponse`,title:`UploadSourceMapsResponse`}),s=e.object({path:e.string().min(1),sizeBytes:e.number().int().nonnegative(),hasSourcesContent:e.boolean(),hasNames:e.boolean(),hasFile:e.boolean(),mappingsPresent:e.boolean()}).meta({id:`SignSourceMapFile`,title:`SignSourceMapFile`}),c=e.object({files:e.array(s)}).meta({id:`SignSourceMapsRequest`,title:`SignSourceMapsRequest`,description:"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest."}),l=e.object({path:e.string(),objectKey:e.string(),presignedUrl:e.string()}).meta({id:`SignSourceMapUpload`,title:`SignSourceMapUpload`}),u=e.object({uploads:e.array(l),expiresAt:e.number().int()}).meta({id:`SignSourceMapsResponse`,title:`SignSourceMapsResponse`}),d=e.object({path:e.string().min(1),hash:e.string(),debugId:e.string(),chunkUrl:e.string()}).meta({id:`CompleteSourceMapFile`,title:`CompleteSourceMapFile`}),f=e.object({files:e.array(d),sourceFileCount:e.number().int().nonnegative().optional(),bundler:t}).meta({id:`CompleteSourceMapsRequest`,title:`CompleteSourceMapsRequest`,description:"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry."}),p=e.object({ok:e.boolean(),fileCount:e.number().int().nonnegative()}).meta({id:`CompleteSourceMapsResponse`,title:`CompleteSourceMapsResponse`});export{d as completeSourceMapFile,f as completeSourceMapsRequest,p as completeSourceMapsResponse,t as manifestBundlerSchema,s as signSourceMapFile,l as signSourceMapUpload,c as signSourceMapsRequest,u as signSourceMapsResponse,r as sourceMapManifestSchema,i as uploadSourceMapEntry,a as uploadSourceMapsMetadata,o as uploadSourceMapsResponse};
|
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Source-map / manifest R2 keys live in\n// `@interfere/internal-schemas/pipeline/r2-keys` now — they're internal\n// to the producer/consumer contract between the collector and the\n// enrichment service, not part of the public SDK surface. Anything in\n// this package that needed them imported the old `getSourceMapPath` /\n// `getManifestPath` helpers; those have been removed and call sites\n// reach for `r2Keys.sourceMaps.{file,manifest}` directly.\n\n/**\n * Bundler that produced this source-map upload. Reported back in the\n * SDK `bundler` upload metric for diagnostics. Mandatory now —\n * server-side suffix-matching against `chunkUrl` is uniform across\n * bundlers, but knowing which bundler produced the manifest is still\n * useful for diagnostics (different bundlers exhibit different stack\n * shapes; we want that pivot when investigating resolution issues).\n */\nexport const manifestBundlerSchema = z\n .enum([\"webpack\", \"turbopack\", \"tsc\"])\n .meta({ id: \"ManifestBundler\", title: \"ManifestBundler\" });\n\nexport type ManifestBundler = z.infer<typeof manifestBundlerSchema>;\n\nconst sourceMapManifestEntrySchema = z.object({\n /**\n * Public path the runtime loads this chunk from — `_next/static/\n * chunks/<hash>.js` for Next, or any deploy-relative path the\n * bundler emits. Stored as the build-time relative path (not the\n * fully-qualified deployed URL) because preview / production /\n * branch deploys all share the same dist tree but resolve to\n * different origins, so the build can't know the runtime URL up\n * front. The server-side resolver pairs `frame.fileName` (an\n * absolute runtime URL) to this field by suffix-matching the\n * content-hashed filename, which works on either form. Always\n * populated for both bundlers; turbopack discovery extends to\n * walk JS chunks (in addition to .map files) so it can record\n * this. Replaces the old `generatedFile` field, whose semantics\n * differed by bundler.\n */\n chunkUrl: z.string(),\n /**\n * UUID injected into the chunk content (`//# debugId=…` comment) and\n * the source-map JSON (`debugId` field) at build time. Mandatory\n * now — server-side parsing depends on a chunk-side debugId comment\n * being present so the manifest can resolve every chunk uniquely.\n */\n debugId: z.string(),\n /** R2 object key for the source-map content. */\n objectKey: z.string(),\n /** sha256 of the source-map content for integrity / cache validation. */\n mapHash: z.string(),\n});\n\nexport const sourceMapManifestSchema = z.object({\n releaseSlug: z.string(),\n surfaceId: z.string(),\n organizationId: z.string(),\n bundler: manifestBundlerSchema,\n createdAt: z.number(),\n files: z.array(sourceMapManifestEntrySchema),\n});\n\nexport type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;\n\n/**\n * Per-entry metadata for the legacy multipart upload endpoint\n * (`POST /v1/releases/:slug/source-maps`). One entry per source-map file\n * in the multipart body, paired by `path` matching the multipart filename.\n *\n * Every entry carries `chunkUrl` (the public URL the runtime loads the\n * chunk from) and `debugId` — both mandatory now. The legacy multipart\n * endpoint accepts the same shape as the new presigned-URL flow.\n */\nexport const uploadSourceMapEntry = z\n .object({\n path: z.string().min(1),\n hash: z.string(),\n debugId: z.string(),\n /**\n * Build-time relative chunk path (`_next/static/chunks/<hash>.js`,\n * etc.) — see `sourceMapManifestEntrySchema.chunkUrl` for why\n * this isn't an absolute URL.\n */\n chunkUrl: z.string(),\n })\n .meta({ id: \"UploadSourceMapEntry\", title: \"UploadSourceMapEntry\" });\n\nexport type UploadSourceMapEntry = z.infer<typeof uploadSourceMapEntry>;\n\n/**\n * Multipart metadata for the legacy upload endpoint. The `files` field\n * carries the actual JSON bodies as multipart File parts; this `metadata`\n * object travels alongside as a JSON-encoded form field.\n *\n * This endpoint is deprecated in favour of the `/sign` + direct R2 PUT\n * + `/complete` flow, which scales beyond the body-size limits of any\n * worker / load balancer in front of the collector. Kept for backwards\n * compatibility with deployed SDKs during the deprecation window.\n *\n * @deprecated\n */\nexport const uploadSourceMapsMetadata = z\n .object({\n entries: z.array(uploadSourceMapEntry),\n sourceFileCount: z.number().int().nonnegative().optional(),\n bundler: manifestBundlerSchema,\n })\n .meta({\n id: \"UploadSourceMapsMetadata\",\n title: \"UploadSourceMapsMetadata\",\n description: \"Metadata attached alongside uploaded source map files.\",\n });\n\nexport type UploadSourceMapsMetadata = z.infer<typeof uploadSourceMapsMetadata>;\n\nexport const uploadSourceMapsResponse = z\n .object({\n ok: z.boolean(),\n processed: z.number().int().nonnegative(),\n message: z.string(),\n fileCount: z.number().int().nonnegative(),\n })\n .meta({ id: \"UploadSourceMapsResponse\", title: \"UploadSourceMapsResponse\" });\n\nexport type UploadSourceMapsResponse = z.infer<typeof uploadSourceMapsResponse>;\n\nexport const signSourceMapFile = z\n .object({\n path: z.string().min(1),\n sizeBytes: z.number().int().nonnegative(),\n hasSourcesContent: z.boolean(),\n hasNames: z.boolean(),\n hasFile: z.boolean(),\n mappingsPresent: z.boolean(),\n })\n .meta({ id: \"SignSourceMapFile\", title: \"SignSourceMapFile\" });\n\nexport const signSourceMapsRequest = z\n .object({\n files: z.array(signSourceMapFile),\n })\n .meta({\n id: \"SignSourceMapsRequest\",\n title: \"SignSourceMapsRequest\",\n description:\n \"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest.\",\n });\n\nexport type SignSourceMapsRequest = z.infer<typeof signSourceMapsRequest>;\n\nexport const signSourceMapUpload = z\n .object({\n path: z.string(),\n objectKey: z.string(),\n presignedUrl: z.string(),\n })\n .meta({ id: \"SignSourceMapUpload\", title: \"SignSourceMapUpload\" });\n\nexport const signSourceMapsResponse = z\n .object({\n uploads: z.array(signSourceMapUpload),\n expiresAt: z.number().int(),\n })\n .meta({\n id: \"SignSourceMapsResponse\",\n title: \"SignSourceMapsResponse\",\n });\n\nexport type SignSourceMapsResponse = z.infer<typeof signSourceMapsResponse>;\n\nexport const completeSourceMapFile = z\n .object({\n path: z.string().min(1),\n hash: z.string(),\n debugId: z.string(),\n /**\n * Build-time relative chunk path. See\n * `sourceMapManifestEntrySchema.chunkUrl` for the rationale —\n * preview / prod / branch deploys share dist trees but resolve\n * to different runtime origins, and the build doesn't know\n * which one it'll be.\n */\n chunkUrl: z.string(),\n })\n .meta({ id: \"CompleteSourceMapFile\", title: \"CompleteSourceMapFile\" });\n\nexport const completeSourceMapsRequest = z\n .object({\n files: z.array(completeSourceMapFile),\n sourceFileCount: z.number().int().nonnegative().optional(),\n bundler: manifestBundlerSchema,\n })\n .meta({\n id: \"CompleteSourceMapsRequest\",\n title: \"CompleteSourceMapsRequest\",\n description:\n \"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry.\",\n });\n\nexport type CompleteSourceMapsRequest = z.infer<\n typeof completeSourceMapsRequest\n>;\n\nexport const completeSourceMapsResponse = z\n .object({\n ok: z.boolean(),\n fileCount: z.number().int().nonnegative(),\n })\n .meta({\n id: \"CompleteSourceMapsResponse\",\n title: \"CompleteSourceMapsResponse\",\n });\n\nexport type CompleteSourceMapsResponse = z.infer<\n typeof completeSourceMapsResponse\n>;\n"],"mappings":"wBAkBA,MAAa,EAAwB,EAClC,KAAK,CAAC,UAAW,YAAa,MAAM,CAAC,CACrC,KAAK,CAAE,GAAI,kBAAmB,MAAO,kBAAmB,CAAC,CAItD,EAA+B,EAAE,OAAO,CAgB5C,SAAU,EAAE,QAAQ,CAOpB,QAAS,EAAE,QAAQ,CAEnB,UAAW,EAAE,QAAQ,CAErB,QAAS,EAAE,QAAQ,CACpB,CAAC,CAEW,EAA0B,EAAE,OAAO,CAC9C,YAAa,EAAE,QAAQ,CACvB,UAAW,EAAE,QAAQ,CACrB,eAAgB,EAAE,QAAQ,CAC1B,QAAS,EACT,UAAW,EAAE,QAAQ,CACrB,MAAO,EAAE,MAAM,EAA6B,CAC7C,CAAC,CAaW,EAAuB,EACjC,OAAO,CACN,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CACvB,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,QAAQ,CAMnB,SAAU,EAAE,QAAQ,CACrB,CAAC,CACD,KAAK,CAAE,GAAI,uBAAwB,MAAO,uBAAwB,CAAC,CAgBzD,EAA2B,EACrC,OAAO,CACN,QAAS,EAAE,MAAM,EAAqB,CACtC,gBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAC1D,QAAS,EACV,CAAC,CACD,KAAK,CACJ,GAAI,2BACJ,MAAO,2BACP,YAAa,yDACd,CAAC,CAIS,EAA2B,EACrC,OAAO,CACN,GAAI,EAAE,SAAS,CACf,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CACzC,QAAS,EAAE,QAAQ,CACnB,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAC1C,CAAC,CACD,KAAK,CAAE,GAAI,2BAA4B,MAAO,2BAA4B,CAAC,CAIjE,EAAoB,EAC9B,OAAO,CACN,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CACvB,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CACzC,kBAAmB,EAAE,SAAS,CAC9B,SAAU,EAAE,SAAS,CACrB,QAAS,EAAE,SAAS,CACpB,gBAAiB,EAAE,SAAS,CAC7B,CAAC,CACD,KAAK,CAAE,GAAI,oBAAqB,MAAO,oBAAqB,CAAC,CAEnD,EAAwB,EAClC,OAAO,CACN,MAAO,EAAE,MAAM,EAAkB,CAClC,CAAC,CACD,KAAK,CACJ,GAAI,wBACJ,MAAO,wBACP,YACE,0RACH,CAAC,CAIS,EAAsB,EAChC,OAAO,CACN,KAAM,EAAE,QAAQ,CAChB,UAAW,EAAE,QAAQ,CACrB,aAAc,EAAE,QAAQ,CACzB,CAAC,CACD,KAAK,CAAE,GAAI,sBAAuB,MAAO,sBAAuB,CAAC,CAEvD,EAAyB,EACnC,OAAO,CACN,QAAS,EAAE,MAAM,EAAoB,CACrC,UAAW,EAAE,QAAQ,CAAC,KAAK,CAC5B,CAAC,CACD,KAAK,CACJ,GAAI,yBACJ,MAAO,yBACR,CAAC,CAIS,EAAwB,EAClC,OAAO,CACN,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CACvB,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,QAAQ,CAQnB,SAAU,EAAE,QAAQ,CACrB,CAAC,CACD,KAAK,CAAE,GAAI,wBAAyB,MAAO,wBAAyB,CAAC,CAE3D,EAA4B,EACtC,OAAO,CACN,MAAO,EAAE,MAAM,EAAsB,CACrC,gBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAC1D,QAAS,EACV,CAAC,CACD,KAAK,CACJ,GAAI,4BACJ,MAAO,4BACP,YACE,qKACH,CAAC,CAMS,EAA6B,EACvC,OAAO,CACN,GAAI,EAAE,SAAS,CACf,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAC1C,CAAC,CACD,KAAK,CACJ,GAAI,6BACJ,MAAO,6BACR,CAAC"}
|
package/dist/events/error.d.mts
CHANGED
|
@@ -1,52 +1,145 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/events/error.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const resolvedFrameSchema: z.ZodObject<{
|
|
5
|
+
ingestedId: z.ZodString;
|
|
6
|
+
inApp: z.ZodBoolean;
|
|
5
7
|
file: z.ZodNullable<z.ZodString>;
|
|
6
8
|
line: z.ZodNullable<z.ZodNumber>;
|
|
7
9
|
column: z.ZodNullable<z.ZodNumber>;
|
|
8
10
|
fn: z.ZodNullable<z.ZodString>;
|
|
11
|
+
resolved: z.ZodLiteral<true>;
|
|
9
12
|
originalFile: z.ZodNullable<z.ZodString>;
|
|
10
13
|
originalLine: z.ZodNullable<z.ZodNumber>;
|
|
11
14
|
originalColumn: z.ZodNullable<z.ZodNumber>;
|
|
12
15
|
originalName: z.ZodNullable<z.ZodString>;
|
|
13
|
-
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
declare const unresolvedFrameSchema: z.ZodObject<{
|
|
18
|
+
ingestedId: z.ZodString;
|
|
14
19
|
inApp: z.ZodBoolean;
|
|
15
|
-
|
|
20
|
+
file: z.ZodNullable<z.ZodString>;
|
|
21
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
column: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
fn: z.ZodNullable<z.ZodString>;
|
|
24
|
+
resolved: z.ZodLiteral<false>;
|
|
16
25
|
}, z.core.$strip>;
|
|
26
|
+
declare const enrichedFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
ingestedId: z.ZodString;
|
|
28
|
+
inApp: z.ZodBoolean;
|
|
29
|
+
file: z.ZodNullable<z.ZodString>;
|
|
30
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
column: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
fn: z.ZodNullable<z.ZodString>;
|
|
33
|
+
resolved: z.ZodLiteral<true>;
|
|
34
|
+
originalFile: z.ZodNullable<z.ZodString>;
|
|
35
|
+
originalLine: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
originalColumn: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
originalName: z.ZodNullable<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
ingestedId: z.ZodString;
|
|
40
|
+
inApp: z.ZodBoolean;
|
|
41
|
+
file: z.ZodNullable<z.ZodString>;
|
|
42
|
+
line: z.ZodNullable<z.ZodNumber>;
|
|
43
|
+
column: z.ZodNullable<z.ZodNumber>;
|
|
44
|
+
fn: z.ZodNullable<z.ZodString>;
|
|
45
|
+
resolved: z.ZodLiteral<false>;
|
|
46
|
+
}, z.core.$strip>], "resolved">;
|
|
17
47
|
type EnrichedFrame = z.infer<typeof enrichedFrameSchema>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
type ResolvedFrame = z.infer<typeof resolvedFrameSchema>;
|
|
49
|
+
type UnresolvedFrame = z.infer<typeof unresolvedFrameSchema>;
|
|
50
|
+
declare const errorMechanismSchema: z.ZodObject<{
|
|
51
|
+
type: z.ZodString;
|
|
52
|
+
handled: z.ZodBoolean;
|
|
53
|
+
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
|
|
56
|
+
declare const errorContextSchema: z.ZodObject<{
|
|
57
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
58
|
+
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
"App Router": "App Router";
|
|
60
|
+
"Pages Router": "Pages Router";
|
|
61
|
+
}>>;
|
|
62
|
+
routePath: z.ZodOptional<z.ZodString>;
|
|
63
|
+
routeType: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
action: "action";
|
|
65
|
+
middleware: "middleware";
|
|
66
|
+
proxy: "proxy";
|
|
67
|
+
render: "render";
|
|
68
|
+
route: "route";
|
|
69
|
+
}>>;
|
|
70
|
+
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
71
|
+
"react-server-components": "react-server-components";
|
|
72
|
+
"react-server-components-payload": "react-server-components-payload";
|
|
73
|
+
"server-rendering": "server-rendering";
|
|
74
|
+
}>>;
|
|
75
|
+
revalidateReason: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
"on-demand": "on-demand";
|
|
77
|
+
stale: "stale";
|
|
78
|
+
}>>;
|
|
79
|
+
renderType: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
dynamic: "dynamic";
|
|
81
|
+
"dynamic-resume": "dynamic-resume";
|
|
82
|
+
}>>;
|
|
83
|
+
requestPath: z.ZodOptional<z.ZodString>;
|
|
84
|
+
requestMethod: z.ZodOptional<z.ZodString>;
|
|
85
|
+
errorDigest: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
declare const errorPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
88
|
message: z.ZodNullable<z.ZodString>;
|
|
43
89
|
name: z.ZodNullable<z.ZodString>;
|
|
44
90
|
stack: z.ZodNullable<z.ZodString>;
|
|
91
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
93
|
+
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
"App Router": "App Router";
|
|
95
|
+
"Pages Router": "Pages Router";
|
|
96
|
+
}>>;
|
|
97
|
+
routePath: z.ZodOptional<z.ZodString>;
|
|
98
|
+
routeType: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
action: "action";
|
|
100
|
+
middleware: "middleware";
|
|
101
|
+
proxy: "proxy";
|
|
102
|
+
render: "render";
|
|
103
|
+
route: "route";
|
|
104
|
+
}>>;
|
|
105
|
+
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
"react-server-components": "react-server-components";
|
|
107
|
+
"react-server-components-payload": "react-server-components-payload";
|
|
108
|
+
"server-rendering": "server-rendering";
|
|
109
|
+
}>>;
|
|
110
|
+
revalidateReason: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
"on-demand": "on-demand";
|
|
112
|
+
stale: "stale";
|
|
113
|
+
}>>;
|
|
114
|
+
renderType: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
dynamic: "dynamic";
|
|
116
|
+
"dynamic-resume": "dynamic-resume";
|
|
117
|
+
}>>;
|
|
118
|
+
requestPath: z.ZodOptional<z.ZodString>;
|
|
119
|
+
requestMethod: z.ZodOptional<z.ZodString>;
|
|
120
|
+
errorDigest: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
45
122
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
46
123
|
type: z.ZodString;
|
|
47
124
|
handled: z.ZodBoolean;
|
|
48
125
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
49
126
|
}, z.core.$strip>>;
|
|
127
|
+
captureSource: z.ZodOptional<z.ZodString>;
|
|
128
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
129
|
+
frames: z.ZodArray<z.ZodObject<{
|
|
130
|
+
id: z.ZodOptional<z.ZodString>;
|
|
131
|
+
file: z.ZodOptional<z.ZodString>;
|
|
132
|
+
fn: z.ZodOptional<z.ZodString>;
|
|
133
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
source: z.ZodOptional<z.ZodString>;
|
|
136
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
capture: z.ZodLiteral<"error">;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
message: z.ZodNullable<z.ZodString>;
|
|
141
|
+
name: z.ZodNullable<z.ZodString>;
|
|
142
|
+
stack: z.ZodNullable<z.ZodString>;
|
|
50
143
|
context: z.ZodOptional<z.ZodObject<{
|
|
51
144
|
framework: z.ZodOptional<z.ZodString>;
|
|
52
145
|
routerKind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -78,14 +171,25 @@ declare const errorFactsPayloadSchema: z.ZodObject<{
|
|
|
78
171
|
requestMethod: z.ZodOptional<z.ZodString>;
|
|
79
172
|
errorDigest: z.ZodOptional<z.ZodString>;
|
|
80
173
|
}, z.core.$strip>>;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
174
|
+
mechanism: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
type: z.ZodString;
|
|
176
|
+
handled: z.ZodBoolean;
|
|
177
|
+
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
85
178
|
}, z.core.$strip>>;
|
|
179
|
+
captureSource: z.ZodOptional<z.ZodString>;
|
|
86
180
|
runtime: z.ZodOptional<z.ZodString>;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
181
|
+
frames: z.ZodArray<z.ZodObject<{
|
|
182
|
+
id: z.ZodOptional<z.ZodString>;
|
|
183
|
+
file: z.ZodOptional<z.ZodString>;
|
|
184
|
+
fn: z.ZodOptional<z.ZodString>;
|
|
185
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
source: z.ZodOptional<z.ZodString>;
|
|
188
|
+
debugId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
capture: z.ZodLiteral<"non-error">;
|
|
191
|
+
serialized: z.ZodJSONSchema;
|
|
192
|
+
}, z.core.$strip>], "capture">;
|
|
193
|
+
type ErrorPayload = z.infer<typeof errorPayloadSchema>;
|
|
90
194
|
//#endregion
|
|
91
|
-
export { EnrichedFrame,
|
|
195
|
+
export { EnrichedFrame, ErrorMechanism, ErrorPayload, ResolvedFrame, UnresolvedFrame, enrichedFrameSchema, errorContextSchema, errorMechanismSchema, errorPayloadSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/events/error.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/events/error.ts"],"mappings":";;;cA4BM,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAQnB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;cAId,mBAAA,EAAmB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KAKpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAC/B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAC/B,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAMrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyElB,kBAAA,EAAkB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKnB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA"}
|
package/dist/events/error.mjs
CHANGED
|
@@ -1,64 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ingestedFrame } from "#data/frame";
|
|
3
|
-
//#region src/events/error.ts
|
|
4
|
-
const enrichedFrameSchema = z.object({
|
|
5
|
-
file: z.string().nullable(),
|
|
6
|
-
line: z.number().nullable(),
|
|
7
|
-
column: z.number().nullable(),
|
|
8
|
-
fn: z.string().nullable(),
|
|
9
|
-
originalFile: z.string().nullable(),
|
|
10
|
-
originalLine: z.number().nullable(),
|
|
11
|
-
originalColumn: z.number().nullable(),
|
|
12
|
-
originalName: z.string().nullable(),
|
|
13
|
-
sourceMapFound: z.boolean(),
|
|
14
|
-
inApp: z.boolean(),
|
|
15
|
-
rawId: z.string()
|
|
16
|
-
});
|
|
17
|
-
const errorMechanismSchema = z.object({
|
|
18
|
-
type: z.string(),
|
|
19
|
-
handled: z.boolean(),
|
|
20
|
-
synthetic: z.boolean().optional()
|
|
21
|
-
});
|
|
22
|
-
const errorContextSchema = z.object({
|
|
23
|
-
framework: z.string().optional(),
|
|
24
|
-
routerKind: z.enum(["Pages Router", "App Router"]).optional(),
|
|
25
|
-
routePath: z.string().optional(),
|
|
26
|
-
routeType: z.enum([
|
|
27
|
-
"render",
|
|
28
|
-
"route",
|
|
29
|
-
"action",
|
|
30
|
-
"middleware",
|
|
31
|
-
"proxy"
|
|
32
|
-
]).optional(),
|
|
33
|
-
renderSource: z.enum([
|
|
34
|
-
"react-server-components",
|
|
35
|
-
"react-server-components-payload",
|
|
36
|
-
"server-rendering"
|
|
37
|
-
]).optional(),
|
|
38
|
-
revalidateReason: z.enum(["on-demand", "stale"]).optional(),
|
|
39
|
-
renderType: z.enum(["dynamic", "dynamic-resume"]).optional(),
|
|
40
|
-
requestPath: z.string().optional(),
|
|
41
|
-
requestMethod: z.string().optional(),
|
|
42
|
-
errorDigest: z.string().optional()
|
|
43
|
-
});
|
|
44
|
-
const fingerprintSchema = z.object({
|
|
45
|
-
hash: z.string(),
|
|
46
|
-
components: z.array(z.string())
|
|
47
|
-
});
|
|
48
|
-
const errorFactsPayloadSchema = z.object({
|
|
49
|
-
frames: z.array(ingestedFrame),
|
|
50
|
-
enrichedFrames: z.array(enrichedFrameSchema).optional(),
|
|
51
|
-
frameCount: z.number().optional(),
|
|
52
|
-
enrichedFrameCount: z.number().optional(),
|
|
53
|
-
message: z.string().nullable(),
|
|
54
|
-
name: z.string().nullable(),
|
|
55
|
-
stack: z.string().nullable(),
|
|
56
|
-
mechanism: errorMechanismSchema.optional(),
|
|
57
|
-
context: errorContextSchema.optional(),
|
|
58
|
-
captureSource: z.string().optional(),
|
|
59
|
-
fingerprintComponents: fingerprintSchema.optional(),
|
|
60
|
-
runtime: z.string().optional(),
|
|
61
|
-
releaseId: z.string().nullable().optional()
|
|
62
|
-
});
|
|
63
|
-
//#endregion
|
|
64
|
-
export { errorFactsPayloadSchema };
|
|
1
|
+
import{z as e}from"zod";import{ingestedFrame as t}from"#data/frame";const n=e.object({ingestedId:e.string(),inApp:e.boolean(),file:e.string().nullable(),line:e.number().nullable(),column:e.number().nullable(),fn:e.string().nullable()}),r=n.extend({resolved:e.literal(!0),originalFile:e.string().nullable(),originalLine:e.number().nullable(),originalColumn:e.number().nullable(),originalName:e.string().nullable()}),i=n.extend({resolved:e.literal(!1)}),a=e.discriminatedUnion(`resolved`,[r,i]),o=e.object({type:e.string(),handled:e.boolean(),synthetic:e.boolean().optional()}),s=e.object({framework:e.string().optional(),routerKind:e.enum([`Pages Router`,`App Router`]).optional(),routePath:e.string().optional(),routeType:e.enum([`render`,`route`,`action`,`middleware`,`proxy`]).optional(),renderSource:e.enum([`react-server-components`,`react-server-components-payload`,`server-rendering`]).optional(),revalidateReason:e.enum([`on-demand`,`stale`]).optional(),renderType:e.enum([`dynamic`,`dynamic-resume`]).optional(),requestPath:e.string().optional(),requestMethod:e.string().optional(),errorDigest:e.string().optional()}),c=e.object({message:e.string().nullable(),name:e.string().nullable(),stack:e.string().nullable(),context:s.optional(),mechanism:o.optional(),captureSource:e.string().optional(),runtime:e.string().optional(),frames:e.array(t)}),l=c.extend({capture:e.literal(`error`)}),u=c.extend({capture:e.literal(`non-error`),serialized:e.json()}),d=e.discriminatedUnion(`capture`,[l,u]);export{a as enrichedFrameSchema,s as errorContextSchema,o as errorMechanismSchema,d as errorPayloadSchema};
|