@interfere/types 10.3.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/session.cjs +1 -1
- package/dist/data/session.d.cts +2 -1
- package/dist/data/session.d.mts +2 -1
- package/dist/data/session.mjs +1 -1
- package/dist/data/source-map-batch.cjs +1 -1
- package/dist/data/source-map-batch.mjs +1 -1
- package/dist/integrations/platforms/cloudflare.cjs +1 -1
- package/dist/integrations/platforms/cloudflare.d.cts +2 -2
- package/dist/integrations/platforms/cloudflare.d.mts +2 -2
- package/dist/integrations/platforms/cloudflare.mjs +1 -1
- package/dist/releases/build-telemetry.cjs +1 -1
- package/dist/releases/build-telemetry.d.cts +1 -0
- package/dist/releases/build-telemetry.d.mts +1 -0
- package/dist/releases/build-telemetry.mjs +1 -1
- package/dist/sdk/build-diagnostics.cjs +1 -1
- package/dist/sdk/build-diagnostics.d.cts +2 -2
- package/dist/sdk/build-diagnostics.d.mts +2 -2
- package/dist/sdk/build-diagnostics.mjs +1 -1
- package/dist/sdk/envelope.d.cts +12 -12
- package/dist/sdk/envelope.d.mts +12 -12
- package/dist/sdk/errors.d.cts +3 -34
- package/dist/sdk/errors.d.mts +3 -34
- package/dist/sdk/log-sourcing.cjs +1 -1
- package/dist/sdk/log-sourcing.d.cts +4 -6
- package/dist/sdk/log-sourcing.d.mts +4 -6
- package/dist/sdk/log-sourcing.mjs +1 -1
- package/dist/sdk/server-tracing.cjs +1 -1
- package/dist/sdk/server-tracing.d.cts +17 -13
- package/dist/sdk/server-tracing.d.mts +17 -13
- package/dist/sdk/server-tracing.mjs +1 -1
- package/dist/sdk/service-name.cjs +1 -0
- package/dist/sdk/service-name.d.cts +8 -0
- package/dist/sdk/service-name.d.mts +8 -0
- package/dist/sdk/service-name.mjs +1 -0
- package/dist/sdk/throw-site.cjs +2 -0
- package/dist/sdk/throw-site.d.cts +14 -0
- package/dist/sdk/throw-site.d.mts +14 -0
- package/dist/sdk/throw-site.mjs +2 -0
- package/package.json +9 -10
package/dist/data/session.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const storedSessionIdSchema=zod.z.string().min(1).brand(),wireSessionIdSchema=zod.z.union([zod.z.uuidv7(),zod.z.templateLiteral([`server_`,zod.z.uuidv7()])]),sessionIdSchema=storedSessionIdSchema.and(wireSessionIdSchema).meta({description:`UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback).`,id:`SessionId`,title:`SessionId`});exports.sessionIdSchema=sessionIdSchema,exports.storedSessionIdSchema=storedSessionIdSchema;
|
package/dist/data/session.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/data/session.d.ts
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const storedSessionIdSchema: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
|
|
4
|
+
export declare const sessionIdSchema: z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
|
|
4
5
|
export type SessionId = z.infer<typeof sessionIdSchema>;
|
|
5
6
|
//#endregion
|
package/dist/data/session.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/data/session.d.ts
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const storedSessionIdSchema: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
|
|
4
|
+
export declare const sessionIdSchema: z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>;
|
|
4
5
|
export type SessionId = z.infer<typeof sessionIdSchema>;
|
|
5
6
|
//#endregion
|
package/dist/data/session.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const
|
|
1
|
+
import{z}from"zod";const storedSessionIdSchema=z.string().min(1).brand(),wireSessionIdSchema=z.union([z.uuidv7(),z.templateLiteral([`server_`,z.uuidv7()])]),sessionIdSchema=storedSessionIdSchema.and(wireSessionIdSchema).meta({description:`UUIDv7 (from the client SDK) or server_<uuidv7> (server-side fallback).`,id:`SessionId`,title:`SessionId`});export{sessionIdSchema,storedSessionIdSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});async function sourceMapBatchDigest(batch){let files=batch.files.toSorted((left,right)=>left.path<right.path?-1:Number(left.path>right.path)),content=JSON.stringify({bundler:batch.bundler,sourceFileCount:batch.sourceFileCount??null,files:files.map(({path,hash,debugId,chunkUrl})=>[path,hash,debugId,chunkUrl])}),digest=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(content));return
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let _interfere_helpers_hex=require("@interfere/helpers/hex");async function sourceMapBatchDigest(batch){let files=batch.files.toSorted((left,right)=>left.path<right.path?-1:Number(left.path>right.path)),content=JSON.stringify({bundler:batch.bundler,sourceFileCount:batch.sourceFileCount??null,files:files.map(({path,hash,debugId,chunkUrl})=>[path,hash,debugId,chunkUrl])}),digest=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(content));return(0,_interfere_helpers_hex.bytesToHex)(digest)}exports.sourceMapBatchDigest=sourceMapBatchDigest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function sourceMapBatchDigest(batch){let files=batch.files.toSorted((left,right)=>left.path<right.path?-1:Number(left.path>right.path)),content=JSON.stringify({bundler:batch.bundler,sourceFileCount:batch.sourceFileCount??null,files:files.map(({path,hash,debugId,chunkUrl})=>[path,hash,debugId,chunkUrl])}),digest=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(content));return
|
|
1
|
+
import{bytesToHex}from"@interfere/helpers/hex";async function sourceMapBatchDigest(batch){let files=batch.files.toSorted((left,right)=>left.path<right.path?-1:Number(left.path>right.path)),content=JSON.stringify({bundler:batch.bundler,sourceFileCount:batch.sourceFileCount??null,files:files.map(({path,hash,debugId,chunkUrl})=>[path,hash,debugId,chunkUrl])}),digest=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(content));return bytesToHex(digest)}export{sourceMapBatchDigest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const cloudflareDestinationIdEnvKeys=zod.z.enum([`CF_VERSION_ID`,`WORKERS_CI_BUILD_UUID`]).options,cloudflareSourceIdEnvKeys=zod.z.enum([`WORKERS_CI_COMMIT_SHA`]).options,cloudflareAccountMetadata=zod.z.object({accountType:zod.z.literal(`account`),avatar:zod.z.string().nullable().default(null),id:zod.z.string(),installationUrl:zod.z.string().nullable(),name:zod.z.string().nullable().default(null),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const cloudflareDestinationIdEnvKeys=zod.z.enum([`CF_VERSION_ID`,`WORKERS_CI_BUILD_UUID`]).options,cloudflareSourceIdEnvKeys=zod.z.enum([`WORKERS_CI_COMMIT_SHA`]).options,cloudflareAccountMetadata=zod.z.object({accountType:zod.z.literal(`account`),avatar:zod.z.string().nullable().default(null),id:zod.z.string(),installationUrl:zod.z.string().nullable(),name:zod.z.string().nullable().default(null),deploymentCutoffs:zod.z.record(zod.z.string(),zod.z.string()).optional(),versionCutoffs:zod.z.record(zod.z.string(),zod.z.string()).default({}),workers:zod.z.record(zod.z.string(),zod.z.string()).default({}),assetsOnlyWorkers:zod.z.array(zod.z.string()).optional(),workersDiscoveredAt:zod.z.number().int().nonnegative().optional()}),cloudflareMetadataSchema=zod.z.discriminatedUnion(`accountType`,[cloudflareAccountMetadata]),cloudflareIntegration=zod.z.object({metadata:cloudflareMetadataSchema,name:zod.z.literal(`cloudflare`)});exports.cloudflareAccountMetadata=cloudflareAccountMetadata,exports.cloudflareDestinationIdEnvKeys=cloudflareDestinationIdEnvKeys,exports.cloudflareIntegration=cloudflareIntegration,exports.cloudflareSourceIdEnvKeys=cloudflareSourceIdEnvKeys;
|
|
@@ -8,10 +8,10 @@ export declare const cloudflareAccountMetadata: z.ZodObject<{
|
|
|
8
8
|
id: z.ZodString;
|
|
9
9
|
installationUrl: z.ZodNullable<z.ZodString>;
|
|
10
10
|
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
11
|
-
refreshToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
12
11
|
deploymentCutoffs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
12
|
versionCutoffs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
13
|
workers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
+
assetsOnlyWorkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
15
|
workersDiscoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
export declare const cloudflareIntegration: z.ZodObject<{
|
|
@@ -21,10 +21,10 @@ export declare const cloudflareIntegration: z.ZodObject<{
|
|
|
21
21
|
id: z.ZodString;
|
|
22
22
|
installationUrl: z.ZodNullable<z.ZodString>;
|
|
23
23
|
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
24
|
-
refreshToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
25
24
|
deploymentCutoffs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
25
|
versionCutoffs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
26
|
workers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
|
+
assetsOnlyWorkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
28
|
workersDiscoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
}, z.core.$strip>], "accountType">;
|
|
30
30
|
name: z.ZodLiteral<"cloudflare">;
|
|
@@ -8,10 +8,10 @@ export declare const cloudflareAccountMetadata: z.ZodObject<{
|
|
|
8
8
|
id: z.ZodString;
|
|
9
9
|
installationUrl: z.ZodNullable<z.ZodString>;
|
|
10
10
|
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
11
|
-
refreshToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
12
11
|
deploymentCutoffs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
12
|
versionCutoffs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
13
|
workers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
+
assetsOnlyWorkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
15
|
workersDiscoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
export declare const cloudflareIntegration: z.ZodObject<{
|
|
@@ -21,10 +21,10 @@ export declare const cloudflareIntegration: z.ZodObject<{
|
|
|
21
21
|
id: z.ZodString;
|
|
22
22
|
installationUrl: z.ZodNullable<z.ZodString>;
|
|
23
23
|
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
24
|
-
refreshToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
25
24
|
deploymentCutoffs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
25
|
versionCutoffs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
26
|
workers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
|
+
assetsOnlyWorkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
28
|
workersDiscoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
}, z.core.$strip>], "accountType">;
|
|
30
30
|
name: z.ZodLiteral<"cloudflare">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const cloudflareDestinationIdEnvKeys=z.enum([`CF_VERSION_ID`,`WORKERS_CI_BUILD_UUID`]).options,cloudflareSourceIdEnvKeys=z.enum([`WORKERS_CI_COMMIT_SHA`]).options,cloudflareAccountMetadata=z.object({accountType:z.literal(`account`),avatar:z.string().nullable().default(null),id:z.string(),installationUrl:z.string().nullable(),name:z.string().nullable().default(null),
|
|
1
|
+
import{z}from"zod";const cloudflareDestinationIdEnvKeys=z.enum([`CF_VERSION_ID`,`WORKERS_CI_BUILD_UUID`]).options,cloudflareSourceIdEnvKeys=z.enum([`WORKERS_CI_COMMIT_SHA`]).options,cloudflareAccountMetadata=z.object({accountType:z.literal(`account`),avatar:z.string().nullable().default(null),id:z.string(),installationUrl:z.string().nullable(),name:z.string().nullable().default(null),deploymentCutoffs:z.record(z.string(),z.string()).optional(),versionCutoffs:z.record(z.string(),z.string()).default({}),workers:z.record(z.string(),z.string()).default({}),assetsOnlyWorkers:z.array(z.string()).optional(),workersDiscoveredAt:z.number().int().nonnegative().optional()}),cloudflareMetadataSchema=z.discriminatedUnion(`accountType`,[cloudflareAccountMetadata]),cloudflareIntegration=z.object({metadata:cloudflareMetadataSchema,name:z.literal(`cloudflare`)});export{cloudflareAccountMetadata,cloudflareDestinationIdEnvKeys,cloudflareIntegration,cloudflareSourceIdEnvKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const releaseBuildResultSchema=zod.z.enum([`ok`,`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`pipeline_failed`,`no_source_maps`,`client_maps_unmapped`]).meta({id:`ReleaseBuildResult`,title:`ReleaseBuildResult`}),releaseBuildFaultSchema=zod.z.enum([`interfere`,`customer`]).meta({id:`ReleaseBuildFault`,title:`ReleaseBuildFault`}),CUSTOMER_FAULT_RESULTS=new Set([`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`no_source_maps`,`client_maps_unmapped`]);function faultForBuildResult(result){return CUSTOMER_FAULT_RESULTS.has(result)?`customer`:`interfere`}const releaseBuildStepSchema=zod.z.enum([`discover`,`create`,`upload`,`preflight`,`cleanup`,`total`]).meta({id:`ReleaseBuildStep`,title:`ReleaseBuildStep`});exports.faultForBuildResult=faultForBuildResult,exports.releaseBuildFaultSchema=releaseBuildFaultSchema,exports.releaseBuildResultSchema=releaseBuildResultSchema,exports.releaseBuildStepSchema=releaseBuildStepSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const releaseBuildResultSchema=zod.z.enum([`ok`,`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`api_key_surface_required`,`pipeline_failed`,`no_source_maps`,`client_maps_unmapped`]).meta({id:`ReleaseBuildResult`,title:`ReleaseBuildResult`}),releaseBuildFaultSchema=zod.z.enum([`interfere`,`customer`]).meta({id:`ReleaseBuildFault`,title:`ReleaseBuildFault`}),CUSTOMER_FAULT_RESULTS=new Set([`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`api_key_surface_required`,`no_source_maps`,`client_maps_unmapped`]);function faultForBuildResult(result){return CUSTOMER_FAULT_RESULTS.has(result)?`customer`:`interfere`}const releaseBuildStepSchema=zod.z.enum([`discover`,`create`,`upload`,`preflight`,`cleanup`,`total`]).meta({id:`ReleaseBuildStep`,title:`ReleaseBuildStep`});exports.faultForBuildResult=faultForBuildResult,exports.releaseBuildFaultSchema=releaseBuildFaultSchema,exports.releaseBuildResultSchema=releaseBuildResultSchema,exports.releaseBuildStepSchema=releaseBuildStepSchema;
|
|
@@ -9,6 +9,7 @@ import { z } from "zod";
|
|
|
9
9
|
export declare const releaseBuildResultSchema: z.ZodEnum<{
|
|
10
10
|
api_key_rejected: "api_key_rejected";
|
|
11
11
|
api_key_scope_mismatch: "api_key_scope_mismatch";
|
|
12
|
+
api_key_surface_required: "api_key_surface_required";
|
|
12
13
|
api_key_unreadable: "api_key_unreadable";
|
|
13
14
|
api_key_wrong_prefix: "api_key_wrong_prefix";
|
|
14
15
|
client_maps_unmapped: "client_maps_unmapped";
|
|
@@ -9,6 +9,7 @@ import { z } from "zod";
|
|
|
9
9
|
export declare const releaseBuildResultSchema: z.ZodEnum<{
|
|
10
10
|
api_key_rejected: "api_key_rejected";
|
|
11
11
|
api_key_scope_mismatch: "api_key_scope_mismatch";
|
|
12
|
+
api_key_surface_required: "api_key_surface_required";
|
|
12
13
|
api_key_unreadable: "api_key_unreadable";
|
|
13
14
|
api_key_wrong_prefix: "api_key_wrong_prefix";
|
|
14
15
|
client_maps_unmapped: "client_maps_unmapped";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const releaseBuildResultSchema=z.enum([`ok`,`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`pipeline_failed`,`no_source_maps`,`client_maps_unmapped`]).meta({id:`ReleaseBuildResult`,title:`ReleaseBuildResult`}),releaseBuildFaultSchema=z.enum([`interfere`,`customer`]).meta({id:`ReleaseBuildFault`,title:`ReleaseBuildFault`}),CUSTOMER_FAULT_RESULTS=new Set([`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`no_source_maps`,`client_maps_unmapped`]);function faultForBuildResult(result){return CUSTOMER_FAULT_RESULTS.has(result)?`customer`:`interfere`}const releaseBuildStepSchema=z.enum([`discover`,`create`,`upload`,`preflight`,`cleanup`,`total`]).meta({id:`ReleaseBuildStep`,title:`ReleaseBuildStep`});export{faultForBuildResult,releaseBuildFaultSchema,releaseBuildResultSchema,releaseBuildStepSchema};
|
|
1
|
+
import{z}from"zod";const releaseBuildResultSchema=z.enum([`ok`,`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`api_key_surface_required`,`pipeline_failed`,`no_source_maps`,`client_maps_unmapped`]).meta({id:`ReleaseBuildResult`,title:`ReleaseBuildResult`}),releaseBuildFaultSchema=z.enum([`interfere`,`customer`]).meta({id:`ReleaseBuildFault`,title:`ReleaseBuildFault`}),CUSTOMER_FAULT_RESULTS=new Set([`api_key_wrong_prefix`,`api_key_unreadable`,`api_key_rejected`,`api_key_scope_mismatch`,`api_key_surface_required`,`no_source_maps`,`client_maps_unmapped`]);function faultForBuildResult(result){return CUSTOMER_FAULT_RESULTS.has(result)?`customer`:`interfere`}const releaseBuildStepSchema=z.enum([`discover`,`create`,`upload`,`preflight`,`cleanup`,`total`]).meta({id:`ReleaseBuildStep`,title:`ReleaseBuildStep`});export{faultForBuildResult,releaseBuildFaultSchema,releaseBuildResultSchema,releaseBuildStepSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `),BUILD_CONTINUES=`The build continues, but this release has no source maps in Interfere.`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}function publicKeyHint(ctx){return`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`}function checkReleaseConfig(ctx,input){let{apiKey,commitSha,releaseSlug}=input;return apiKey?isInterfereApiKey(apiKey)?commitSha&&releaseSlug?{status:`ok`,apiKey,commitSha,releaseSlug}:{status:`fail`,title:`Commit SHA missing`,details:[`Could not resolve a commit SHA from environment variables or git.`,"Set `INTERFERE_SOURCE_ID`, ensure your CI exposes its git SHA env var (e.g. `VERCEL_GIT_COMMIT_SHA`, `GITHUB_SHA`), or run inside a git checkout."]}:{status:`fail`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(apiKey)}\`.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}:{status:`skip`,title:`Skipping release`,details:[`INTERFERE_API_KEY is not set, so this build has no release or source maps in Interfere.`,`Set INTERFERE_API_KEY on builds that you deploy.`,`See: ${ctx.docsUrl}`]}}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`error`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`,BUILD_CONTINUES]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`error`,title:`Secret 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_HINT}.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`,BUILD_CONTINUES]}),RELEASE_PIPELINE_FAILED:(_ctx,errorMessage)=>({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: ${errorMessage}`]})},API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}function diagnoseRelease(ctx,error){let errorMessage=error instanceof Error?error.message:String(error);return CATALOG[classifyReleasePipelineError(error)](ctx,errorMessage)}exports.API_KEY_PREFIXES=API_KEY_PREFIXES,exports.checkReleaseConfig=checkReleaseConfig,exports.classifyReleasePipelineError=classifyReleasePipelineError,exports.diagnoseRelease=diagnoseRelease,exports.formatApiKeyPreview=formatApiKeyPreview,exports.isInterfereApiKey=isInterfereApiKey;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `),BUILD_CONTINUES=`The build continues, but this release has no source maps in Interfere.`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}function publicKeyHint(ctx){return`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`}function checkReleaseConfig(ctx,input){let{apiKey,commitSha,releaseSlug}=input;return apiKey?isInterfereApiKey(apiKey)?commitSha&&releaseSlug?{status:`ok`,apiKey,commitSha,releaseSlug}:{status:`fail`,title:`Commit SHA missing`,details:[`Could not resolve a commit SHA from environment variables or git.`,"Set `INTERFERE_SOURCE_ID`, ensure your CI exposes its git SHA env var (e.g. `VERCEL_GIT_COMMIT_SHA`, `GITHUB_SHA`), or run inside a git checkout."]}:{status:`fail`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(apiKey)}\`.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}:{status:`skip`,title:`Skipping release`,details:[`INTERFERE_API_KEY is not set, so this build has no release or source maps in Interfere.`,`Set INTERFERE_API_KEY on builds that you deploy.`,`See: ${ctx.docsUrl}`]}}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`error`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`,BUILD_CONTINUES]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SURFACE_REQUIRED:ctx=>({code:`API_KEY_SURFACE_REQUIRED`,severity:`error`,title:`Public key needed for a workspace secret key`,details:[`INTERFERE_API_KEY is a workspace secret key, so the build must also name the app it publishes for.`,`Set \`${ctx.publicKeyEnvVar}\` to this app's public key on the build machine.`,BUILD_CONTINUES]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`error`,title:`Secret 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_HINT}.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`,BUILD_CONTINUES]}),RELEASE_PIPELINE_FAILED:(_ctx,errorMessage)=>({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: ${errorMessage}`]})},API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_AK_SURFACE_REQUIRED:`API_KEY_SURFACE_REQUIRED`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}function diagnoseRelease(ctx,error){let errorMessage=error instanceof Error?error.message:String(error);return CATALOG[classifyReleasePipelineError(error)](ctx,errorMessage)}exports.API_KEY_PREFIXES=API_KEY_PREFIXES,exports.checkReleaseConfig=checkReleaseConfig,exports.classifyReleasePipelineError=classifyReleasePipelineError,exports.diagnoseRelease=diagnoseRelease,exports.formatApiKeyPreview=formatApiKeyPreview,exports.isInterfereApiKey=isInterfereApiKey;
|
|
@@ -33,13 +33,13 @@ export declare function checkReleaseConfig(ctx: ReleaseDiagnosticContext, input:
|
|
|
33
33
|
commitSha: string;
|
|
34
34
|
releaseSlug: `rel_${string}` & import("zod").$brand<"ReleaseSlug">;
|
|
35
35
|
};
|
|
36
|
-
export type ReleaseDiagnosticCode = "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
36
|
+
export type ReleaseDiagnosticCode = "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_SURFACE_REQUIRED" | "RELEASE_PIPELINE_FAILED";
|
|
37
37
|
export interface ReleaseDiagnostic {
|
|
38
38
|
readonly code: ReleaseDiagnosticCode;
|
|
39
39
|
readonly details: readonly string[];
|
|
40
40
|
readonly severity: "error" | "warn";
|
|
41
41
|
readonly title: string;
|
|
42
42
|
}
|
|
43
|
-
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
43
|
+
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_SURFACE_REQUIRED" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
44
44
|
export declare function diagnoseRelease(ctx: ReleaseDiagnosticContext, error: unknown): ReleaseDiagnostic;
|
|
45
45
|
//#endregion
|
|
@@ -33,13 +33,13 @@ export declare function checkReleaseConfig(ctx: ReleaseDiagnosticContext, input:
|
|
|
33
33
|
commitSha: string;
|
|
34
34
|
releaseSlug: `rel_${string}` & import("zod").$brand<"ReleaseSlug">;
|
|
35
35
|
};
|
|
36
|
-
export type ReleaseDiagnosticCode = "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
36
|
+
export type ReleaseDiagnosticCode = "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_SURFACE_REQUIRED" | "RELEASE_PIPELINE_FAILED";
|
|
37
37
|
export interface ReleaseDiagnostic {
|
|
38
38
|
readonly code: ReleaseDiagnosticCode;
|
|
39
39
|
readonly details: readonly string[];
|
|
40
40
|
readonly severity: "error" | "warn";
|
|
41
41
|
readonly title: string;
|
|
42
42
|
}
|
|
43
|
-
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
43
|
+
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_SURFACE_REQUIRED" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
44
44
|
export declare function diagnoseRelease(ctx: ReleaseDiagnosticContext, error: unknown): ReleaseDiagnostic;
|
|
45
45
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `),BUILD_CONTINUES=`The build continues, but this release has no source maps in Interfere.`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}function publicKeyHint(ctx){return`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`}function checkReleaseConfig(ctx,input){let{apiKey,commitSha,releaseSlug}=input;return apiKey?isInterfereApiKey(apiKey)?commitSha&&releaseSlug?{status:`ok`,apiKey,commitSha,releaseSlug}:{status:`fail`,title:`Commit SHA missing`,details:[`Could not resolve a commit SHA from environment variables or git.`,"Set `INTERFERE_SOURCE_ID`, ensure your CI exposes its git SHA env var (e.g. `VERCEL_GIT_COMMIT_SHA`, `GITHUB_SHA`), or run inside a git checkout."]}:{status:`fail`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(apiKey)}\`.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}:{status:`skip`,title:`Skipping release`,details:[`INTERFERE_API_KEY is not set, so this build has no release or source maps in Interfere.`,`Set INTERFERE_API_KEY on builds that you deploy.`,`See: ${ctx.docsUrl}`]}}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`error`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`,BUILD_CONTINUES]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`error`,title:`Secret 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_HINT}.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`,BUILD_CONTINUES]}),RELEASE_PIPELINE_FAILED:(_ctx,errorMessage)=>({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: ${errorMessage}`]})},API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}function diagnoseRelease(ctx,error){let errorMessage=error instanceof Error?error.message:String(error);return CATALOG[classifyReleasePipelineError(error)](ctx,errorMessage)}export{API_KEY_PREFIXES,checkReleaseConfig,classifyReleasePipelineError,diagnoseRelease,formatApiKeyPreview,isInterfereApiKey};
|
|
1
|
+
const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `),BUILD_CONTINUES=`The build continues, but this release has no source maps in Interfere.`;function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}function publicKeyHint(ctx){return`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`}function checkReleaseConfig(ctx,input){let{apiKey,commitSha,releaseSlug}=input;return apiKey?isInterfereApiKey(apiKey)?commitSha&&releaseSlug?{status:`ok`,apiKey,commitSha,releaseSlug}:{status:`fail`,title:`Commit SHA missing`,details:[`Could not resolve a commit SHA from environment variables or git.`,"Set `INTERFERE_SOURCE_ID`, ensure your CI exposes its git SHA env var (e.g. `VERCEL_GIT_COMMIT_SHA`, `GITHUB_SHA`), or run inside a git checkout."]}:{status:`fail`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(apiKey)}\`.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}:{status:`skip`,title:`Skipping release`,details:[`INTERFERE_API_KEY is not set, so this build has no release or source maps in Interfere.`,`Set INTERFERE_API_KEY on builds that you deploy.`,`See: ${ctx.docsUrl}`]}}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`error`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`,BUILD_CONTINUES]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`error`,title:`Secret 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.`,BUILD_CONTINUES]}),API_KEY_SURFACE_REQUIRED:ctx=>({code:`API_KEY_SURFACE_REQUIRED`,severity:`error`,title:`Public key needed for a workspace secret key`,details:[`INTERFERE_API_KEY is a workspace secret key, so the build must also name the app it publishes for.`,`Set \`${ctx.publicKeyEnvVar}\` to this app's public key on the build machine.`,BUILD_CONTINUES]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`error`,title:`Secret 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_HINT}.`,publicKeyHint(ctx),`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`,BUILD_CONTINUES]}),RELEASE_PIPELINE_FAILED:(_ctx,errorMessage)=>({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: ${errorMessage}`]})},API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_AK_SURFACE_REQUIRED:`API_KEY_SURFACE_REQUIRED`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}function diagnoseRelease(ctx,error){let errorMessage=error instanceof Error?error.message:String(error);return CATALOG[classifyReleasePipelineError(error)](ctx,errorMessage)}export{API_KEY_PREFIXES,checkReleaseConfig,classifyReleasePipelineError,diagnoseRelease,formatApiKeyPreview,isInterfereApiKey};
|
package/dist/sdk/envelope.d.cts
CHANGED
|
@@ -188,7 +188,7 @@ export declare const errorEnvelopeSchema: z.ZodObject<{
|
|
|
188
188
|
node: "node";
|
|
189
189
|
}>>;
|
|
190
190
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
191
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
191
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
192
192
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
193
193
|
async_context: "async_context";
|
|
194
194
|
client: "client";
|
|
@@ -315,7 +315,7 @@ export declare const pageviewEnvelopeSchema: z.ZodObject<{
|
|
|
315
315
|
node: "node";
|
|
316
316
|
}>>;
|
|
317
317
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
318
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
318
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
319
319
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
320
320
|
async_context: "async_context";
|
|
321
321
|
client: "client";
|
|
@@ -422,7 +422,7 @@ export declare const pageleaveEnvelopeSchema: z.ZodObject<{
|
|
|
422
422
|
node: "node";
|
|
423
423
|
}>>;
|
|
424
424
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
425
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
425
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
426
426
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
427
427
|
async_context: "async_context";
|
|
428
428
|
client: "client";
|
|
@@ -529,7 +529,7 @@ export declare const uiEventEnvelopeSchema: z.ZodObject<{
|
|
|
529
529
|
node: "node";
|
|
530
530
|
}>>;
|
|
531
531
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
532
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
532
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
533
533
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
534
534
|
async_context: "async_context";
|
|
535
535
|
client: "client";
|
|
@@ -635,7 +635,7 @@ export declare const replayChunkEnvelopeSchema: z.ZodObject<{
|
|
|
635
635
|
node: "node";
|
|
636
636
|
}>>;
|
|
637
637
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
638
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
638
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
639
639
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
640
640
|
async_context: "async_context";
|
|
641
641
|
client: "client";
|
|
@@ -745,7 +745,7 @@ export declare const rageClickEnvelopeSchema: z.ZodObject<{
|
|
|
745
745
|
node: "node";
|
|
746
746
|
}>>;
|
|
747
747
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
748
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
748
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
749
749
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
750
750
|
async_context: "async_context";
|
|
751
751
|
client: "client";
|
|
@@ -857,7 +857,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
857
857
|
node: "node";
|
|
858
858
|
}>>;
|
|
859
859
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
860
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
860
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
861
861
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
862
862
|
async_context: "async_context";
|
|
863
863
|
client: "client";
|
|
@@ -983,7 +983,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
983
983
|
node: "node";
|
|
984
984
|
}>>;
|
|
985
985
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
986
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
986
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
987
987
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
988
988
|
async_context: "async_context";
|
|
989
989
|
client: "client";
|
|
@@ -1089,7 +1089,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1089
1089
|
node: "node";
|
|
1090
1090
|
}>>;
|
|
1091
1091
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1092
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1092
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1093
1093
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1094
1094
|
async_context: "async_context";
|
|
1095
1095
|
client: "client";
|
|
@@ -1195,7 +1195,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1195
1195
|
node: "node";
|
|
1196
1196
|
}>>;
|
|
1197
1197
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1198
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1198
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1199
1199
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1200
1200
|
async_context: "async_context";
|
|
1201
1201
|
client: "client";
|
|
@@ -1300,7 +1300,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1300
1300
|
node: "node";
|
|
1301
1301
|
}>>;
|
|
1302
1302
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1303
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1303
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1304
1304
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1305
1305
|
async_context: "async_context";
|
|
1306
1306
|
client: "client";
|
|
@@ -1409,7 +1409,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1409
1409
|
node: "node";
|
|
1410
1410
|
}>>;
|
|
1411
1411
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1412
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1412
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1413
1413
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1414
1414
|
async_context: "async_context";
|
|
1415
1415
|
client: "client";
|
package/dist/sdk/envelope.d.mts
CHANGED
|
@@ -188,7 +188,7 @@ export declare const errorEnvelopeSchema: z.ZodObject<{
|
|
|
188
188
|
node: "node";
|
|
189
189
|
}>>;
|
|
190
190
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
191
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
191
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
192
192
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
193
193
|
async_context: "async_context";
|
|
194
194
|
client: "client";
|
|
@@ -315,7 +315,7 @@ export declare const pageviewEnvelopeSchema: z.ZodObject<{
|
|
|
315
315
|
node: "node";
|
|
316
316
|
}>>;
|
|
317
317
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
318
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
318
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
319
319
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
320
320
|
async_context: "async_context";
|
|
321
321
|
client: "client";
|
|
@@ -422,7 +422,7 @@ export declare const pageleaveEnvelopeSchema: z.ZodObject<{
|
|
|
422
422
|
node: "node";
|
|
423
423
|
}>>;
|
|
424
424
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
425
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
425
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
426
426
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
427
427
|
async_context: "async_context";
|
|
428
428
|
client: "client";
|
|
@@ -529,7 +529,7 @@ export declare const uiEventEnvelopeSchema: z.ZodObject<{
|
|
|
529
529
|
node: "node";
|
|
530
530
|
}>>;
|
|
531
531
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
532
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
532
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
533
533
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
534
534
|
async_context: "async_context";
|
|
535
535
|
client: "client";
|
|
@@ -635,7 +635,7 @@ export declare const replayChunkEnvelopeSchema: z.ZodObject<{
|
|
|
635
635
|
node: "node";
|
|
636
636
|
}>>;
|
|
637
637
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
638
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
638
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
639
639
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
640
640
|
async_context: "async_context";
|
|
641
641
|
client: "client";
|
|
@@ -745,7 +745,7 @@ export declare const rageClickEnvelopeSchema: z.ZodObject<{
|
|
|
745
745
|
node: "node";
|
|
746
746
|
}>>;
|
|
747
747
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
748
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
748
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
749
749
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
750
750
|
async_context: "async_context";
|
|
751
751
|
client: "client";
|
|
@@ -857,7 +857,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
857
857
|
node: "node";
|
|
858
858
|
}>>;
|
|
859
859
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
860
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
860
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
861
861
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
862
862
|
async_context: "async_context";
|
|
863
863
|
client: "client";
|
|
@@ -983,7 +983,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
983
983
|
node: "node";
|
|
984
984
|
}>>;
|
|
985
985
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
986
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
986
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
987
987
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
988
988
|
async_context: "async_context";
|
|
989
989
|
client: "client";
|
|
@@ -1089,7 +1089,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1089
1089
|
node: "node";
|
|
1090
1090
|
}>>;
|
|
1091
1091
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1092
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1092
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1093
1093
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1094
1094
|
async_context: "async_context";
|
|
1095
1095
|
client: "client";
|
|
@@ -1195,7 +1195,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1195
1195
|
node: "node";
|
|
1196
1196
|
}>>;
|
|
1197
1197
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1198
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1198
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1199
1199
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1200
1200
|
async_context: "async_context";
|
|
1201
1201
|
client: "client";
|
|
@@ -1300,7 +1300,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1300
1300
|
node: "node";
|
|
1301
1301
|
}>>;
|
|
1302
1302
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1303
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1303
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1304
1304
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1305
1305
|
async_context: "async_context";
|
|
1306
1306
|
client: "client";
|
|
@@ -1409,7 +1409,7 @@ export declare const envelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1409
1409
|
node: "node";
|
|
1410
1410
|
}>>;
|
|
1411
1411
|
sdkStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1412
|
-
sessionId: z.ZodNullable<z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]
|
|
1412
|
+
sessionId: z.ZodNullable<z.ZodIntersection<z.core.$ZodBranded<z.ZodString, "SessionId", "out">, z.ZodUnion<readonly [z.ZodUUID, z.ZodTemplateLiteral<`server_${string}`>]>>>;
|
|
1413
1413
|
sessionSource: z.ZodOptional<z.ZodEnum<{
|
|
1414
1414
|
async_context: "async_context";
|
|
1415
1415
|
client: "client";
|
package/dist/sdk/errors.d.cts
CHANGED
|
@@ -92,19 +92,7 @@ export declare function parseReactComponentStack(componentStack: string): {
|
|
|
92
92
|
line?: number | undefined;
|
|
93
93
|
source?: string | undefined;
|
|
94
94
|
}[];
|
|
95
|
-
/**
|
|
96
|
-
* Coerces any thrown value into an `Error` instance, preferring a nested
|
|
97
|
-
* `Error` inside a plain-object rejection over a stringified fallback.
|
|
98
|
-
*
|
|
99
|
-
* Motivated by the common `Promise.reject({ error: realErr })` pattern
|
|
100
|
-
* (tRPC, GraphQL clients, some fetch wrappers). Without this, the captured
|
|
101
|
-
* exception would be `new Error("[object Object]")` and the nested Error's
|
|
102
|
-
* stack/message would be lost entirely.
|
|
103
|
-
*
|
|
104
|
-
* When multiple candidate Error values exist on the object, the first one
|
|
105
|
-
* found (in declaration order) wins. `cause` is preferred if present, since
|
|
106
|
-
* it's the documented ES2022 convention.
|
|
107
|
-
*/
|
|
95
|
+
/** Returns an Error, preferring an existing or nested Error over a stringified fallback. */
|
|
108
96
|
export declare function toError(error: unknown): Error;
|
|
109
97
|
/**
|
|
110
98
|
* Capture-side variant for thrown values that aren't Errors and don't
|
|
@@ -139,29 +127,10 @@ export interface NonErrorException {
|
|
|
139
127
|
*/
|
|
140
128
|
readonly value: string;
|
|
141
129
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Depth-bounded, circular-safe clone. Primitives + null/undefined pass
|
|
144
|
-
* through as-is. Objects and arrays recurse up to `MAX_NON_ERROR_DEPTH`
|
|
145
|
-
* before collapsing to `DEPTH_LIMIT_SENTINEL`; back-edges become
|
|
146
|
-
* `CIRCULAR_SENTINEL`. Functions, symbols, and other non-serialisable
|
|
147
|
-
* values are coerced via `String(...)` so the dashboard can render
|
|
148
|
-
* something rather than dropping the field.
|
|
149
|
-
*/
|
|
150
130
|
type SerializedException = null | undefined | string | number | boolean | SerializedException[] | {
|
|
151
131
|
[key: string]: SerializedException;
|
|
152
132
|
};
|
|
153
|
-
/**
|
|
154
|
-
* Coerces any thrown value into either an `Error` (when one is
|
|
155
|
-
* recoverable — direct Error, or nested Error inside an object via
|
|
156
|
-
* `cause` / first-Error-valued property — or a string, which maps
|
|
157
|
-
* cleanly to `new Error(str)`) or a structured `NonErrorException`
|
|
158
|
-
* carrying the original payload.
|
|
159
|
-
*
|
|
160
|
-
* Replaces `toError` for capture sites that handle both branches
|
|
161
|
-
* (today: `unhandledrejection`). `toError` is kept for callers that
|
|
162
|
-
* specifically need an `Error` (`<ErrorBoundary>` interop, browser
|
|
163
|
-
* APIs that take Error-typed args).
|
|
164
|
-
*/
|
|
133
|
+
/** Preserves recoverable Errors and serializes other thrown values as structured exceptions. */
|
|
165
134
|
export declare function toException(value: unknown): Error | {
|
|
166
135
|
kind: "non-error";
|
|
167
136
|
serialized: SerializedException;
|
|
@@ -175,7 +144,7 @@ export declare function isNonErrorException(value: unknown): value is NonErrorEx
|
|
|
175
144
|
* plus the raw `stack` string — the SDK ships **no parsed frames**.
|
|
176
145
|
* Server-side ingest parses `stack` into structured `IngestedFrame[]`
|
|
177
146
|
* via the collector's stack parser (see
|
|
178
|
-
* `src/packages/private/otlp-ingest/src/stack-parser.ts`).
|
|
147
|
+
* `src/packages/private/otlp-ingest/src/mapping/traces/stack-parser.ts`).
|
|
179
148
|
*
|
|
180
149
|
* Non-Error rejections short-circuit to a single `kind: "non-error"`
|
|
181
150
|
* entry with the structured payload on `serialized`.
|
package/dist/sdk/errors.d.mts
CHANGED
|
@@ -92,19 +92,7 @@ export declare function parseReactComponentStack(componentStack: string): {
|
|
|
92
92
|
line?: number | undefined;
|
|
93
93
|
source?: string | undefined;
|
|
94
94
|
}[];
|
|
95
|
-
/**
|
|
96
|
-
* Coerces any thrown value into an `Error` instance, preferring a nested
|
|
97
|
-
* `Error` inside a plain-object rejection over a stringified fallback.
|
|
98
|
-
*
|
|
99
|
-
* Motivated by the common `Promise.reject({ error: realErr })` pattern
|
|
100
|
-
* (tRPC, GraphQL clients, some fetch wrappers). Without this, the captured
|
|
101
|
-
* exception would be `new Error("[object Object]")` and the nested Error's
|
|
102
|
-
* stack/message would be lost entirely.
|
|
103
|
-
*
|
|
104
|
-
* When multiple candidate Error values exist on the object, the first one
|
|
105
|
-
* found (in declaration order) wins. `cause` is preferred if present, since
|
|
106
|
-
* it's the documented ES2022 convention.
|
|
107
|
-
*/
|
|
95
|
+
/** Returns an Error, preferring an existing or nested Error over a stringified fallback. */
|
|
108
96
|
export declare function toError(error: unknown): Error;
|
|
109
97
|
/**
|
|
110
98
|
* Capture-side variant for thrown values that aren't Errors and don't
|
|
@@ -139,29 +127,10 @@ export interface NonErrorException {
|
|
|
139
127
|
*/
|
|
140
128
|
readonly value: string;
|
|
141
129
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Depth-bounded, circular-safe clone. Primitives + null/undefined pass
|
|
144
|
-
* through as-is. Objects and arrays recurse up to `MAX_NON_ERROR_DEPTH`
|
|
145
|
-
* before collapsing to `DEPTH_LIMIT_SENTINEL`; back-edges become
|
|
146
|
-
* `CIRCULAR_SENTINEL`. Functions, symbols, and other non-serialisable
|
|
147
|
-
* values are coerced via `String(...)` so the dashboard can render
|
|
148
|
-
* something rather than dropping the field.
|
|
149
|
-
*/
|
|
150
130
|
type SerializedException = null | undefined | string | number | boolean | SerializedException[] | {
|
|
151
131
|
[key: string]: SerializedException;
|
|
152
132
|
};
|
|
153
|
-
/**
|
|
154
|
-
* Coerces any thrown value into either an `Error` (when one is
|
|
155
|
-
* recoverable — direct Error, or nested Error inside an object via
|
|
156
|
-
* `cause` / first-Error-valued property — or a string, which maps
|
|
157
|
-
* cleanly to `new Error(str)`) or a structured `NonErrorException`
|
|
158
|
-
* carrying the original payload.
|
|
159
|
-
*
|
|
160
|
-
* Replaces `toError` for capture sites that handle both branches
|
|
161
|
-
* (today: `unhandledrejection`). `toError` is kept for callers that
|
|
162
|
-
* specifically need an `Error` (`<ErrorBoundary>` interop, browser
|
|
163
|
-
* APIs that take Error-typed args).
|
|
164
|
-
*/
|
|
133
|
+
/** Preserves recoverable Errors and serializes other thrown values as structured exceptions. */
|
|
165
134
|
export declare function toException(value: unknown): Error | {
|
|
166
135
|
kind: "non-error";
|
|
167
136
|
serialized: SerializedException;
|
|
@@ -175,7 +144,7 @@ export declare function isNonErrorException(value: unknown): value is NonErrorEx
|
|
|
175
144
|
* plus the raw `stack` string — the SDK ships **no parsed frames**.
|
|
176
145
|
* Server-side ingest parses `stack` into structured `IngestedFrame[]`
|
|
177
146
|
* via the collector's stack parser (see
|
|
178
|
-
* `src/packages/private/otlp-ingest/src/stack-parser.ts`).
|
|
147
|
+
* `src/packages/private/otlp-ingest/src/mapping/traces/stack-parser.ts`).
|
|
179
148
|
*
|
|
180
149
|
* Non-Error rejections short-circuit to a single `kind: "non-error"`
|
|
181
150
|
* entry with the structured payload on `serialized`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=zod.z.enum([`sdk`,`drain`]);function resolveLogSourcingMode(injected){let parsed=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(injected));return parsed.success?parsed.data:`sdk`}function readLogSourcingMode(){let scope=globalThis;return resolveLogSourcingMode(`__INTERFERE_LOG_SOURCING__`in scope?scope[LOG_SOURCING_GLOBAL]:void 0)}exports.DEFAULT_LOG_SOURCING_MODE=`sdk`,exports.LOG_SOURCING_GLOBAL=LOG_SOURCING_GLOBAL,exports.logSourcingModeSchema=logSourcingModeSchema,exports.readLogSourcingMode=readLogSourcingMode,exports.resolveLogSourcingMode=resolveLogSourcingMode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
-
export declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -23,9 +22,8 @@ export declare const logSourcingModeSchema: z.ZodEnum<{
|
|
|
23
22
|
*/
|
|
24
23
|
export type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
24
|
export declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): "drain" | "sdk";
|
|
25
|
+
/** The build-injected surface configuration wins; otherwise {@link DEFAULT_LOG_SOURCING_MODE}. */
|
|
26
|
+
export declare function resolveLogSourcingMode(injected?: unknown): "drain" | "sdk";
|
|
27
|
+
/** Reads the build-injected {@link LOG_SOURCING_GLOBAL} global. */
|
|
28
|
+
export declare function readLogSourcingMode(): "drain" | "sdk";
|
|
31
29
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
-
export declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -23,9 +22,8 @@ export declare const logSourcingModeSchema: z.ZodEnum<{
|
|
|
23
22
|
*/
|
|
24
23
|
export type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
24
|
export declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): "drain" | "sdk";
|
|
25
|
+
/** The build-injected surface configuration wins; otherwise {@link DEFAULT_LOG_SOURCING_MODE}. */
|
|
26
|
+
export declare function resolveLogSourcingMode(injected?: unknown): "drain" | "sdk";
|
|
27
|
+
/** Reads the build-injected {@link LOG_SOURCING_GLOBAL} global. */
|
|
28
|
+
export declare function readLogSourcingMode(): "drain" | "sdk";
|
|
31
29
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv
|
|
1
|
+
import{normalizeEnv}from"./runtime.mjs";import{z}from"zod";const LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=z.enum([`sdk`,`drain`]),DEFAULT_LOG_SOURCING_MODE=`sdk`;function resolveLogSourcingMode(injected){let parsed=logSourcingModeSchema.safeParse(normalizeEnv(injected));return parsed.success?parsed.data:`sdk`}function readLogSourcingMode(){let scope=globalThis;return resolveLogSourcingMode(`__INTERFERE_LOG_SOURCING__`in scope?scope[LOG_SOURCING_GLOBAL]:void 0)}export{DEFAULT_LOG_SOURCING_MODE,LOG_SOURCING_GLOBAL,logSourcingModeSchema,readLogSourcingMode,resolveLogSourcingMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected)),env=opts?.env??require_sdk_runtime.readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!require_sdk_runtime.normalizeEnv(env?.VERCEL)}}function readServerTracing(env=require_sdk_runtime.readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}exports.DEFAULT_SERVER_TRACING_MODE=DEFAULT_SERVER_TRACING_MODE,exports.SERVER_TRACING_GLOBAL=SERVER_TRACING_GLOBAL,exports.VERCEL_EXPORT_TIMEOUT_MS=2e3,exports.readServerTracing=readServerTracing,exports.resolveServerTracing=resolveServerTracing,exports.serverTracingModeSchema=serverTracingModeSchema;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/server-tracing.d.ts
|
|
3
|
-
export declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -22,19 +21,24 @@ export declare const serverTracingModeSchema: z.ZodEnum<{
|
|
|
22
21
|
*/
|
|
23
22
|
export type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
23
|
export declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
24
|
+
/** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
|
|
25
|
+
export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
|
|
25
26
|
/**
|
|
26
|
-
* Resolve the server tracing mode
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Resolve the server tracing mode from the build-injected surface
|
|
28
|
+
* configuration alone; unrecognised or absent values resolve to
|
|
29
|
+
* {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
|
|
30
|
+
* set, which callers use to cap direct export timeouts.
|
|
29
31
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
readonly injected?:
|
|
32
|
+
export declare function resolveServerTracing(opts?: {
|
|
33
|
+
readonly injected?: unknown;
|
|
32
34
|
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
-
}):
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}): {
|
|
36
|
+
mode: "drain" | "full";
|
|
37
|
+
vercel: boolean;
|
|
38
|
+
};
|
|
39
|
+
/** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
|
|
40
|
+
export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
|
|
41
|
+
mode: "drain" | "full";
|
|
42
|
+
vercel: boolean;
|
|
43
|
+
};
|
|
40
44
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/server-tracing.d.ts
|
|
3
|
-
export declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -22,19 +21,24 @@ export declare const serverTracingModeSchema: z.ZodEnum<{
|
|
|
22
21
|
*/
|
|
23
22
|
export type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
23
|
export declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
24
|
+
/** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
|
|
25
|
+
export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
|
|
25
26
|
/**
|
|
26
|
-
* Resolve the server tracing mode
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Resolve the server tracing mode from the build-injected surface
|
|
28
|
+
* configuration alone; unrecognised or absent values resolve to
|
|
29
|
+
* {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
|
|
30
|
+
* set, which callers use to cap direct export timeouts.
|
|
29
31
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
readonly injected?:
|
|
32
|
+
export declare function resolveServerTracing(opts?: {
|
|
33
|
+
readonly injected?: unknown;
|
|
32
34
|
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
-
}):
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}): {
|
|
36
|
+
mode: "drain" | "full";
|
|
37
|
+
vercel: boolean;
|
|
38
|
+
};
|
|
39
|
+
/** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
|
|
40
|
+
export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
|
|
41
|
+
mode: "drain" | "full";
|
|
42
|
+
vercel: boolean;
|
|
43
|
+
};
|
|
40
44
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const
|
|
1
|
+
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`,VERCEL_EXPORT_TIMEOUT_MS=2e3;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected)),env=opts?.env??readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!normalizeEnv(env?.VERCEL)}}function readServerTracing(env=readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}export{DEFAULT_SERVER_TRACING_MODE,SERVER_TRACING_GLOBAL,VERCEL_EXPORT_TIMEOUT_MS,readServerTracing,resolveServerTracing,serverTracingModeSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),exports.SERVICE_NAME_GLOBAL=`__INTERFERE_SERVICE_NAME__`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/sdk/service-name.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Global a build stamps into the page with the default OTel `service.name`
|
|
4
|
+
* (the build integrations derive it from the package name). The kernel reads it
|
|
5
|
+
* when `init()` is called without `serviceName`; an explicit value wins.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SERVICE_NAME_GLOBAL = "__INTERFERE_SERVICE_NAME__";
|
|
8
|
+
//#endregion
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/sdk/service-name.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Global a build stamps into the page with the default OTel `service.name`
|
|
4
|
+
* (the build integrations derive it from the package name). The kernel reads it
|
|
5
|
+
* when `init()` is called without `serviceName`; an explicit value wins.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SERVICE_NAME_GLOBAL = "__INTERFERE_SERVICE_NAME__";
|
|
8
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const SERVICE_NAME_GLOBAL=`__INTERFERE_SERVICE_NAME__`;export{SERVICE_NAME_GLOBAL};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let _sdk_errors=require("#sdk/errors");const V8_FRAME_RE=/^\s*at\s+(?:(?<fn>.+?)\s+\()?(?<location>.+?):(?<line>\d+)(?::\d+)?\)?\s*$/u,GECKO_FRAME_RE=/^(?<fn>[^@]*)@(?<location>.+?):(?<line>\d+)(?::\d+)?\s*$/u,FOREIGN_LOCATION_RE=/(?:^|\/)node_modules\/|^(?:native|<anonymous>|\[native code\])$|\beval at\s|^(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):/u,ANONYMOUS_FN_RE=/^(?:<anonymous>|Object\.<anonymous>|global code)?$/u;function basename(location){let trimmed=location.replace(/[?#].*$/u,``),last=trimmed.lastIndexOf(`/`);return(last===-1?trimmed:trimmed.slice(last+1))||trimmed}function throwSiteLabel(stack){for(let rawLine of stack.split(`
|
|
2
|
+
`,30)){let line=rawLine.slice(0,1024),groups=(V8_FRAME_RE.exec(line)??GECKO_FRAME_RE.exec(line))?.groups;if(!groups?.location||!groups.line)continue;let location=groups.location.trim();if(FOREIGN_LOCATION_RE.test(location))continue;let fn=(groups.fn??``).replace(/^(?:async|new)\s+/u,``).trim(),site=`${basename(location)}:${groups.line}`;return ANONYMOUS_FN_RE.test(fn)?site:`${fn} (${site})`}return null}function exceptionSpanName(value){if((0,_sdk_errors.isNonErrorException)(value))return value.type;let stack=value.stack;return(typeof stack==`string`?throwSiteLabel(stack):null)??(value.name||`Error`)}exports.exceptionSpanName=exceptionSpanName;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NonErrorException } from "#sdk/errors";
|
|
2
|
+
//#region src/sdk/throw-site.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Name for the span the SDK opens to carry a captured exception when no
|
|
5
|
+
* span is active: the top in-app frame of the raw stack as `fn (file:line)`
|
|
6
|
+
* (`file:line` for anonymous frames; `node_modules`, native and
|
|
7
|
+
* browser-extension frames are skipped), or the error's type when the
|
|
8
|
+
* stack has no usable frame or host code replaced it with a non-string.
|
|
9
|
+
* Non-Error rejections carry no stack and use their structural type. The
|
|
10
|
+
* label mirrors the raw text the SDK ships; symbolication of minified
|
|
11
|
+
* names stays server-side.
|
|
12
|
+
*/
|
|
13
|
+
export declare function exceptionSpanName(value: Error | NonErrorException): string;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NonErrorException } from "#sdk/errors";
|
|
2
|
+
//#region src/sdk/throw-site.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Name for the span the SDK opens to carry a captured exception when no
|
|
5
|
+
* span is active: the top in-app frame of the raw stack as `fn (file:line)`
|
|
6
|
+
* (`file:line` for anonymous frames; `node_modules`, native and
|
|
7
|
+
* browser-extension frames are skipped), or the error's type when the
|
|
8
|
+
* stack has no usable frame or host code replaced it with a non-string.
|
|
9
|
+
* Non-Error rejections carry no stack and use their structural type. The
|
|
10
|
+
* label mirrors the raw text the SDK ships; symbolication of minified
|
|
11
|
+
* names stays server-side.
|
|
12
|
+
*/
|
|
13
|
+
export declare function exceptionSpanName(value: Error | NonErrorException): string;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isNonErrorException}from"#sdk/errors";const V8_FRAME_RE=/^\s*at\s+(?:(?<fn>.+?)\s+\()?(?<location>.+?):(?<line>\d+)(?::\d+)?\)?\s*$/u,GECKO_FRAME_RE=/^(?<fn>[^@]*)@(?<location>.+?):(?<line>\d+)(?::\d+)?\s*$/u,FOREIGN_LOCATION_RE=/(?:^|\/)node_modules\/|^(?:native|<anonymous>|\[native code\])$|\beval at\s|^(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):/u,ANONYMOUS_FN_RE=/^(?:<anonymous>|Object\.<anonymous>|global code)?$/u;function basename(location){let trimmed=location.replace(/[?#].*$/u,``),last=trimmed.lastIndexOf(`/`);return(last===-1?trimmed:trimmed.slice(last+1))||trimmed}function throwSiteLabel(stack){for(let rawLine of stack.split(`
|
|
2
|
+
`,30)){let line=rawLine.slice(0,1024),groups=(V8_FRAME_RE.exec(line)??GECKO_FRAME_RE.exec(line))?.groups;if(!groups?.location||!groups.line)continue;let location=groups.location.trim();if(FOREIGN_LOCATION_RE.test(location))continue;let fn=(groups.fn??``).replace(/^(?:async|new)\s+/u,``).trim(),site=`${basename(location)}:${groups.line}`;return ANONYMOUS_FN_RE.test(fn)?site:`${fn} (${site})`}return null}function exceptionSpanName(value){if(isNonErrorException(value))return value.type;let stack=value.stack;return(typeof stack==`string`?throwSiteLabel(stack):null)??(value.name||`Error`)}export{exceptionSpanName};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "TypeScript & Zod types for Interfere",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"logging",
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
"typescript"
|
|
9
9
|
],
|
|
10
10
|
"homepage": "https://interfere.com",
|
|
11
|
-
"bugs":
|
|
12
|
-
"url": "mailto:support@interfere.com"
|
|
13
|
-
},
|
|
11
|
+
"bugs": "mailto:support@interfere.com",
|
|
14
12
|
"license": "MIT",
|
|
15
13
|
"author": "Interfere <support@interfere.com> (https://interfere.com)",
|
|
16
14
|
"repository": {
|
|
@@ -145,20 +143,21 @@
|
|
|
145
143
|
},
|
|
146
144
|
"scripts": {
|
|
147
145
|
"build": "tsdown",
|
|
148
|
-
"test": "vitest run --config ../../../../vitest.config.ts",
|
|
146
|
+
"test": "node ../../private/vitest-config/src/cli.ts run --config ../../../../vitest.config.ts",
|
|
149
147
|
"typecheck": "bun check"
|
|
150
148
|
},
|
|
151
149
|
"dependencies": {
|
|
152
|
-
"
|
|
150
|
+
"@interfere/helpers": "^9.3.0",
|
|
151
|
+
"zod": "4.6.6"
|
|
153
152
|
},
|
|
154
153
|
"devDependencies": {
|
|
155
|
-
"@interfere/test-utils": "^10.0.
|
|
154
|
+
"@interfere/test-utils": "^10.0.2",
|
|
156
155
|
"@interfere/typescript-config": "^9.0.2",
|
|
157
156
|
"@interfere/vitest-config": "0.0.0",
|
|
158
|
-
"@types/node": "
|
|
157
|
+
"@types/node": "26.4.1",
|
|
159
158
|
"@vitest/coverage-v8": "5.0.5",
|
|
160
|
-
"tsdown": "
|
|
161
|
-
"typescript": "
|
|
159
|
+
"tsdown": "0.23.0",
|
|
160
|
+
"typescript": "7.0.2",
|
|
162
161
|
"vitest": "5.0.5"
|
|
163
162
|
}
|
|
164
163
|
}
|