@interfere/types 9.0.3-canary.4 → 10.0.0-canary.6
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/README.md +2 -2
- package/dist/data/source-maps.cjs +1 -1
- package/dist/data/source-maps.d.cts +35 -1
- package/dist/data/source-maps.d.mts +35 -1
- package/dist/data/source-maps.mjs +1 -1
- package/dist/sdk/errors.cjs +1 -1
- package/dist/sdk/errors.d.cts +1 -0
- package/dist/sdk/errors.d.mts +1 -0
- package/dist/sdk/errors.mjs +1 -1
- package/dist/sdk/identify.cjs +1 -1
- package/dist/sdk/identify.mjs +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://interfere.com">
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img src="https://
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://images.interfere.com/cdn-cgi/imagedelivery/ZQ3TDZdJHXvYNyL5BNulpQ/v2/header/logo-dark/format=auto">
|
|
5
|
+
<img src="https://images.interfere.com/cdn-cgi/imagedelivery/ZQ3TDZdJHXvYNyL5BNulpQ/v2/header/logo-light/format=auto" height="64" alt="Interfere">
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
8
|
<h1 align="center">@interfere/types</h1>
|
|
@@ -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`});exports.completeSourceMapFile=completeSourceMapFile,exports.completeSourceMapsRequest=completeSourceMapsRequest,exports.completeSourceMapsResponse=completeSourceMapsResponse,exports.manifestBundlerSchema=manifestBundlerSchema,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
|
+
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-]+$/;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*$/,SPEC_LAST_DEBUG_ID_RE=/\/\/# debugId=([a-fA-F0-9-]+)(?![\s\S]*\/\/# debugId=)/m,RUNTIME_DEBUG_ID_RE=/(_debugIds\[[^\]]*\]=")[a-fA-F0-9-]+(")/g;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;
|
|
@@ -146,5 +146,39 @@ declare const completeSourceMapsResponse: z.ZodObject<{
|
|
|
146
146
|
fileCount: z.ZodNumber;
|
|
147
147
|
}, z.core.$strip>;
|
|
148
148
|
type CompleteSourceMapsResponse = z.infer<typeof completeSourceMapsResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Self-registering snippet appended to a built JS chunk so the runtime
|
|
151
|
+
* can recover the chunk's `debugId` from a live `Error().stack`. Mirrors
|
|
152
|
+
* Sentry's `debugIdInjectionSnippet` but keys the global as `_debugIds`
|
|
153
|
+
* (the TC39 / turbopack-native name) so the SDK's reader picks up both
|
|
154
|
+
* our injected chunks and bundlers that emit the global natively.
|
|
155
|
+
*
|
|
156
|
+
* Appended (never prepended) so it lands past the source map's mapped
|
|
157
|
+
* region and cannot shift original line positions.
|
|
158
|
+
*/
|
|
159
|
+
declare function debugIdRuntimeSnippet(debugId: string): string;
|
|
160
|
+
/**
|
|
161
|
+
* Reads an existing `//# debugId=…` comment from the bundle source.
|
|
162
|
+
* Returns `null` when no debug ID comment is present — the caller is
|
|
163
|
+
* expected to generate and inject one.
|
|
164
|
+
*/
|
|
165
|
+
declare function readDebugIdFromJs(content: string): string | null;
|
|
166
|
+
/**
|
|
167
|
+
* Inserts a `//# debugId=…` comment plus the `_debugIds` runtime snippet
|
|
168
|
+
* into a built JS chunk. Idempotent: if a spec-compliant comment is
|
|
169
|
+
* already present (webpack 5.104+ with `SourceMapDevToolPlugin({ debugIds:
|
|
170
|
+
* true })`, turbopack with `experimental.turbopack.debugIds`, or any other
|
|
171
|
+
* tool) it is overwritten with the supplied debugId — and any of our own
|
|
172
|
+
* `_debugIds` runtime carriers are re-synced to the same id so the comment,
|
|
173
|
+
* the source map, and the runtime value can never drift apart.
|
|
174
|
+
*
|
|
175
|
+
* Otherwise the snippet and comment are appended just before the existing
|
|
176
|
+
* `//# sourceMappingURL=…` line so the browser still resolves the map.
|
|
177
|
+
* Shared by every bundler plugin so the injected wire format cannot drift.
|
|
178
|
+
*
|
|
179
|
+
* Throws (via {@link debugIdRuntimeSnippet}) on a non-hex/dashes id in every
|
|
180
|
+
* branch, so an unsanitized id can never reach the constructed output.
|
|
181
|
+
*/
|
|
182
|
+
declare function injectDebugIdIntoJs(content: string, debugId: string): string;
|
|
149
183
|
//#endregion
|
|
150
|
-
export { CompleteSourceMapsRequest, CompleteSourceMapsResponse, ManifestBundler, SignSourceMapsRequest, SignSourceMapsResponse, SourceMapManifest, UploadSourceMapEntry, UploadSourceMapsMetadata, UploadSourceMapsResponse, completeSourceMapFile, completeSourceMapsRequest, completeSourceMapsResponse, manifestBundlerSchema, signSourceMapFile, signSourceMapUpload, signSourceMapsRequest, signSourceMapsResponse, sourceMapManifestSchema, uploadSourceMapEntry, uploadSourceMapsMetadata, uploadSourceMapsResponse };
|
|
184
|
+
export { CompleteSourceMapsRequest, CompleteSourceMapsResponse, ManifestBundler, SignSourceMapsRequest, SignSourceMapsResponse, SourceMapManifest, UploadSourceMapEntry, UploadSourceMapsMetadata, UploadSourceMapsResponse, completeSourceMapFile, completeSourceMapsRequest, completeSourceMapsResponse, debugIdRuntimeSnippet, injectDebugIdIntoJs, manifestBundlerSchema, readDebugIdFromJs, signSourceMapFile, signSourceMapUpload, signSourceMapsRequest, signSourceMapsResponse, sourceMapManifestSchema, uploadSourceMapEntry, uploadSourceMapsMetadata, uploadSourceMapsResponse };
|
|
@@ -146,5 +146,39 @@ declare const completeSourceMapsResponse: z.ZodObject<{
|
|
|
146
146
|
fileCount: z.ZodNumber;
|
|
147
147
|
}, z.core.$strip>;
|
|
148
148
|
type CompleteSourceMapsResponse = z.infer<typeof completeSourceMapsResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Self-registering snippet appended to a built JS chunk so the runtime
|
|
151
|
+
* can recover the chunk's `debugId` from a live `Error().stack`. Mirrors
|
|
152
|
+
* Sentry's `debugIdInjectionSnippet` but keys the global as `_debugIds`
|
|
153
|
+
* (the TC39 / turbopack-native name) so the SDK's reader picks up both
|
|
154
|
+
* our injected chunks and bundlers that emit the global natively.
|
|
155
|
+
*
|
|
156
|
+
* Appended (never prepended) so it lands past the source map's mapped
|
|
157
|
+
* region and cannot shift original line positions.
|
|
158
|
+
*/
|
|
159
|
+
declare function debugIdRuntimeSnippet(debugId: string): string;
|
|
160
|
+
/**
|
|
161
|
+
* Reads an existing `//# debugId=…` comment from the bundle source.
|
|
162
|
+
* Returns `null` when no debug ID comment is present — the caller is
|
|
163
|
+
* expected to generate and inject one.
|
|
164
|
+
*/
|
|
165
|
+
declare function readDebugIdFromJs(content: string): string | null;
|
|
166
|
+
/**
|
|
167
|
+
* Inserts a `//# debugId=…` comment plus the `_debugIds` runtime snippet
|
|
168
|
+
* into a built JS chunk. Idempotent: if a spec-compliant comment is
|
|
169
|
+
* already present (webpack 5.104+ with `SourceMapDevToolPlugin({ debugIds:
|
|
170
|
+
* true })`, turbopack with `experimental.turbopack.debugIds`, or any other
|
|
171
|
+
* tool) it is overwritten with the supplied debugId — and any of our own
|
|
172
|
+
* `_debugIds` runtime carriers are re-synced to the same id so the comment,
|
|
173
|
+
* the source map, and the runtime value can never drift apart.
|
|
174
|
+
*
|
|
175
|
+
* Otherwise the snippet and comment are appended just before the existing
|
|
176
|
+
* `//# sourceMappingURL=…` line so the browser still resolves the map.
|
|
177
|
+
* Shared by every bundler plugin so the injected wire format cannot drift.
|
|
178
|
+
*
|
|
179
|
+
* Throws (via {@link debugIdRuntimeSnippet}) on a non-hex/dashes id in every
|
|
180
|
+
* branch, so an unsanitized id can never reach the constructed output.
|
|
181
|
+
*/
|
|
182
|
+
declare function injectDebugIdIntoJs(content: string, debugId: string): string;
|
|
149
183
|
//#endregion
|
|
150
|
-
export { CompleteSourceMapsRequest, CompleteSourceMapsResponse, ManifestBundler, SignSourceMapsRequest, SignSourceMapsResponse, SourceMapManifest, UploadSourceMapEntry, UploadSourceMapsMetadata, UploadSourceMapsResponse, completeSourceMapFile, completeSourceMapsRequest, completeSourceMapsResponse, manifestBundlerSchema, signSourceMapFile, signSourceMapUpload, signSourceMapsRequest, signSourceMapsResponse, sourceMapManifestSchema, uploadSourceMapEntry, uploadSourceMapsMetadata, uploadSourceMapsResponse };
|
|
184
|
+
export { CompleteSourceMapsRequest, CompleteSourceMapsResponse, ManifestBundler, SignSourceMapsRequest, SignSourceMapsResponse, SourceMapManifest, UploadSourceMapEntry, UploadSourceMapsMetadata, UploadSourceMapsResponse, completeSourceMapFile, completeSourceMapsRequest, completeSourceMapsResponse, debugIdRuntimeSnippet, injectDebugIdIntoJs, manifestBundlerSchema, readDebugIdFromJs, signSourceMapFile, signSourceMapUpload, signSourceMapsRequest, signSourceMapsResponse, sourceMapManifestSchema, uploadSourceMapEntry, uploadSourceMapsMetadata, 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`});export{completeSourceMapFile,completeSourceMapsRequest,completeSourceMapsResponse,manifestBundlerSchema,signSourceMapFile,signSourceMapUpload,signSourceMapsRequest,signSourceMapsResponse,sourceMapManifestSchema,uploadSourceMapEntry,uploadSourceMapsMetadata,uploadSourceMapsResponse};
|
|
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-]+$/;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*$/,SPEC_LAST_DEBUG_ID_RE=/\/\/# debugId=([a-fA-F0-9-]+)(?![\s\S]*\/\/# debugId=)/m,RUNTIME_DEBUG_ID_RE=/(_debugIds\[[^\]]*\]=")[a-fA-F0-9-]+(")/g;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};
|
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`,serverAction:`auto.function.nextjs.server_action`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
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):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
2
2
|
`)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}exports.MECHANISM_TYPE=MECHANISM_TYPE,exports.isNonErrorException=isNonErrorException,exports.parseReactComponentStack=parseReactComponentStack,exports.shouldDropBrowserExtensionNoise=shouldDropBrowserExtensionNoise,exports.shouldDropUnresolvableStack=shouldDropUnresolvableStack,exports.toError=toError,exports.toException=toException,exports.toExceptions=toExceptions;
|
package/dist/sdk/errors.d.cts
CHANGED
|
@@ -39,6 +39,7 @@ declare const MECHANISM_TYPE: {
|
|
|
39
39
|
readonly onRequestError: "auto.function.nextjs.on_request_error";
|
|
40
40
|
readonly captureError: "auto.function.nextjs.capture_error";
|
|
41
41
|
readonly proxy: "auto.function.nextjs.proxy";
|
|
42
|
+
readonly routeHandler: "auto.function.nextjs.route_handler";
|
|
42
43
|
readonly serverAction: "auto.function.nextjs.server_action";
|
|
43
44
|
};
|
|
44
45
|
readonly node: {
|
package/dist/sdk/errors.d.mts
CHANGED
|
@@ -39,6 +39,7 @@ declare const MECHANISM_TYPE: {
|
|
|
39
39
|
readonly onRequestError: "auto.function.nextjs.on_request_error";
|
|
40
40
|
readonly captureError: "auto.function.nextjs.capture_error";
|
|
41
41
|
readonly proxy: "auto.function.nextjs.proxy";
|
|
42
|
+
readonly routeHandler: "auto.function.nextjs.route_handler";
|
|
42
43
|
readonly serverAction: "auto.function.nextjs.server_action";
|
|
43
44
|
};
|
|
44
45
|
readonly node: {
|
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`,serverAction:`auto.function.nextjs.server_action`},node:{captureError:`auto.function.node.capture_error`,uncaughtException:`auto.node.global_handlers.uncaught_exception`,unhandledRejection:`auto.node.global_handlers.unhandled_rejection`},manual:{capture:`manual.api.capture`}},EXTENSION_URL_RE=/\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
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):\/\//;function shouldDropBrowserExtensionNoise(stacks){return stacks.some(stack=>EXTENSION_URL_RE.test(stack))}const HAS_SOURCE_LOCATION_RE=/(?:https?|file|blob|webpack-internal):\/\/|\sat\s+[\w$.<>]+\s+\([^)]+:\d/;function shouldDropUnresolvableStack(stacks){if(stacks.length===0)return!1;for(let stack of stacks)if(HAS_SOURCE_LOCATION_RE.test(stack))return!1;return!0}const COMPONENT_STACK_RE=/^(?:in|at)\s+([^\s(]+)(?:\s+\(([^\s:)]+):(\d+)(?::(\d+))?\))?/;function parseReactComponentStack(componentStack){let frames=[];for(let rawLine of componentStack.split(`
|
|
2
2
|
`)){let line=rawLine.trim();if(!line)continue;let match=COMPONENT_STACK_RE.exec(line);if(!match)continue;let[,name,fileName,lineStr,colStr]=match;if(!name)continue;let frame={id:`react-${frames.length}`,fn:name};fileName&&(frame.file=fileName),lineStr&&(frame.line=Number(lineStr)),colStr&&(frame.column=Number(colStr)),frames.push(frame)}return frames}function toError(error){return error instanceof Error?error:typeof error==`string`?Error(error):typeof error==`object`&&error?tryUnwrapNestedError(error)||tagAsNonError(safeJson(error)??String(error)):tagAsNonError(String(error))}function tryUnwrapNestedError(record){if(record.cause instanceof Error)return record.cause;for(let value of Object.values(record))if(value instanceof Error)return value}function tagAsNonError(message){let e=Error(message);return e.name=`NonError`,e}function safeJson(value){try{return JSON.stringify(value)}catch{return null}}function classify(value){if(value===null)return`null`;let t=typeof value;if(t!==`object`)return t;let tag=Object.prototype.toString.call(value).slice(8,-1);return tag===`Object`?`PlainObject`:tag}function describe(value){if(value==null)return`Non-Error captured: ${String(value)}`;if(typeof value==`object`){let keys=Object.keys(value).sort();return keys.length===0?`Non-Error captured: empty object`:`Non-Error captured with keys: ${keys.join(`, `)}`}return`Non-Error captured: ${String(value)}`}function serializeBoundedDepth(value,maxDepth){let seen=new WeakSet,walk=(current,depth)=>{if(current===null)return null;let t=typeof current;if(t===`string`||t===`number`||t===`boolean`)return current;if(t===`undefined`)return;if(t===`function`||t===`symbol`||t===`bigint`)return String(current);if(depth>maxDepth)return`[depth-limit]`;if(seen.has(current))return`[circular]`;if(seen.add(current),Array.isArray(current))return current.map(item=>walk(item,depth+1));let out={};for(let[k,v]of Object.entries(current))out[k]=walk(v,depth+1);return out};return walk(value,0)}function toException(value){if(value instanceof Error)return value;if(typeof value==`string`)return Error(value);if(typeof value==`object`&&value){let nested=tryUnwrapNestedError(value);if(nested)return nested}return{kind:`non-error`,type:classify(value),value:describe(value),serialized:serializeBoundedDepth(value,4)}}function isNonErrorException(value){return typeof value==`object`&&!!value&&value.kind===`non-error`}function toExceptions(value,mechanism){if(isNonErrorException(value))return[{kind:`non-error`,type:value.type,value:value.value,mechanism,serialized:value.serialized}];let exceptions=[],current=value;for(let depth=0;current&&depth<5;depth+=1)exceptions.push({kind:`error`,type:current.name,value:current.message,mechanism:depth===0?mechanism:void 0,stack:current.stack??``}),current=current.cause instanceof Error?current.cause:void 0;return exceptions}export{MECHANISM_TYPE,isNonErrorException,parseReactComponentStack,shouldDropBrowserExtensionNoise,shouldDropUnresolvableStack,toError,toException,toExceptions};
|
package/dist/sdk/identify.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const identifySourceSchema=zod.z.discriminatedUnion(`type`,[zod.z.object({type:zod.z.literal(`clerk`),name:zod.z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),zod.z.object({type:zod.z.literal(`auth0`),name:zod.z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),zod.z.object({type:zod.z.literal(`custom`),name:zod.z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=zod.z.record(zod.z.string(),zod.z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=zod.z.object({avatar:zod.z.string().optional(),email:zod.z.email().optional(),identifier:zod.z.string(),name:zod.z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});exports.identifyParamsSchema=identifyParamsSchema,exports.identifySourceSchema=identifySourceSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const identifySourceSchema=zod.z.discriminatedUnion(`type`,[zod.z.object({type:zod.z.literal(`clerk`),name:zod.z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),zod.z.object({type:zod.z.literal(`auth0`),name:zod.z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),zod.z.object({type:zod.z.literal(`custom`),name:zod.z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=zod.z.record(zod.z.string(),zod.z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=zod.z.object({avatar:zod.z.string().optional(),email:zod.z.email().optional(),identifier:zod.z.string(),name:zod.z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).superRefine((params,ctx)=>{params.source.type===`clerk`&&!params.identifier.startsWith(`user_`)&&ctx.addIssue({code:`custom`,message:`Clerk identifiers must be raw Clerk user ids starting with user_.`,path:[`identifier`]})}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});exports.identifyParamsSchema=identifyParamsSchema,exports.identifySourceSchema=identifySourceSchema;
|
package/dist/sdk/identify.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const identifySourceSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`clerk`),name:z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),z.object({type:z.literal(`auth0`),name:z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),z.object({type:z.literal(`custom`),name:z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=z.record(z.string(),z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=z.object({avatar:z.string().optional(),email:z.email().optional(),identifier:z.string(),name:z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});export{identifyParamsSchema,identifySourceSchema};
|
|
1
|
+
import{z}from"zod";const identifySourceSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`clerk`),name:z.literal(`Clerk`)}).meta({id:`ClerkIdentifySource`,title:`ClerkIdentifySource`}),z.object({type:z.literal(`auth0`),name:z.literal(`Auth0`)}).meta({id:`Auth0IdentifySource`,title:`Auth0IdentifySource`}),z.object({type:z.literal(`custom`),name:z.string()}).meta({id:`CustomIdentifySource`,title:`CustomIdentifySource`})]).meta({id:`IdentifySource`,title:`IdentifySource`,description:`Auth provider that surfaced this identification.`}),traitsSchema=z.record(z.string(),z.unknown()).meta({id:`IdentifyTraits`,title:`IdentifyTraits`,description:`Free-form key/value bag of user attributes attached when identifying a session.`}),identifyParamsSchema=z.object({avatar:z.string().optional(),email:z.email().optional(),identifier:z.string(),name:z.string().optional(),source:identifySourceSchema,traits:traitsSchema.optional()}).superRefine((params,ctx)=>{params.source.type===`clerk`&&!params.identifier.startsWith(`user_`)&&ctx.addIssue({code:`custom`,message:`Clerk identifiers must be raw Clerk user ids starting with user_.`,path:[`identifier`]})}).meta({id:`IdentifyParams`,title:`IdentifyParams`,description:`User attributes attached when identifying a session.`});export{identifyParamsSchema,identifySourceSchema};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-canary.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
@@ -152,11 +152,11 @@
|
|
|
152
152
|
"zod": "^4.4.3"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
|
-
"@interfere/sdk": "^11.0.0-canary.
|
|
156
|
-
"@interfere/test-utils": "^9.0.
|
|
157
|
-
"@interfere/typescript-config": "^9.0.
|
|
158
|
-
"@types/node": "^26.
|
|
159
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
155
|
+
"@interfere/sdk": "^11.0.0-canary.6",
|
|
156
|
+
"@interfere/test-utils": "^9.0.1-canary.1",
|
|
157
|
+
"@interfere/typescript-config": "^9.0.1-canary.1",
|
|
158
|
+
"@types/node": "^26.1.0",
|
|
159
|
+
"@typescript/native-preview": "7.0.0-dev.20260701.1",
|
|
160
160
|
"@vitest/coverage-v8": "4.1.9",
|
|
161
161
|
"tsdown": "^0.22.2",
|
|
162
162
|
"vitest": "4.1.9"
|