@interfere/types 9.0.3-canary.1 → 9.0.3-canary.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 (102) hide show
  1. package/dist/data/frame.d.cts +1 -2
  2. package/dist/data/frame.d.mts +1 -2
  3. package/dist/data/frame.mjs +1 -2
  4. package/dist/data/session.d.cts +1 -2
  5. package/dist/data/session.d.mts +1 -2
  6. package/dist/data/session.mjs +1 -2
  7. package/dist/data/source-maps.d.cts +1 -2
  8. package/dist/data/source-maps.d.mts +1 -2
  9. package/dist/data/source-maps.mjs +1 -2
  10. package/dist/events/error.d.cts +1 -2
  11. package/dist/events/error.d.mts +1 -2
  12. package/dist/events/error.mjs +1 -2
  13. package/dist/events/pageleave.d.cts +1 -2
  14. package/dist/events/pageleave.d.mts +1 -2
  15. package/dist/events/pageleave.mjs +1 -2
  16. package/dist/events/pageview.d.cts +1 -2
  17. package/dist/events/pageview.d.mts +1 -2
  18. package/dist/events/pageview.mjs +1 -2
  19. package/dist/integrations/index.cjs +1 -1
  20. package/dist/integrations/index.d.cts +56 -3
  21. package/dist/integrations/index.d.mts +56 -3
  22. package/dist/integrations/index.mjs +1 -2
  23. package/dist/integrations/platforms/cli.d.cts +1 -2
  24. package/dist/integrations/platforms/cli.d.mts +1 -2
  25. package/dist/integrations/platforms/cli.mjs +1 -2
  26. package/dist/integrations/platforms/cloudflare.cjs +1 -0
  27. package/dist/integrations/platforms/cloudflare.d.cts +29 -0
  28. package/dist/integrations/platforms/cloudflare.d.mts +29 -0
  29. package/dist/integrations/platforms/cloudflare.mjs +1 -0
  30. package/dist/integrations/platforms/github.d.cts +1 -2
  31. package/dist/integrations/platforms/github.d.mts +1 -2
  32. package/dist/integrations/platforms/github.mjs +1 -2
  33. package/dist/integrations/platforms/slack.d.cts +1 -2
  34. package/dist/integrations/platforms/slack.d.mts +1 -2
  35. package/dist/integrations/platforms/slack.mjs +1 -2
  36. package/dist/integrations/platforms/vercel.d.cts +1 -2
  37. package/dist/integrations/platforms/vercel.d.mts +1 -2
  38. package/dist/integrations/platforms/vercel.mjs +1 -2
  39. package/dist/releases/definition.d.cts +16 -2
  40. package/dist/releases/definition.d.mts +16 -2
  41. package/dist/releases/definition.mjs +1 -2
  42. package/dist/releases/slug.d.cts +1 -2
  43. package/dist/releases/slug.d.mts +1 -2
  44. package/dist/releases/slug.mjs +1 -2
  45. package/dist/sdk/cli-destination.cjs +1 -0
  46. package/dist/sdk/cli-destination.d.cts +7 -0
  47. package/dist/sdk/cli-destination.d.mts +7 -0
  48. package/dist/sdk/cli-destination.mjs +1 -0
  49. package/dist/sdk/deploy-environment.cjs +2 -0
  50. package/dist/sdk/deploy-environment.d.cts +5 -0
  51. package/dist/sdk/deploy-environment.d.mts +5 -0
  52. package/dist/sdk/deploy-environment.mjs +2 -0
  53. package/dist/sdk/env.d.cts +1 -2
  54. package/dist/sdk/env.d.mts +1 -2
  55. package/dist/sdk/env.mjs +1 -2
  56. package/dist/sdk/envelope.d.cts +1 -2
  57. package/dist/sdk/envelope.d.mts +1 -2
  58. package/dist/sdk/envelope.mjs +1 -2
  59. package/dist/sdk/errors.cjs +1 -1
  60. package/dist/sdk/errors.d.cts +7 -2
  61. package/dist/sdk/errors.d.mts +7 -2
  62. package/dist/sdk/errors.mjs +2 -3
  63. package/dist/sdk/geo.d.cts +1 -2
  64. package/dist/sdk/geo.d.mts +1 -2
  65. package/dist/sdk/geo.mjs +1 -2
  66. package/dist/sdk/identify.d.cts +1 -2
  67. package/dist/sdk/identify.d.mts +1 -2
  68. package/dist/sdk/identify.mjs +1 -2
  69. package/dist/sdk/plugins/context/browser.d.cts +1 -2
  70. package/dist/sdk/plugins/context/browser.d.mts +1 -2
  71. package/dist/sdk/plugins/context/browser.mjs +1 -2
  72. package/dist/sdk/plugins/context/edge.d.cts +1 -2
  73. package/dist/sdk/plugins/context/edge.d.mts +1 -2
  74. package/dist/sdk/plugins/context/edge.mjs +1 -2
  75. package/dist/sdk/plugins/context/next.d.cts +1 -2
  76. package/dist/sdk/plugins/context/next.d.mts +1 -2
  77. package/dist/sdk/plugins/context/next.mjs +1 -2
  78. package/dist/sdk/plugins/context/node.d.cts +1 -2
  79. package/dist/sdk/plugins/context/node.d.mts +1 -2
  80. package/dist/sdk/plugins/context/node.mjs +1 -2
  81. package/dist/sdk/plugins/manifest.d.cts +1 -2
  82. package/dist/sdk/plugins/manifest.d.mts +1 -2
  83. package/dist/sdk/plugins/manifest.mjs +1 -2
  84. package/dist/sdk/plugins/payload/errors.d.cts +1 -2
  85. package/dist/sdk/plugins/payload/errors.d.mts +1 -2
  86. package/dist/sdk/plugins/payload/errors.mjs +1 -2
  87. package/dist/sdk/plugins/payload/page-events.d.cts +1 -2
  88. package/dist/sdk/plugins/payload/page-events.d.mts +1 -2
  89. package/dist/sdk/plugins/payload/page-events.mjs +1 -2
  90. package/dist/sdk/plugins/payload/rage-click.d.cts +1 -2
  91. package/dist/sdk/plugins/payload/rage-click.d.mts +1 -2
  92. package/dist/sdk/plugins/payload/rage-click.mjs +1 -2
  93. package/dist/sdk/plugins/payload/replay.d.cts +1 -2
  94. package/dist/sdk/plugins/payload/replay.d.mts +1 -2
  95. package/dist/sdk/plugins/payload/replay.mjs +1 -2
  96. package/dist/sdk/remote-config.d.cts +1 -2
  97. package/dist/sdk/remote-config.d.mts +1 -2
  98. package/dist/sdk/remote-config.mjs +1 -2
  99. package/dist/sdk/runtime.d.cts +1 -2
  100. package/dist/sdk/runtime.d.mts +1 -2
  101. package/dist/sdk/runtime.mjs +1 -2
  102. package/package.json +6 -28
@@ -1,2 +1 @@
1
- import{releaseDestinationMetadataSchema,releaseSourceMetadataSchema}from"../integrations/index.mjs";import{releaseSlugSchema}from"./slug.mjs";import{z}from"zod";const releaseStatusSchema=z.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=z.object({source:releaseSourceMetadataSchema,destination:releaseDestinationMetadataSchema.nullable(),buildId:z.string(),slug:z.string().optional(),producerVersion:z.string().optional()}).meta({id:`CreateReleaseRequest`,title:`CreateReleaseRequest`,description:`Request body for creating a release.`}),createReleaseResponse=z.object({org:orgRefSchema,surface:surfaceRefSchema,source:z.object({id:z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),destination:z.object({id:z.string(),slug:releaseSlugSchema,environment:z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),build:z.object({hash:z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`})}).meta({id:`CreateReleaseResponse`,title:`CreateReleaseResponse`,description:`Response body returned after creating a release.`});export{createReleaseRequest,createReleaseResponse,releaseStatusSchema};
2
- //# sourceMappingURL=definition.mjs.map
1
+ import{releaseDestinationMetadataSchema,releaseSourceMetadataSchema}from"../integrations/index.mjs";import{releaseSlugSchema}from"./slug.mjs";import{z}from"zod";const releaseStatusSchema=z.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=z.object({source:releaseSourceMetadataSchema,destination:releaseDestinationMetadataSchema.nullable(),buildId:z.string(),slug:z.string().optional(),producerVersion:z.string().optional()}).meta({id:`CreateReleaseRequest`,title:`CreateReleaseRequest`,description:`Request body for creating a release.`}),createReleaseResponse=z.object({org:orgRefSchema,surface:surfaceRefSchema,source:z.object({id:z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),destination:z.object({id:z.string(),slug:releaseSlugSchema,environment:z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),build:z.object({hash:z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`})}).meta({id:`CreateReleaseResponse`,title:`CreateReleaseResponse`,description:`Response body returned after creating a release.`});export{createReleaseRequest,createReleaseResponse,releaseStatusSchema};
@@ -20,5 +20,4 @@ declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.core.$brand<"ReleaseSl
20
20
  */
21
21
  declare function deriveReleaseSlug(commitSha: string): ReleaseSlug;
22
22
  //#endregion
23
- export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
24
- //# sourceMappingURL=slug.d.cts.map
23
+ export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
@@ -20,5 +20,4 @@ declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.core.$brand<"ReleaseSl
20
20
  */
21
21
  declare function deriveReleaseSlug(commitSha: string): ReleaseSlug;
22
22
  //#endregion
23
- export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
24
- //# sourceMappingURL=slug.d.mts.map
23
+ export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const SLUG_PREFIX=`rel_`,releaseSlugSchema=z.templateLiteral([SLUG_PREFIX,z.string().regex(/^[0-9a-f]{16}$/)]).brand(),LOCAL_DEV_RELEASE_SLUG=releaseSlugSchema.parse(`rel_0000000000000000`);function deriveReleaseSlug(commitSha){return releaseSlugSchema.parse(`${SLUG_PREFIX}${commitSha.toLowerCase().slice(0,16)}`)}export{LOCAL_DEV_RELEASE_SLUG,deriveReleaseSlug,releaseSlugSchema};
2
- //# sourceMappingURL=slug.mjs.map
1
+ import{z}from"zod";const SLUG_PREFIX=`rel_`,releaseSlugSchema=z.templateLiteral([SLUG_PREFIX,z.string().regex(/^[0-9a-f]{16}$/)]).brand(),LOCAL_DEV_RELEASE_SLUG=releaseSlugSchema.parse(`rel_0000000000000000`);function deriveReleaseSlug(commitSha){return releaseSlugSchema.parse(`${SLUG_PREFIX}${commitSha.toLowerCase().slice(0,16)}`)}export{LOCAL_DEV_RELEASE_SLUG,deriveReleaseSlug,releaseSlugSchema};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_env=require("./env.cjs");function resolveCliReleaseDestination(env,releaseSlug){return{provider:`cli`,destinationReleaseId:releaseSlug,environment:require_sdk_env.parseEnvValue(env.INTERFERE_ENVIRONMENT),deploymentUrl:require_sdk_env.parseEnvValue(env.INTERFERE_DEPLOYMENT_URL)}}exports.resolveCliReleaseDestination=resolveCliReleaseDestination;
@@ -0,0 +1,7 @@
1
+ import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
2
+ import { ReleaseSlug } from "../releases/slug.cjs";
3
+
4
+ //#region src/sdk/cli-destination.d.ts
5
+ declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): ReleaseDestinationMetadata;
6
+ //#endregion
7
+ export { resolveCliReleaseDestination };
@@ -0,0 +1,7 @@
1
+ import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
2
+ import { ReleaseSlug } from "../releases/slug.mjs";
3
+
4
+ //#region src/sdk/cli-destination.d.ts
5
+ declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): ReleaseDestinationMetadata;
6
+ //#endregion
7
+ export { resolveCliReleaseDestination };
@@ -0,0 +1 @@
1
+ import{parseEnvValue}from"./env.mjs";function resolveCliReleaseDestination(env,releaseSlug){return{provider:`cli`,destinationReleaseId:releaseSlug,environment:parseEnvValue(env.INTERFERE_ENVIRONMENT),deploymentUrl:parseEnvValue(env.INTERFERE_DEPLOYMENT_URL)}}export{resolveCliReleaseDestination};
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");function fromEnv(...names){return env=>{for(let name of names){let value=require_sdk_runtime.normalizeEnv(env[name]);if(value)return value}return null}}const PROVIDER_RESOLVERS={vercel:[fromEnv(`VERCEL_TARGET_ENV`,`VERCEL_ENV`)],cloudflare:[fromEnv(`CLOUDFLARE_ENV`)]},UNRESOLVED_ENVIRONMENT_MESSAGE=[`Could not determine the deploy environment for this build.`,`Set INTERFERE_ENVIRONMENT (e.g. production or preview), or deploy on a platform that sets VERCEL_ENV / CLOUDFLARE_ENV.`].join(`
2
+ `);var DeployEnvironmentError=class extends Error{};function resolveDeployEnvironment(env){let explicit=require_sdk_runtime.normalizeEnv(env.INTERFERE_ENVIRONMENT);if(explicit)return explicit;for(let resolvers of Object.values(PROVIDER_RESOLVERS))for(let resolve of resolvers){let value=resolve(env);if(value)return value}throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE)}exports.DeployEnvironmentError=DeployEnvironmentError,exports.resolveDeployEnvironment=resolveDeployEnvironment;
@@ -0,0 +1,5 @@
1
+ //#region src/sdk/deploy-environment.d.ts
2
+ declare class DeployEnvironmentError extends Error {}
3
+ declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
4
+ //#endregion
5
+ export { DeployEnvironmentError, resolveDeployEnvironment };
@@ -0,0 +1,5 @@
1
+ //#region src/sdk/deploy-environment.d.ts
2
+ declare class DeployEnvironmentError extends Error {}
3
+ declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
4
+ //#endregion
5
+ export { DeployEnvironmentError, resolveDeployEnvironment };
@@ -0,0 +1,2 @@
1
+ import{normalizeEnv}from"./runtime.mjs";function fromEnv(...names){return env=>{for(let name of names){let value=normalizeEnv(env[name]);if(value)return value}return null}}const PROVIDER_RESOLVERS={vercel:[fromEnv(`VERCEL_TARGET_ENV`,`VERCEL_ENV`)],cloudflare:[fromEnv(`CLOUDFLARE_ENV`)]},UNRESOLVED_ENVIRONMENT_MESSAGE=[`Could not determine the deploy environment for this build.`,`Set INTERFERE_ENVIRONMENT (e.g. production or preview), or deploy on a platform that sets VERCEL_ENV / CLOUDFLARE_ENV.`].join(`
2
+ `);var DeployEnvironmentError=class extends Error{};function resolveDeployEnvironment(env){let explicit=normalizeEnv(env.INTERFERE_ENVIRONMENT);if(explicit)return explicit;for(let resolvers of Object.values(PROVIDER_RESOLVERS))for(let resolve of resolvers){let value=resolve(env);if(value)return value}throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE)}export{DeployEnvironmentError,resolveDeployEnvironment};
@@ -2,5 +2,4 @@
2
2
  declare function parseEnvValue(value: unknown): string | null;
3
3
  declare function readFirstEnvValue(env: Record<string, string | undefined>, keys: readonly string[]): string | null;
4
4
  //#endregion
5
- export { parseEnvValue, readFirstEnvValue };
6
- //# sourceMappingURL=env.d.cts.map
5
+ export { parseEnvValue, readFirstEnvValue };
@@ -2,5 +2,4 @@
2
2
  declare function parseEnvValue(value: unknown): string | null;
3
3
  declare function readFirstEnvValue(env: Record<string, string | undefined>, keys: readonly string[]): string | null;
4
4
  //#endregion
5
- export { parseEnvValue, readFirstEnvValue };
6
- //# sourceMappingURL=env.d.mts.map
5
+ export { parseEnvValue, readFirstEnvValue };
package/dist/sdk/env.mjs CHANGED
@@ -1,2 +1 @@
1
- import{z}from"zod";const interfereEnvValueSchema=z.string().trim().min(1);function parseEnvValue(value){let parsed=interfereEnvValueSchema.safeParse(value);return parsed.success?parsed.data:null}function readFirstEnvValue(env,keys){for(let key of keys){let value=parseEnvValue(env[key]);if(value!==null)return value}return null}export{parseEnvValue,readFirstEnvValue};
2
- //# sourceMappingURL=env.mjs.map
1
+ import{z}from"zod";const interfereEnvValueSchema=z.string().trim().min(1);function parseEnvValue(value){let parsed=interfereEnvValueSchema.safeParse(value);return parsed.success?parsed.data:null}function readFirstEnvValue(env,keys){for(let key of keys){let value=parseEnvValue(env[key]);if(value!==null)return value}return null}export{parseEnvValue,readFirstEnvValue};
@@ -1437,5 +1437,4 @@ type Envelope<T extends EventType | undefined = undefined> = T extends EventType
1437
1437
  }> : EnvelopeBase;
1438
1438
  type EnvelopePayload<T extends EventType> = Envelope<T>["payload"];
1439
1439
  //#endregion
1440
- export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
1441
- //# sourceMappingURL=envelope.d.cts.map
1440
+ export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
@@ -1437,5 +1437,4 @@ type Envelope<T extends EventType | undefined = undefined> = T extends EventType
1437
1437
  }> : EnvelopeBase;
1438
1438
  type EnvelopePayload<T extends EventType> = Envelope<T>["payload"];
1439
1439
  //#endregion
1440
- export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
1441
- //# sourceMappingURL=envelope.d.mts.map
1440
+ export { Envelope, EnvelopeContext, EnvelopePayload, EventType, SessionSource, envelopeContextSchema, envelopeSchema, errorEnvelopeSchema, pageleaveEnvelopeSchema, pageviewEnvelopeSchema, rageClickEnvelopeSchema, replayChunkEnvelopeSchema, sessionSourceSchema, uiEventEnvelopeSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";import{sessionIdSchema}from"#data/session";import{browserContextSchema}from"#sdk/plugins/context/browser";import{edgeContextSchema}from"#sdk/plugins/context/edge";import{nextjsContextSchema}from"#sdk/plugins/context/next";import{nodeContextSchema}from"#sdk/plugins/context/node";import{errorEnvelopePayloadSchema}from"#sdk/plugins/payload/errors";import{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema}from"#sdk/plugins/payload/page-events";import{rageClickPayloadSchema}from"#sdk/plugins/payload/rage-click";import{replayChunkPayloadSchema}from"#sdk/plugins/payload/replay";import{envSchema,runtimeSchema}from"#sdk/runtime";const sessionSourceSchema=z.enum([`header`,`async_context`,`fallback`,`client`]).optional().meta({id:`SessionSource`,title:`SessionSource`,description:`How the server resolved the sessionId for this envelope.`}),envelopeContextSchema=z.discriminatedUnion(`runtime`,[browserContextSchema,nextjsContextSchema,edgeContextSchema,nodeContextSchema]).meta({id:`EnvelopeContext`,title:`EnvelopeContext`,description:`Runtime-specific request context attached to every envelope.`}),envelopeHeadersShape={buildId:z.string(),clientTs:z.int(),context:envelopeContextSchema.optional(),environment:envSchema,producerVersion:z.string().optional(),releaseId:z.string().nullable(),runtime:runtimeSchema,sdkStack:z.array(z.string()).optional(),sessionId:sessionIdSchema.nullable(),sessionSource:sessionSourceSchema,uuid:z.uuidv7(),v:z.literal(0)},errorEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`error`),payload:errorEnvelopePayloadSchema}).meta({id:`ErrorEnvelope`,title:`ErrorEnvelope`}),pageviewEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageview`),payload:pageviewPayloadSchema}).meta({id:`PageviewEnvelope`,title:`PageviewEnvelope`}),pageleaveEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageleave`),payload:pageleavePayloadSchema}).meta({id:`PageleaveEnvelope`,title:`PageleaveEnvelope`}),uiEventEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`ui_event`),payload:uiEventPayloadSchema}).meta({id:`UiEventEnvelope`,title:`UiEventEnvelope`}),replayChunkEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`replay_chunk`),payload:replayChunkPayloadSchema}).meta({id:`ReplayChunkEnvelope`,title:`ReplayChunkEnvelope`}),rageClickEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`rage_click`),payload:rageClickPayloadSchema}).meta({id:`RageClickEnvelope`,title:`RageClickEnvelope`}),envelopeSchema=z.discriminatedUnion(`type`,[errorEnvelopeSchema,pageviewEnvelopeSchema,pageleaveEnvelopeSchema,uiEventEnvelopeSchema,replayChunkEnvelopeSchema,rageClickEnvelopeSchema]).meta({id:`Envelope`,title:`Envelope`,description:`A single event envelope accepted by the collector.`});export{envelopeContextSchema,envelopeSchema,errorEnvelopeSchema,pageleaveEnvelopeSchema,pageviewEnvelopeSchema,rageClickEnvelopeSchema,replayChunkEnvelopeSchema,sessionSourceSchema,uiEventEnvelopeSchema};
2
- //# sourceMappingURL=envelope.mjs.map
1
+ import{z}from"zod";import{sessionIdSchema}from"#data/session";import{browserContextSchema}from"#sdk/plugins/context/browser";import{edgeContextSchema}from"#sdk/plugins/context/edge";import{nextjsContextSchema}from"#sdk/plugins/context/next";import{nodeContextSchema}from"#sdk/plugins/context/node";import{errorEnvelopePayloadSchema}from"#sdk/plugins/payload/errors";import{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema}from"#sdk/plugins/payload/page-events";import{rageClickPayloadSchema}from"#sdk/plugins/payload/rage-click";import{replayChunkPayloadSchema}from"#sdk/plugins/payload/replay";import{envSchema,runtimeSchema}from"#sdk/runtime";const sessionSourceSchema=z.enum([`header`,`async_context`,`fallback`,`client`]).optional().meta({id:`SessionSource`,title:`SessionSource`,description:`How the server resolved the sessionId for this envelope.`}),envelopeContextSchema=z.discriminatedUnion(`runtime`,[browserContextSchema,nextjsContextSchema,edgeContextSchema,nodeContextSchema]).meta({id:`EnvelopeContext`,title:`EnvelopeContext`,description:`Runtime-specific request context attached to every envelope.`}),envelopeHeadersShape={buildId:z.string(),clientTs:z.int(),context:envelopeContextSchema.optional(),environment:envSchema,producerVersion:z.string().optional(),releaseId:z.string().nullable(),runtime:runtimeSchema,sdkStack:z.array(z.string()).optional(),sessionId:sessionIdSchema.nullable(),sessionSource:sessionSourceSchema,uuid:z.uuidv7(),v:z.literal(0)},errorEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`error`),payload:errorEnvelopePayloadSchema}).meta({id:`ErrorEnvelope`,title:`ErrorEnvelope`}),pageviewEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageview`),payload:pageviewPayloadSchema}).meta({id:`PageviewEnvelope`,title:`PageviewEnvelope`}),pageleaveEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`pageleave`),payload:pageleavePayloadSchema}).meta({id:`PageleaveEnvelope`,title:`PageleaveEnvelope`}),uiEventEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`ui_event`),payload:uiEventPayloadSchema}).meta({id:`UiEventEnvelope`,title:`UiEventEnvelope`}),replayChunkEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`replay_chunk`),payload:replayChunkPayloadSchema}).meta({id:`ReplayChunkEnvelope`,title:`ReplayChunkEnvelope`}),rageClickEnvelopeSchema=z.object({...envelopeHeadersShape,type:z.literal(`rage_click`),payload:rageClickPayloadSchema}).meta({id:`RageClickEnvelope`,title:`RageClickEnvelope`}),envelopeSchema=z.discriminatedUnion(`type`,[errorEnvelopeSchema,pageviewEnvelopeSchema,pageleaveEnvelopeSchema,uiEventEnvelopeSchema,replayChunkEnvelopeSchema,rageClickEnvelopeSchema]).meta({id:`Envelope`,title:`Envelope`,description:`A single event envelope accepted by the collector.`});export{envelopeContextSchema,envelopeSchema,errorEnvelopeSchema,pageleaveEnvelopeSchema,pageviewEnvelopeSchema,rageClickEnvelopeSchema,replayChunkEnvelopeSchema,sessionSourceSchema,uiEventEnvelopeSchema};
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,xhrFailedResponse:`auto.browser.xhr.failed_response`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,fetchNetworkError:`auto.browser.fetch.network_error`,xhrFailedResponse:`auto.browser.xhr.failed_response`,xhrNetworkError:`auto.browser.xhr.network_error`,securityPolicyViolation:`auto.browser.security_policy.violation`,resourceError:`auto.browser.resource.error`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`,proxy:`auto.function.nextjs.proxy`,serverAction:`auto.function.nextjs.server_action`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
2
2
  `)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}exports.MECHANISM_TYPE=MECHANISM_TYPE,exports.isNonErrorException=isNonErrorException,exports.parseReactComponentStack=parseReactComponentStack,exports.shouldDropBrowserExtensionNoise=shouldDropBrowserExtensionNoise,exports.shouldDropUnresolvableStack=shouldDropUnresolvableStack,exports.toError=toError,exports.toException=toException,exports.toExceptions=toExceptions;
@@ -22,7 +22,11 @@ declare const MECHANISM_TYPE: {
22
22
  readonly onunhandledrejection: "auto.browser.global_handlers.onunhandledrejection";
23
23
  readonly consoleError: "auto.browser.console.error";
24
24
  readonly fetchFailedResponse: "auto.browser.fetch.failed_response";
25
+ readonly fetchNetworkError: "auto.browser.fetch.network_error";
25
26
  readonly xhrFailedResponse: "auto.browser.xhr.failed_response";
27
+ readonly xhrNetworkError: "auto.browser.xhr.network_error";
28
+ readonly securityPolicyViolation: "auto.browser.security_policy.violation";
29
+ readonly resourceError: "auto.browser.resource.error";
26
30
  };
27
31
  readonly react: {
28
32
  readonly errorBoundary: "auto.function.react.error_boundary";
@@ -34,6 +38,8 @@ declare const MECHANISM_TYPE: {
34
38
  readonly nextjs: {
35
39
  readonly onRequestError: "auto.function.nextjs.on_request_error";
36
40
  readonly captureError: "auto.function.nextjs.capture_error";
41
+ readonly proxy: "auto.function.nextjs.proxy";
42
+ readonly serverAction: "auto.function.nextjs.server_action";
37
43
  };
38
44
  readonly node: {
39
45
  readonly captureError: "auto.function.node.capture_error";
@@ -152,5 +158,4 @@ declare function isNonErrorException(value: unknown): value is NonErrorException
152
158
  */
153
159
  declare function toExceptions(value: Error | NonErrorException, mechanism: ErrorMechanism): ExceptionValue[];
154
160
  //#endregion
155
- export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
156
- //# sourceMappingURL=errors.d.cts.map
161
+ export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
@@ -22,7 +22,11 @@ declare const MECHANISM_TYPE: {
22
22
  readonly onunhandledrejection: "auto.browser.global_handlers.onunhandledrejection";
23
23
  readonly consoleError: "auto.browser.console.error";
24
24
  readonly fetchFailedResponse: "auto.browser.fetch.failed_response";
25
+ readonly fetchNetworkError: "auto.browser.fetch.network_error";
25
26
  readonly xhrFailedResponse: "auto.browser.xhr.failed_response";
27
+ readonly xhrNetworkError: "auto.browser.xhr.network_error";
28
+ readonly securityPolicyViolation: "auto.browser.security_policy.violation";
29
+ readonly resourceError: "auto.browser.resource.error";
26
30
  };
27
31
  readonly react: {
28
32
  readonly errorBoundary: "auto.function.react.error_boundary";
@@ -34,6 +38,8 @@ declare const MECHANISM_TYPE: {
34
38
  readonly nextjs: {
35
39
  readonly onRequestError: "auto.function.nextjs.on_request_error";
36
40
  readonly captureError: "auto.function.nextjs.capture_error";
41
+ readonly proxy: "auto.function.nextjs.proxy";
42
+ readonly serverAction: "auto.function.nextjs.server_action";
37
43
  };
38
44
  readonly node: {
39
45
  readonly captureError: "auto.function.node.capture_error";
@@ -152,5 +158,4 @@ declare function isNonErrorException(value: unknown): value is NonErrorException
152
158
  */
153
159
  declare function toExceptions(value: Error | NonErrorException, mechanism: ErrorMechanism): ExceptionValue[];
154
160
  //#endregion
155
- export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
156
- //# sourceMappingURL=errors.d.mts.map
161
+ export { MECHANISM_TYPE, NonErrorException, isNonErrorException, parseReactComponentStack, shouldDropBrowserExtensionNoise, shouldDropUnresolvableStack, toError, toException, toExceptions };
@@ -1,3 +1,2 @@
1
- const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,xhrFailedResponse:`auto.browser.xhr.failed_response`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
2
- `)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}export{MECHANISM_TYPE,isNonErrorException,parseReactComponentStack,shouldDropBrowserExtensionNoise,shouldDropUnresolvableStack,toError,toException,toExceptions};
3
- //# sourceMappingURL=errors.mjs.map
1
+ const MECHANISM_TYPE={browser:{onerror:`auto.browser.global_handlers.onerror`,onunhandledrejection:`auto.browser.global_handlers.onunhandledrejection`,consoleError:`auto.browser.console.error`,fetchFailedResponse:`auto.browser.fetch.failed_response`,fetchNetworkError:`auto.browser.fetch.network_error`,xhrFailedResponse:`auto.browser.xhr.failed_response`,xhrNetworkError:`auto.browser.xhr.network_error`,securityPolicyViolation:`auto.browser.security_policy.violation`,resourceError:`auto.browser.resource.error`},react:{errorBoundary:`auto.function.react.error_boundary`,captureBoundary:`auto.function.react.capture_boundary`,caughtError:`auto.function.react.caught_error`,uncaughtError:`auto.function.react.uncaught_error`,recoverableError:`auto.function.react.recoverable_error`},nextjs:{onRequestError:`auto.function.nextjs.on_request_error`,captureError:`auto.function.nextjs.capture_error`,proxy:`auto.function.nextjs.proxy`,serverAction:`auto.function.nextjs.server_action`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
2
+ `)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}export{MECHANISM_TYPE,isNonErrorException,parseReactComponentStack,shouldDropBrowserExtensionNoise,shouldDropUnresolvableStack,toError,toException,toExceptions};
@@ -7,5 +7,4 @@ declare const cloudflareTraceSchema: z.ZodObject<{
7
7
  type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;
8
8
  declare function extractCountryHeader(request: Request): string | null;
9
9
  //#endregion
10
- export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
11
- //# sourceMappingURL=geo.d.cts.map
10
+ export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
@@ -7,5 +7,4 @@ declare const cloudflareTraceSchema: z.ZodObject<{
7
7
  type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;
8
8
  declare function extractCountryHeader(request: Request): string | null;
9
9
  //#endregion
10
- export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
11
- //# sourceMappingURL=geo.d.mts.map
10
+ export { CloudflareTrace, cloudflareTraceSchema, extractCountryHeader };
package/dist/sdk/geo.mjs CHANGED
@@ -1,2 +1 @@
1
- import{z}from"zod";const cloudflareTraceSchema=z.object({loc:z.string().length(2)}).loose(),GEO_COUNTRY_HEADERS=[`cf-ipcountry`,`x-vercel-ip-country`,`x-country-code`];function extractCountryHeader(request){for(let header of GEO_COUNTRY_HEADERS){let value=request.headers.get(header);if(value&&value.length===2)return value.toUpperCase()}return null}export{cloudflareTraceSchema,extractCountryHeader};
2
- //# sourceMappingURL=geo.mjs.map
1
+ import{z}from"zod";const cloudflareTraceSchema=z.object({loc:z.string().length(2)}).loose(),GEO_COUNTRY_HEADERS=[`cf-ipcountry`,`x-vercel-ip-country`,`x-country-code`];function extractCountryHeader(request){for(let header of GEO_COUNTRY_HEADERS){let value=request.headers.get(header);if(value&&value.length===2)return value.toUpperCase()}return null}export{cloudflareTraceSchema,extractCountryHeader};
@@ -31,5 +31,4 @@ declare const identifyParamsSchema: z.ZodObject<{
31
31
  }, z.core.$strip>;
32
32
  type IdentifyParams = z.infer<typeof identifyParamsSchema>;
33
33
  //#endregion
34
- export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
35
- //# sourceMappingURL=identify.d.cts.map
34
+ export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
@@ -31,5 +31,4 @@ declare const identifyParamsSchema: z.ZodObject<{
31
31
  }, z.core.$strip>;
32
32
  type IdentifyParams = z.infer<typeof identifyParamsSchema>;
33
33
  //#endregion
34
- export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
35
- //# sourceMappingURL=identify.d.mts.map
34
+ export { IdentifyParams, IdentifySource, identifyParamsSchema, identifySourceSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const identifySourceSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`clerk`),name:z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),z.object({type:z.literal(`auth0`),name:z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),z.object({type:z.literal(`custom`),name:z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=z.record(z.string(),z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=z.object({avatar:z.string().optional(),email:z.email().optional(),identifier:z.string(),name:z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});export{identifyParamsSchema,identifySourceSchema};
2
- //# sourceMappingURL=identify.mjs.map
1
+ import{z}from"zod";const identifySourceSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`clerk`),name:z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),z.object({type:z.literal(`auth0`),name:z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),z.object({type:z.literal(`custom`),name:z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=z.record(z.string(),z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=z.object({avatar:z.string().optional(),email:z.email().optional(),identifier:z.string(),name:z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});export{identifyParamsSchema,identifySourceSchema};
@@ -88,5 +88,4 @@ declare const browserContextSchema: z.ZodObject<{
88
88
  }, z.core.$strip>;
89
89
  type BrowserContext = z.infer<typeof browserContextSchema>;
90
90
  //#endregion
91
- export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
92
- //# sourceMappingURL=browser.d.cts.map
91
+ export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
@@ -88,5 +88,4 @@ declare const browserContextSchema: z.ZodObject<{
88
88
  }, z.core.$strip>;
89
89
  type BrowserContext = z.infer<typeof browserContextSchema>;
90
90
  //#endregion
91
- export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
92
- //# sourceMappingURL=browser.d.mts.map
91
+ export { BrowserContext, BrowserMetadata, DeviceMetadata, browserContextSchema, deviceMetadataSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const deviceBrowserSchema=z.object({major:z.string().optional(),name:z.string().optional(),type:z.string().optional(),version:z.string().optional(),fullVersion:z.string().optional()}).meta({id:`DeviceBrowser`,title:`DeviceBrowser`}),deviceCpuSchema=z.object({architecture:z.string().optional(),bitness:z.string().optional()}).meta({id:`DeviceCpu`,title:`DeviceCpu`}),deviceInfoSchema=z.object({model:z.string().optional(),type:z.string().optional(),vendor:z.string().optional()}).meta({id:`DeviceInfo`,title:`DeviceInfo`}),deviceEngineSchema=z.object({name:z.string().optional(),version:z.string().optional()}).meta({id:`DeviceEngine`,title:`DeviceEngine`}),deviceOsSchema=z.object({name:z.string().optional(),version:z.string().optional(),versionFull:z.string().optional()}).meta({id:`DeviceOs`,title:`DeviceOs`}),deviceMetadataSchema=z.object({browser:deviceBrowserSchema,cpu:deviceCpuSchema,device:deviceInfoSchema,engine:deviceEngineSchema,os:deviceOsSchema,ua:z.string(),frozenUa:z.boolean().optional()}).meta({id:`DeviceMetadata`,title:`DeviceMetadata`,description:`Device/browser metadata extracted from the user agent.`}),displayScreenSchema=z.object({height:z.number(),width:z.number(),orientation:z.string().optional()}).meta({id:`Screen`,title:`Screen`}),displaySchema=z.object({screen:displayScreenSchema}).meta({id:`Display`,title:`Display`}),browserMetadataSchema=z.object({language:z.string().optional(),timezone:z.string().optional(),display:displaySchema}).meta({id:`BrowserMetadata`,title:`BrowserMetadata`,description:`Browser locale and display metadata.`}),browserContextSchema=z.object({runtime:z.literal(`browser`),browser:browserMetadataSchema.nullable(),device:deviceMetadataSchema.nullable()}).meta({id:`BrowserContext`,title:`BrowserContext`,description:`Request context for the browser runtime.`});export{browserContextSchema,deviceMetadataSchema};
2
- //# sourceMappingURL=browser.mjs.map
1
+ import{z}from"zod";const deviceBrowserSchema=z.object({major:z.string().optional(),name:z.string().optional(),type:z.string().optional(),version:z.string().optional(),fullVersion:z.string().optional()}).meta({id:`DeviceBrowser`,title:`DeviceBrowser`}),deviceCpuSchema=z.object({architecture:z.string().optional(),bitness:z.string().optional()}).meta({id:`DeviceCpu`,title:`DeviceCpu`}),deviceInfoSchema=z.object({model:z.string().optional(),type:z.string().optional(),vendor:z.string().optional()}).meta({id:`DeviceInfo`,title:`DeviceInfo`}),deviceEngineSchema=z.object({name:z.string().optional(),version:z.string().optional()}).meta({id:`DeviceEngine`,title:`DeviceEngine`}),deviceOsSchema=z.object({name:z.string().optional(),version:z.string().optional(),versionFull:z.string().optional()}).meta({id:`DeviceOs`,title:`DeviceOs`}),deviceMetadataSchema=z.object({browser:deviceBrowserSchema,cpu:deviceCpuSchema,device:deviceInfoSchema,engine:deviceEngineSchema,os:deviceOsSchema,ua:z.string(),frozenUa:z.boolean().optional()}).meta({id:`DeviceMetadata`,title:`DeviceMetadata`,description:`Device/browser metadata extracted from the user agent.`}),displayScreenSchema=z.object({height:z.number(),width:z.number(),orientation:z.string().optional()}).meta({id:`Screen`,title:`Screen`}),displaySchema=z.object({screen:displayScreenSchema}).meta({id:`Display`,title:`Display`}),browserMetadataSchema=z.object({language:z.string().optional(),timezone:z.string().optional(),display:displaySchema}).meta({id:`BrowserMetadata`,title:`BrowserMetadata`,description:`Browser locale and display metadata.`}),browserContextSchema=z.object({runtime:z.literal(`browser`),browser:browserMetadataSchema.nullable(),device:deviceMetadataSchema.nullable()}).meta({id:`BrowserContext`,title:`BrowserContext`,description:`Request context for the browser runtime.`});export{browserContextSchema,deviceMetadataSchema};
@@ -6,5 +6,4 @@ declare const edgeContextSchema: z.ZodObject<{
6
6
  }, z.core.$strip>;
7
7
  type EdgeContext = z.infer<typeof edgeContextSchema>;
8
8
  //#endregion
9
- export { EdgeContext, edgeContextSchema };
10
- //# sourceMappingURL=edge.d.cts.map
9
+ export { EdgeContext, edgeContextSchema };
@@ -6,5 +6,4 @@ declare const edgeContextSchema: z.ZodObject<{
6
6
  }, z.core.$strip>;
7
7
  type EdgeContext = z.infer<typeof edgeContextSchema>;
8
8
  //#endregion
9
- export { EdgeContext, edgeContextSchema };
10
- //# sourceMappingURL=edge.d.mts.map
9
+ export { EdgeContext, edgeContextSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const edgeContextSchema=z.object({runtime:z.literal(`edge`)}).meta({id:`EdgeContext`,title:`EdgeContext`,description:`Request context for the Edge runtime.`});export{edgeContextSchema};
2
- //# sourceMappingURL=edge.mjs.map
1
+ import{z}from"zod";const edgeContextSchema=z.object({runtime:z.literal(`edge`)}).meta({id:`EdgeContext`,title:`EdgeContext`,description:`Request context for the Edge runtime.`});export{edgeContextSchema};
@@ -58,5 +58,4 @@ declare const nextjsContextSchema: z.ZodObject<{
58
58
  }, z.core.$strip>;
59
59
  type NextjsContext = z.infer<typeof nextjsContextSchema>;
60
60
  //#endregion
61
- export { NextjsContext, nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
62
- //# sourceMappingURL=next.d.cts.map
61
+ export { NextjsContext, nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
@@ -58,5 +58,4 @@ declare const nextjsContextSchema: z.ZodObject<{
58
58
  }, z.core.$strip>;
59
59
  type NextjsContext = z.infer<typeof nextjsContextSchema>;
60
60
  //#endregion
61
- export { NextjsContext, nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
62
- //# sourceMappingURL=next.d.mts.map
61
+ export { NextjsContext, nextjsContextSchema, renderSourceSchema, renderTypeSchema, revalidateReasonSchema, routeTypeSchema, routerKindSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const renderSourceSchema=z.enum([`react-server-components`,`react-server-components-payload`,`server-rendering`]).meta({id:`RenderSource`,title:`RenderSource`}),renderTypeSchema=z.enum([`dynamic`,`dynamic-resume`]).meta({id:`RenderType`,title:`RenderType`}),revalidateReasonSchema=z.enum([`on-demand`,`stale`]).meta({id:`RevalidateReason`,title:`RevalidateReason`}),routeTypeSchema=z.enum([`render`,`route`,`action`,`middleware`,`proxy`]).meta({id:`RouteType`,title:`RouteType`}),routerKindSchema=z.enum([`Pages Router`,`App Router`]).meta({id:`RouterKind`,title:`RouterKind`}),nextjsContextSchema=z.object({errorDigest:z.string().optional(),renderSource:renderSourceSchema.optional(),renderType:renderTypeSchema.optional(),requestMethod:z.string().optional(),requestPath:z.string().optional(),revalidateReason:revalidateReasonSchema.optional(),routePath:z.string().optional(),routeType:routeTypeSchema.optional(),routerKind:routerKindSchema.optional(),runtime:z.literal(`nextjs`)}).meta({id:`NextjsContext`,title:`NextjsContext`,description:`Request context for the Next.js runtime.`});export{nextjsContextSchema,renderSourceSchema,renderTypeSchema,revalidateReasonSchema,routeTypeSchema,routerKindSchema};
2
- //# sourceMappingURL=next.mjs.map
1
+ import{z}from"zod";const renderSourceSchema=z.enum([`react-server-components`,`react-server-components-payload`,`server-rendering`]).meta({id:`RenderSource`,title:`RenderSource`}),renderTypeSchema=z.enum([`dynamic`,`dynamic-resume`]).meta({id:`RenderType`,title:`RenderType`}),revalidateReasonSchema=z.enum([`on-demand`,`stale`]).meta({id:`RevalidateReason`,title:`RevalidateReason`}),routeTypeSchema=z.enum([`render`,`route`,`action`,`middleware`,`proxy`]).meta({id:`RouteType`,title:`RouteType`}),routerKindSchema=z.enum([`Pages Router`,`App Router`]).meta({id:`RouterKind`,title:`RouterKind`}),nextjsContextSchema=z.object({errorDigest:z.string().optional(),renderSource:renderSourceSchema.optional(),renderType:renderTypeSchema.optional(),requestMethod:z.string().optional(),requestPath:z.string().optional(),revalidateReason:revalidateReasonSchema.optional(),routePath:z.string().optional(),routeType:routeTypeSchema.optional(),routerKind:routerKindSchema.optional(),runtime:z.literal(`nextjs`)}).meta({id:`NextjsContext`,title:`NextjsContext`,description:`Request context for the Next.js runtime.`});export{nextjsContextSchema,renderSourceSchema,renderTypeSchema,revalidateReasonSchema,routeTypeSchema,routerKindSchema};
@@ -9,5 +9,4 @@ declare const nodeContextSchema: z.ZodObject<{
9
9
  }, z.core.$strip>;
10
10
  type NodeContext = z.infer<typeof nodeContextSchema>;
11
11
  //#endregion
12
- export { NodeContext, nodeContextSchema };
13
- //# sourceMappingURL=node.d.cts.map
12
+ export { NodeContext, nodeContextSchema };
@@ -9,5 +9,4 @@ declare const nodeContextSchema: z.ZodObject<{
9
9
  }, z.core.$strip>;
10
10
  type NodeContext = z.infer<typeof nodeContextSchema>;
11
11
  //#endregion
12
- export { NodeContext, nodeContextSchema };
13
- //# sourceMappingURL=node.d.mts.map
12
+ export { NodeContext, nodeContextSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const nodeContextSchema=z.object({errorDigest:z.string().optional(),requestMethod:z.string().optional(),requestPath:z.string().optional(),runtime:z.literal(`node`)}).meta({id:`NodeContext`,title:`NodeContext`,description:`Request context for the Node.js runtime.`});export{nodeContextSchema};
2
- //# sourceMappingURL=node.mjs.map
1
+ import{z}from"zod";const nodeContextSchema=z.object({errorDigest:z.string().optional(),requestMethod:z.string().optional(),requestPath:z.string().optional(),runtime:z.literal(`node`)}).meta({id:`NodeContext`,title:`NodeContext`,description:`Request context for the Node.js runtime.`});export{nodeContextSchema};
@@ -56,5 +56,4 @@ type PluginKey = PluginManifest[number]["name"];
56
56
  type GateableCategory = Exclude<ConsentCategory, "necessary">;
57
57
  type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;
58
58
  //#endregion
59
- export { CONSENT_CATEGORIES, ConsentCategory, ConsentState, GateableCategory, PLUGIN_MANIFEST, PluginKey, PluginManifest };
60
- //# sourceMappingURL=manifest.d.cts.map
59
+ export { CONSENT_CATEGORIES, ConsentCategory, ConsentState, GateableCategory, PLUGIN_MANIFEST, PluginKey, PluginManifest };
@@ -56,5 +56,4 @@ type PluginKey = PluginManifest[number]["name"];
56
56
  type GateableCategory = Exclude<ConsentCategory, "necessary">;
57
57
  type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;
58
58
  //#endregion
59
- export { CONSENT_CATEGORIES, ConsentCategory, ConsentState, GateableCategory, PLUGIN_MANIFEST, PluginKey, PluginManifest };
60
- //# sourceMappingURL=manifest.d.mts.map
59
+ export { CONSENT_CATEGORIES, ConsentCategory, ConsentState, GateableCategory, PLUGIN_MANIFEST, PluginKey, PluginManifest };
@@ -1,2 +1 @@
1
- const CONSENT_CATEGORIES=[`necessary`,`analytics`,`replay`],PLUGIN_MANIFEST=[{consentCategory:`necessary`,defaultEnabled:!0,events:[{enrich:!0,name:`error`}],name:`errors`},{consentCategory:`analytics`,defaultEnabled:!0,events:[],name:`device`},{consentCategory:`analytics`,defaultEnabled:!0,events:[{enrich:!0,name:`pageview`},{enrich:!0,name:`pageleave`},{enrich:!0,name:`ui_event`}],name:`pageEvents`},{consentCategory:`analytics`,defaultEnabled:!0,events:[{enrich:!0,name:`rage_click`}],name:`rageClick`},{consentCategory:`replay`,defaultEnabled:!0,events:[{enrich:!1,name:`replay_chunk`}],name:`replay`},{consentCategory:`necessary`,defaultEnabled:!0,events:[],name:`logs`}];export{CONSENT_CATEGORIES,PLUGIN_MANIFEST};
2
- //# sourceMappingURL=manifest.mjs.map
1
+ const CONSENT_CATEGORIES=[`necessary`,`analytics`,`replay`],PLUGIN_MANIFEST=[{consentCategory:`necessary`,defaultEnabled:!0,events:[{enrich:!0,name:`error`}],name:`errors`},{consentCategory:`analytics`,defaultEnabled:!0,events:[],name:`device`},{consentCategory:`analytics`,defaultEnabled:!0,events:[{enrich:!0,name:`pageview`},{enrich:!0,name:`pageleave`},{enrich:!0,name:`ui_event`}],name:`pageEvents`},{consentCategory:`analytics`,defaultEnabled:!0,events:[{enrich:!0,name:`rage_click`}],name:`rageClick`},{consentCategory:`replay`,defaultEnabled:!0,events:[{enrich:!1,name:`replay_chunk`}],name:`replay`},{consentCategory:`necessary`,defaultEnabled:!0,events:[],name:`logs`}];export{CONSENT_CATEGORIES,PLUGIN_MANIFEST};
@@ -61,5 +61,4 @@ declare const errorEnvelopePayloadSchema: z.ZodObject<{
61
61
  }, z.core.$strip>;
62
62
  type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
63
63
  //#endregion
64
- export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
65
- //# sourceMappingURL=errors.d.cts.map
64
+ export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
@@ -61,5 +61,4 @@ declare const errorEnvelopePayloadSchema: z.ZodObject<{
61
61
  }, z.core.$strip>;
62
62
  type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
63
63
  //#endregion
64
- export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
65
- //# sourceMappingURL=errors.d.mts.map
64
+ export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const errorSourceSchema=z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=z.object({type:z.string(),handled:z.boolean(),synthetic:z.boolean().optional()}).meta({id:`ErrorMechanism`,title:`ErrorMechanism`,description:`How the exception was captured by the SDK.`}),errorExceptionSchema=z.object({kind:z.literal(`error`),type:z.string(),value:z.string(),mechanism:errorMechanismSchema.optional(),stack:z.string()}),nonErrorExceptionSchema=z.object({kind:z.literal(`non-error`),type:z.string(),value:z.string(),mechanism:errorMechanismSchema.optional(),serialized:z.unknown()}),exceptionValueSchema=z.union([errorExceptionSchema,nonErrorExceptionSchema]).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."}),errorEnvelopePayloadSchema=z.object({exceptions:z.array(exceptionValueSchema).min(1),errorDigest:z.string().optional()}).meta({id:`ErrorPayload`,title:`ErrorPayload`,description:`Payload for an error envelope.`});export{errorEnvelopePayloadSchema,errorMechanismSchema,errorSourceSchema,exceptionValueSchema};
2
- //# sourceMappingURL=errors.mjs.map
1
+ import{z}from"zod";const errorSourceSchema=z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=z.object({type:z.string(),handled:z.boolean(),synthetic:z.boolean().optional()}).meta({id:`ErrorMechanism`,title:`ErrorMechanism`,description:`How the exception was captured by the SDK.`}),errorExceptionSchema=z.object({kind:z.literal(`error`),type:z.string(),value:z.string(),mechanism:errorMechanismSchema.optional(),stack:z.string()}),nonErrorExceptionSchema=z.object({kind:z.literal(`non-error`),type:z.string(),value:z.string(),mechanism:errorMechanismSchema.optional(),serialized:z.unknown()}),exceptionValueSchema=z.union([errorExceptionSchema,nonErrorExceptionSchema]).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."}),errorEnvelopePayloadSchema=z.object({exceptions:z.array(exceptionValueSchema).min(1),errorDigest:z.string().optional()}).meta({id:`ErrorPayload`,title:`ErrorPayload`,description:`Payload for an error envelope.`});export{errorEnvelopePayloadSchema,errorMechanismSchema,errorSourceSchema,exceptionValueSchema};
@@ -16,5 +16,4 @@ declare const pageleavePayloadSchema: z.ZodObject<{
16
16
  }, z.core.$strip>;
17
17
  type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
18
18
  //#endregion
19
- export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
20
- //# sourceMappingURL=page-events.d.cts.map
19
+ export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
@@ -16,5 +16,4 @@ declare const pageleavePayloadSchema: z.ZodObject<{
16
16
  }, z.core.$strip>;
17
17
  type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
18
18
  //#endregion
19
- export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
20
- //# sourceMappingURL=page-events.d.mts.map
19
+ export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const uiEventPayloadSchema=z.object({event:z.record(z.string(),z.unknown())}).meta({id:`UiEventPayload`,title:`UiEventPayload`,description:`Payload for a UI event envelope.`}),pageviewPayloadSchema=z.object({url:z.url(),title:z.string().optional()}).meta({id:`PageviewPayload`,title:`PageviewPayload`,description:`Payload for a pageview envelope.`}),pageleavePayloadSchema=z.object({url:z.url(),durationMs:z.number().optional()}).meta({id:`PageleavePayload`,title:`PageleavePayload`,description:`Payload for a pageleave envelope.`});export{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema};
2
- //# sourceMappingURL=page-events.mjs.map
1
+ import{z}from"zod";const uiEventPayloadSchema=z.object({event:z.record(z.string(),z.unknown())}).meta({id:`UiEventPayload`,title:`UiEventPayload`,description:`Payload for a UI event envelope.`}),pageviewPayloadSchema=z.object({url:z.url(),title:z.string().optional()}).meta({id:`PageviewPayload`,title:`PageviewPayload`,description:`Payload for a pageview envelope.`}),pageleavePayloadSchema=z.object({url:z.url(),durationMs:z.number().optional()}).meta({id:`PageleavePayload`,title:`PageleavePayload`,description:`Payload for a pageleave envelope.`});export{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema};
@@ -12,5 +12,4 @@ declare const rageClickPayloadSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
14
14
  //#endregion
15
- export { RageClickPayload, rageClickPayloadSchema };
16
- //# sourceMappingURL=rage-click.d.cts.map
15
+ export { RageClickPayload, rageClickPayloadSchema };
@@ -12,5 +12,4 @@ declare const rageClickPayloadSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
14
14
  //#endregion
15
- export { RageClickPayload, rageClickPayloadSchema };
16
- //# sourceMappingURL=rage-click.d.mts.map
15
+ export { RageClickPayload, rageClickPayloadSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const rageClickPayloadSchema=z.object({count:z.number(),timeWindow:z.number(),selector:z.string(),text:z.string(),x:z.number(),y:z.number(),timestamp:z.number()}).meta({id:`RageClickPayload`,title:`RageClickPayload`,description:`Payload for a rage-click envelope.`});export{rageClickPayloadSchema};
2
- //# sourceMappingURL=rage-click.mjs.map
1
+ import{z}from"zod";const rageClickPayloadSchema=z.object({count:z.number(),timeWindow:z.number(),selector:z.string(),text:z.string(),x:z.number(),y:z.number(),timestamp:z.number()}).meta({id:`RageClickPayload`,title:`RageClickPayload`,description:`Payload for a rage-click envelope.`});export{rageClickPayloadSchema};
@@ -10,5 +10,4 @@ declare const replayChunkPayloadSchema: z.ZodObject<{
10
10
  }, z.core.$strip>;
11
11
  type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
12
12
  //#endregion
13
- export { ReplayChunkPayload, replayChunkPayloadSchema };
14
- //# sourceMappingURL=replay.d.cts.map
13
+ export { ReplayChunkPayload, replayChunkPayloadSchema };
@@ -10,5 +10,4 @@ declare const replayChunkPayloadSchema: z.ZodObject<{
10
10
  }, z.core.$strip>;
11
11
  type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
12
12
  //#endregion
13
- export { ReplayChunkPayload, replayChunkPayloadSchema };
14
- //# sourceMappingURL=replay.d.mts.map
13
+ export { ReplayChunkPayload, replayChunkPayloadSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const replayChunkPayloadSchema=z.object({ts:z.number(),count:z.number(),events:z.array(z.string()),first_event_ts:z.number().optional(),last_event_ts:z.number().optional()}).meta({id:`ReplayChunkPayload`,title:`ReplayChunkPayload`,description:`Payload for a replay-chunk envelope.`});export{replayChunkPayloadSchema};
2
- //# sourceMappingURL=replay.mjs.map
1
+ import{z}from"zod";const replayChunkPayloadSchema=z.object({ts:z.number(),count:z.number(),events:z.array(z.string()),first_event_ts:z.number().optional(),last_event_ts:z.number().optional()}).meta({id:`ReplayChunkPayload`,title:`ReplayChunkPayload`,description:`Payload for a replay-chunk envelope.`});export{replayChunkPayloadSchema};
@@ -35,5 +35,4 @@ declare const remoteConfigSchema: z.ZodObject<{
35
35
  type RemoteConfig = z.infer<typeof remoteConfigSchema>;
36
36
  declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
37
37
  //#endregion
38
- export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
39
- //# sourceMappingURL=remote-config.d.cts.map
38
+ export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
@@ -35,5 +35,4 @@ declare const remoteConfigSchema: z.ZodObject<{
35
35
  type RemoteConfig = z.infer<typeof remoteConfigSchema>;
36
36
  declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
37
37
  //#endregion
38
- export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
39
- //# sourceMappingURL=remote-config.d.mts.map
38
+ export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
@@ -1,2 +1 @@
1
- import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({plugins:remotePluginConfigSchema}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),EVENT_TYPE_TO_PLUGIN=Object.fromEntries(PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));export{EVENT_TYPE_TO_PLUGIN,remoteConfigSchema,remotePluginConfigSchema};
2
- //# sourceMappingURL=remote-config.mjs.map
1
+ import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({plugins:remotePluginConfigSchema}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),EVENT_TYPE_TO_PLUGIN=Object.fromEntries(PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));export{EVENT_TYPE_TO_PLUGIN,remoteConfigSchema,remotePluginConfigSchema};
@@ -37,5 +37,4 @@ declare function inferRuntime(options?: {
37
37
  }): Runtime;
38
38
  declare function normalizeEnv(value: unknown): string | null;
39
39
  //#endregion
40
- export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
41
- //# sourceMappingURL=runtime.d.cts.map
40
+ export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
@@ -37,5 +37,4 @@ declare function inferRuntime(options?: {
37
37
  }): Runtime;
38
38
  declare function normalizeEnv(value: unknown): string | null;
39
39
  //#endregion
40
- export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
41
- //# sourceMappingURL=runtime.d.mts.map
40
+ export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const envSchema=z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`?`browser`:typeof globalThis.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof process<`u`&&typeof process.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}export{DEFAULT_ENVIRONMENT,envSchema,inferRuntime,normalizeEnv,resolveEnvironment,runtimeSchema};
2
- //# sourceMappingURL=runtime.mjs.map
1
+ import{z}from"zod";const envSchema=z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`?`browser`:typeof globalThis.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof process<`u`&&typeof process.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}export{DEFAULT_ENVIRONMENT,envSchema,inferRuntime,normalizeEnv,resolveEnvironment,runtimeSchema};