@interfere/types 8.1.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/frame.d.mts.map +1 -1
- package/dist/data/frame.mjs +4 -0
- package/dist/data/frame.mjs.map +1 -1
- package/dist/data/session.d.mts.map +1 -1
- package/dist/data/session.mjs +5 -1
- package/dist/data/session.mjs.map +1 -1
- package/dist/integrations/index.d.mts +16 -1
- package/dist/integrations/index.d.mts.map +1 -1
- package/dist/integrations/index.mjs +29 -7
- package/dist/integrations/index.mjs.map +1 -1
- package/dist/integrations/platforms/github.mjs.map +1 -1
- package/dist/integrations/platforms/vercel.mjs.map +1 -1
- package/dist/releases/definition.d.mts +5 -4
- package/dist/releases/definition.d.mts.map +1 -1
- package/dist/releases/definition.mjs +41 -13
- package/dist/releases/definition.mjs.map +1 -1
- package/dist/sdk/envelope.d.mts +1143 -35
- package/dist/sdk/envelope.d.mts.map +1 -1
- package/dist/sdk/envelope.mjs +74 -32
- package/dist/sdk/envelope.mjs.map +1 -1
- package/dist/sdk/errors.d.mts +86 -6
- package/dist/sdk/errors.d.mts.map +1 -1
- package/dist/sdk/errors.mjs +174 -12
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/identify.d.mts.map +1 -1
- package/dist/sdk/identify.mjs +18 -1
- package/dist/sdk/identify.mjs.map +1 -1
- package/dist/sdk/plugins/context/browser.d.mts.map +1 -1
- package/dist/sdk/plugins/context/browser.mjs +65 -25
- package/dist/sdk/plugins/context/browser.mjs.map +1 -1
- package/dist/sdk/plugins/context/edge.d.mts.map +1 -1
- package/dist/sdk/plugins/context/edge.mjs +5 -1
- package/dist/sdk/plugins/context/edge.mjs.map +1 -1
- package/dist/sdk/plugins/context/next.d.mts +25 -1
- package/dist/sdk/plugins/context/next.d.mts.map +1 -1
- package/dist/sdk/plugins/context/next.mjs +40 -16
- package/dist/sdk/plugins/context/next.mjs.map +1 -1
- package/dist/sdk/plugins/payload/errors.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/errors.mjs +17 -2
- package/dist/sdk/plugins/payload/errors.mjs.map +1 -1
- package/dist/sdk/plugins/payload/page-events.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/page-events.mjs +13 -1
- package/dist/sdk/plugins/payload/page-events.mjs.map +1 -1
- package/dist/sdk/plugins/payload/rage-click.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/rage-click.mjs +4 -0
- package/dist/sdk/plugins/payload/rage-click.mjs.map +1 -1
- package/dist/sdk/plugins/payload/replay.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/replay.mjs +6 -0
- package/dist/sdk/plugins/payload/replay.mjs.map +1 -1
- package/dist/sdk/runtime.d.mts.map +1 -1
- package/dist/sdk/runtime.mjs +10 -2
- package/dist/sdk/runtime.mjs.map +1 -1
- package/package.json +8 -14
- package/dist/util/omit-undefined.d.mts +0 -5
- package/dist/util/omit-undefined.d.mts.map +0 -1
- package/dist/util/omit-undefined.mjs +0 -8
- package/dist/util/omit-undefined.mjs.map +0 -1
|
@@ -1,41 +1,81 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/context/browser.ts
|
|
3
|
+
const deviceBrowserSchema = z.object({
|
|
4
|
+
major: z.string().optional(),
|
|
5
|
+
name: z.string().optional(),
|
|
6
|
+
type: z.string().optional(),
|
|
7
|
+
version: z.string().optional()
|
|
8
|
+
}).meta({
|
|
9
|
+
id: "DeviceBrowser",
|
|
10
|
+
title: "DeviceBrowser"
|
|
11
|
+
});
|
|
12
|
+
const deviceCpuSchema = z.object({ architecture: z.string().optional() }).meta({
|
|
13
|
+
id: "DeviceCpu",
|
|
14
|
+
title: "DeviceCpu"
|
|
15
|
+
});
|
|
16
|
+
const deviceInfoSchema = z.object({
|
|
17
|
+
model: z.string().optional(),
|
|
18
|
+
type: z.string().optional(),
|
|
19
|
+
vendor: z.string().optional()
|
|
20
|
+
}).meta({
|
|
21
|
+
id: "DeviceInfo",
|
|
22
|
+
title: "DeviceInfo"
|
|
23
|
+
});
|
|
24
|
+
const deviceEngineSchema = z.object({
|
|
25
|
+
name: z.string().optional(),
|
|
26
|
+
version: z.string().optional()
|
|
27
|
+
}).meta({
|
|
28
|
+
id: "DeviceEngine",
|
|
29
|
+
title: "DeviceEngine"
|
|
30
|
+
});
|
|
31
|
+
const deviceOsSchema = z.object({
|
|
32
|
+
name: z.string().optional(),
|
|
33
|
+
version: z.string().optional()
|
|
34
|
+
}).meta({
|
|
35
|
+
id: "DeviceOs",
|
|
36
|
+
title: "DeviceOs"
|
|
37
|
+
});
|
|
3
38
|
const deviceMetadataSchema = z.object({
|
|
4
|
-
browser:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}),
|
|
10
|
-
cpu: z.object({ architecture: z.string().optional() }),
|
|
11
|
-
device: z.object({
|
|
12
|
-
model: z.string().optional(),
|
|
13
|
-
type: z.string().optional(),
|
|
14
|
-
vendor: z.string().optional()
|
|
15
|
-
}),
|
|
16
|
-
engine: z.object({
|
|
17
|
-
name: z.string().optional(),
|
|
18
|
-
version: z.string().optional()
|
|
19
|
-
}),
|
|
20
|
-
os: z.object({
|
|
21
|
-
name: z.string().optional(),
|
|
22
|
-
version: z.string().optional()
|
|
23
|
-
}),
|
|
39
|
+
browser: deviceBrowserSchema,
|
|
40
|
+
cpu: deviceCpuSchema,
|
|
41
|
+
device: deviceInfoSchema,
|
|
42
|
+
engine: deviceEngineSchema,
|
|
43
|
+
os: deviceOsSchema,
|
|
24
44
|
ua: z.string()
|
|
45
|
+
}).meta({
|
|
46
|
+
id: "DeviceMetadata",
|
|
47
|
+
title: "DeviceMetadata",
|
|
48
|
+
description: "Device/browser metadata extracted from the user agent."
|
|
49
|
+
});
|
|
50
|
+
const displayScreenSchema = z.object({
|
|
51
|
+
height: z.number(),
|
|
52
|
+
width: z.number(),
|
|
53
|
+
orientation: z.string().optional()
|
|
54
|
+
}).meta({
|
|
55
|
+
id: "Screen",
|
|
56
|
+
title: "Screen"
|
|
57
|
+
});
|
|
58
|
+
const displaySchema = z.object({ screen: displayScreenSchema }).meta({
|
|
59
|
+
id: "Display",
|
|
60
|
+
title: "Display"
|
|
25
61
|
});
|
|
26
62
|
const browserMetadataSchema = z.object({
|
|
27
63
|
language: z.string().optional(),
|
|
28
64
|
timezone: z.string().optional(),
|
|
29
|
-
display:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
display: displaySchema
|
|
66
|
+
}).meta({
|
|
67
|
+
id: "BrowserMetadata",
|
|
68
|
+
title: "BrowserMetadata",
|
|
69
|
+
description: "Browser locale and display metadata."
|
|
34
70
|
});
|
|
35
71
|
const browserContextSchema = z.object({
|
|
36
72
|
runtime: z.literal("browser"),
|
|
37
73
|
browser: browserMetadataSchema.nullable(),
|
|
38
74
|
device: deviceMetadataSchema.nullable()
|
|
75
|
+
}).meta({
|
|
76
|
+
id: "BrowserContext",
|
|
77
|
+
title: "BrowserContext",
|
|
78
|
+
description: "Request context for the browser runtime."
|
|
39
79
|
});
|
|
40
80
|
//#endregion
|
|
41
81
|
export { browserContextSchema, deviceMetadataSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/browser.ts"],"sourcesContent":["import { z } from \"zod\";\n\
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/browser.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst deviceBrowserSchema = z\n .object({\n major: z.string().optional(),\n name: z.string().optional(),\n type: z.string().optional(),\n version: z.string().optional(),\n })\n .meta({ id: \"DeviceBrowser\", title: \"DeviceBrowser\" });\n\nconst deviceCpuSchema = z\n .object({\n architecture: z.string().optional(),\n })\n .meta({ id: \"DeviceCpu\", title: \"DeviceCpu\" });\n\nconst deviceInfoSchema = z\n .object({\n model: z.string().optional(),\n type: z.string().optional(),\n vendor: z.string().optional(),\n })\n .meta({ id: \"DeviceInfo\", title: \"DeviceInfo\" });\n\nconst deviceEngineSchema = z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n })\n .meta({ id: \"DeviceEngine\", title: \"DeviceEngine\" });\n\nconst deviceOsSchema = z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n })\n .meta({ id: \"DeviceOs\", title: \"DeviceOs\" });\n\nexport const deviceMetadataSchema = z\n .object({\n browser: deviceBrowserSchema,\n cpu: deviceCpuSchema,\n device: deviceInfoSchema,\n engine: deviceEngineSchema,\n os: deviceOsSchema,\n ua: z.string(),\n })\n .meta({\n id: \"DeviceMetadata\",\n title: \"DeviceMetadata\",\n description: \"Device/browser metadata extracted from the user agent.\",\n });\n\nexport type DeviceMetadata = z.infer<typeof deviceMetadataSchema>;\n\nconst displayScreenSchema = z\n .object({\n height: z.number(),\n width: z.number(),\n orientation: z.string().optional(),\n })\n .meta({ id: \"Screen\", title: \"Screen\" });\n\nconst displaySchema = z\n .object({\n screen: displayScreenSchema,\n })\n .meta({ id: \"Display\", title: \"Display\" });\n\nconst browserMetadataSchema = z\n .object({\n language: z.string().optional(),\n timezone: z.string().optional(),\n display: displaySchema,\n })\n .meta({\n id: \"BrowserMetadata\",\n title: \"BrowserMetadata\",\n description: \"Browser locale and display metadata.\",\n });\n\nexport type BrowserMetadata = z.infer<typeof browserMetadataSchema>;\n\nexport const browserContextSchema = z\n .object({\n runtime: z.literal(\"browser\"),\n browser: browserMetadataSchema.nullable(),\n device: deviceMetadataSchema.nullable(),\n })\n .meta({\n id: \"BrowserContext\",\n title: \"BrowserContext\",\n description: \"Request context for the browser runtime.\",\n });\n\nexport type BrowserContext = z.infer<typeof browserContextSchema>;\n"],"mappings":";;AAEA,MAAM,sBAAsB,EACzB,OAAO;CACN,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC,CACD,KAAK;CAAE,IAAI;CAAiB,OAAO;CAAiB,CAAC;AAExD,MAAM,kBAAkB,EACrB,OAAO,EACN,cAAc,EAAE,QAAQ,CAAC,UAAU,EACpC,CAAC,CACD,KAAK;CAAE,IAAI;CAAa,OAAO;CAAa,CAAC;AAEhD,MAAM,mBAAmB,EACtB,OAAO;CACN,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC9B,CAAC,CACD,KAAK;CAAE,IAAI;CAAc,OAAO;CAAc,CAAC;AAElD,MAAM,qBAAqB,EACxB,OAAO;CACN,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC,CACD,KAAK;CAAE,IAAI;CAAgB,OAAO;CAAgB,CAAC;AAEtD,MAAM,iBAAiB,EACpB,OAAO;CACN,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC,CACD,KAAK;CAAE,IAAI;CAAY,OAAO;CAAY,CAAC;AAE9C,MAAa,uBAAuB,EACjC,OAAO;CACN,SAAS;CACT,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,IAAI;CACJ,IAAI,EAAE,QAAQ;CACf,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAM,sBAAsB,EACzB,OAAO;CACN,QAAQ,EAAE,QAAQ;CAClB,OAAO,EAAE,QAAQ;CACjB,aAAa,EAAE,QAAQ,CAAC,UAAU;CACnC,CAAC,CACD,KAAK;CAAE,IAAI;CAAU,OAAO;CAAU,CAAC;AAE1C,MAAM,gBAAgB,EACnB,OAAO,EACN,QAAQ,qBACT,CAAC,CACD,KAAK;CAAE,IAAI;CAAW,OAAO;CAAW,CAAC;AAE5C,MAAM,wBAAwB,EAC3B,OAAO;CACN,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,SAAS;CACV,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,uBAAuB,EACjC,OAAO;CACN,SAAS,EAAE,QAAQ,UAAU;CAC7B,SAAS,sBAAsB,UAAU;CACzC,QAAQ,qBAAqB,UAAU;CACxC,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"mappings":";;;cAEa,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;
|
|
1
|
+
{"version":3,"file":"edge.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"mappings":";;;cAEa,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;KAUlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/context/edge.ts
|
|
3
|
-
const edgeContextSchema = z.object({ runtime: z.literal("edge") })
|
|
3
|
+
const edgeContextSchema = z.object({ runtime: z.literal("edge") }).meta({
|
|
4
|
+
id: "EdgeContext",
|
|
5
|
+
title: "EdgeContext",
|
|
6
|
+
description: "Request context for the Edge runtime."
|
|
7
|
+
});
|
|
4
8
|
//#endregion
|
|
5
9
|
export { edgeContextSchema };
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"file":"edge.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const edgeContextSchema = z\n .object({\n runtime: z.literal(\"edge\"),\n })\n .meta({\n id: \"EdgeContext\",\n title: \"EdgeContext\",\n description: \"Request context for the Edge runtime.\",\n });\n\nexport type EdgeContext = z.infer<typeof edgeContextSchema>;\n"],"mappings":";;AAEA,MAAa,oBAAoB,EAC9B,OAAO,EACN,SAAS,EAAE,QAAQ,OAAO,EAC3B,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/sdk/plugins/context/next.d.ts
|
|
4
|
+
declare const renderSourceSchema: z.ZodEnum<{
|
|
5
|
+
"react-server-components": "react-server-components";
|
|
6
|
+
"react-server-components-payload": "react-server-components-payload";
|
|
7
|
+
"server-rendering": "server-rendering";
|
|
8
|
+
}>;
|
|
9
|
+
declare const renderTypeSchema: z.ZodEnum<{
|
|
10
|
+
dynamic: "dynamic";
|
|
11
|
+
"dynamic-resume": "dynamic-resume";
|
|
12
|
+
}>;
|
|
13
|
+
declare const revalidateReasonSchema: z.ZodEnum<{
|
|
14
|
+
"on-demand": "on-demand";
|
|
15
|
+
stale: "stale";
|
|
16
|
+
}>;
|
|
17
|
+
declare const routeTypeSchema: z.ZodEnum<{
|
|
18
|
+
action: "action";
|
|
19
|
+
middleware: "middleware";
|
|
20
|
+
proxy: "proxy";
|
|
21
|
+
render: "render";
|
|
22
|
+
route: "route";
|
|
23
|
+
}>;
|
|
24
|
+
declare const routerKindSchema: z.ZodEnum<{
|
|
25
|
+
"App Router": "App Router";
|
|
26
|
+
"Pages Router": "Pages Router";
|
|
27
|
+
}>;
|
|
4
28
|
declare const nextjsContextSchema: z.ZodObject<{
|
|
5
29
|
errorDigest: z.ZodOptional<z.ZodString>;
|
|
6
30
|
renderSource: z.ZodOptional<z.ZodEnum<{
|
|
@@ -34,4 +58,4 @@ declare const nextjsContextSchema: z.ZodObject<{
|
|
|
34
58
|
}, z.core.$strip>;
|
|
35
59
|
type NextjsContext = z.infer<typeof nextjsContextSchema>;
|
|
36
60
|
//#endregion
|
|
37
|
-
export { NextjsContext, nextjsContextSchema };
|
|
61
|
+
export { NextjsContext, nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"mappings":";;;cAEa,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"next.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"mappings":";;;cAEa,kBAAA,EAAkB,CAAA,CAAA,OAAA;;;;;cAQlB,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;cAIhB,sBAAA,EAAsB,CAAA,CAAA,OAAA;;;;cAItB,eAAA,EAAe,CAAA,CAAA,OAAA;;;;;;;cAIf,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;cAIhB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmBpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA"}
|
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/context/next.ts
|
|
3
|
+
const renderSourceSchema = z.enum([
|
|
4
|
+
"react-server-components",
|
|
5
|
+
"react-server-components-payload",
|
|
6
|
+
"server-rendering"
|
|
7
|
+
]).meta({
|
|
8
|
+
id: "RenderSource",
|
|
9
|
+
title: "RenderSource"
|
|
10
|
+
});
|
|
11
|
+
const renderTypeSchema = z.enum(["dynamic", "dynamic-resume"]).meta({
|
|
12
|
+
id: "RenderType",
|
|
13
|
+
title: "RenderType"
|
|
14
|
+
});
|
|
15
|
+
const revalidateReasonSchema = z.enum(["on-demand", "stale"]).meta({
|
|
16
|
+
id: "RevalidateReason",
|
|
17
|
+
title: "RevalidateReason"
|
|
18
|
+
});
|
|
19
|
+
const routeTypeSchema = z.enum([
|
|
20
|
+
"render",
|
|
21
|
+
"route",
|
|
22
|
+
"action",
|
|
23
|
+
"middleware",
|
|
24
|
+
"proxy"
|
|
25
|
+
]).meta({
|
|
26
|
+
id: "RouteType",
|
|
27
|
+
title: "RouteType"
|
|
28
|
+
});
|
|
29
|
+
const routerKindSchema = z.enum(["Pages Router", "App Router"]).meta({
|
|
30
|
+
id: "RouterKind",
|
|
31
|
+
title: "RouterKind"
|
|
32
|
+
});
|
|
3
33
|
const nextjsContextSchema = z.object({
|
|
4
34
|
errorDigest: z.string().optional(),
|
|
5
|
-
renderSource:
|
|
6
|
-
|
|
7
|
-
"react-server-components-payload",
|
|
8
|
-
"server-rendering"
|
|
9
|
-
]).optional(),
|
|
10
|
-
renderType: z.enum(["dynamic", "dynamic-resume"]).optional(),
|
|
35
|
+
renderSource: renderSourceSchema.optional(),
|
|
36
|
+
renderType: renderTypeSchema.optional(),
|
|
11
37
|
requestMethod: z.string().optional(),
|
|
12
38
|
requestPath: z.string().optional(),
|
|
13
|
-
revalidateReason:
|
|
39
|
+
revalidateReason: revalidateReasonSchema.optional(),
|
|
14
40
|
routePath: z.string().optional(),
|
|
15
|
-
routeType:
|
|
16
|
-
|
|
17
|
-
"route",
|
|
18
|
-
"action",
|
|
19
|
-
"middleware",
|
|
20
|
-
"proxy"
|
|
21
|
-
]).optional(),
|
|
22
|
-
routerKind: z.enum(["Pages Router", "App Router"]).optional(),
|
|
41
|
+
routeType: routeTypeSchema.optional(),
|
|
42
|
+
routerKind: routerKindSchema.optional(),
|
|
23
43
|
runtime: z.literal("nextjs")
|
|
44
|
+
}).meta({
|
|
45
|
+
id: "NextjsContext",
|
|
46
|
+
title: "NextjsContext",
|
|
47
|
+
description: "Request context for the Next.js runtime."
|
|
24
48
|
});
|
|
25
49
|
//#endregion
|
|
26
|
-
export { nextjsContextSchema };
|
|
50
|
+
export { nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"next.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const renderSourceSchema = z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .meta({ id: \"RenderSource\", title: \"RenderSource\" });\n\nexport const renderTypeSchema = z\n .enum([\"dynamic\", \"dynamic-resume\"])\n .meta({ id: \"RenderType\", title: \"RenderType\" });\n\nexport const revalidateReasonSchema = z\n .enum([\"on-demand\", \"stale\"])\n .meta({ id: \"RevalidateReason\", title: \"RevalidateReason\" });\n\nexport const routeTypeSchema = z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .meta({ id: \"RouteType\", title: \"RouteType\" });\n\nexport const routerKindSchema = z\n .enum([\"Pages Router\", \"App Router\"])\n .meta({ id: \"RouterKind\", title: \"RouterKind\" });\n\nexport const nextjsContextSchema = z\n .object({\n errorDigest: z.string().optional(),\n renderSource: renderSourceSchema.optional(),\n renderType: renderTypeSchema.optional(),\n requestMethod: z.string().optional(),\n requestPath: z.string().optional(),\n revalidateReason: revalidateReasonSchema.optional(),\n routePath: z.string().optional(),\n routeType: routeTypeSchema.optional(),\n routerKind: routerKindSchema.optional(),\n runtime: z.literal(\"nextjs\"),\n })\n .meta({\n id: \"NextjsContext\",\n title: \"NextjsContext\",\n description: \"Request context for the Next.js runtime.\",\n });\n\nexport type NextjsContext = z.infer<typeof nextjsContextSchema>;\n"],"mappings":";;AAEA,MAAa,qBAAqB,EAC/B,KAAK;CACJ;CACA;CACA;CACD,CAAC,CACD,KAAK;CAAE,IAAI;CAAgB,OAAO;CAAgB,CAAC;AAEtD,MAAa,mBAAmB,EAC7B,KAAK,CAAC,WAAW,iBAAiB,CAAC,CACnC,KAAK;CAAE,IAAI;CAAc,OAAO;CAAc,CAAC;AAElD,MAAa,yBAAyB,EACnC,KAAK,CAAC,aAAa,QAAQ,CAAC,CAC5B,KAAK;CAAE,IAAI;CAAoB,OAAO;CAAoB,CAAC;AAE9D,MAAa,kBAAkB,EAC5B,KAAK;CAAC;CAAU;CAAS;CAAU;CAAc;CAAQ,CAAC,CAC1D,KAAK;CAAE,IAAI;CAAa,OAAO;CAAa,CAAC;AAEhD,MAAa,mBAAmB,EAC7B,KAAK,CAAC,gBAAgB,aAAa,CAAC,CACpC,KAAK;CAAE,IAAI;CAAc,OAAO;CAAc,CAAC;AAElD,MAAa,sBAAsB,EAChC,OAAO;CACN,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,cAAc,mBAAmB,UAAU;CAC3C,YAAY,iBAAiB,UAAU;CACvC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,kBAAkB,uBAAuB,UAAU;CACnD,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,WAAW,gBAAgB,UAAU;CACrC,YAAY,iBAAiB,UAAU;CACvC,SAAS,EAAE,QAAQ,SAAS;CAC7B,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAIa,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAIa,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;KAIlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,cAE5B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAYrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;KAarB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;KAU3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
|
|
@@ -5,18 +5,33 @@ const errorSourceSchema = z.enum([
|
|
|
5
5
|
"client",
|
|
6
6
|
"server",
|
|
7
7
|
"edge"
|
|
8
|
-
])
|
|
8
|
+
]).meta({
|
|
9
|
+
id: "ErrorSource",
|
|
10
|
+
title: "ErrorSource"
|
|
11
|
+
});
|
|
9
12
|
const errorMechanismSchema = z.object({
|
|
10
13
|
type: z.string(),
|
|
11
14
|
handled: z.boolean(),
|
|
12
15
|
synthetic: z.boolean().optional()
|
|
16
|
+
}).meta({
|
|
17
|
+
id: "ErrorMechanism",
|
|
18
|
+
title: "ErrorMechanism",
|
|
19
|
+
description: "How the exception was captured by the SDK."
|
|
13
20
|
});
|
|
14
21
|
const exceptionValueSchema = z.object({
|
|
15
22
|
type: z.string(),
|
|
16
23
|
value: z.string(),
|
|
17
24
|
mechanism: errorMechanismSchema.optional(),
|
|
18
25
|
frames: z.array(ingestedFrame)
|
|
26
|
+
}).meta({
|
|
27
|
+
id: "Exception",
|
|
28
|
+
title: "Exception",
|
|
29
|
+
description: "A single exception in a chained error."
|
|
30
|
+
});
|
|
31
|
+
const errorEnvelopePayloadSchema = z.object({ exceptions: z.array(exceptionValueSchema).min(1) }).meta({
|
|
32
|
+
id: "ErrorPayload",
|
|
33
|
+
title: "ErrorPayload",
|
|
34
|
+
description: "Payload for an error envelope."
|
|
19
35
|
});
|
|
20
|
-
const errorEnvelopePayloadSchema = z.object({ exceptions: z.array(exceptionValueSchema).min(1) });
|
|
21
36
|
//#endregion
|
|
22
37
|
export { errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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\n .enum([\"client\", \"server\", \"edge\"])\n .meta({ id: \"ErrorSource\", title: \"ErrorSource\" });\n\nexport type ErrorSource = z.infer<typeof errorSourceSchema>;\n\nexport const errorMechanismSchema = z\n .object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n })\n .meta({\n id: \"ErrorMechanism\",\n title: \"ErrorMechanism\",\n description: \"How the exception was captured by the SDK.\",\n });\n\nexport type ErrorMechanism = z.infer<typeof errorMechanismSchema>;\n\nexport const exceptionValueSchema = z\n .object({\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n frames: z.array(ingestedFrame),\n })\n .meta({\n id: \"Exception\",\n title: \"Exception\",\n description: \"A single exception in a chained error.\",\n });\n\nexport type ExceptionValue = z.infer<typeof exceptionValueSchema>;\n\nexport const errorEnvelopePayloadSchema = z\n .object({\n exceptions: z.array(exceptionValueSchema).min(1),\n })\n .meta({\n id: \"ErrorPayload\",\n title: \"ErrorPayload\",\n description: \"Payload for an error envelope.\",\n });\n\nexport type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;\n"],"mappings":";;;AAIA,MAAa,oBAAoB,EAC9B,KAAK;CAAC;CAAU;CAAU;CAAO,CAAC,CAClC,KAAK;CAAE,IAAI;CAAe,OAAO;CAAe,CAAC;AAIpD,MAAa,uBAAuB,EACjC,OAAO;CACN,MAAM,EAAE,QAAQ;CAChB,SAAS,EAAE,SAAS;CACpB,WAAW,EAAE,SAAS,CAAC,UAAU;CAClC,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,uBAAuB,EACjC,OAAO;CACN,MAAM,EAAE,QAAQ;CAChB,OAAO,EAAE,QAAQ;CACjB,WAAW,qBAAqB,UAAU;CAC1C,QAAQ,EAAE,MAAM,cAAc;CAC/B,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,6BAA6B,EACvC,OAAO,EACN,YAAY,EAAE,MAAM,qBAAqB,CAAC,IAAI,EAAE,EACjD,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-events.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;
|
|
1
|
+
{"version":3,"file":"page-events.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;KAUrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;KAWtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;KAWvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/page-events.ts
|
|
3
|
-
const uiEventPayloadSchema = z.object({ event: z.record(z.string(), z.unknown()) })
|
|
3
|
+
const uiEventPayloadSchema = z.object({ event: z.record(z.string(), z.unknown()) }).meta({
|
|
4
|
+
id: "UiEventPayload",
|
|
5
|
+
title: "UiEventPayload",
|
|
6
|
+
description: "Payload for a UI event envelope."
|
|
7
|
+
});
|
|
4
8
|
const pageviewPayloadSchema = z.object({
|
|
5
9
|
url: z.string(),
|
|
6
10
|
title: z.string().optional()
|
|
11
|
+
}).meta({
|
|
12
|
+
id: "PageviewPayload",
|
|
13
|
+
title: "PageviewPayload",
|
|
14
|
+
description: "Payload for a pageview envelope."
|
|
7
15
|
});
|
|
8
16
|
const pageleavePayloadSchema = z.object({
|
|
9
17
|
url: z.string(),
|
|
10
18
|
durationMs: z.number().optional()
|
|
19
|
+
}).meta({
|
|
20
|
+
id: "PageleavePayload",
|
|
21
|
+
title: "PageleavePayload",
|
|
22
|
+
description: "Payload for a pageleave envelope."
|
|
11
23
|
});
|
|
12
24
|
//#endregion
|
|
13
25
|
export { pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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\n .object({\n event: z.record(z.string(), z.unknown()),\n })\n .meta({\n id: \"UiEventPayload\",\n title: \"UiEventPayload\",\n description: \"Payload for a UI event envelope.\",\n });\n\nexport type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;\n\nexport const pageviewPayloadSchema = z\n .object({\n url: z.string(),\n title: z.string().optional(),\n })\n .meta({\n id: \"PageviewPayload\",\n title: \"PageviewPayload\",\n description: \"Payload for a pageview envelope.\",\n });\n\nexport type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;\n\nexport const pageleavePayloadSchema = z\n .object({\n url: z.string(),\n durationMs: z.number().optional(),\n })\n .meta({\n id: \"PageleavePayload\",\n title: \"PageleavePayload\",\n description: \"Payload for a pageleave envelope.\",\n });\n\nexport type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;\n"],"mappings":";;AAEA,MAAa,uBAAuB,EACjC,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,EACzC,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,wBAAwB,EAClC,OAAO;CACN,KAAK,EAAE,QAAQ;CACf,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,yBAAyB,EACnC,OAAO;CACN,KAAK,EAAE,QAAQ;CACf,YAAY,EAAE,QAAQ,CAAC,UAAU;CAClC,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rage-click.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"mappings":";;;cAEa,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"rage-click.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"mappings":";;;cAEa,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;KAgBvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA"}
|
|
@@ -8,6 +8,10 @@ const rageClickPayloadSchema = z.object({
|
|
|
8
8
|
x: z.number(),
|
|
9
9
|
y: z.number(),
|
|
10
10
|
timestamp: z.number()
|
|
11
|
+
}).meta({
|
|
12
|
+
id: "RageClickPayload",
|
|
13
|
+
title: "RageClickPayload",
|
|
14
|
+
description: "Payload for a rage-click envelope."
|
|
11
15
|
});
|
|
12
16
|
//#endregion
|
|
13
17
|
export { rageClickPayloadSchema };
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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\n .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 .meta({\n id: \"RageClickPayload\",\n title: \"RageClickPayload\",\n description: \"Payload for a rage-click envelope.\",\n });\n\nexport type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,yBAAyB,EACnC,OAAO;CACN,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,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"mappings":";;;cAEa,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"replay.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"mappings":";;;cAEa,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;KAgBzB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,wBAAA"}
|
|
@@ -4,8 +4,14 @@ const replayChunkPayloadSchema = z.object({
|
|
|
4
4
|
ts: z.number(),
|
|
5
5
|
count: z.number(),
|
|
6
6
|
events: z.array(z.string()),
|
|
7
|
+
/** First rrweb event timestamp (ms) in this chunk – actual recording start */
|
|
7
8
|
first_event_ts: z.number().optional(),
|
|
9
|
+
/** Last rrweb event timestamp (ms) in this chunk – actual recording end */
|
|
8
10
|
last_event_ts: z.number().optional()
|
|
11
|
+
}).meta({
|
|
12
|
+
id: "ReplayChunkPayload",
|
|
13
|
+
title: "ReplayChunkPayload",
|
|
14
|
+
description: "Payload for a replay-chunk envelope."
|
|
9
15
|
});
|
|
10
16
|
//#endregion
|
|
11
17
|
export { replayChunkPayloadSchema };
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"file":"replay.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const replayChunkPayloadSchema = z\n .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 .meta({\n id: \"ReplayChunkPayload\",\n title: \"ReplayChunkPayload\",\n description: \"Payload for a replay-chunk envelope.\",\n });\n\nexport type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;\n"],"mappings":";;AAEA,MAAa,2BAA2B,EACrC,OAAO;CACN,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,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/sdk/runtime.ts"],"mappings":";;;cAEa,SAAA,EAAS,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/sdk/runtime.ts"],"mappings":";;;cAEa,SAAA,EAAS,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;KASV,GAAA,GAAM,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAEpB,aAAA,EAAa,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;KASd,OAAA,GAAU,CAAA,CAAE,KAAA,QAAa,aAAA;AAAA,iBAErB,YAAA,CAAa,OAAA;EAAA,SAClB,WAAA;AAAA,IACP,OAAA;AAAA,iBAiCY,YAAA,CAAa,KAAA,YAAiB,GAAA"}
|
package/dist/sdk/runtime.mjs
CHANGED
|
@@ -4,12 +4,20 @@ const envSchema = z.enum([
|
|
|
4
4
|
"development",
|
|
5
5
|
"preview",
|
|
6
6
|
"production"
|
|
7
|
-
]).nullable()
|
|
7
|
+
]).nullable().meta({
|
|
8
|
+
id: "Environment",
|
|
9
|
+
title: "Environment",
|
|
10
|
+
description: "Deployment environment the SDK is running in."
|
|
11
|
+
});
|
|
8
12
|
const runtimeSchema = z.enum([
|
|
9
13
|
"browser",
|
|
10
14
|
"node",
|
|
11
15
|
"edge"
|
|
12
|
-
]).nullable()
|
|
16
|
+
]).nullable().meta({
|
|
17
|
+
id: "Runtime",
|
|
18
|
+
title: "Runtime",
|
|
19
|
+
description: "JavaScript runtime the SDK is running in."
|
|
20
|
+
});
|
|
13
21
|
function inferRuntime(options) {
|
|
14
22
|
if (typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined") return "browser";
|
|
15
23
|
if (typeof globalThis.EdgeRuntime === "string") return "edge";
|
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\";\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;
|
|
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 .meta({\n id: \"Environment\",\n title: \"Environment\",\n description: \"Deployment environment the SDK is running in.\",\n });\n\nexport type Env = z.infer<typeof envSchema>;\n\nexport const runtimeSchema = z\n .enum([\"browser\", \"node\", \"edge\"])\n .nullable()\n .meta({\n id: \"Runtime\",\n title: \"Runtime\",\n description: \"JavaScript runtime the SDK is running in.\",\n });\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,CACV,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,MAAa,gBAAgB,EAC1B,KAAK;CAAC;CAAW;CAAQ;CAAO,CAAC,CACjC,UAAU,CACV,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACd,CAAC;AAIJ,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": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
@@ -45,11 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"exports": {
|
|
48
|
-
"./util/*": {
|
|
49
|
-
"@source": "./src/util/*.ts",
|
|
50
|
-
"types": "./dist/util/*.d.mts",
|
|
51
|
-
"default": "./dist/util/*.mjs"
|
|
52
|
-
},
|
|
53
48
|
"./data/*": {
|
|
54
49
|
"@source": "./src/data/*.ts",
|
|
55
50
|
"types": "./dist/data/*.d.mts",
|
|
@@ -101,22 +96,21 @@
|
|
|
101
96
|
},
|
|
102
97
|
"scripts": {
|
|
103
98
|
"build": "tsdown",
|
|
104
|
-
"dev": "tsdown --watch",
|
|
105
99
|
"test": "vitest run --coverage",
|
|
106
100
|
"typecheck": "tsc --noEmit --incremental"
|
|
107
101
|
},
|
|
108
102
|
"dependencies": {
|
|
109
|
-
"@interfere/constants": "^
|
|
103
|
+
"@interfere/constants": "^9.0.0",
|
|
110
104
|
"error-stack-parser-es": "^1.0.5",
|
|
111
105
|
"zod": "^4.3.6"
|
|
112
106
|
},
|
|
113
107
|
"devDependencies": {
|
|
114
|
-
"@interfere/test-utils": "^
|
|
115
|
-
"@interfere/typescript-config": "^
|
|
108
|
+
"@interfere/test-utils": "^9.0.0",
|
|
109
|
+
"@interfere/typescript-config": "^9.0.0",
|
|
116
110
|
"@types/node": "^24.12.0",
|
|
117
|
-
"@vitest/coverage-v8": "^4.1.
|
|
118
|
-
"tsdown": "^0.21.
|
|
119
|
-
"typescript": "6.0.
|
|
120
|
-
"vitest": "^4.1.
|
|
111
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
112
|
+
"tsdown": "^0.21.10",
|
|
113
|
+
"typescript": "6.0.3",
|
|
114
|
+
"vitest": "^4.1.5"
|
|
121
115
|
}
|
|
122
116
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
//#region src/util/omit-undefined.d.ts
|
|
2
|
-
type OmitUndefined<T extends object> = Partial<{ [K in keyof T]: Exclude<T[K], undefined> }>;
|
|
3
|
-
declare function omitUndefined<T extends object>(value: T): OmitUndefined<T>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { OmitUndefined, omitUndefined };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit-undefined.d.mts","names":[],"sources":["../../src/util/omit-undefined.ts"],"mappings":";KAAY,aAAA,qBAAkC,OAAA,eAChC,CAAA,GAAI,OAAA,CAAQ,CAAA,CAAE,CAAA;AAAA,iBAGZ,aAAA,kBAAA,CAAgC,KAAA,EAAO,CAAA,GAAI,aAAA,CAAc,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit-undefined.mjs","names":[],"sources":["../../src/util/omit-undefined.ts"],"sourcesContent":["export type OmitUndefined<T extends object> = Partial<{\n [K in keyof T]: Exclude<T[K], undefined>;\n}>;\n\nexport function omitUndefined<T extends object>(value: T): OmitUndefined<T> {\n const result: Record<string, unknown> = {};\n\n for (const [key, entry] of Object.entries(value as Record<string, unknown>)) {\n if (entry !== undefined) {\n result[key] = entry;\n }\n }\n\n return result as OmitUndefined<T>;\n}\n"],"mappings":";AAIA,SAAgB,cAAgC,OAA4B;CAC1E,MAAM,SAAkC,EAAE;AAE1C,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAiC,CACzE,KAAI,UAAU,KAAA,EACZ,QAAO,OAAO;AAIlB,QAAO"}
|