@interfere/types 9.0.0 → 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.
Files changed (92) hide show
  1. package/README.md +3 -3
  2. package/dist/data/frame.d.mts +16 -4
  3. package/dist/data/frame.d.mts.map +1 -1
  4. package/dist/data/frame.mjs +1 -16
  5. package/dist/data/frame.mjs.map +1 -1
  6. package/dist/data/session.d.mts +1 -1
  7. package/dist/data/session.d.mts.map +1 -1
  8. package/dist/data/session.mjs +1 -9
  9. package/dist/data/session.mjs.map +1 -1
  10. package/dist/data/source-maps.d.mts +133 -27
  11. package/dist/data/source-maps.d.mts.map +1 -1
  12. package/dist/data/source-maps.mjs +1 -21
  13. package/dist/data/source-maps.mjs.map +1 -1
  14. package/dist/events/error.d.mts +139 -35
  15. package/dist/events/error.d.mts.map +1 -1
  16. package/dist/events/error.mjs +1 -64
  17. package/dist/events/error.mjs.map +1 -1
  18. package/dist/events/pageleave.d.mts +1 -1
  19. package/dist/events/pageleave.mjs +1 -10
  20. package/dist/events/pageleave.mjs.map +1 -1
  21. package/dist/events/pageview.d.mts +1 -1
  22. package/dist/events/pageview.d.mts.map +1 -1
  23. package/dist/events/pageview.mjs +1 -11
  24. package/dist/events/pageview.mjs.map +1 -1
  25. package/dist/integrations/index.mjs +1 -57
  26. package/dist/integrations/index.mjs.map +1 -1
  27. package/dist/integrations/platforms/github.mjs +1 -13
  28. package/dist/integrations/platforms/github.mjs.map +1 -1
  29. package/dist/integrations/platforms/slack.d.mts +32 -0
  30. package/dist/integrations/platforms/slack.d.mts.map +1 -0
  31. package/dist/integrations/platforms/slack.mjs +1 -0
  32. package/dist/integrations/platforms/slack.mjs.map +1 -0
  33. package/dist/integrations/platforms/vercel.mjs +1 -26
  34. package/dist/integrations/platforms/vercel.mjs.map +1 -1
  35. package/dist/releases/definition.d.mts +2 -1
  36. package/dist/releases/definition.d.mts.map +1 -1
  37. package/dist/releases/definition.mjs +1 -63
  38. package/dist/releases/definition.mjs.map +1 -1
  39. package/dist/releases/slug.d.mts +22 -0
  40. package/dist/releases/slug.d.mts.map +1 -0
  41. package/dist/releases/slug.mjs +1 -0
  42. package/dist/releases/slug.mjs.map +1 -0
  43. package/dist/sdk/env.mjs +1 -17
  44. package/dist/sdk/env.mjs.map +1 -1
  45. package/dist/sdk/envelope.d.mts +161 -34
  46. package/dist/sdk/envelope.d.mts.map +1 -1
  47. package/dist/sdk/envelope.mjs +1 -114
  48. package/dist/sdk/envelope.mjs.map +1 -1
  49. package/dist/sdk/errors.d.mts +87 -30
  50. package/dist/sdk/errors.d.mts.map +1 -1
  51. package/dist/sdk/errors.mjs +2 -253
  52. package/dist/sdk/errors.mjs.map +1 -1
  53. package/dist/sdk/geo.mjs +1 -17
  54. package/dist/sdk/geo.mjs.map +1 -1
  55. package/dist/sdk/identify.d.mts +1 -1
  56. package/dist/sdk/identify.d.mts.map +1 -1
  57. package/dist/sdk/identify.mjs +1 -43
  58. package/dist/sdk/identify.mjs.map +1 -1
  59. package/dist/sdk/plugins/context/browser.d.mts +8 -0
  60. package/dist/sdk/plugins/context/browser.d.mts.map +1 -1
  61. package/dist/sdk/plugins/context/browser.mjs +1 -81
  62. package/dist/sdk/plugins/context/browser.mjs.map +1 -1
  63. package/dist/sdk/plugins/context/edge.mjs +1 -9
  64. package/dist/sdk/plugins/context/edge.mjs.map +1 -1
  65. package/dist/sdk/plugins/context/next.mjs +1 -50
  66. package/dist/sdk/plugins/context/next.mjs.map +1 -1
  67. package/dist/sdk/plugins/context/node.d.mts +12 -0
  68. package/dist/sdk/plugins/context/node.d.mts.map +1 -0
  69. package/dist/sdk/plugins/context/node.mjs +1 -0
  70. package/dist/sdk/plugins/context/node.mjs.map +1 -0
  71. package/dist/sdk/plugins/manifest.d.mts +5 -0
  72. package/dist/sdk/plugins/manifest.d.mts.map +1 -1
  73. package/dist/sdk/plugins/manifest.mjs +1 -62
  74. package/dist/sdk/plugins/manifest.mjs.map +1 -1
  75. package/dist/sdk/plugins/payload/errors.d.mts +27 -18
  76. package/dist/sdk/plugins/payload/errors.d.mts.map +1 -1
  77. package/dist/sdk/plugins/payload/errors.mjs +1 -37
  78. package/dist/sdk/plugins/payload/errors.mjs.map +1 -1
  79. package/dist/sdk/plugins/payload/page-events.d.mts +2 -2
  80. package/dist/sdk/plugins/payload/page-events.mjs +1 -25
  81. package/dist/sdk/plugins/payload/page-events.mjs.map +1 -1
  82. package/dist/sdk/plugins/payload/rage-click.mjs +1 -17
  83. package/dist/sdk/plugins/payload/rage-click.mjs.map +1 -1
  84. package/dist/sdk/plugins/payload/replay.mjs +1 -17
  85. package/dist/sdk/plugins/payload/replay.mjs.map +1 -1
  86. package/dist/sdk/remote-config.d.mts +31 -4
  87. package/dist/sdk/remote-config.d.mts.map +1 -1
  88. package/dist/sdk/remote-config.mjs +1 -5
  89. package/dist/sdk/remote-config.mjs.map +1 -1
  90. package/dist/sdk/runtime.mjs +1 -35
  91. package/dist/sdk/runtime.mjs.map +1 -1
  92. package/package.json +10 -16
@@ -13,7 +13,8 @@ declare const errorMechanismSchema: z.ZodObject<{
13
13
  synthetic: z.ZodOptional<z.ZodBoolean>;
14
14
  }, z.core.$strip>;
15
15
  type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
16
- declare const exceptionValueSchema: z.ZodObject<{
16
+ declare const exceptionValueSchema: z.ZodUnion<readonly [z.ZodObject<{
17
+ kind: z.ZodLiteral<"error">;
17
18
  type: z.ZodString;
18
19
  value: z.ZodString;
19
20
  mechanism: z.ZodOptional<z.ZodObject<{
@@ -21,18 +22,22 @@ declare const exceptionValueSchema: z.ZodObject<{
21
22
  handled: z.ZodBoolean;
22
23
  synthetic: z.ZodOptional<z.ZodBoolean>;
23
24
  }, z.core.$strip>>;
24
- frames: z.ZodArray<z.ZodObject<{
25
- fileName: z.ZodOptional<z.ZodString>;
26
- functionName: z.ZodOptional<z.ZodString>;
27
- lineNumber: z.ZodOptional<z.ZodNumber>;
28
- columnNumber: z.ZodOptional<z.ZodNumber>;
29
- source: z.ZodOptional<z.ZodString>;
30
- debugId: z.ZodOptional<z.ZodString>;
25
+ stack: z.ZodString;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"non-error">;
28
+ type: z.ZodString;
29
+ value: z.ZodString;
30
+ mechanism: z.ZodOptional<z.ZodObject<{
31
+ type: z.ZodString;
32
+ handled: z.ZodBoolean;
33
+ synthetic: z.ZodOptional<z.ZodBoolean>;
31
34
  }, z.core.$strip>>;
32
- }, z.core.$strip>;
35
+ serialized: z.ZodUnknown;
36
+ }, z.core.$strip>]>;
33
37
  type ExceptionValue = z.infer<typeof exceptionValueSchema>;
34
38
  declare const errorEnvelopePayloadSchema: z.ZodObject<{
35
- exceptions: z.ZodArray<z.ZodObject<{
39
+ exceptions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
40
+ kind: z.ZodLiteral<"error">;
36
41
  type: z.ZodString;
37
42
  value: z.ZodString;
38
43
  mechanism: z.ZodOptional<z.ZodObject<{
@@ -40,15 +45,19 @@ declare const errorEnvelopePayloadSchema: z.ZodObject<{
40
45
  handled: z.ZodBoolean;
41
46
  synthetic: z.ZodOptional<z.ZodBoolean>;
42
47
  }, z.core.$strip>>;
43
- frames: z.ZodArray<z.ZodObject<{
44
- fileName: z.ZodOptional<z.ZodString>;
45
- functionName: z.ZodOptional<z.ZodString>;
46
- lineNumber: z.ZodOptional<z.ZodNumber>;
47
- columnNumber: z.ZodOptional<z.ZodNumber>;
48
- source: z.ZodOptional<z.ZodString>;
49
- debugId: z.ZodOptional<z.ZodString>;
48
+ stack: z.ZodString;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ kind: z.ZodLiteral<"non-error">;
51
+ type: z.ZodString;
52
+ value: z.ZodString;
53
+ mechanism: z.ZodOptional<z.ZodObject<{
54
+ type: z.ZodString;
55
+ handled: z.ZodBoolean;
56
+ synthetic: z.ZodOptional<z.ZodBoolean>;
50
57
  }, z.core.$strip>>;
51
- }, z.core.$strip>>;
58
+ serialized: z.ZodUnknown;
59
+ }, z.core.$strip>]>>;
60
+ errorDigest: z.ZodOptional<z.ZodString>;
52
61
  }, z.core.$strip>;
53
62
  type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
54
63
  //#endregion
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAEa,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,cAkC/B,oBAAA,EAAoB,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KASrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;KAkB3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
@@ -1,37 +1 @@
1
- import { z } from "zod";
2
- import { ingestedFrame } from "#data/frame";
3
- //#region src/sdk/plugins/payload/errors.ts
4
- const errorSourceSchema = z.enum([
5
- "client",
6
- "server",
7
- "edge"
8
- ]).meta({
9
- id: "ErrorSource",
10
- title: "ErrorSource"
11
- });
12
- const errorMechanismSchema = z.object({
13
- type: z.string(),
14
- handled: z.boolean(),
15
- synthetic: z.boolean().optional()
16
- }).meta({
17
- id: "ErrorMechanism",
18
- title: "ErrorMechanism",
19
- description: "How the exception was captured by the SDK."
20
- });
21
- const exceptionValueSchema = z.object({
22
- type: z.string(),
23
- value: z.string(),
24
- mechanism: errorMechanismSchema.optional(),
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."
35
- });
36
- //#endregion
37
- export { errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
1
+ import{z as e}from"zod";const t=e.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),n=e.object({type:e.string(),handled:e.boolean(),synthetic:e.boolean().optional()}).meta({id:`ErrorMechanism`,title:`ErrorMechanism`,description:`How the exception was captured by the SDK.`}),r=e.object({kind:e.literal(`error`),type:e.string(),value:e.string(),mechanism:n.optional(),stack:e.string()}),i=e.object({kind:e.literal(`non-error`),type:e.string(),value:e.string(),mechanism:n.optional(),serialized:e.unknown()}),a=e.union([r,i]).meta({id:`Exception`,title:`Exception`,description:"A single exception. Error-shaped exceptions carry the raw `error.stack` string; non-Error rejections (e.g. `Promise.reject({ code: 401 })`) carry the structured payload as `serialized` instead."}),o=e.object({exceptions:e.array(a).min(1),errorDigest:e.string().optional()}).meta({id:`ErrorPayload`,title:`ErrorPayload`,description:`Payload for an error envelope.`});export{o as errorEnvelopePayloadSchema,n as errorMechanismSchema,t as errorSourceSchema,a as 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\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
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"sourcesContent":["import { z } from \"zod\";\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\n/**\n * Error-shaped exception: carries the raw `error.stack` string. The SDK\n * does not parse stacks client-side anymore — the collector parses\n * `stack` at ingest time (see\n * `src/services/collector/src/lib/stack-parser.ts`) so SDK bundle size\n * stays small and parsing-edge-case fixes don't require an SDK release.\n */\nconst errorExceptionSchema = z.object({\n kind: z.literal(\"error\"),\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n stack: z.string(),\n});\n\n/**\n * Non-Error rejection: `Promise.reject({ code: 401 })`,\n * `Promise.reject(42)`, etc. There's no stack to parse, so `stack` is\n * absent; the original payload rides as `serialized` (depth-bounded\n * and circular-safe — see `serializeBoundedDepth` in\n * `@interfere/types/sdk/errors`). Dashboards render the structured\n * payload from `serialized` rather than parsing JSON back out of\n * `value`.\n */\nconst nonErrorExceptionSchema = z.object({\n kind: z.literal(\"non-error\"),\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n serialized: z.unknown(),\n});\n\nexport const exceptionValueSchema = z\n .union([errorExceptionSchema, nonErrorExceptionSchema])\n .meta({\n id: \"Exception\",\n title: \"Exception\",\n description:\n \"A single exception. Error-shaped exceptions carry the raw `error.stack` string; non-Error rejections (e.g. `Promise.reject({ code: 401 })`) carry the structured payload as `serialized` instead.\",\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 * `error.digest` from React when an RSC server-side throw is sanitised\n * and rebuilt as a synthetic Error on the client. The only identifier\n * that pairs the redacted client-side capture with the unredacted\n * server-side capture; downstream enrichment mixes it into the\n * fingerprint so both events group as one problem.\n */\n errorDigest: z.string().optional(),\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":"wBAEA,MAAa,EAAoB,EAC9B,KAAK,CAAC,SAAU,SAAU,OAAO,CAAC,CAClC,KAAK,CAAE,GAAI,cAAe,MAAO,cAAe,CAAC,CAIvC,EAAuB,EACjC,OAAO,CACN,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,SAAS,CACpB,UAAW,EAAE,SAAS,CAAC,UAAU,CAClC,CAAC,CACD,KAAK,CACJ,GAAI,iBACJ,MAAO,iBACP,YAAa,6CACd,CAAC,CAWE,EAAuB,EAAE,OAAO,CACpC,KAAM,EAAE,QAAQ,QAAQ,CACxB,KAAM,EAAE,QAAQ,CAChB,MAAO,EAAE,QAAQ,CACjB,UAAW,EAAqB,UAAU,CAC1C,MAAO,EAAE,QAAQ,CAClB,CAAC,CAWI,EAA0B,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,YAAY,CAC5B,KAAM,EAAE,QAAQ,CAChB,MAAO,EAAE,QAAQ,CACjB,UAAW,EAAqB,UAAU,CAC1C,WAAY,EAAE,SAAS,CACxB,CAAC,CAEW,EAAuB,EACjC,MAAM,CAAC,EAAsB,EAAwB,CAAC,CACtD,KAAK,CACJ,GAAI,YACJ,MAAO,YACP,YACE,oMACH,CAAC,CAIS,EAA6B,EACvC,OAAO,CACN,WAAY,EAAE,MAAM,EAAqB,CAAC,IAAI,EAAE,CAQhD,YAAa,EAAE,QAAQ,CAAC,UAAU,CACnC,CAAC,CACD,KAAK,CACJ,GAAI,eACJ,MAAO,eACP,YAAa,iCACd,CAAC"}
@@ -6,12 +6,12 @@ declare const uiEventPayloadSchema: z.ZodObject<{
6
6
  }, z.core.$strip>;
7
7
  type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;
8
8
  declare const pageviewPayloadSchema: z.ZodObject<{
9
- url: z.ZodString;
9
+ url: z.ZodURL;
10
10
  title: z.ZodOptional<z.ZodString>;
11
11
  }, z.core.$strip>;
12
12
  type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;
13
13
  declare const pageleavePayloadSchema: z.ZodObject<{
14
- url: z.ZodString;
14
+ url: z.ZodURL;
15
15
  durationMs: z.ZodOptional<z.ZodNumber>;
16
16
  }, z.core.$strip>;
17
17
  type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
@@ -1,25 +1 @@
1
- import { z } from "zod";
2
- //#region src/sdk/plugins/payload/page-events.ts
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
- });
8
- const pageviewPayloadSchema = z.object({
9
- url: z.string(),
10
- title: z.string().optional()
11
- }).meta({
12
- id: "PageviewPayload",
13
- title: "PageviewPayload",
14
- description: "Payload for a pageview envelope."
15
- });
16
- const pageleavePayloadSchema = z.object({
17
- url: z.string(),
18
- durationMs: z.number().optional()
19
- }).meta({
20
- id: "PageleavePayload",
21
- title: "PageleavePayload",
22
- description: "Payload for a pageleave envelope."
23
- });
24
- //#endregion
25
- export { pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
1
+ import{z as e}from"zod";const t=e.object({event:e.record(e.string(),e.unknown())}).meta({id:`UiEventPayload`,title:`UiEventPayload`,description:`Payload for a UI event envelope.`}),n=e.object({url:e.url(),title:e.string().optional()}).meta({id:`PageviewPayload`,title:`PageviewPayload`,description:`Payload for a pageview envelope.`}),r=e.object({url:e.url(),durationMs:e.number().optional()}).meta({id:`PageleavePayload`,title:`PageleavePayload`,description:`Payload for a pageleave envelope.`});export{r as pageleavePayloadSchema,n as pageviewPayloadSchema,t as 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\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
+ {"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.url(),\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.url(),\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":"wBAEA,MAAa,EAAuB,EACjC,OAAO,CACN,MAAO,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,SAAS,CAAC,CACzC,CAAC,CACD,KAAK,CACJ,GAAI,iBACJ,MAAO,iBACP,YAAa,mCACd,CAAC,CAIS,EAAwB,EAClC,OAAO,CACN,IAAK,EAAE,KAAK,CACZ,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC7B,CAAC,CACD,KAAK,CACJ,GAAI,kBACJ,MAAO,kBACP,YAAa,mCACd,CAAC,CAIS,EAAyB,EACnC,OAAO,CACN,IAAK,EAAE,KAAK,CACZ,WAAY,EAAE,QAAQ,CAAC,UAAU,CAClC,CAAC,CACD,KAAK,CACJ,GAAI,mBACJ,MAAO,mBACP,YAAa,oCACd,CAAC"}
@@ -1,17 +1 @@
1
- import { z } from "zod";
2
- //#region src/sdk/plugins/payload/rage-click.ts
3
- const rageClickPayloadSchema = z.object({
4
- count: z.number(),
5
- timeWindow: z.number(),
6
- selector: z.string(),
7
- text: z.string(),
8
- x: z.number(),
9
- y: z.number(),
10
- timestamp: z.number()
11
- }).meta({
12
- id: "RageClickPayload",
13
- title: "RageClickPayload",
14
- description: "Payload for a rage-click envelope."
15
- });
16
- //#endregion
17
- export { rageClickPayloadSchema };
1
+ import{z as e}from"zod";const t=e.object({count:e.number(),timeWindow:e.number(),selector:e.string(),text:e.string(),x:e.number(),y:e.number(),timestamp:e.number()}).meta({id:`RageClickPayload`,title:`RageClickPayload`,description:`Payload for a rage-click envelope.`});export{t as 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\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
+ {"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":"wBAEA,MAAa,EAAyB,EACnC,OAAO,CACN,MAAO,EAAE,QAAQ,CACjB,WAAY,EAAE,QAAQ,CACtB,SAAU,EAAE,QAAQ,CACpB,KAAM,EAAE,QAAQ,CAChB,EAAG,EAAE,QAAQ,CACb,EAAG,EAAE,QAAQ,CACb,UAAW,EAAE,QAAQ,CACtB,CAAC,CACD,KAAK,CACJ,GAAI,mBACJ,MAAO,mBACP,YAAa,qCACd,CAAC"}
@@ -1,17 +1 @@
1
- import { z } from "zod";
2
- //#region src/sdk/plugins/payload/replay.ts
3
- const replayChunkPayloadSchema = z.object({
4
- ts: z.number(),
5
- count: z.number(),
6
- events: z.array(z.string()),
7
- /** First rrweb event timestamp (ms) in this chunk – actual recording start */
8
- first_event_ts: z.number().optional(),
9
- /** Last rrweb event timestamp (ms) in this chunk – actual recording end */
10
- last_event_ts: z.number().optional()
11
- }).meta({
12
- id: "ReplayChunkPayload",
13
- title: "ReplayChunkPayload",
14
- description: "Payload for a replay-chunk envelope."
15
- });
16
- //#endregion
17
- export { replayChunkPayloadSchema };
1
+ import{z as e}from"zod";const t=e.object({ts:e.number(),count:e.number(),events:e.array(e.string()),first_event_ts:e.number().optional(),last_event_ts:e.number().optional()}).meta({id:`ReplayChunkPayload`,title:`ReplayChunkPayload`,description:`Payload for a replay-chunk envelope.`});export{t as 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\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
+ {"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":"wBAEA,MAAa,EAA2B,EACrC,OAAO,CACN,GAAI,EAAE,QAAQ,CACd,MAAO,EAAE,QAAQ,CACjB,OAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAE3B,eAAgB,EAAE,QAAQ,CAAC,UAAU,CAErC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACrC,CAAC,CACD,KAAK,CACJ,GAAI,qBACJ,MAAO,qBACP,YAAa,uCACd,CAAC"}
@@ -1,11 +1,38 @@
1
1
  import { EventType } from "./envelope.mjs";
2
2
  import { PluginKey } from "./plugins/manifest.mjs";
3
+ import { z } from "zod";
3
4
 
4
5
  //#region src/sdk/remote-config.d.ts
5
6
  type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;
6
- interface RemoteConfig {
7
- plugins: Record<PluginKey, boolean>;
8
- }
7
+ /**
8
+ * Closed-shape schema for the SDK's per-plugin enabled state. Derived
9
+ * from `PLUGIN_MANIFEST` so adding a plugin to the manifest extends
10
+ * this schema automatically — no separate place to keep in sync.
11
+ *
12
+ * The closed shape (vs `Record<string, boolean>`) is what makes Speakeasy
13
+ * generate a typed `{ errors?: boolean, replay?: boolean, ... }` instead
14
+ * of a generic dictionary, and lets the SDK reject typo'd plugin names
15
+ * before they silently drop on the wire.
16
+ */
17
+ declare const remotePluginConfigSchema: z.ZodObject<{
18
+ device: z.ZodBoolean;
19
+ errors: z.ZodBoolean;
20
+ logs: z.ZodBoolean;
21
+ pageEvents: z.ZodBoolean;
22
+ rageClick: z.ZodBoolean;
23
+ replay: z.ZodBoolean;
24
+ }, z.core.$strip>;
25
+ declare const remoteConfigSchema: z.ZodObject<{
26
+ plugins: z.ZodObject<{
27
+ device: z.ZodBoolean;
28
+ errors: z.ZodBoolean;
29
+ logs: z.ZodBoolean;
30
+ pageEvents: z.ZodBoolean;
31
+ rageClick: z.ZodBoolean;
32
+ replay: z.ZodBoolean;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>;
35
+ type RemoteConfig = z.infer<typeof remoteConfigSchema>;
9
36
  declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
10
37
  //#endregion
11
- export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig };
38
+ export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
@@ -1 +1 @@
1
- {"version":3,"file":"remote-config.d.mts","names":[],"sources":["../../src/sdk/remote-config.ts"],"mappings":";;;;KAGY,kBAAA,GAAqB,OAAA,CAAQ,MAAA,CAAO,SAAA;AAAA,UAE/B,YAAA;EACf,OAAA,EAAS,MAAA,CAAO,SAAA;AAAA;AAAA,cAGL,oBAAA,EAAsB,MAAA,CAAO,SAAA,EAAW,SAAA"}
1
+ {"version":3,"file":"remote-config.d.mts","names":[],"sources":["../../src/sdk/remote-config.ts"],"mappings":";;;;;KAKY,kBAAA,GAAqB,OAAA,CAAQ,MAAA,CAAO,SAAA;;AAAhD;;;;;;;;;cAYa,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;cAQxB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;KAMnB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA;AAAA,cAE7B,oBAAA,EAAsB,MAAA,CAAO,SAAA,EAAW,SAAA"}
@@ -1,5 +1 @@
1
- import { PLUGIN_MANIFEST } from "./plugins/manifest.mjs";
2
- //#region src/sdk/remote-config.ts
3
- const EVENT_TYPE_TO_PLUGIN = Object.fromEntries(PLUGIN_MANIFEST.flatMap((plugin) => plugin.events.map((event) => [event.name, plugin.name])));
4
- //#endregion
5
- export { EVENT_TYPE_TO_PLUGIN };
1
+ import{PLUGIN_MANIFEST as e}from"./plugins/manifest.mjs";import{z as t}from"zod";const n=t.object(Object.fromEntries(e.map(e=>[e.name,t.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),r=t.object({plugins:n}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),i=Object.fromEntries(e.flatMap(e=>e.events.map(t=>[t.name,e.name])));export{i as EVENT_TYPE_TO_PLUGIN,r as remoteConfigSchema,n as remotePluginConfigSchema};
@@ -1 +1 @@
1
- {"version":3,"file":"remote-config.mjs","names":[],"sources":["../../src/sdk/remote-config.ts"],"sourcesContent":["import type { EventType } from \"./envelope.js\";\nimport { PLUGIN_MANIFEST, type PluginKey } from \"./plugins/manifest.js\";\n\nexport type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;\n\nexport interface RemoteConfig {\n plugins: Record<PluginKey, boolean>;\n}\n\nexport const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey> =\n Object.fromEntries(\n PLUGIN_MANIFEST.flatMap((plugin) =>\n plugin.events.map((event) => [event.name, plugin.name])\n )\n ) as Record<EventType, PluginKey>;\n"],"mappings":";;AASA,MAAa,uBACX,OAAO,YACL,gBAAgB,SAAS,WACvB,OAAO,OAAO,KAAK,UAAU,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,CACxD,CACF"}
1
+ {"version":3,"file":"remote-config.mjs","names":[],"sources":["../../src/sdk/remote-config.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { EventType } from \"./envelope.js\";\nimport { PLUGIN_MANIFEST, type PluginKey } from \"./plugins/manifest.js\";\n\nexport type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;\n\n/**\n * Closed-shape schema for the SDK's per-plugin enabled state. Derived\n * from `PLUGIN_MANIFEST` so adding a plugin to the manifest extends\n * this schema automatically — no separate place to keep in sync.\n *\n * The closed shape (vs `Record<string, boolean>`) is what makes Speakeasy\n * generate a typed `{ errors?: boolean, replay?: boolean, ... }` instead\n * of a generic dictionary, and lets the SDK reject typo'd plugin names\n * before they silently drop on the wire.\n */\nexport const remotePluginConfigSchema = z\n .object(\n Object.fromEntries(\n PLUGIN_MANIFEST.map((p) => [p.name, z.boolean()])\n ) as Record<PluginKey, z.ZodBoolean>\n )\n .meta({ id: \"RemotePluginConfig\", title: \"RemotePluginConfig\" });\n\nexport const remoteConfigSchema = z\n .object({\n plugins: remotePluginConfigSchema,\n })\n .meta({ id: \"RemoteConfig\", title: \"RemoteConfig\" });\n\nexport type RemoteConfig = z.infer<typeof remoteConfigSchema>;\n\nexport const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey> =\n Object.fromEntries(\n PLUGIN_MANIFEST.flatMap((plugin) =>\n plugin.events.map((event) => [event.name, plugin.name])\n )\n ) as Record<EventType, PluginKey>;\n"],"mappings":"iFAiBA,MAAa,EAA2B,EACrC,OACC,OAAO,YACL,EAAgB,IAAK,GAAM,CAAC,EAAE,KAAM,EAAE,SAAS,CAAC,CAAC,CAClD,CACF,CACA,KAAK,CAAE,GAAI,qBAAsB,MAAO,qBAAsB,CAAC,CAErD,EAAqB,EAC/B,OAAO,CACN,QAAS,EACV,CAAC,CACD,KAAK,CAAE,GAAI,eAAgB,MAAO,eAAgB,CAAC,CAIzC,EACX,OAAO,YACL,EAAgB,QAAS,GACvB,EAAO,OAAO,IAAK,GAAU,CAAC,EAAM,KAAM,EAAO,KAAK,CAAC,CACxD,CACF"}
@@ -1,35 +1 @@
1
- import { z } from "zod";
2
- //#region src/sdk/runtime.ts
3
- const envSchema = z.enum([
4
- "development",
5
- "preview",
6
- "production"
7
- ]).nullable().meta({
8
- id: "Environment",
9
- title: "Environment",
10
- description: "Deployment environment the SDK is running in."
11
- });
12
- const runtimeSchema = z.enum([
13
- "browser",
14
- "node",
15
- "edge"
16
- ]).nullable().meta({
17
- id: "Runtime",
18
- title: "Runtime",
19
- description: "JavaScript runtime the SDK is running in."
20
- });
21
- function inferRuntime(options) {
22
- if (typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined") return "browser";
23
- if (typeof globalThis.EdgeRuntime === "string") return "edge";
24
- if (options?.nextRuntime === "edge") return "edge";
25
- if (typeof process !== "undefined" && typeof process.versions?.node === "string") return "node";
26
- return null;
27
- }
28
- function normalizeEnv(value) {
29
- if (typeof value !== "string") return null;
30
- const env = value.toLowerCase();
31
- if (envSchema.safeParse(env).success) return env;
32
- return null;
33
- }
34
- //#endregion
35
- export { envSchema, inferRuntime, normalizeEnv, runtimeSchema };
1
+ import{z as e}from"zod";const t=e.enum([`development`,`preview`,`production`]).nullable().meta({id:`Environment`,title:`Environment`,description:`Deployment environment the SDK is running in.`}),n=e.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function r(e){return typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`?`browser`:typeof globalThis.EdgeRuntime==`string`||e?.nextRuntime===`edge`?`edge`:typeof process<`u`&&typeof process.versions?.node==`string`?`node`:null}function i(e){if(typeof e!=`string`)return null;let n=e.toLowerCase();return t.safeParse(n).success?n:null}export{t as envSchema,r as inferRuntime,i as normalizeEnv,n as runtimeSchema};
@@ -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 .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"}
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":"wBAEA,MAAa,EAAY,EACtB,KAAK,CAAC,cAAe,UAAW,aAAa,CAAC,CAC9C,UAAU,CACV,KAAK,CACJ,GAAI,cACJ,MAAO,cACP,YAAa,gDACd,CAAC,CAIS,EAAgB,EAC1B,KAAK,CAAC,UAAW,OAAQ,OAAO,CAAC,CACjC,UAAU,CACV,KAAK,CACJ,GAAI,UACJ,MAAO,UACP,YAAa,4CACd,CAAC,CAIJ,SAAgB,EAAa,EAEjB,CA8BV,OA3BE,OAAO,OAAW,KAClB,OAAO,SAAa,KACpB,OAAO,UAAc,IAEd,UAKP,OAAQ,WAAyC,aAAgB,UAM/D,GAAS,cAAgB,OACpB,OAKP,OAAO,QAAY,KACnB,OAAO,QAAQ,UAAU,MAAS,SAE3B,OAGF,KAGT,SAAgB,EAAa,EAAqB,CAChD,GAAI,OAAO,GAAU,SACnB,OAAO,KAGT,IAAM,EAAM,EAAM,aAAa,CAM/B,OAJI,EAAU,UAAU,EAAI,CAAC,QACpB,EAGF"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@interfere/types",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "license": "MIT",
5
5
  "description": "TypeScript & Zod types for Interfere",
6
6
  "keywords": [
7
7
  "observability",
8
- "typescript",
8
+ "@typescript/native-preview",
9
9
  "logging"
10
10
  ],
11
11
  "homepage": "https://interfere.com",
@@ -80,11 +80,6 @@
80
80
  "types": "./dist/integrations/index.d.mts",
81
81
  "default": "./dist/integrations/index.mjs"
82
82
  },
83
- "./integrations/*": {
84
- "@source": "./src/integrations/*.ts",
85
- "types": "./dist/integrations/*.d.mts",
86
- "default": "./dist/integrations/*.mjs"
87
- },
88
83
  "./integrations/platforms/*": {
89
84
  "@source": "./src/integrations/platforms/*.ts",
90
85
  "types": "./dist/integrations/platforms/*.d.mts",
@@ -96,21 +91,20 @@
96
91
  },
97
92
  "scripts": {
98
93
  "build": "tsdown",
99
- "test": "vitest run --coverage",
100
- "typecheck": "tsc --noEmit --incremental"
94
+ "test": "vitest run",
95
+ "typecheck": "tsgo --noEmit --incremental"
101
96
  },
102
97
  "dependencies": {
103
- "@interfere/constants": "^9.0.0",
104
- "error-stack-parser-es": "^1.0.5",
105
- "zod": "^4.3.6"
98
+ "@interfere/constants": "^9.0.1",
99
+ "zod": "^4.4.3"
106
100
  },
107
101
  "devDependencies": {
108
102
  "@interfere/test-utils": "^9.0.0",
109
103
  "@interfere/typescript-config": "^9.0.0",
110
104
  "@types/node": "^24.12.0",
111
- "@vitest/coverage-v8": "^4.1.5",
112
- "tsdown": "^0.21.10",
113
- "typescript": "6.0.3",
114
- "vitest": "^4.1.5"
105
+ "@typescript/native-preview": "7.0.0-dev.20260512.1",
106
+ "@vitest/coverage-v8": "^4.1.6",
107
+ "tsdown": "^0.22.0",
108
+ "vitest": "^4.1.6"
115
109
  }
116
110
  }