@interfere/types 10.0.2 → 10.1.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/source-maps.cjs +1 -1
- package/dist/data/source-maps.mjs +1 -1
- package/dist/integrations/index.cjs +1 -1
- package/dist/integrations/index.d.cts +4 -0
- package/dist/integrations/index.d.mts +4 -0
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/platforms/github.cjs +1 -1
- package/dist/integrations/platforms/github.mjs +1 -1
- package/dist/releases/slug.cjs +1 -1
- package/dist/releases/slug.d.cts +1 -1
- package/dist/releases/slug.d.mts +1 -1
- package/dist/releases/slug.mjs +1 -1
- package/dist/sdk/build-diagnostics.cjs +1 -1
- package/dist/sdk/build-diagnostics.mjs +1 -1
- package/dist/sdk/deploy-environment.cjs +1 -1
- package/dist/sdk/deploy-environment.d.cts +3 -1
- package/dist/sdk/deploy-environment.d.mts +3 -1
- package/dist/sdk/deploy-environment.mjs +1 -1
- package/dist/sdk/errors.cjs +2 -2
- package/dist/sdk/errors.mjs +2 -2
- package/dist/sdk/github-source.cjs +1 -0
- package/dist/sdk/github-source.d.cts +21 -0
- package/dist/sdk/github-source.d.mts +21 -0
- package/dist/sdk/github-source.mjs +1 -0
- package/dist/sdk/injected-globals.cjs +1 -1
- package/dist/sdk/injected-globals.d.cts +2 -1
- package/dist/sdk/injected-globals.d.mts +2 -1
- package/dist/sdk/injected-globals.mjs +1 -1
- package/dist/sdk/log-sourcing.cjs +1 -1
- package/dist/sdk/log-sourcing.mjs +1 -1
- package/dist/sdk/runtime.cjs +1 -1
- package/dist/sdk/runtime.d.cts +6 -1
- package/dist/sdk/runtime.d.mts +6 -1
- package/dist/sdk/runtime.mjs +1 -1
- package/dist/sdk/server-tracing.cjs +1 -1
- package/dist/sdk/server-tracing.mjs +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const manifestBundlerSchema=zod.z.enum([`webpack`,`turbopack`,`rollup`,`tsc`]).meta({id:`ManifestBundler`,title:`ManifestBundler`}),sourceMapManifestEntrySchema=zod.z.object({chunkUrl:zod.z.string(),debugId:zod.z.string(),objectKey:zod.z.string(),mapHash:zod.z.string()}),sourceMapManifestSchema=zod.z.object({releaseSlug:zod.z.string(),surfaceId:zod.z.string(),organizationId:zod.z.string(),bundler:manifestBundlerSchema,createdAt:zod.z.number(),files:zod.z.array(sourceMapManifestEntrySchema)}),uploadSourceMapEntry=zod.z.object({path:zod.z.string().min(1),hash:zod.z.string(),debugId:zod.z.string(),chunkUrl:zod.z.string()}).meta({id:`UploadSourceMapEntry`,title:`UploadSourceMapEntry`}),uploadSourceMapsMetadata=zod.z.object({entries:zod.z.array(uploadSourceMapEntry),sourceFileCount:zod.z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`UploadSourceMapsMetadata`,title:`UploadSourceMapsMetadata`,description:`Metadata attached alongside uploaded source map files.`}),uploadSourceMapsResponse=zod.z.object({ok:zod.z.boolean(),processed:zod.z.number().int().nonnegative(),message:zod.z.string(),fileCount:zod.z.number().int().nonnegative()}).meta({id:`UploadSourceMapsResponse`,title:`UploadSourceMapsResponse`}),signSourceMapFile=zod.z.object({path:zod.z.string().min(1),sizeBytes:zod.z.number().int().nonnegative(),hasSourcesContent:zod.z.boolean(),hasNames:zod.z.boolean(),hasFile:zod.z.boolean(),mappingsPresent:zod.z.boolean()}).meta({id:`SignSourceMapFile`,title:`SignSourceMapFile`}),signSourceMapsRequest=zod.z.object({files:zod.z.array(signSourceMapFile)}).meta({id:`SignSourceMapsRequest`,title:`SignSourceMapsRequest`,description:"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest."}),signSourceMapUpload=zod.z.object({path:zod.z.string(),objectKey:zod.z.string(),presignedUrl:zod.z.string()}).meta({id:`SignSourceMapUpload`,title:`SignSourceMapUpload`}),signSourceMapsResponse=zod.z.object({uploads:zod.z.array(signSourceMapUpload),expiresAt:zod.z.number().int()}).meta({id:`SignSourceMapsResponse`,title:`SignSourceMapsResponse`}),completeSourceMapFile=zod.z.object({path:zod.z.string().min(1),hash:zod.z.string(),debugId:zod.z.string(),chunkUrl:zod.z.string()}).meta({id:`CompleteSourceMapFile`,title:`CompleteSourceMapFile`}),completeSourceMapsRequest=zod.z.object({files:zod.z.array(completeSourceMapFile),sourceFileCount:zod.z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`CompleteSourceMapsRequest`,title:`CompleteSourceMapsRequest`,description:"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry."}),completeSourceMapsResponse=zod.z.object({ok:zod.z.boolean(),fileCount:zod.z.number().int().nonnegative()}).meta({id:`CompleteSourceMapsResponse`,title:`CompleteSourceMapsResponse`}),DEBUG_ID_RE=/^[a-fA-F0-9-]
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const manifestBundlerSchema=zod.z.enum([`webpack`,`turbopack`,`rollup`,`tsc`]).meta({id:`ManifestBundler`,title:`ManifestBundler`}),sourceMapManifestEntrySchema=zod.z.object({chunkUrl:zod.z.string(),debugId:zod.z.string(),objectKey:zod.z.string(),mapHash:zod.z.string()}),sourceMapManifestSchema=zod.z.object({releaseSlug:zod.z.string(),surfaceId:zod.z.string(),organizationId:zod.z.string(),bundler:manifestBundlerSchema,createdAt:zod.z.number(),files:zod.z.array(sourceMapManifestEntrySchema)}),uploadSourceMapEntry=zod.z.object({path:zod.z.string().min(1),hash:zod.z.string(),debugId:zod.z.string(),chunkUrl:zod.z.string()}).meta({id:`UploadSourceMapEntry`,title:`UploadSourceMapEntry`}),uploadSourceMapsMetadata=zod.z.object({entries:zod.z.array(uploadSourceMapEntry),sourceFileCount:zod.z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`UploadSourceMapsMetadata`,title:`UploadSourceMapsMetadata`,description:`Metadata attached alongside uploaded source map files.`}),uploadSourceMapsResponse=zod.z.object({ok:zod.z.boolean(),processed:zod.z.number().int().nonnegative(),message:zod.z.string(),fileCount:zod.z.number().int().nonnegative()}).meta({id:`UploadSourceMapsResponse`,title:`UploadSourceMapsResponse`}),signSourceMapFile=zod.z.object({path:zod.z.string().min(1),sizeBytes:zod.z.number().int().nonnegative(),hasSourcesContent:zod.z.boolean(),hasNames:zod.z.boolean(),hasFile:zod.z.boolean(),mappingsPresent:zod.z.boolean()}).meta({id:`SignSourceMapFile`,title:`SignSourceMapFile`}),signSourceMapsRequest=zod.z.object({files:zod.z.array(signSourceMapFile)}).meta({id:`SignSourceMapsRequest`,title:`SignSourceMapsRequest`,description:"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest."}),signSourceMapUpload=zod.z.object({path:zod.z.string(),objectKey:zod.z.string(),presignedUrl:zod.z.string()}).meta({id:`SignSourceMapUpload`,title:`SignSourceMapUpload`}),signSourceMapsResponse=zod.z.object({uploads:zod.z.array(signSourceMapUpload),expiresAt:zod.z.number().int()}).meta({id:`SignSourceMapsResponse`,title:`SignSourceMapsResponse`}),completeSourceMapFile=zod.z.object({path:zod.z.string().min(1),hash:zod.z.string(),debugId:zod.z.string(),chunkUrl:zod.z.string()}).meta({id:`CompleteSourceMapFile`,title:`CompleteSourceMapFile`}),completeSourceMapsRequest=zod.z.object({files:zod.z.array(completeSourceMapFile),sourceFileCount:zod.z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`CompleteSourceMapsRequest`,title:`CompleteSourceMapsRequest`,description:"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry."}),completeSourceMapsResponse=zod.z.object({ok:zod.z.boolean(),fileCount:zod.z.number().int().nonnegative()}).meta({id:`CompleteSourceMapsResponse`,title:`CompleteSourceMapsResponse`}),DEBUG_ID_RE=/^[a-fA-F0-9-]+$/u;function debugIdRuntimeSnippet(debugId){if(!DEBUG_ID_RE.test(debugId))throw Error(`debugId must be hex and dashes only, got: ${debugId}`);return`;!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._debugIds=e._debugIds||{},e._debugIds[n]="${debugId}")}catch(e){}}();`}const SOURCEMAPPING_RE=/\/\/[#@]\s*sourceMappingURL=\S+\s*$/u,SPEC_LAST_DEBUG_ID_RE=/\/\/# debugId=(?<id>[a-fA-F0-9-]+)(?![\s\S]*\/\/# debugId=)/mu,RUNTIME_DEBUG_ID_RE=/(?<prefix>_debugIds\[[^\]]*\]=")[a-fA-F0-9-]+(?<suffix>")/gu;function readDebugIdFromJs(content){return SPEC_LAST_DEBUG_ID_RE.exec(content)?.[1]??null}function injectDebugIdIntoJs(content,debugId){let snippet=debugIdRuntimeSnippet(debugId),debugIdComment=`//# debugId=${debugId}`;if(SPEC_LAST_DEBUG_ID_RE.test(content))return content.replace(SPEC_LAST_DEBUG_ID_RE,debugIdComment).replace(RUNTIME_DEBUG_ID_RE,`$1${debugId}$2`);let match=SOURCEMAPPING_RE.exec(content);return match?`${content.slice(0,match.index).trimEnd()}\n${snippet}\n${debugIdComment}\n${match[0]}`:`${content}\n${snippet}\n${debugIdComment}`}exports.completeSourceMapFile=completeSourceMapFile,exports.completeSourceMapsRequest=completeSourceMapsRequest,exports.completeSourceMapsResponse=completeSourceMapsResponse,exports.debugIdRuntimeSnippet=debugIdRuntimeSnippet,exports.injectDebugIdIntoJs=injectDebugIdIntoJs,exports.manifestBundlerSchema=manifestBundlerSchema,exports.readDebugIdFromJs=readDebugIdFromJs,exports.signSourceMapFile=signSourceMapFile,exports.signSourceMapUpload=signSourceMapUpload,exports.signSourceMapsRequest=signSourceMapsRequest,exports.signSourceMapsResponse=signSourceMapsResponse,exports.sourceMapManifestSchema=sourceMapManifestSchema,exports.uploadSourceMapEntry=uploadSourceMapEntry,exports.uploadSourceMapsMetadata=uploadSourceMapsMetadata,exports.uploadSourceMapsResponse=uploadSourceMapsResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const manifestBundlerSchema=z.enum([`webpack`,`turbopack`,`rollup`,`tsc`]).meta({id:`ManifestBundler`,title:`ManifestBundler`}),sourceMapManifestEntrySchema=z.object({chunkUrl:z.string(),debugId:z.string(),objectKey:z.string(),mapHash:z.string()}),sourceMapManifestSchema=z.object({releaseSlug:z.string(),surfaceId:z.string(),organizationId:z.string(),bundler:manifestBundlerSchema,createdAt:z.number(),files:z.array(sourceMapManifestEntrySchema)}),uploadSourceMapEntry=z.object({path:z.string().min(1),hash:z.string(),debugId:z.string(),chunkUrl:z.string()}).meta({id:`UploadSourceMapEntry`,title:`UploadSourceMapEntry`}),uploadSourceMapsMetadata=z.object({entries:z.array(uploadSourceMapEntry),sourceFileCount:z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`UploadSourceMapsMetadata`,title:`UploadSourceMapsMetadata`,description:`Metadata attached alongside uploaded source map files.`}),uploadSourceMapsResponse=z.object({ok:z.boolean(),processed:z.number().int().nonnegative(),message:z.string(),fileCount:z.number().int().nonnegative()}).meta({id:`UploadSourceMapsResponse`,title:`UploadSourceMapsResponse`}),signSourceMapFile=z.object({path:z.string().min(1),sizeBytes:z.number().int().nonnegative(),hasSourcesContent:z.boolean(),hasNames:z.boolean(),hasFile:z.boolean(),mappingsPresent:z.boolean()}).meta({id:`SignSourceMapFile`,title:`SignSourceMapFile`}),signSourceMapsRequest=z.object({files:z.array(signSourceMapFile)}).meta({id:`SignSourceMapsRequest`,title:`SignSourceMapsRequest`,description:"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest."}),signSourceMapUpload=z.object({path:z.string(),objectKey:z.string(),presignedUrl:z.string()}).meta({id:`SignSourceMapUpload`,title:`SignSourceMapUpload`}),signSourceMapsResponse=z.object({uploads:z.array(signSourceMapUpload),expiresAt:z.number().int()}).meta({id:`SignSourceMapsResponse`,title:`SignSourceMapsResponse`}),completeSourceMapFile=z.object({path:z.string().min(1),hash:z.string(),debugId:z.string(),chunkUrl:z.string()}).meta({id:`CompleteSourceMapFile`,title:`CompleteSourceMapFile`}),completeSourceMapsRequest=z.object({files:z.array(completeSourceMapFile),sourceFileCount:z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`CompleteSourceMapsRequest`,title:`CompleteSourceMapsRequest`,description:"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry."}),completeSourceMapsResponse=z.object({ok:z.boolean(),fileCount:z.number().int().nonnegative()}).meta({id:`CompleteSourceMapsResponse`,title:`CompleteSourceMapsResponse`}),DEBUG_ID_RE=/^[a-fA-F0-9-]
|
|
1
|
+
import{z}from"zod";const manifestBundlerSchema=z.enum([`webpack`,`turbopack`,`rollup`,`tsc`]).meta({id:`ManifestBundler`,title:`ManifestBundler`}),sourceMapManifestEntrySchema=z.object({chunkUrl:z.string(),debugId:z.string(),objectKey:z.string(),mapHash:z.string()}),sourceMapManifestSchema=z.object({releaseSlug:z.string(),surfaceId:z.string(),organizationId:z.string(),bundler:manifestBundlerSchema,createdAt:z.number(),files:z.array(sourceMapManifestEntrySchema)}),uploadSourceMapEntry=z.object({path:z.string().min(1),hash:z.string(),debugId:z.string(),chunkUrl:z.string()}).meta({id:`UploadSourceMapEntry`,title:`UploadSourceMapEntry`}),uploadSourceMapsMetadata=z.object({entries:z.array(uploadSourceMapEntry),sourceFileCount:z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`UploadSourceMapsMetadata`,title:`UploadSourceMapsMetadata`,description:`Metadata attached alongside uploaded source map files.`}),uploadSourceMapsResponse=z.object({ok:z.boolean(),processed:z.number().int().nonnegative(),message:z.string(),fileCount:z.number().int().nonnegative()}).meta({id:`UploadSourceMapsResponse`,title:`UploadSourceMapsResponse`}),signSourceMapFile=z.object({path:z.string().min(1),sizeBytes:z.number().int().nonnegative(),hasSourcesContent:z.boolean(),hasNames:z.boolean(),hasFile:z.boolean(),mappingsPresent:z.boolean()}).meta({id:`SignSourceMapFile`,title:`SignSourceMapFile`}),signSourceMapsRequest=z.object({files:z.array(signSourceMapFile)}).meta({id:`SignSourceMapsRequest`,title:`SignSourceMapsRequest`,description:"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest."}),signSourceMapUpload=z.object({path:z.string(),objectKey:z.string(),presignedUrl:z.string()}).meta({id:`SignSourceMapUpload`,title:`SignSourceMapUpload`}),signSourceMapsResponse=z.object({uploads:z.array(signSourceMapUpload),expiresAt:z.number().int()}).meta({id:`SignSourceMapsResponse`,title:`SignSourceMapsResponse`}),completeSourceMapFile=z.object({path:z.string().min(1),hash:z.string(),debugId:z.string(),chunkUrl:z.string()}).meta({id:`CompleteSourceMapFile`,title:`CompleteSourceMapFile`}),completeSourceMapsRequest=z.object({files:z.array(completeSourceMapFile),sourceFileCount:z.number().int().nonnegative().optional(),bundler:manifestBundlerSchema}).meta({id:`CompleteSourceMapsRequest`,title:`CompleteSourceMapsRequest`,description:"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry."}),completeSourceMapsResponse=z.object({ok:z.boolean(),fileCount:z.number().int().nonnegative()}).meta({id:`CompleteSourceMapsResponse`,title:`CompleteSourceMapsResponse`}),DEBUG_ID_RE=/^[a-fA-F0-9-]+$/u;function debugIdRuntimeSnippet(debugId){if(!DEBUG_ID_RE.test(debugId))throw Error(`debugId must be hex and dashes only, got: ${debugId}`);return`;!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._debugIds=e._debugIds||{},e._debugIds[n]="${debugId}")}catch(e){}}();`}const SOURCEMAPPING_RE=/\/\/[#@]\s*sourceMappingURL=\S+\s*$/u,SPEC_LAST_DEBUG_ID_RE=/\/\/# debugId=(?<id>[a-fA-F0-9-]+)(?![\s\S]*\/\/# debugId=)/mu,RUNTIME_DEBUG_ID_RE=/(?<prefix>_debugIds\[[^\]]*\]=")[a-fA-F0-9-]+(?<suffix>")/gu;function readDebugIdFromJs(content){return SPEC_LAST_DEBUG_ID_RE.exec(content)?.[1]??null}function injectDebugIdIntoJs(content,debugId){let snippet=debugIdRuntimeSnippet(debugId),debugIdComment=`//# debugId=${debugId}`;if(SPEC_LAST_DEBUG_ID_RE.test(content))return content.replace(SPEC_LAST_DEBUG_ID_RE,debugIdComment).replace(RUNTIME_DEBUG_ID_RE,`$1${debugId}$2`);let match=SOURCEMAPPING_RE.exec(content);return match?`${content.slice(0,match.index).trimEnd()}\n${snippet}\n${debugIdComment}\n${match[0]}`:`${content}\n${snippet}\n${debugIdComment}`}export{completeSourceMapFile,completeSourceMapsRequest,completeSourceMapsResponse,debugIdRuntimeSnippet,injectDebugIdIntoJs,manifestBundlerSchema,readDebugIdFromJs,signSourceMapFile,signSourceMapUpload,signSourceMapsRequest,signSourceMapsResponse,sourceMapManifestSchema,uploadSourceMapEntry,uploadSourceMapsMetadata,uploadSourceMapsResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_integrations_platforms_cloudflare=require("./platforms/cloudflare.cjs"),require_integrations_platforms_github=require("./platforms/github.cjs"),require_integrations_platforms_vercel=require("./platforms/vercel.cjs");let zod=require("zod");const githubReleaseSourceSchema=zod.z.object({provider:zod.z.literal(`github`),commitMessage:zod.z.string(),branch:zod.z.string(),commitSha:zod.z.string().nullable(),runnerName:zod.z.string().nullable().optional(),runId:zod.z.string().nullable().optional(),runUrl:zod.z.string().nullable().optional()}).meta({id:`GithubReleaseSource`,title:`GithubReleaseSource`,description:`Release source metadata coming from GitHub.`}),cliReleaseSourceSchema=zod.z.object({provider:zod.z.literal(`cli`),commitSha:zod.z.string().nullable(),commitRef:zod.z.string().nullable(),commitMessage:zod.z.string().nullable(),commitUrl:zod.z.string().nullable(),runnerName:zod.z.string().nullable(),runId:zod.z.string().nullable(),runUrl:zod.z.string().nullable(),environment:zod.z.string().nullable().optional(),deploymentUrl:zod.z.string().nullable().optional()}).meta({id:`CliReleaseSource`,title:`CliReleaseSource`,description:`Release source metadata from the Interfere CLI.`}),releaseSourceMetadataSchema=zod.z.discriminatedUnion(`provider`,[githubReleaseSourceSchema,cliReleaseSourceSchema]).meta({id:`ReleaseSource`,title:`ReleaseSource`}),releaseSourceProviderSchema=zod.z.enum([`github`,`cli`]).meta({id:`ReleaseSourceProvider`,title:`ReleaseSourceProvider`}),vercelReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`vercel`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),deploymentId:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable(),environmentName:zod.z.string().nullable(),environmentTarget:zod.z.string().nullable()}).meta({id:`VercelReleaseDestination`,title:`VercelReleaseDestination`,description:`Release destination metadata for a Vercel deployment.`}),cloudflareReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`cloudflare`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),versionId:zod.z.string().nullable(),scriptName:zod.z.string().nullable(),accountId:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable(),environmentName:zod.z.string().nullable(),environmentTarget:zod.z.string().nullable()}).meta({id:`CloudflareReleaseDestination`,title:`CloudflareReleaseDestination`,description:`Release destination metadata for a Cloudflare Workers deployment.`}),cliReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`cli`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable()}).meta({id:`CliReleaseDestination`,title:`CliReleaseDestination`,description:`Release destination metadata from the Interfere CLI.`}),releaseDestinationMetadataSchema=zod.z.discriminatedUnion(`provider`,[vercelReleaseDestinationSchema,cloudflareReleaseDestinationSchema,cliReleaseDestinationSchema]).meta({id:`ReleaseDestination`,title:`ReleaseDestination`}),releaseDestinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ReleaseDestinationProvider`,title:`ReleaseDestinationProvider`}),configuredSourceProviderSchema=zod.z.enum([`github`]).meta({id:`ConfiguredSourceProvider`,title:`ConfiguredSourceProvider`}),configuredDestinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ConfiguredDestinationProvider`,title:`ConfiguredDestinationProvider`}),sourceProviderSchema=configuredSourceProviderSchema.meta({id:`SourceProvider`,title:`SourceProvider`}),destinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`]).meta({id:`DestinationProvider`,title:`DestinationProvider`}),releaseSourceIdEnvKeys=zod.z.enum([`NEXT_PUBLIC_INTERFERE_BUILD_ID`,`INTERFERE_SOURCE_ID`,`NEXT_BUILD_ID`,...require_integrations_platforms_github.githubSourceIdEnvKeys,...require_integrations_platforms_cloudflare.cloudflareSourceIdEnvKeys]).options,releaseDestinationIdEnvKeys=zod.z.enum([`NEXT_PUBLIC_INTERFERE_RELEASE_ID`,`INTERFERE_DESTINATION_ID`,...require_integrations_platforms_vercel.vercelDestinationIdEnvKeys,...require_integrations_platforms_cloudflare.cloudflareDestinationIdEnvKeys,...require_integrations_platforms_github.githubSourceIdEnvKeys]).options;exports.cliReleaseDestinationSchema=cliReleaseDestinationSchema,exports.cliReleaseSourceSchema=cliReleaseSourceSchema,exports.cloudflareReleaseDestinationSchema=cloudflareReleaseDestinationSchema,exports.configuredDestinationProviderSchema=configuredDestinationProviderSchema,exports.configuredSourceProviderSchema=configuredSourceProviderSchema,exports.destinationProviderSchema=destinationProviderSchema,exports.githubReleaseSourceSchema=githubReleaseSourceSchema,exports.releaseDestinationIdEnvKeys=releaseDestinationIdEnvKeys,exports.releaseDestinationMetadataSchema=releaseDestinationMetadataSchema,exports.releaseDestinationProviderSchema=releaseDestinationProviderSchema,exports.releaseSourceIdEnvKeys=releaseSourceIdEnvKeys,exports.releaseSourceMetadataSchema=releaseSourceMetadataSchema,exports.releaseSourceProviderSchema=releaseSourceProviderSchema,exports.sourceProviderSchema=sourceProviderSchema,exports.vercelReleaseDestinationSchema=vercelReleaseDestinationSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_integrations_platforms_cloudflare=require("./platforms/cloudflare.cjs"),require_integrations_platforms_github=require("./platforms/github.cjs"),require_integrations_platforms_vercel=require("./platforms/vercel.cjs");let zod=require("zod");const githubReleaseSourceSchema=zod.z.object({provider:zod.z.literal(`github`),commitMessage:zod.z.string(),branch:zod.z.string(),commitSha:zod.z.string().nullable(),runnerName:zod.z.string().nullable().optional(),runId:zod.z.string().nullable().optional(),runUrl:zod.z.string().nullable().optional()}).meta({id:`GithubReleaseSource`,title:`GithubReleaseSource`,description:`Release source metadata coming from GitHub.`}),cliReleaseSourceSchema=zod.z.object({provider:zod.z.literal(`cli`),commitSha:zod.z.string().nullable(),commitRef:zod.z.string().nullable(),commitMessage:zod.z.string().nullable(),commitUrl:zod.z.string().nullable(),runnerName:zod.z.string().nullable(),runId:zod.z.string().nullable(),runUrl:zod.z.string().nullable(),environment:zod.z.string().nullable().optional(),deploymentUrl:zod.z.string().nullable().optional()}).meta({id:`CliReleaseSource`,title:`CliReleaseSource`,description:`Release source metadata from the Interfere CLI.`}),releaseSourceMetadataSchema=zod.z.discriminatedUnion(`provider`,[githubReleaseSourceSchema,cliReleaseSourceSchema]).meta({id:`ReleaseSource`,title:`ReleaseSource`}),releaseSourceProviderSchema=zod.z.enum([`github`,`cli`]).meta({id:`ReleaseSourceProvider`,title:`ReleaseSourceProvider`}),vercelReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`vercel`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),deploymentId:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable(),environmentName:zod.z.string().nullable(),environmentTarget:zod.z.string().nullable()}).meta({id:`VercelReleaseDestination`,title:`VercelReleaseDestination`,description:`Release destination metadata for a Vercel deployment.`}),cloudflareReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`cloudflare`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),versionId:zod.z.string().nullable(),scriptName:zod.z.string().nullable(),accountId:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable(),environmentName:zod.z.string().nullable(),environmentTarget:zod.z.string().nullable()}).meta({id:`CloudflareReleaseDestination`,title:`CloudflareReleaseDestination`,description:`Release destination metadata for a Cloudflare Workers deployment.`}),cliReleaseDestinationSchema=zod.z.object({provider:zod.z.literal(`cli`),destinationReleaseId:zod.z.string().nullable(),environment:zod.z.string().nullable(),deploymentUrl:zod.z.string().nullable()}).meta({id:`CliReleaseDestination`,title:`CliReleaseDestination`,description:`Release destination metadata from the Interfere CLI.`}),releaseDestinationMetadataSchema=zod.z.discriminatedUnion(`provider`,[vercelReleaseDestinationSchema,cloudflareReleaseDestinationSchema,cliReleaseDestinationSchema]).meta({id:`ReleaseDestination`,title:`ReleaseDestination`}),releaseDestinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ReleaseDestinationProvider`,title:`ReleaseDestinationProvider`}),configuredSourceProviderSchema=zod.z.enum([`github`,`ghe_cloud`,`ghe_server`]).meta({id:`ConfiguredSourceProvider`,title:`ConfiguredSourceProvider`}),configuredDestinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ConfiguredDestinationProvider`,title:`ConfiguredDestinationProvider`}),sourceProviderSchema=configuredSourceProviderSchema.meta({id:`SourceProvider`,title:`SourceProvider`}),destinationProviderSchema=zod.z.enum([`vercel`,`cloudflare`]).meta({id:`DestinationProvider`,title:`DestinationProvider`}),releaseSourceIdEnvKeys=zod.z.enum([`NEXT_PUBLIC_INTERFERE_BUILD_ID`,`INTERFERE_SOURCE_ID`,`NEXT_BUILD_ID`,...require_integrations_platforms_github.githubSourceIdEnvKeys,...require_integrations_platforms_cloudflare.cloudflareSourceIdEnvKeys]).options,releaseDestinationIdEnvKeys=zod.z.enum([`NEXT_PUBLIC_INTERFERE_RELEASE_ID`,`INTERFERE_DESTINATION_ID`,...require_integrations_platforms_vercel.vercelDestinationIdEnvKeys,...require_integrations_platforms_cloudflare.cloudflareDestinationIdEnvKeys,...require_integrations_platforms_github.githubSourceIdEnvKeys]).options;exports.cliReleaseDestinationSchema=cliReleaseDestinationSchema,exports.cliReleaseSourceSchema=cliReleaseSourceSchema,exports.cloudflareReleaseDestinationSchema=cloudflareReleaseDestinationSchema,exports.configuredDestinationProviderSchema=configuredDestinationProviderSchema,exports.configuredSourceProviderSchema=configuredSourceProviderSchema,exports.destinationProviderSchema=destinationProviderSchema,exports.githubReleaseSourceSchema=githubReleaseSourceSchema,exports.releaseDestinationIdEnvKeys=releaseDestinationIdEnvKeys,exports.releaseDestinationMetadataSchema=releaseDestinationMetadataSchema,exports.releaseDestinationProviderSchema=releaseDestinationProviderSchema,exports.releaseSourceIdEnvKeys=releaseSourceIdEnvKeys,exports.releaseSourceMetadataSchema=releaseSourceMetadataSchema,exports.releaseSourceProviderSchema=releaseSourceProviderSchema,exports.sourceProviderSchema=sourceProviderSchema,exports.vercelReleaseDestinationSchema=vercelReleaseDestinationSchema;
|
|
@@ -105,6 +105,8 @@ declare const releaseDestinationProviderSchema: z.ZodEnum<{
|
|
|
105
105
|
}>;
|
|
106
106
|
type ReleaseDestinationProvider = z.infer<typeof releaseDestinationProviderSchema>;
|
|
107
107
|
declare const configuredSourceProviderSchema: z.ZodEnum<{
|
|
108
|
+
ghe_cloud: "ghe_cloud";
|
|
109
|
+
ghe_server: "ghe_server";
|
|
108
110
|
github: "github";
|
|
109
111
|
}>;
|
|
110
112
|
type ConfiguredSourceProvider = z.infer<typeof configuredSourceProviderSchema>;
|
|
@@ -115,6 +117,8 @@ declare const configuredDestinationProviderSchema: z.ZodEnum<{
|
|
|
115
117
|
}>;
|
|
116
118
|
type ConfiguredDestinationProvider = z.infer<typeof configuredDestinationProviderSchema>;
|
|
117
119
|
declare const sourceProviderSchema: z.ZodEnum<{
|
|
120
|
+
ghe_cloud: "ghe_cloud";
|
|
121
|
+
ghe_server: "ghe_server";
|
|
118
122
|
github: "github";
|
|
119
123
|
}>;
|
|
120
124
|
type SourceProvider = z.infer<typeof sourceProviderSchema>;
|
|
@@ -105,6 +105,8 @@ declare const releaseDestinationProviderSchema: z.ZodEnum<{
|
|
|
105
105
|
}>;
|
|
106
106
|
type ReleaseDestinationProvider = z.infer<typeof releaseDestinationProviderSchema>;
|
|
107
107
|
declare const configuredSourceProviderSchema: z.ZodEnum<{
|
|
108
|
+
ghe_cloud: "ghe_cloud";
|
|
109
|
+
ghe_server: "ghe_server";
|
|
108
110
|
github: "github";
|
|
109
111
|
}>;
|
|
110
112
|
type ConfiguredSourceProvider = z.infer<typeof configuredSourceProviderSchema>;
|
|
@@ -115,6 +117,8 @@ declare const configuredDestinationProviderSchema: z.ZodEnum<{
|
|
|
115
117
|
}>;
|
|
116
118
|
type ConfiguredDestinationProvider = z.infer<typeof configuredDestinationProviderSchema>;
|
|
117
119
|
declare const sourceProviderSchema: z.ZodEnum<{
|
|
120
|
+
ghe_cloud: "ghe_cloud";
|
|
121
|
+
ghe_server: "ghe_server";
|
|
118
122
|
github: "github";
|
|
119
123
|
}>;
|
|
120
124
|
type SourceProvider = z.infer<typeof sourceProviderSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloudflareDestinationIdEnvKeys,cloudflareSourceIdEnvKeys}from"./platforms/cloudflare.mjs";import{githubSourceIdEnvKeys}from"./platforms/github.mjs";import{vercelDestinationIdEnvKeys}from"./platforms/vercel.mjs";import{z}from"zod";const githubReleaseSourceSchema=z.object({provider:z.literal(`github`),commitMessage:z.string(),branch:z.string(),commitSha:z.string().nullable(),runnerName:z.string().nullable().optional(),runId:z.string().nullable().optional(),runUrl:z.string().nullable().optional()}).meta({id:`GithubReleaseSource`,title:`GithubReleaseSource`,description:`Release source metadata coming from GitHub.`}),cliReleaseSourceSchema=z.object({provider:z.literal(`cli`),commitSha:z.string().nullable(),commitRef:z.string().nullable(),commitMessage:z.string().nullable(),commitUrl:z.string().nullable(),runnerName:z.string().nullable(),runId:z.string().nullable(),runUrl:z.string().nullable(),environment:z.string().nullable().optional(),deploymentUrl:z.string().nullable().optional()}).meta({id:`CliReleaseSource`,title:`CliReleaseSource`,description:`Release source metadata from the Interfere CLI.`}),releaseSourceMetadataSchema=z.discriminatedUnion(`provider`,[githubReleaseSourceSchema,cliReleaseSourceSchema]).meta({id:`ReleaseSource`,title:`ReleaseSource`}),releaseSourceProviderSchema=z.enum([`github`,`cli`]).meta({id:`ReleaseSourceProvider`,title:`ReleaseSourceProvider`}),vercelReleaseDestinationSchema=z.object({provider:z.literal(`vercel`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),deploymentId:z.string().nullable(),deploymentUrl:z.string().nullable(),environmentName:z.string().nullable(),environmentTarget:z.string().nullable()}).meta({id:`VercelReleaseDestination`,title:`VercelReleaseDestination`,description:`Release destination metadata for a Vercel deployment.`}),cloudflareReleaseDestinationSchema=z.object({provider:z.literal(`cloudflare`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),versionId:z.string().nullable(),scriptName:z.string().nullable(),accountId:z.string().nullable(),deploymentUrl:z.string().nullable(),environmentName:z.string().nullable(),environmentTarget:z.string().nullable()}).meta({id:`CloudflareReleaseDestination`,title:`CloudflareReleaseDestination`,description:`Release destination metadata for a Cloudflare Workers deployment.`}),cliReleaseDestinationSchema=z.object({provider:z.literal(`cli`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),deploymentUrl:z.string().nullable()}).meta({id:`CliReleaseDestination`,title:`CliReleaseDestination`,description:`Release destination metadata from the Interfere CLI.`}),releaseDestinationMetadataSchema=z.discriminatedUnion(`provider`,[vercelReleaseDestinationSchema,cloudflareReleaseDestinationSchema,cliReleaseDestinationSchema]).meta({id:`ReleaseDestination`,title:`ReleaseDestination`}),releaseDestinationProviderSchema=z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ReleaseDestinationProvider`,title:`ReleaseDestinationProvider`}),configuredSourceProviderSchema=z.enum([`github`]).meta({id:`ConfiguredSourceProvider`,title:`ConfiguredSourceProvider`}),configuredDestinationProviderSchema=z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ConfiguredDestinationProvider`,title:`ConfiguredDestinationProvider`}),sourceProviderSchema=configuredSourceProviderSchema.meta({id:`SourceProvider`,title:`SourceProvider`}),destinationProviderSchema=z.enum([`vercel`,`cloudflare`]).meta({id:`DestinationProvider`,title:`DestinationProvider`}),releaseSourceIdEnvKeys=z.enum([`NEXT_PUBLIC_INTERFERE_BUILD_ID`,`INTERFERE_SOURCE_ID`,`NEXT_BUILD_ID`,...githubSourceIdEnvKeys,...cloudflareSourceIdEnvKeys]).options,releaseDestinationIdEnvKeys=z.enum([`NEXT_PUBLIC_INTERFERE_RELEASE_ID`,`INTERFERE_DESTINATION_ID`,...vercelDestinationIdEnvKeys,...cloudflareDestinationIdEnvKeys,...githubSourceIdEnvKeys]).options;export{cliReleaseDestinationSchema,cliReleaseSourceSchema,cloudflareReleaseDestinationSchema,configuredDestinationProviderSchema,configuredSourceProviderSchema,destinationProviderSchema,githubReleaseSourceSchema,releaseDestinationIdEnvKeys,releaseDestinationMetadataSchema,releaseDestinationProviderSchema,releaseSourceIdEnvKeys,releaseSourceMetadataSchema,releaseSourceProviderSchema,sourceProviderSchema,vercelReleaseDestinationSchema};
|
|
1
|
+
import{cloudflareDestinationIdEnvKeys,cloudflareSourceIdEnvKeys}from"./platforms/cloudflare.mjs";import{githubSourceIdEnvKeys}from"./platforms/github.mjs";import{vercelDestinationIdEnvKeys}from"./platforms/vercel.mjs";import{z}from"zod";const githubReleaseSourceSchema=z.object({provider:z.literal(`github`),commitMessage:z.string(),branch:z.string(),commitSha:z.string().nullable(),runnerName:z.string().nullable().optional(),runId:z.string().nullable().optional(),runUrl:z.string().nullable().optional()}).meta({id:`GithubReleaseSource`,title:`GithubReleaseSource`,description:`Release source metadata coming from GitHub.`}),cliReleaseSourceSchema=z.object({provider:z.literal(`cli`),commitSha:z.string().nullable(),commitRef:z.string().nullable(),commitMessage:z.string().nullable(),commitUrl:z.string().nullable(),runnerName:z.string().nullable(),runId:z.string().nullable(),runUrl:z.string().nullable(),environment:z.string().nullable().optional(),deploymentUrl:z.string().nullable().optional()}).meta({id:`CliReleaseSource`,title:`CliReleaseSource`,description:`Release source metadata from the Interfere CLI.`}),releaseSourceMetadataSchema=z.discriminatedUnion(`provider`,[githubReleaseSourceSchema,cliReleaseSourceSchema]).meta({id:`ReleaseSource`,title:`ReleaseSource`}),releaseSourceProviderSchema=z.enum([`github`,`cli`]).meta({id:`ReleaseSourceProvider`,title:`ReleaseSourceProvider`}),vercelReleaseDestinationSchema=z.object({provider:z.literal(`vercel`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),deploymentId:z.string().nullable(),deploymentUrl:z.string().nullable(),environmentName:z.string().nullable(),environmentTarget:z.string().nullable()}).meta({id:`VercelReleaseDestination`,title:`VercelReleaseDestination`,description:`Release destination metadata for a Vercel deployment.`}),cloudflareReleaseDestinationSchema=z.object({provider:z.literal(`cloudflare`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),versionId:z.string().nullable(),scriptName:z.string().nullable(),accountId:z.string().nullable(),deploymentUrl:z.string().nullable(),environmentName:z.string().nullable(),environmentTarget:z.string().nullable()}).meta({id:`CloudflareReleaseDestination`,title:`CloudflareReleaseDestination`,description:`Release destination metadata for a Cloudflare Workers deployment.`}),cliReleaseDestinationSchema=z.object({provider:z.literal(`cli`),destinationReleaseId:z.string().nullable(),environment:z.string().nullable(),deploymentUrl:z.string().nullable()}).meta({id:`CliReleaseDestination`,title:`CliReleaseDestination`,description:`Release destination metadata from the Interfere CLI.`}),releaseDestinationMetadataSchema=z.discriminatedUnion(`provider`,[vercelReleaseDestinationSchema,cloudflareReleaseDestinationSchema,cliReleaseDestinationSchema]).meta({id:`ReleaseDestination`,title:`ReleaseDestination`}),releaseDestinationProviderSchema=z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ReleaseDestinationProvider`,title:`ReleaseDestinationProvider`}),configuredSourceProviderSchema=z.enum([`github`,`ghe_cloud`,`ghe_server`]).meta({id:`ConfiguredSourceProvider`,title:`ConfiguredSourceProvider`}),configuredDestinationProviderSchema=z.enum([`vercel`,`cloudflare`,`cli`]).meta({id:`ConfiguredDestinationProvider`,title:`ConfiguredDestinationProvider`}),sourceProviderSchema=configuredSourceProviderSchema.meta({id:`SourceProvider`,title:`SourceProvider`}),destinationProviderSchema=z.enum([`vercel`,`cloudflare`]).meta({id:`DestinationProvider`,title:`DestinationProvider`}),releaseSourceIdEnvKeys=z.enum([`NEXT_PUBLIC_INTERFERE_BUILD_ID`,`INTERFERE_SOURCE_ID`,`NEXT_BUILD_ID`,...githubSourceIdEnvKeys,...cloudflareSourceIdEnvKeys]).options,releaseDestinationIdEnvKeys=z.enum([`NEXT_PUBLIC_INTERFERE_RELEASE_ID`,`INTERFERE_DESTINATION_ID`,...vercelDestinationIdEnvKeys,...cloudflareDestinationIdEnvKeys,...githubSourceIdEnvKeys]).options;export{cliReleaseDestinationSchema,cliReleaseSourceSchema,cloudflareReleaseDestinationSchema,configuredDestinationProviderSchema,configuredSourceProviderSchema,destinationProviderSchema,githubReleaseSourceSchema,releaseDestinationIdEnvKeys,releaseDestinationMetadataSchema,releaseDestinationProviderSchema,releaseSourceIdEnvKeys,releaseSourceMetadataSchema,releaseSourceProviderSchema,sourceProviderSchema,vercelReleaseDestinationSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const HOST_REGEX=/^https
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const HOST_REGEX=/^https?:\/\//u,PATH_REGEX=/\/.*$/u,githubSourceIdEnvKeys=zod.z.enum([`VERCEL_GIT_COMMIT_SHA`,`GITHUB_SHA`]).options,githubHostFlavorSchema=zod.z.enum([`github_com`,`ghe_cloud`,`ghe_server`]),GITHUB_COM_HOST=`github.com`,GITHUB_COM_API_BASE_URL=`https://api.github.com`,GITHUB_COM_WEB_BASE_URL=`https://github.com`,githubMetadata=zod.z.object({accountType:zod.z.string(),avatarUrl:zod.z.string().nullable().default(null),repositories:zod.z.record(zod.z.string(),zod.z.string()),installationUrl:zod.z.string().nullable(),host:zod.z.string().default(GITHUB_COM_HOST),flavor:githubHostFlavorSchema.default(`github_com`)}),githubIntegration=zod.z.object({name:zod.z.literal(`github`),metadata:githubMetadata}),gheCloudIntegration=zod.z.object({name:zod.z.literal(`ghe_cloud`),metadata:githubMetadata}),gheServerIntegration=zod.z.object({name:zod.z.literal(`ghe_server`),metadata:githubMetadata}),githubFamilyProviders=[githubIntegration.shape.name.value,gheCloudIntegration.shape.name.value,gheServerIntegration.shape.name.value],PROVIDER_FLAVOR={github:`github_com`,ghe_cloud:`ghe_cloud`,ghe_server:`ghe_server`};function normalizeGithubHost(host){return host.trim().toLowerCase().replace(HOST_REGEX,``).replace(PATH_REGEX,``)}function detectGithubHostFlavor(host){let normalized=normalizeGithubHost(host);return normalized===`github.com`?`github_com`:normalized.endsWith(`.ghe.com`)?`ghe_cloud`:`ghe_server`}function providerFromHost(host){let flavor=detectGithubHostFlavor(normalizeGithubHost(host));return flavor===`github_com`?`github`:flavor}const HOST_URL_RESOLVERS={github_com:()=>({host:GITHUB_COM_HOST,flavor:`github_com`,apiBaseUrl:GITHUB_COM_API_BASE_URL,webBaseUrl:GITHUB_COM_WEB_BASE_URL}),ghe_cloud:host=>({host,flavor:`ghe_cloud`,apiBaseUrl:`https://api.${host}`,webBaseUrl:`https://${host}`}),ghe_server:host=>({host,flavor:`ghe_server`,apiBaseUrl:`https://${host}/api/v3`,webBaseUrl:`https://${host}`})};function resolveGithubHostUrls(input){let host=normalizeGithubHost(input.host),flavor=input.flavor??detectGithubHostFlavor(host);return HOST_URL_RESOLVERS[flavor](host)}exports.GITHUB_COM_API_BASE_URL=GITHUB_COM_API_BASE_URL,exports.GITHUB_COM_HOST=GITHUB_COM_HOST,exports.GITHUB_COM_WEB_BASE_URL=GITHUB_COM_WEB_BASE_URL,exports.PROVIDER_FLAVOR=PROVIDER_FLAVOR,exports.detectGithubHostFlavor=detectGithubHostFlavor,exports.gheCloudIntegration=gheCloudIntegration,exports.gheServerIntegration=gheServerIntegration,exports.githubFamilyProviders=githubFamilyProviders,exports.githubHostFlavorSchema=githubHostFlavorSchema,exports.githubIntegration=githubIntegration,exports.githubSourceIdEnvKeys=githubSourceIdEnvKeys,exports.normalizeGithubHost=normalizeGithubHost,exports.providerFromHost=providerFromHost,exports.resolveGithubHostUrls=resolveGithubHostUrls;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const HOST_REGEX=/^https
|
|
1
|
+
import{z}from"zod";const HOST_REGEX=/^https?:\/\//u,PATH_REGEX=/\/.*$/u,githubSourceIdEnvKeys=z.enum([`VERCEL_GIT_COMMIT_SHA`,`GITHUB_SHA`]).options,githubHostFlavorSchema=z.enum([`github_com`,`ghe_cloud`,`ghe_server`]),GITHUB_COM_HOST=`github.com`,GITHUB_COM_API_BASE_URL=`https://api.github.com`,GITHUB_COM_WEB_BASE_URL=`https://github.com`,githubMetadata=z.object({accountType:z.string(),avatarUrl:z.string().nullable().default(null),repositories:z.record(z.string(),z.string()),installationUrl:z.string().nullable(),host:z.string().default(GITHUB_COM_HOST),flavor:githubHostFlavorSchema.default(`github_com`)}),githubIntegration=z.object({name:z.literal(`github`),metadata:githubMetadata}),gheCloudIntegration=z.object({name:z.literal(`ghe_cloud`),metadata:githubMetadata}),gheServerIntegration=z.object({name:z.literal(`ghe_server`),metadata:githubMetadata}),githubFamilyProviders=[githubIntegration.shape.name.value,gheCloudIntegration.shape.name.value,gheServerIntegration.shape.name.value],PROVIDER_FLAVOR={github:`github_com`,ghe_cloud:`ghe_cloud`,ghe_server:`ghe_server`};function normalizeGithubHost(host){return host.trim().toLowerCase().replace(HOST_REGEX,``).replace(PATH_REGEX,``)}function detectGithubHostFlavor(host){let normalized=normalizeGithubHost(host);return normalized===`github.com`?`github_com`:normalized.endsWith(`.ghe.com`)?`ghe_cloud`:`ghe_server`}function providerFromHost(host){let flavor=detectGithubHostFlavor(normalizeGithubHost(host));return flavor===`github_com`?`github`:flavor}const HOST_URL_RESOLVERS={github_com:()=>({host:GITHUB_COM_HOST,flavor:`github_com`,apiBaseUrl:GITHUB_COM_API_BASE_URL,webBaseUrl:GITHUB_COM_WEB_BASE_URL}),ghe_cloud:host=>({host,flavor:`ghe_cloud`,apiBaseUrl:`https://api.${host}`,webBaseUrl:`https://${host}`}),ghe_server:host=>({host,flavor:`ghe_server`,apiBaseUrl:`https://${host}/api/v3`,webBaseUrl:`https://${host}`})};function resolveGithubHostUrls(input){let host=normalizeGithubHost(input.host),flavor=input.flavor??detectGithubHostFlavor(host);return HOST_URL_RESOLVERS[flavor](host)}export{GITHUB_COM_API_BASE_URL,GITHUB_COM_HOST,GITHUB_COM_WEB_BASE_URL,PROVIDER_FLAVOR,detectGithubHostFlavor,gheCloudIntegration,gheServerIntegration,githubFamilyProviders,githubHostFlavorSchema,githubIntegration,githubSourceIdEnvKeys,normalizeGithubHost,providerFromHost,resolveGithubHostUrls};
|
package/dist/releases/slug.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const SLUG_PREFIX=`rel_`,releaseSlugSchema=zod.z.templateLiteral([SLUG_PREFIX,zod.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)}`)}exports.LOCAL_DEV_RELEASE_SLUG=LOCAL_DEV_RELEASE_SLUG,exports.deriveReleaseSlug=deriveReleaseSlug,exports.releaseSlugSchema=releaseSlugSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const SLUG_PREFIX=`rel_`,releaseSlugSchema=zod.z.templateLiteral([SLUG_PREFIX,zod.z.string().regex(/^[0-9a-f]{16}$/u)]).brand(),LOCAL_DEV_RELEASE_SLUG=releaseSlugSchema.parse(`rel_0000000000000000`);function deriveReleaseSlug(commitSha){return releaseSlugSchema.parse(`${SLUG_PREFIX}${commitSha.toLowerCase().slice(0,16)}`)}exports.LOCAL_DEV_RELEASE_SLUG=LOCAL_DEV_RELEASE_SLUG,exports.deriveReleaseSlug=deriveReleaseSlug,exports.releaseSlugSchema=releaseSlugSchema;
|
package/dist/releases/slug.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
//#region src/releases/slug.d.ts
|
|
3
3
|
declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
4
|
type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
-
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z
|
|
5
|
+
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
6
6
|
/**
|
|
7
7
|
* Derives a release slug from a commit SHA. Both ends of the wire — the
|
|
8
8
|
* build step that stamps the slug into the bundle, and any server-side
|
package/dist/releases/slug.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
//#region src/releases/slug.d.ts
|
|
3
3
|
declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
4
|
type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
-
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z
|
|
5
|
+
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
6
6
|
/**
|
|
7
7
|
* Derives a release slug from a commit SHA. Both ends of the wire — the
|
|
8
8
|
* build step that stamps the slug into the bundle, and any server-side
|
package/dist/releases/slug.mjs
CHANGED
|
@@ -1 +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};
|
|
1
|
+
import{z}from"zod";const SLUG_PREFIX=`rel_`,releaseSlugSchema=z.templateLiteral([SLUG_PREFIX,z.string().regex(/^[0-9a-f]{16}$/u)]).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};
|
|
@@ -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 `);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))}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_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,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}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,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.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,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.`]}),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_PREFIXES=API_KEY_PREFIXES,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 `);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))}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_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,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}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,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.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,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.`]}),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={AUTH_MISSING:`API_KEY_UNREADABLE`,AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,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_PREFIXES=API_KEY_PREFIXES,exports.classifyReleasePipelineError=classifyReleasePipelineError,exports.diagnoseRelease=diagnoseRelease,exports.formatApiKeyPreview=formatApiKeyPreview,exports.isInterfereApiKey=isInterfereApiKey;
|
|
@@ -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 `);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))}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_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,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}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,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.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,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.`]}),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_PREFIXES,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 `);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))}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_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,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}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,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.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,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.`]}),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={AUTH_MISSING:`API_KEY_UNREADABLE`,AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,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_PREFIXES,classifyReleasePipelineError,diagnoseRelease,formatApiKeyPreview,isInterfereApiKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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;
|
|
2
|
+
`);var DeployEnvironmentError=class extends Error{name=`DeployEnvironmentError`};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;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
|
|
2
2
|
//#region src/sdk/deploy-environment.d.ts
|
|
3
3
|
declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
-
declare class DeployEnvironmentError extends Error {
|
|
4
|
+
declare class DeployEnvironmentError extends Error {
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
5
7
|
declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
6
8
|
declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): ReleaseDestinationMetadata;
|
|
7
9
|
//#endregion
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
|
|
2
2
|
//#region src/sdk/deploy-environment.d.ts
|
|
3
3
|
declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
-
declare class DeployEnvironmentError extends Error {
|
|
4
|
+
declare class DeployEnvironmentError extends Error {
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
5
7
|
declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
6
8
|
declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): ReleaseDestinationMetadata;
|
|
7
9
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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
|
+
`),DEPLOY_ENVIRONMENT_MAX_LENGTH=32;var DeployEnvironmentError=class extends Error{name=`DeployEnvironmentError`};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};
|
package/dist/sdk/errors.cjs
CHANGED
|
@@ -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`,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`,routeHandler:`auto.function.nextjs.route_handler`,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)
|
|
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).
|
|
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`,routeHandler:`auto.function.nextjs.route_handler`,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):\/\//u;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/u;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+(?<name>[^\s(]+)(?:\s+\((?<fileName>[^\s:)]+):(?<line>\d+)(?::(?<column>\d+))?\))?/u;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).toSorted();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;
|
package/dist/sdk/errors.mjs
CHANGED
|
@@ -1,2 +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`,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`,routeHandler:`auto.function.nextjs.route_handler`,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)
|
|
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).
|
|
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`,routeHandler:`auto.function.nextjs.route_handler`,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):\/\//u;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/u;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+(?<name>[^\s(]+)(?:\s+\((?<fileName>[^\s:)]+):(?<line>\d+)(?::(?<column>\d+))?\))?/u;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).toSorted();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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_integrations_index=require("../integrations/index.cjs"),require_sdk_env=require("./env.cjs");function resolveReleaseCommitSha(env,runGit){return require_sdk_env.readFirstEnvValue(env,require_integrations_index.releaseSourceIdEnvKeys)??runGit(`git rev-parse HEAD`)}function resolveGithubReleaseSource(env,runGit){return{provider:`github`,branch:require_sdk_env.parseEnvValue(env.VERCEL_GIT_COMMIT_REF)??require_sdk_env.parseEnvValue(env.GITHUB_REF_NAME)??require_sdk_env.parseEnvValue(env.GITHUB_HEAD_REF)??runGit(`git rev-parse --abbrev-ref HEAD`)??`unknown`,commitMessage:require_sdk_env.parseEnvValue(env.VERCEL_GIT_COMMIT_MESSAGE)??runGit(`git log -1 --pretty=%B`)??``,commitSha:resolveReleaseCommitSha(env,runGit)}}exports.resolveGithubReleaseSource=resolveGithubReleaseSource,exports.resolveReleaseCommitSha=resolveReleaseCommitSha;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReleaseSourceMetadata } from "../integrations/index.cjs";
|
|
2
|
+
//#region src/sdk/github-source.d.ts
|
|
3
|
+
type GithubReleaseSource = Extract<ReleaseSourceMetadata, {
|
|
4
|
+
provider: "github";
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Runs a git command, returning `null` when git is unavailable. Injected
|
|
8
|
+
* rather than imported so this module stays free of `node:child_process` —
|
|
9
|
+
* it is reachable from bundles that never run in Node.
|
|
10
|
+
*/
|
|
11
|
+
type RunGitCommand = (command: string) => string | null;
|
|
12
|
+
/**
|
|
13
|
+
* The single answer to "what commit is this build?". The release slug and
|
|
14
|
+
* `source_metadata.commitSha` must resolve identically or the release
|
|
15
|
+
* registers with a working slug and a null ref, and every source tool 404s
|
|
16
|
+
* against it for the life of that release (ENG-3303).
|
|
17
|
+
*/
|
|
18
|
+
declare function resolveReleaseCommitSha(env: Record<string, string | undefined>, runGit: RunGitCommand): string | null;
|
|
19
|
+
declare function resolveGithubReleaseSource(env: Record<string, string | undefined>, runGit: RunGitCommand): GithubReleaseSource;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { RunGitCommand, resolveGithubReleaseSource, resolveReleaseCommitSha };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReleaseSourceMetadata } from "../integrations/index.mjs";
|
|
2
|
+
//#region src/sdk/github-source.d.ts
|
|
3
|
+
type GithubReleaseSource = Extract<ReleaseSourceMetadata, {
|
|
4
|
+
provider: "github";
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Runs a git command, returning `null` when git is unavailable. Injected
|
|
8
|
+
* rather than imported so this module stays free of `node:child_process` —
|
|
9
|
+
* it is reachable from bundles that never run in Node.
|
|
10
|
+
*/
|
|
11
|
+
type RunGitCommand = (command: string) => string | null;
|
|
12
|
+
/**
|
|
13
|
+
* The single answer to "what commit is this build?". The release slug and
|
|
14
|
+
* `source_metadata.commitSha` must resolve identically or the release
|
|
15
|
+
* registers with a working slug and a null ref, and every source tool 404s
|
|
16
|
+
* against it for the life of that release (ENG-3303).
|
|
17
|
+
*/
|
|
18
|
+
declare function resolveReleaseCommitSha(env: Record<string, string | undefined>, runGit: RunGitCommand): string | null;
|
|
19
|
+
declare function resolveGithubReleaseSource(env: Record<string, string | undefined>, runGit: RunGitCommand): GithubReleaseSource;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { RunGitCommand, resolveGithubReleaseSource, resolveReleaseCommitSha };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{releaseSourceIdEnvKeys}from"../integrations/index.mjs";import{parseEnvValue,readFirstEnvValue}from"./env.mjs";function resolveReleaseCommitSha(env,runGit){return readFirstEnvValue(env,releaseSourceIdEnvKeys)??runGit(`git rev-parse HEAD`)}function resolveGithubReleaseSource(env,runGit){return{provider:`github`,branch:parseEnvValue(env.VERCEL_GIT_COMMIT_REF)??parseEnvValue(env.GITHUB_REF_NAME)??parseEnvValue(env.GITHUB_HEAD_REF)??runGit(`git rev-parse --abbrev-ref HEAD`)??`unknown`,commitMessage:parseEnvValue(env.VERCEL_GIT_COMMIT_MESSAGE)??runGit(`git log -1 --pretty=%B`)??``,commitSha:resolveReleaseCommitSha(env,runGit)}}export{resolveGithubReleaseSource,resolveReleaseCommitSha};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),exports.API_URL_GLOBAL=`__INTERFERE_API_URL__`,exports.ENVIRONMENT_GLOBAL=`__INTERFERE_ENVIRONMENT__`,exports.FORCE_ENABLE_GLOBAL=`__INTERFERE_FORCE_ENABLE__`,exports.INGEST_URL_GLOBAL=`__INTERFERE_INGEST_URL__`,exports.PUBLIC_KEY_GLOBAL=`__INTERFERE_PUBLIC_KEY__`,exports.RELEASE_SLUG_GLOBAL=`__INTERFERE_RELEASE_SLUG__`,exports.SDK_STACK_GLOBAL=`__INTERFERE_SDK_STACK__`;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),exports.API_URL_GLOBAL=`__INTERFERE_API_URL__`,exports.BUILD_MARKER_GLOBAL=`__INTERFERE_BUILD__`,exports.ENVIRONMENT_GLOBAL=`__INTERFERE_ENVIRONMENT__`,exports.FORCE_ENABLE_GLOBAL=`__INTERFERE_FORCE_ENABLE__`,exports.INGEST_URL_GLOBAL=`__INTERFERE_INGEST_URL__`,exports.PUBLIC_KEY_GLOBAL=`__INTERFERE_PUBLIC_KEY__`,exports.RELEASE_SLUG_GLOBAL=`__INTERFERE_RELEASE_SLUG__`,exports.SDK_STACK_GLOBAL=`__INTERFERE_SDK_STACK__`;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/sdk/injected-globals.d.ts
|
|
2
2
|
declare const API_URL_GLOBAL = "__INTERFERE_API_URL__";
|
|
3
|
+
declare const BUILD_MARKER_GLOBAL = "__INTERFERE_BUILD__";
|
|
3
4
|
declare const ENVIRONMENT_GLOBAL = "__INTERFERE_ENVIRONMENT__";
|
|
4
5
|
declare const FORCE_ENABLE_GLOBAL = "__INTERFERE_FORCE_ENABLE__";
|
|
5
6
|
declare const INGEST_URL_GLOBAL = "__INTERFERE_INGEST_URL__";
|
|
@@ -7,4 +8,4 @@ declare const PUBLIC_KEY_GLOBAL = "__INTERFERE_PUBLIC_KEY__";
|
|
|
7
8
|
declare const RELEASE_SLUG_GLOBAL = "__INTERFERE_RELEASE_SLUG__";
|
|
8
9
|
declare const SDK_STACK_GLOBAL = "__INTERFERE_SDK_STACK__";
|
|
9
10
|
//#endregion
|
|
10
|
-
export { API_URL_GLOBAL, ENVIRONMENT_GLOBAL, FORCE_ENABLE_GLOBAL, INGEST_URL_GLOBAL, PUBLIC_KEY_GLOBAL, RELEASE_SLUG_GLOBAL, SDK_STACK_GLOBAL };
|
|
11
|
+
export { API_URL_GLOBAL, BUILD_MARKER_GLOBAL, ENVIRONMENT_GLOBAL, FORCE_ENABLE_GLOBAL, INGEST_URL_GLOBAL, PUBLIC_KEY_GLOBAL, RELEASE_SLUG_GLOBAL, SDK_STACK_GLOBAL };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/sdk/injected-globals.d.ts
|
|
2
2
|
declare const API_URL_GLOBAL = "__INTERFERE_API_URL__";
|
|
3
|
+
declare const BUILD_MARKER_GLOBAL = "__INTERFERE_BUILD__";
|
|
3
4
|
declare const ENVIRONMENT_GLOBAL = "__INTERFERE_ENVIRONMENT__";
|
|
4
5
|
declare const FORCE_ENABLE_GLOBAL = "__INTERFERE_FORCE_ENABLE__";
|
|
5
6
|
declare const INGEST_URL_GLOBAL = "__INTERFERE_INGEST_URL__";
|
|
@@ -7,4 +8,4 @@ declare const PUBLIC_KEY_GLOBAL = "__INTERFERE_PUBLIC_KEY__";
|
|
|
7
8
|
declare const RELEASE_SLUG_GLOBAL = "__INTERFERE_RELEASE_SLUG__";
|
|
8
9
|
declare const SDK_STACK_GLOBAL = "__INTERFERE_SDK_STACK__";
|
|
9
10
|
//#endregion
|
|
10
|
-
export { API_URL_GLOBAL, ENVIRONMENT_GLOBAL, FORCE_ENABLE_GLOBAL, INGEST_URL_GLOBAL, PUBLIC_KEY_GLOBAL, RELEASE_SLUG_GLOBAL, SDK_STACK_GLOBAL };
|
|
11
|
+
export { API_URL_GLOBAL, BUILD_MARKER_GLOBAL, ENVIRONMENT_GLOBAL, FORCE_ENABLE_GLOBAL, INGEST_URL_GLOBAL, PUBLIC_KEY_GLOBAL, RELEASE_SLUG_GLOBAL, SDK_STACK_GLOBAL };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const API_URL_GLOBAL=`__INTERFERE_API_URL__`,ENVIRONMENT_GLOBAL=`__INTERFERE_ENVIRONMENT__`,FORCE_ENABLE_GLOBAL=`__INTERFERE_FORCE_ENABLE__`,INGEST_URL_GLOBAL=`__INTERFERE_INGEST_URL__`,PUBLIC_KEY_GLOBAL=`__INTERFERE_PUBLIC_KEY__`,RELEASE_SLUG_GLOBAL=`__INTERFERE_RELEASE_SLUG__`,SDK_STACK_GLOBAL=`__INTERFERE_SDK_STACK__`;export{API_URL_GLOBAL,ENVIRONMENT_GLOBAL,FORCE_ENABLE_GLOBAL,INGEST_URL_GLOBAL,PUBLIC_KEY_GLOBAL,RELEASE_SLUG_GLOBAL,SDK_STACK_GLOBAL};
|
|
1
|
+
const API_URL_GLOBAL=`__INTERFERE_API_URL__`,BUILD_MARKER_GLOBAL=`__INTERFERE_BUILD__`,ENVIRONMENT_GLOBAL=`__INTERFERE_ENVIRONMENT__`,FORCE_ENABLE_GLOBAL=`__INTERFERE_FORCE_ENABLE__`,INGEST_URL_GLOBAL=`__INTERFERE_INGEST_URL__`,PUBLIC_KEY_GLOBAL=`__INTERFERE_PUBLIC_KEY__`,RELEASE_SLUG_GLOBAL=`__INTERFERE_RELEASE_SLUG__`,SDK_STACK_GLOBAL=`__INTERFERE_SDK_STACK__`;export{API_URL_GLOBAL,BUILD_MARKER_GLOBAL,ENVIRONMENT_GLOBAL,FORCE_ENABLE_GLOBAL,INGEST_URL_GLOBAL,PUBLIC_KEY_GLOBAL,RELEASE_SLUG_GLOBAL,SDK_STACK_GLOBAL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const LOG_SOURCING_ENV_VAR=`INTERFERE_LOG_SOURCING`,LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=zod.z.enum([`sdk`,`drain`]);function resolveLogSourcingMode(opts){let injected=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.env?.[LOG_SOURCING_ENV_VAR]));return fromEnv.success?fromEnv.data:`sdk`}function readLogSourcingMode(env=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const LOG_SOURCING_ENV_VAR=`INTERFERE_LOG_SOURCING`,LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=zod.z.enum([`sdk`,`drain`]);function resolveLogSourcingMode(opts){let injected=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.env?.[LOG_SOURCING_ENV_VAR]));return fromEnv.success?fromEnv.data:`sdk`}function readLogSourcingMode(env=require_sdk_runtime.readProcessEnv()){let injected=globalThis[LOG_SOURCING_GLOBAL];return resolveLogSourcingMode({injected:typeof injected==`string`?injected:void 0,env})}exports.DEFAULT_LOG_SOURCING_MODE=`sdk`,exports.LOG_SOURCING_ENV_VAR=LOG_SOURCING_ENV_VAR,exports.LOG_SOURCING_GLOBAL=LOG_SOURCING_GLOBAL,exports.logSourcingModeSchema=logSourcingModeSchema,exports.readLogSourcingMode=readLogSourcingMode,exports.resolveLogSourcingMode=resolveLogSourcingMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv}from"./runtime.mjs";import{z}from"zod";const LOG_SOURCING_ENV_VAR=`INTERFERE_LOG_SOURCING`,LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=z.enum([`sdk`,`drain`]),DEFAULT_LOG_SOURCING_MODE=`sdk`;function resolveLogSourcingMode(opts){let injected=logSourcingModeSchema.safeParse(normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=logSourcingModeSchema.safeParse(normalizeEnv(opts?.env?.[LOG_SOURCING_ENV_VAR]));return fromEnv.success?fromEnv.data:`sdk`}function readLogSourcingMode(env=
|
|
1
|
+
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const LOG_SOURCING_ENV_VAR=`INTERFERE_LOG_SOURCING`,LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=z.enum([`sdk`,`drain`]),DEFAULT_LOG_SOURCING_MODE=`sdk`;function resolveLogSourcingMode(opts){let injected=logSourcingModeSchema.safeParse(normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=logSourcingModeSchema.safeParse(normalizeEnv(opts?.env?.[LOG_SOURCING_ENV_VAR]));return fromEnv.success?fromEnv.data:`sdk`}function readLogSourcingMode(env=readProcessEnv()){let injected=globalThis[LOG_SOURCING_GLOBAL];return resolveLogSourcingMode({injected:typeof injected==`string`?injected:void 0,env})}export{DEFAULT_LOG_SOURCING_MODE,LOG_SOURCING_ENV_VAR,LOG_SOURCING_GLOBAL,logSourcingModeSchema,readLogSourcingMode,resolveLogSourcingMode};
|
package/dist/sdk/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const envSchema=zod.z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=zod.z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const envSchema=zod.z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=zod.z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`}),globalScope=globalThis;function readProcessEnv(){return globalScope.process?.env}function inferRuntime(options){return globalScope.window!==void 0&&globalScope.document!==void 0&&globalScope.navigator!==void 0?`browser`:typeof globalScope.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof globalScope.process?.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}exports.DEFAULT_ENVIRONMENT=DEFAULT_ENVIRONMENT,exports.envSchema=envSchema,exports.inferRuntime=inferRuntime,exports.normalizeEnv=normalizeEnv,exports.readProcessEnv=readProcessEnv,exports.resolveEnvironment=resolveEnvironment,exports.runtimeSchema=runtimeSchema;
|
package/dist/sdk/runtime.d.cts
CHANGED
|
@@ -31,9 +31,14 @@ declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
|
|
|
31
31
|
node: "node";
|
|
32
32
|
}>>;
|
|
33
33
|
type Runtime = z.infer<typeof runtimeSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* `process.env` when the runtime provides it, `undefined` otherwise. Accessed
|
|
36
|
+
* structurally via `globalThis` so callers never need `@types/node`.
|
|
37
|
+
*/
|
|
38
|
+
declare function readProcessEnv(): Record<string, string | undefined> | undefined;
|
|
34
39
|
declare function inferRuntime(options?: {
|
|
35
40
|
readonly nextRuntime?: unknown;
|
|
36
41
|
}): Runtime;
|
|
37
42
|
declare function normalizeEnv(value: unknown): string | null;
|
|
38
43
|
//#endregion
|
|
39
|
-
export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
|
|
44
|
+
export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, readProcessEnv, resolveEnvironment, runtimeSchema };
|
package/dist/sdk/runtime.d.mts
CHANGED
|
@@ -31,9 +31,14 @@ declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
|
|
|
31
31
|
node: "node";
|
|
32
32
|
}>>;
|
|
33
33
|
type Runtime = z.infer<typeof runtimeSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* `process.env` when the runtime provides it, `undefined` otherwise. Accessed
|
|
36
|
+
* structurally via `globalThis` so callers never need `@types/node`.
|
|
37
|
+
*/
|
|
38
|
+
declare function readProcessEnv(): Record<string, string | undefined> | undefined;
|
|
34
39
|
declare function inferRuntime(options?: {
|
|
35
40
|
readonly nextRuntime?: unknown;
|
|
36
41
|
}): Runtime;
|
|
37
42
|
declare function normalizeEnv(value: unknown): string | null;
|
|
38
43
|
//#endregion
|
|
39
|
-
export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
|
|
44
|
+
export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, readProcessEnv, resolveEnvironment, runtimeSchema };
|
package/dist/sdk/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const envSchema=z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return
|
|
1
|
+
import{z}from"zod";const envSchema=z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`}),globalScope=globalThis;function readProcessEnv(){return globalScope.process?.env}function inferRuntime(options){return globalScope.window!==void 0&&globalScope.document!==void 0&&globalScope.navigator!==void 0?`browser`:typeof globalScope.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof globalScope.process?.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}export{DEFAULT_ENVIRONMENT,envSchema,inferRuntime,normalizeEnv,readProcessEnv,resolveEnvironment,runtimeSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const SERVER_TRACING_ENV_VAR=`INTERFERE_SERVER_TRACING`,SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracingMode(opts){let injected=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.env?.[SERVER_TRACING_ENV_VAR]));return fromEnv.success?fromEnv.data:DEFAULT_SERVER_TRACING_MODE}function readServerTracingMode(env=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const SERVER_TRACING_ENV_VAR=`INTERFERE_SERVER_TRACING`,SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracingMode(opts){let injected=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.env?.[SERVER_TRACING_ENV_VAR]));return fromEnv.success?fromEnv.data:DEFAULT_SERVER_TRACING_MODE}function readServerTracingMode(env=require_sdk_runtime.readProcessEnv()){let injected=globalThis[SERVER_TRACING_GLOBAL];return resolveServerTracingMode({injected:typeof injected==`string`?injected:void 0,env})}exports.DEFAULT_SERVER_TRACING_MODE=DEFAULT_SERVER_TRACING_MODE,exports.SERVER_TRACING_ENV_VAR=SERVER_TRACING_ENV_VAR,exports.SERVER_TRACING_GLOBAL=SERVER_TRACING_GLOBAL,exports.readServerTracingMode=readServerTracingMode,exports.resolveServerTracingMode=resolveServerTracingMode,exports.serverTracingModeSchema=serverTracingModeSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv}from"./runtime.mjs";import{z}from"zod";const SERVER_TRACING_ENV_VAR=`INTERFERE_SERVER_TRACING`,SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracingMode(opts){let injected=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=serverTracingModeSchema.safeParse(normalizeEnv(opts?.env?.[SERVER_TRACING_ENV_VAR]));return fromEnv.success?fromEnv.data:DEFAULT_SERVER_TRACING_MODE}function readServerTracingMode(env=
|
|
1
|
+
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const SERVER_TRACING_ENV_VAR=`INTERFERE_SERVER_TRACING`,SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracingMode(opts){let injected=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected));if(injected.success)return injected.data;let fromEnv=serverTracingModeSchema.safeParse(normalizeEnv(opts?.env?.[SERVER_TRACING_ENV_VAR]));return fromEnv.success?fromEnv.data:DEFAULT_SERVER_TRACING_MODE}function readServerTracingMode(env=readProcessEnv()){let injected=globalThis[SERVER_TRACING_GLOBAL];return resolveServerTracingMode({injected:typeof injected==`string`?injected:void 0,env})}export{DEFAULT_SERVER_TRACING_MODE,SERVER_TRACING_ENV_VAR,SERVER_TRACING_GLOBAL,readServerTracingMode,resolveServerTracingMode,serverTracingModeSchema};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"observability",
|
|
8
|
-
"
|
|
8
|
+
"typescript",
|
|
9
9
|
"logging"
|
|
10
10
|
],
|
|
11
11
|
"homepage": "https://interfere.com",
|
|
@@ -146,19 +146,19 @@
|
|
|
146
146
|
"scripts": {
|
|
147
147
|
"build": "tsdown",
|
|
148
148
|
"test": "vitest run",
|
|
149
|
-
"typecheck": "
|
|
149
|
+
"typecheck": "tsc --noEmit"
|
|
150
150
|
},
|
|
151
151
|
"dependencies": {
|
|
152
152
|
"zod": "^4.4.3"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
|
-
"@interfere/sdk": "^11.0
|
|
156
|
-
"@interfere/test-utils": "^9.0
|
|
157
|
-
"@interfere/typescript-config": "^9.0.
|
|
158
|
-
"@types/node": "^26.
|
|
159
|
-
"@
|
|
160
|
-
"@vitest/coverage-v8": "4.1.9",
|
|
155
|
+
"@interfere/sdk": "^11.1.0",
|
|
156
|
+
"@interfere/test-utils": "^9.1.0",
|
|
157
|
+
"@interfere/typescript-config": "^9.0.2",
|
|
158
|
+
"@types/node": "^26.2.0",
|
|
159
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
161
160
|
"tsdown": "^0.22.2",
|
|
162
|
-
"
|
|
161
|
+
"typescript": "^7.0.2",
|
|
162
|
+
"vitest": "4.1.10"
|
|
163
163
|
}
|
|
164
164
|
}
|