@interfere/types 9.0.3-canary.1 → 9.0.3-canary.3

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 (107) 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.cjs +1 -1
  11. package/dist/events/error.d.cts +5 -4
  12. package/dist/events/error.d.mts +5 -4
  13. package/dist/events/error.mjs +1 -2
  14. package/dist/events/pageleave.d.cts +1 -2
  15. package/dist/events/pageleave.d.mts +1 -2
  16. package/dist/events/pageleave.mjs +1 -2
  17. package/dist/events/pageview.d.cts +1 -2
  18. package/dist/events/pageview.d.mts +1 -2
  19. package/dist/events/pageview.mjs +1 -2
  20. package/dist/integrations/index.cjs +1 -1
  21. package/dist/integrations/index.d.cts +57 -4
  22. package/dist/integrations/index.d.mts +57 -4
  23. package/dist/integrations/index.mjs +1 -2
  24. package/dist/integrations/platforms/cli.d.cts +1 -2
  25. package/dist/integrations/platforms/cli.d.mts +1 -2
  26. package/dist/integrations/platforms/cli.mjs +1 -2
  27. package/dist/integrations/platforms/cloudflare.cjs +1 -0
  28. package/dist/integrations/platforms/cloudflare.d.cts +30 -0
  29. package/dist/integrations/platforms/cloudflare.d.mts +30 -0
  30. package/dist/integrations/platforms/cloudflare.mjs +1 -0
  31. package/dist/integrations/platforms/github.d.cts +1 -2
  32. package/dist/integrations/platforms/github.d.mts +1 -2
  33. package/dist/integrations/platforms/github.mjs +1 -2
  34. package/dist/integrations/platforms/slack.d.cts +1 -2
  35. package/dist/integrations/platforms/slack.d.mts +1 -2
  36. package/dist/integrations/platforms/slack.mjs +1 -2
  37. package/dist/integrations/platforms/vercel.d.cts +1 -2
  38. package/dist/integrations/platforms/vercel.d.mts +1 -2
  39. package/dist/integrations/platforms/vercel.mjs +1 -2
  40. package/dist/releases/definition.d.cts +16 -2
  41. package/dist/releases/definition.d.mts +16 -2
  42. package/dist/releases/definition.mjs +1 -2
  43. package/dist/releases/slug.d.cts +1 -2
  44. package/dist/releases/slug.d.mts +1 -2
  45. package/dist/releases/slug.mjs +1 -2
  46. package/dist/sdk/build-diagnostics.cjs +1 -0
  47. package/dist/sdk/build-diagnostics.d.cts +22 -0
  48. package/dist/sdk/build-diagnostics.d.mts +22 -0
  49. package/dist/sdk/build-diagnostics.mjs +1 -0
  50. package/dist/sdk/cli-destination.cjs +1 -0
  51. package/dist/sdk/cli-destination.d.cts +7 -0
  52. package/dist/sdk/cli-destination.d.mts +7 -0
  53. package/dist/sdk/cli-destination.mjs +1 -0
  54. package/dist/sdk/deploy-environment.cjs +2 -0
  55. package/dist/sdk/deploy-environment.d.cts +9 -0
  56. package/dist/sdk/deploy-environment.d.mts +9 -0
  57. package/dist/sdk/deploy-environment.mjs +2 -0
  58. package/dist/sdk/env.d.cts +1 -2
  59. package/dist/sdk/env.d.mts +1 -2
  60. package/dist/sdk/env.mjs +1 -2
  61. package/dist/sdk/envelope.d.cts +1 -2
  62. package/dist/sdk/envelope.d.mts +1 -2
  63. package/dist/sdk/envelope.mjs +1 -2
  64. package/dist/sdk/errors.cjs +1 -1
  65. package/dist/sdk/errors.d.cts +8 -3
  66. package/dist/sdk/errors.d.mts +8 -3
  67. package/dist/sdk/errors.mjs +2 -3
  68. package/dist/sdk/geo.d.cts +1 -2
  69. package/dist/sdk/geo.d.mts +1 -2
  70. package/dist/sdk/geo.mjs +1 -2
  71. package/dist/sdk/identify.d.cts +1 -2
  72. package/dist/sdk/identify.d.mts +1 -2
  73. package/dist/sdk/identify.mjs +1 -2
  74. package/dist/sdk/plugins/context/browser.d.cts +1 -2
  75. package/dist/sdk/plugins/context/browser.d.mts +1 -2
  76. package/dist/sdk/plugins/context/browser.mjs +1 -2
  77. package/dist/sdk/plugins/context/edge.d.cts +1 -2
  78. package/dist/sdk/plugins/context/edge.d.mts +1 -2
  79. package/dist/sdk/plugins/context/edge.mjs +1 -2
  80. package/dist/sdk/plugins/context/next.d.cts +1 -2
  81. package/dist/sdk/plugins/context/next.d.mts +1 -2
  82. package/dist/sdk/plugins/context/next.mjs +1 -2
  83. package/dist/sdk/plugins/context/node.d.cts +1 -2
  84. package/dist/sdk/plugins/context/node.d.mts +1 -2
  85. package/dist/sdk/plugins/context/node.mjs +1 -2
  86. package/dist/sdk/plugins/manifest.d.cts +1 -2
  87. package/dist/sdk/plugins/manifest.d.mts +1 -2
  88. package/dist/sdk/plugins/manifest.mjs +1 -2
  89. package/dist/sdk/plugins/payload/errors.d.cts +1 -2
  90. package/dist/sdk/plugins/payload/errors.d.mts +1 -2
  91. package/dist/sdk/plugins/payload/errors.mjs +1 -2
  92. package/dist/sdk/plugins/payload/page-events.d.cts +1 -2
  93. package/dist/sdk/plugins/payload/page-events.d.mts +1 -2
  94. package/dist/sdk/plugins/payload/page-events.mjs +1 -2
  95. package/dist/sdk/plugins/payload/rage-click.d.cts +1 -2
  96. package/dist/sdk/plugins/payload/rage-click.d.mts +1 -2
  97. package/dist/sdk/plugins/payload/rage-click.mjs +1 -2
  98. package/dist/sdk/plugins/payload/replay.d.cts +1 -2
  99. package/dist/sdk/plugins/payload/replay.d.mts +1 -2
  100. package/dist/sdk/plugins/payload/replay.mjs +1 -2
  101. package/dist/sdk/remote-config.d.cts +1 -2
  102. package/dist/sdk/remote-config.d.mts +1 -2
  103. package/dist/sdk/remote-config.mjs +1 -2
  104. package/dist/sdk/runtime.d.cts +1 -2
  105. package/dist/sdk/runtime.d.mts +1 -2
  106. package/dist/sdk/runtime.mjs +1 -2
  107. package/package.json +7 -28
@@ -1,2 +1 @@
1
- import{z}from"zod";const vercelDestinationIdEnvKeys=z.enum([`VERCEL_DEPLOYMENT_ID`]).options,vercelMetadataBase=z.object({avatar:z.string().nullable().default(null),name:z.string().nullable().default(null),installationUrl:z.string().nullable(),projects:z.record(z.string(),z.string()).default({})}),vercelTeamMetadata=vercelMetadataBase.extend({accountType:z.literal(`team`),id:z.string(),slug:z.string()}),vercelUserMetadata=vercelMetadataBase.extend({accountType:z.literal(`user`),id:z.string(),username:z.string(),email:z.string()}),vercelMetadataSchema=z.discriminatedUnion(`accountType`,[vercelTeamMetadata,vercelUserMetadata]),vercelIntegration=z.object({name:z.literal(`vercel`),metadata:vercelMetadataSchema});export{vercelDestinationIdEnvKeys,vercelIntegration,vercelTeamMetadata,vercelUserMetadata};
2
- //# sourceMappingURL=vercel.mjs.map
1
+ import{z}from"zod";const vercelDestinationIdEnvKeys=z.enum([`VERCEL_DEPLOYMENT_ID`]).options,vercelMetadataBase=z.object({avatar:z.string().nullable().default(null),name:z.string().nullable().default(null),installationUrl:z.string().nullable(),projects:z.record(z.string(),z.string()).default({})}),vercelTeamMetadata=vercelMetadataBase.extend({accountType:z.literal(`team`),id:z.string(),slug:z.string()}),vercelUserMetadata=vercelMetadataBase.extend({accountType:z.literal(`user`),id:z.string(),username:z.string(),email:z.string()}),vercelMetadataSchema=z.discriminatedUnion(`accountType`,[vercelTeamMetadata,vercelUserMetadata]),vercelIntegration=z.object({name:z.literal(`vercel`),metadata:vercelMetadataSchema});export{vercelDestinationIdEnvKeys,vercelIntegration,vercelTeamMetadata,vercelUserMetadata};
@@ -38,6 +38,21 @@ declare const createReleaseRequest: z.ZodObject<{
38
38
  deploymentUrl: z.ZodNullable<z.ZodString>;
39
39
  environmentName: z.ZodNullable<z.ZodString>;
40
40
  environmentTarget: z.ZodNullable<z.ZodString>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ provider: z.ZodLiteral<"cloudflare">;
43
+ destinationReleaseId: z.ZodNullable<z.ZodString>;
44
+ environment: z.ZodNullable<z.ZodString>;
45
+ versionId: z.ZodNullable<z.ZodString>;
46
+ scriptName: z.ZodNullable<z.ZodString>;
47
+ accountId: z.ZodNullable<z.ZodString>;
48
+ deploymentUrl: z.ZodNullable<z.ZodString>;
49
+ environmentName: z.ZodNullable<z.ZodString>;
50
+ environmentTarget: z.ZodNullable<z.ZodString>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ provider: z.ZodLiteral<"cli">;
53
+ destinationReleaseId: z.ZodNullable<z.ZodString>;
54
+ environment: z.ZodNullable<z.ZodString>;
55
+ deploymentUrl: z.ZodNullable<z.ZodString>;
41
56
  }, z.core.$strip>], "provider">>;
42
57
  buildId: z.ZodString;
43
58
  slug: z.ZodOptional<z.ZodString>;
@@ -67,5 +82,4 @@ declare const createReleaseResponse: z.ZodObject<{
67
82
  }, z.core.$strip>;
68
83
  type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
69
84
  //#endregion
70
- export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
71
- //# sourceMappingURL=definition.d.cts.map
85
+ export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
@@ -38,6 +38,21 @@ declare const createReleaseRequest: z.ZodObject<{
38
38
  deploymentUrl: z.ZodNullable<z.ZodString>;
39
39
  environmentName: z.ZodNullable<z.ZodString>;
40
40
  environmentTarget: z.ZodNullable<z.ZodString>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ provider: z.ZodLiteral<"cloudflare">;
43
+ destinationReleaseId: z.ZodNullable<z.ZodString>;
44
+ environment: z.ZodNullable<z.ZodString>;
45
+ versionId: z.ZodNullable<z.ZodString>;
46
+ scriptName: z.ZodNullable<z.ZodString>;
47
+ accountId: z.ZodNullable<z.ZodString>;
48
+ deploymentUrl: z.ZodNullable<z.ZodString>;
49
+ environmentName: z.ZodNullable<z.ZodString>;
50
+ environmentTarget: z.ZodNullable<z.ZodString>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ provider: z.ZodLiteral<"cli">;
53
+ destinationReleaseId: z.ZodNullable<z.ZodString>;
54
+ environment: z.ZodNullable<z.ZodString>;
55
+ deploymentUrl: z.ZodNullable<z.ZodString>;
41
56
  }, z.core.$strip>], "provider">>;
42
57
  buildId: z.ZodString;
43
58
  slug: z.ZodOptional<z.ZodString>;
@@ -67,5 +82,4 @@ declare const createReleaseResponse: z.ZodObject<{
67
82
  }, z.core.$strip>;
68
83
  type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
69
84
  //#endregion
70
- export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
71
- //# sourceMappingURL=definition.d.mts.map
85
+ export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
@@ -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 API_KEY_PREFIX=`interfere_ak_`,DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}const CATALOG={API_KEY_WRONG_PREFIX:(ctx,input)=>({code:`API_KEY_WRONG_PREFIX`,severity:`fatal`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with \`${API_KEY_PREFIX}\` but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a publishable key (\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new API key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,title:`API key could not be read`,details:[`INTERFERE_API_KEY was sent but the server could not read it.`,`Expected a key starting with \`${API_KEY_PREFIX}\`.`,`If you set a publishable key (\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new API key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,title:`API key rejected by server`,details:[`INTERFERE_API_KEY was sent but the server did not recognize it.`,`Verify it matches an active key at ${DASHBOARD_KEYS_URL}.`,`If you recently rotated keys, restart your build with the new value.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,title:`API key missing release scope`,details:[`INTERFERE_API_KEY was recognized but cannot publish release metadata.`,`Create or update the key with \`release:write\` scope at ${DASHBOARD_KEYS_URL}.`,`If you recently changed key scopes, restart your build with the new value.`]}),RELEASE_PIPELINE_FAILED:(_ctx,input)=>({code:`RELEASE_PIPELINE_FAILED`,severity:`warn`,title:`Skipping release pipeline`,details:[`Interfere failed to process this release.`,`Events from this release will be ingested, but ignored as finding when generating insights.`,`Please check https://status.interfere.com for any outages, or contact support@interfere.com if the problem persists.`,`Error: ${input.errorMessage??`<unknown>`}`]})};function diagnoseRelease(code,ctx,input={}){return CATALOG[code](ctx,input)}const COLLECTOR_CODE_TO_DIAGNOSTIC={COLLECTOR_AUTH_MISSING:`API_KEY_UNREADABLE`,COLLECTOR_AUTH_AK_INVALID:`API_KEY_REJECTED`,COLLECTOR_AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`};function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let{code}=error;return typeof code==`string`?COLLECTOR_CODE_TO_DIAGNOSTIC[code]??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}exports.API_KEY_PREFIX=API_KEY_PREFIX,exports.classifyReleasePipelineError=classifyReleasePipelineError,exports.diagnoseRelease=diagnoseRelease,exports.formatApiKeyPreview=formatApiKeyPreview;
@@ -0,0 +1,22 @@
1
+ //#region src/sdk/build-diagnostics.d.ts
2
+ declare const API_KEY_PREFIX = "interfere_ak_";
3
+ type ReleaseDiagnosticSeverity = "fatal" | "warn";
4
+ type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
5
+ interface ReleaseDiagnostic {
6
+ readonly code: ReleaseDiagnosticCode;
7
+ readonly details: readonly string[];
8
+ readonly severity: ReleaseDiagnosticSeverity;
9
+ readonly title: string;
10
+ }
11
+ interface ReleaseDiagnosticContext {
12
+ readonly publicKeyEnvVar: string;
13
+ }
14
+ interface ReleaseDiagnosticInput {
15
+ readonly apiKey?: string;
16
+ readonly errorMessage?: string;
17
+ }
18
+ declare function formatApiKeyPreview(apiKey: string): string;
19
+ declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
20
+ declare function classifyReleasePipelineError(error: unknown): ReleaseDiagnosticCode;
21
+ //#endregion
22
+ export { API_KEY_PREFIX, ReleaseDiagnostic, ReleaseDiagnosticCode, ReleaseDiagnosticContext, ReleaseDiagnosticInput, ReleaseDiagnosticSeverity, classifyReleasePipelineError, diagnoseRelease, formatApiKeyPreview };
@@ -0,0 +1,22 @@
1
+ //#region src/sdk/build-diagnostics.d.ts
2
+ declare const API_KEY_PREFIX = "interfere_ak_";
3
+ type ReleaseDiagnosticSeverity = "fatal" | "warn";
4
+ type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
5
+ interface ReleaseDiagnostic {
6
+ readonly code: ReleaseDiagnosticCode;
7
+ readonly details: readonly string[];
8
+ readonly severity: ReleaseDiagnosticSeverity;
9
+ readonly title: string;
10
+ }
11
+ interface ReleaseDiagnosticContext {
12
+ readonly publicKeyEnvVar: string;
13
+ }
14
+ interface ReleaseDiagnosticInput {
15
+ readonly apiKey?: string;
16
+ readonly errorMessage?: string;
17
+ }
18
+ declare function formatApiKeyPreview(apiKey: string): string;
19
+ declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
20
+ declare function classifyReleasePipelineError(error: unknown): ReleaseDiagnosticCode;
21
+ //#endregion
22
+ export { API_KEY_PREFIX, ReleaseDiagnostic, ReleaseDiagnosticCode, ReleaseDiagnosticContext, ReleaseDiagnosticInput, ReleaseDiagnosticSeverity, classifyReleasePipelineError, diagnoseRelease, formatApiKeyPreview };
@@ -0,0 +1 @@
1
+ const API_KEY_PREFIX=`interfere_ak_`,DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}const CATALOG={API_KEY_WRONG_PREFIX:(ctx,input)=>({code:`API_KEY_WRONG_PREFIX`,severity:`fatal`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with \`${API_KEY_PREFIX}\` but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a publishable key (\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new API key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,title:`API key could not be read`,details:[`INTERFERE_API_KEY was sent but the server could not read it.`,`Expected a key starting with \`${API_KEY_PREFIX}\`.`,`If you set a publishable key (\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new API key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,title:`API key rejected by server`,details:[`INTERFERE_API_KEY was sent but the server did not recognize it.`,`Verify it matches an active key at ${DASHBOARD_KEYS_URL}.`,`If you recently rotated keys, restart your build with the new value.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,title:`API key missing release scope`,details:[`INTERFERE_API_KEY was recognized but cannot publish release metadata.`,`Create or update the key with \`release:write\` scope at ${DASHBOARD_KEYS_URL}.`,`If you recently changed key scopes, restart your build with the new value.`]}),RELEASE_PIPELINE_FAILED:(_ctx,input)=>({code:`RELEASE_PIPELINE_FAILED`,severity:`warn`,title:`Skipping release pipeline`,details:[`Interfere failed to process this release.`,`Events from this release will be ingested, but ignored as finding when generating insights.`,`Please check https://status.interfere.com for any outages, or contact support@interfere.com if the problem persists.`,`Error: ${input.errorMessage??`<unknown>`}`]})};function diagnoseRelease(code,ctx,input={}){return CATALOG[code](ctx,input)}const COLLECTOR_CODE_TO_DIAGNOSTIC={COLLECTOR_AUTH_MISSING:`API_KEY_UNREADABLE`,COLLECTOR_AUTH_AK_INVALID:`API_KEY_REJECTED`,COLLECTOR_AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`};function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let{code}=error;return typeof code==`string`?COLLECTOR_CODE_TO_DIAGNOSTIC[code]??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}export{API_KEY_PREFIX,classifyReleasePipelineError,diagnoseRelease,formatApiKeyPreview};
@@ -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 resolveEnvironmentValue(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}return null}function resolveDeployEnvironment(env){let environment=resolveEnvironmentValue(env);if(!environment)throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE);if(environment.length>32)throw new DeployEnvironmentError(`Deploy environment "${environment}" is ${environment.length} characters; the maximum is 32. Set a shorter INTERFERE_ENVIRONMENT.`);return environment}function applyDeployEnvironment(destination,environment){return environment?destination.provider===`cli`?{...destination,environment}:{...destination,environment,environmentName:environment,environmentTarget:environment}:destination}exports.DEPLOY_ENVIRONMENT_MAX_LENGTH=32,exports.DeployEnvironmentError=DeployEnvironmentError,exports.applyDeployEnvironment=applyDeployEnvironment,exports.resolveDeployEnvironment=resolveDeployEnvironment;
@@ -0,0 +1,9 @@
1
+ import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
2
+
3
+ //#region src/sdk/deploy-environment.d.ts
4
+ declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
5
+ declare class DeployEnvironmentError extends Error {}
6
+ declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
7
+ declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): ReleaseDestinationMetadata;
8
+ //#endregion
9
+ export { DEPLOY_ENVIRONMENT_MAX_LENGTH, DeployEnvironmentError, applyDeployEnvironment, resolveDeployEnvironment };
@@ -0,0 +1,9 @@
1
+ import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
2
+
3
+ //#region src/sdk/deploy-environment.d.ts
4
+ declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
5
+ declare class DeployEnvironmentError extends Error {}
6
+ declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
7
+ declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): ReleaseDestinationMetadata;
8
+ //#endregion
9
+ export { DEPLOY_ENVIRONMENT_MAX_LENGTH, DeployEnvironmentError, applyDeployEnvironment, 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
+ `),DEPLOY_ENVIRONMENT_MAX_LENGTH=32;var DeployEnvironmentError=class extends Error{};function resolveEnvironmentValue(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}return null}function resolveDeployEnvironment(env){let environment=resolveEnvironmentValue(env);if(!environment)throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE);if(environment.length>32)throw new DeployEnvironmentError(`Deploy environment "${environment}" is ${environment.length} characters; the maximum is 32. Set a shorter INTERFERE_ENVIRONMENT.`);return environment}function applyDeployEnvironment(destination,environment){return environment?destination.provider===`cli`?{...destination,environment}:{...destination,environment,environmentName:environment,environmentTarget:environment}:destination}export{DEPLOY_ENVIRONMENT_MAX_LENGTH,DeployEnvironmentError,applyDeployEnvironment,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;
@@ -13,7 +13,7 @@ import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
13
13
  * server wrappers)
14
14
  *
15
15
  * Leaves (`.onerror`, `.error_boundary`, `.on_request_error`, …) identify
16
- * the specific capture site, which lets the agent's skill classifier reason
16
+ * the specific capture site, which lets Interfere's skill classifier reason
17
17
  * about what "kind" of event this is without string-matching loose names.
18
18
  */
19
19
  declare const MECHANISM_TYPE: {
@@ -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 };
@@ -13,7 +13,7 @@ import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
13
13
  * server wrappers)
14
14
  *
15
15
  * Leaves (`.onerror`, `.error_boundary`, `.on_request_error`, …) identify
16
- * the specific capture site, which lets the agent's skill classifier reason
16
+ * the specific capture site, which lets Interfere's skill classifier reason
17
17
  * about what "kind" of event this is without string-matching loose names.
18
18
  */
19
19
  declare const MECHANISM_TYPE: {
@@ -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 };