@interfere/types 10.0.0-canary.7 → 10.0.1
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/frame.d.cts +0 -1
- package/dist/data/frame.d.mts +0 -1
- package/dist/data/session.d.cts +0 -1
- package/dist/data/session.d.mts +0 -1
- package/dist/data/source-maps.d.cts +0 -1
- package/dist/data/source-maps.d.mts +0 -1
- package/dist/events/error.d.cts +0 -1
- package/dist/events/error.d.mts +0 -1
- package/dist/events/pageleave.d.cts +0 -1
- package/dist/events/pageleave.d.mts +0 -1
- package/dist/events/pageview.d.cts +0 -1
- package/dist/events/pageview.d.mts +0 -1
- package/dist/integrations/index.d.cts +0 -1
- package/dist/integrations/index.d.mts +0 -1
- package/dist/integrations/platforms/cli.d.cts +0 -1
- package/dist/integrations/platforms/cli.d.mts +0 -1
- package/dist/integrations/platforms/cloudflare.d.cts +0 -1
- package/dist/integrations/platforms/cloudflare.d.mts +0 -1
- package/dist/integrations/platforms/github.cjs +1 -1
- package/dist/integrations/platforms/github.d.cts +0 -1
- package/dist/integrations/platforms/github.d.mts +0 -1
- package/dist/integrations/platforms/github.mjs +1 -1
- package/dist/integrations/platforms/slack.d.cts +0 -1
- package/dist/integrations/platforms/slack.d.mts +0 -1
- package/dist/integrations/platforms/vercel.d.cts +0 -1
- package/dist/integrations/platforms/vercel.d.mts +0 -1
- package/dist/releases/definition.d.cts +0 -1
- package/dist/releases/definition.d.mts +0 -1
- package/dist/releases/slug.d.cts +0 -1
- package/dist/releases/slug.d.mts +0 -1
- package/dist/sdk/cli-destination.d.cts +0 -1
- package/dist/sdk/cli-destination.d.mts +0 -1
- package/dist/sdk/deploy-environment.d.cts +0 -1
- package/dist/sdk/deploy-environment.d.mts +0 -1
- package/dist/sdk/envelope.d.cts +0 -1
- package/dist/sdk/envelope.d.mts +0 -1
- package/dist/sdk/errors.d.cts +2 -2
- package/dist/sdk/errors.d.mts +2 -2
- package/dist/sdk/geo.d.cts +0 -1
- package/dist/sdk/geo.d.mts +0 -1
- package/dist/sdk/identify.cjs +1 -1
- package/dist/sdk/identify.d.cts +6 -1
- package/dist/sdk/identify.d.mts +6 -1
- package/dist/sdk/identify.mjs +1 -1
- package/dist/sdk/log-sourcing.cjs +1 -0
- package/dist/sdk/log-sourcing.d.cts +32 -0
- package/dist/sdk/log-sourcing.d.mts +32 -0
- package/dist/sdk/log-sourcing.mjs +1 -0
- package/dist/sdk/plugins/context/browser.d.cts +0 -1
- package/dist/sdk/plugins/context/browser.d.mts +0 -1
- package/dist/sdk/plugins/context/edge.d.cts +0 -1
- package/dist/sdk/plugins/context/edge.d.mts +0 -1
- package/dist/sdk/plugins/context/next.d.cts +0 -1
- package/dist/sdk/plugins/context/next.d.mts +0 -1
- package/dist/sdk/plugins/context/node.d.cts +0 -1
- package/dist/sdk/plugins/context/node.d.mts +0 -1
- package/dist/sdk/plugins/manifest.d.cts +1 -1
- package/dist/sdk/plugins/manifest.d.mts +1 -1
- package/dist/sdk/plugins/payload/errors.d.cts +0 -1
- package/dist/sdk/plugins/payload/errors.d.mts +0 -1
- package/dist/sdk/plugins/payload/page-events.d.cts +0 -1
- package/dist/sdk/plugins/payload/page-events.d.mts +0 -1
- package/dist/sdk/plugins/payload/rage-click.d.cts +0 -1
- package/dist/sdk/plugins/payload/rage-click.d.mts +0 -1
- package/dist/sdk/plugins/payload/replay.d.cts +0 -1
- package/dist/sdk/plugins/payload/replay.d.mts +0 -1
- package/dist/sdk/remote-config.cjs +1 -1
- package/dist/sdk/remote-config.d.cts +17 -2
- package/dist/sdk/remote-config.d.mts +17 -2
- package/dist/sdk/remote-config.mjs +1 -1
- package/dist/sdk/runtime.d.cts +0 -1
- package/dist/sdk/runtime.d.mts +0 -1
- package/dist/sdk/server-tracing.cjs +1 -0
- package/dist/sdk/server-tracing.d.cts +41 -0
- package/dist/sdk/server-tracing.d.mts +41 -0
- package/dist/sdk/server-tracing.mjs +1 -0
- package/package.json +4 -4
package/dist/data/frame.d.cts
CHANGED
package/dist/data/frame.d.mts
CHANGED
package/dist/data/session.d.cts
CHANGED
package/dist/data/session.d.mts
CHANGED
package/dist/events/error.d.cts
CHANGED
package/dist/events/error.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const HOST_REGEX=/^https?:\/\//,PATH_REGEX=/\/.*$/,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)
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const HOST_REGEX=/^https?:\/\//,PATH_REGEX=/\/.*$/,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?:\/\//,PATH_REGEX=/\/.*$/,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)
|
|
1
|
+
import{z}from"zod";const HOST_REGEX=/^https?:\/\//,PATH_REGEX=/\/.*$/,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.d.cts
CHANGED
package/dist/releases/slug.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
|
|
2
2
|
import { ReleaseSlug } from "../releases/slug.cjs";
|
|
3
|
-
|
|
4
3
|
//#region src/sdk/cli-destination.d.ts
|
|
5
4
|
declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): ReleaseDestinationMetadata;
|
|
6
5
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
|
|
2
2
|
import { ReleaseSlug } from "../releases/slug.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/sdk/cli-destination.d.ts
|
|
5
4
|
declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): ReleaseDestinationMetadata;
|
|
6
5
|
//#endregion
|
package/dist/sdk/envelope.d.cts
CHANGED
package/dist/sdk/envelope.d.mts
CHANGED
package/dist/sdk/errors.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IngestedFrame } from "#data/frame";
|
|
2
2
|
import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
|
|
3
|
-
|
|
4
3
|
//#region src/sdk/errors.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Structured taxonomy of capture sources, tagged onto each
|
|
@@ -48,7 +47,8 @@ declare const MECHANISM_TYPE: {
|
|
|
48
47
|
readonly unhandledRejection: "auto.node.global_handlers.unhandled_rejection";
|
|
49
48
|
};
|
|
50
49
|
readonly manual: {
|
|
51
|
-
/** Customer called `capture(error)` from `@interfere/react/api`. */
|
|
50
|
+
/** Customer called `capture(error)` from `@interfere/react/api`. */
|
|
51
|
+
readonly capture: "manual.api.capture";
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
/**
|
package/dist/sdk/errors.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IngestedFrame } from "#data/frame";
|
|
2
2
|
import { ErrorMechanism, ExceptionValue } from "#sdk/plugins/payload/errors";
|
|
3
|
-
|
|
4
3
|
//#region src/sdk/errors.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Structured taxonomy of capture sources, tagged onto each
|
|
@@ -48,7 +47,8 @@ declare const MECHANISM_TYPE: {
|
|
|
48
47
|
readonly unhandledRejection: "auto.node.global_handlers.unhandled_rejection";
|
|
49
48
|
};
|
|
50
49
|
readonly manual: {
|
|
51
|
-
/** Customer called `capture(error)` from `@interfere/react/api`. */
|
|
50
|
+
/** Customer called `capture(error)` from `@interfere/react/api`. */
|
|
51
|
+
readonly capture: "manual.api.capture";
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
/**
|
package/dist/sdk/geo.d.cts
CHANGED
package/dist/sdk/geo.d.mts
CHANGED
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()}).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;
|
|
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(`workos`),name:zod.z.literal(`WorkOS`)}).meta({id:`WorkOSIdentifySource`,title:`WorkOSIdentifySource`}),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.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/sdk/identify.d.ts
|
|
4
3
|
declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
4
|
type: z.ZodLiteral<"clerk">;
|
|
@@ -7,6 +6,9 @@ declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7
6
|
}, z.core.$strip>, z.ZodObject<{
|
|
8
7
|
type: z.ZodLiteral<"auth0">;
|
|
9
8
|
name: z.ZodLiteral<"Auth0">;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"workos">;
|
|
11
|
+
name: z.ZodLiteral<"WorkOS">;
|
|
10
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
11
13
|
type: z.ZodLiteral<"custom">;
|
|
12
14
|
name: z.ZodString;
|
|
@@ -23,6 +25,9 @@ declare const identifyParamsSchema: z.ZodObject<{
|
|
|
23
25
|
}, z.core.$strip>, z.ZodObject<{
|
|
24
26
|
type: z.ZodLiteral<"auth0">;
|
|
25
27
|
name: z.ZodLiteral<"Auth0">;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"workos">;
|
|
30
|
+
name: z.ZodLiteral<"WorkOS">;
|
|
26
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
27
32
|
type: z.ZodLiteral<"custom">;
|
|
28
33
|
name: z.ZodString;
|
package/dist/sdk/identify.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/sdk/identify.d.ts
|
|
4
3
|
declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
4
|
type: z.ZodLiteral<"clerk">;
|
|
@@ -7,6 +6,9 @@ declare const identifySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7
6
|
}, z.core.$strip>, z.ZodObject<{
|
|
8
7
|
type: z.ZodLiteral<"auth0">;
|
|
9
8
|
name: z.ZodLiteral<"Auth0">;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"workos">;
|
|
11
|
+
name: z.ZodLiteral<"WorkOS">;
|
|
10
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
11
13
|
type: z.ZodLiteral<"custom">;
|
|
12
14
|
name: z.ZodString;
|
|
@@ -23,6 +25,9 @@ declare const identifyParamsSchema: z.ZodObject<{
|
|
|
23
25
|
}, z.core.$strip>, z.ZodObject<{
|
|
24
26
|
type: z.ZodLiteral<"auth0">;
|
|
25
27
|
name: z.ZodLiteral<"Auth0">;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"workos">;
|
|
30
|
+
name: z.ZodLiteral<"WorkOS">;
|
|
26
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
27
32
|
type: z.ZodLiteral<"custom">;
|
|
28
33
|
name: z.ZodString;
|
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()}).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};
|
|
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(`workos`),name:z.literal(`WorkOS`)}).meta({id:`WorkOSIdentifySource`,title:`WorkOSIdentifySource`}),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};
|
|
@@ -0,0 +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=typeof process>`u`?void 0:process.env){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;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
+
declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
|
+
/**
|
|
5
|
+
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
|
+
* value-injection loader) from the surface's remote config. Read at cold
|
|
7
|
+
* start so the mode is known synchronously, before the console bridge and
|
|
8
|
+
* logger provider register.
|
|
9
|
+
*/
|
|
10
|
+
declare const LOG_SOURCING_GLOBAL = "__INTERFERE_LOG_SOURCING__";
|
|
11
|
+
declare const logSourcingModeSchema: z.ZodEnum<{
|
|
12
|
+
drain: "drain";
|
|
13
|
+
sdk: "sdk";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* How the server-side SDK sources logs.
|
|
17
|
+
*
|
|
18
|
+
* - `sdk`: the SDK intercepts `console.*` (`bridgeConsoleToOtel`) and ships
|
|
19
|
+
* log records through its own OTLP log exporter.
|
|
20
|
+
* - `drain`: the SDK does not intercept `console.*` and does not register a
|
|
21
|
+
* logger provider; a platform log drain (e.g. Vercel) captures stdout
|
|
22
|
+
* out-of-process and posts records to the collector directly.
|
|
23
|
+
*/
|
|
24
|
+
type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
|
+
declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
+
declare function resolveLogSourcingMode(opts?: {
|
|
27
|
+
readonly injected?: string | null | undefined;
|
|
28
|
+
readonly env?: Record<string, string | undefined> | undefined;
|
|
29
|
+
}): LogSourcingMode;
|
|
30
|
+
declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): LogSourcingMode;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DEFAULT_LOG_SOURCING_MODE, LOG_SOURCING_ENV_VAR, LOG_SOURCING_GLOBAL, LogSourcingMode, logSourcingModeSchema, readLogSourcingMode, resolveLogSourcingMode };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
+
declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
|
+
/**
|
|
5
|
+
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
|
+
* value-injection loader) from the surface's remote config. Read at cold
|
|
7
|
+
* start so the mode is known synchronously, before the console bridge and
|
|
8
|
+
* logger provider register.
|
|
9
|
+
*/
|
|
10
|
+
declare const LOG_SOURCING_GLOBAL = "__INTERFERE_LOG_SOURCING__";
|
|
11
|
+
declare const logSourcingModeSchema: z.ZodEnum<{
|
|
12
|
+
drain: "drain";
|
|
13
|
+
sdk: "sdk";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* How the server-side SDK sources logs.
|
|
17
|
+
*
|
|
18
|
+
* - `sdk`: the SDK intercepts `console.*` (`bridgeConsoleToOtel`) and ships
|
|
19
|
+
* log records through its own OTLP log exporter.
|
|
20
|
+
* - `drain`: the SDK does not intercept `console.*` and does not register a
|
|
21
|
+
* logger provider; a platform log drain (e.g. Vercel) captures stdout
|
|
22
|
+
* out-of-process and posts records to the collector directly.
|
|
23
|
+
*/
|
|
24
|
+
type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
|
+
declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
+
declare function resolveLogSourcingMode(opts?: {
|
|
27
|
+
readonly injected?: string | null | undefined;
|
|
28
|
+
readonly env?: Record<string, string | undefined> | undefined;
|
|
29
|
+
}): LogSourcingMode;
|
|
30
|
+
declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): LogSourcingMode;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DEFAULT_LOG_SOURCING_MODE, LOG_SOURCING_ENV_VAR, LOG_SOURCING_GLOBAL, LogSourcingMode, logSourcingModeSchema, readLogSourcingMode, resolveLogSourcingMode };
|
|
@@ -0,0 +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=typeof process>`u`?void 0:process.env){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};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/sdk/plugins/manifest.d.ts
|
|
2
2
|
declare const CONSENT_CATEGORIES: readonly ["necessary", "analytics", "replay"];
|
|
3
|
-
type AtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<T
|
|
3
|
+
type AtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>; }[keyof T];
|
|
4
4
|
declare const PLUGIN_MANIFEST: readonly [{
|
|
5
5
|
readonly consentCategory: "necessary";
|
|
6
6
|
readonly defaultEnabled: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/sdk/plugins/manifest.d.ts
|
|
2
2
|
declare const CONSENT_CATEGORIES: readonly ["necessary", "analytics", "replay"];
|
|
3
|
-
type AtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<T
|
|
3
|
+
type AtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>; }[keyof T];
|
|
4
4
|
declare const PLUGIN_MANIFEST: readonly [{
|
|
5
5
|
readonly consentCategory: "necessary";
|
|
6
6
|
readonly defaultEnabled: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_plugins_manifest=require("./plugins/manifest.cjs");let zod=require("zod");const remotePluginConfigSchema=zod.z.object(Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.map(p=>[p.name,zod.z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=zod.z.object({plugins:remotePluginConfigSchema}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),EVENT_TYPE_TO_PLUGIN=Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));exports.EVENT_TYPE_TO_PLUGIN=EVENT_TYPE_TO_PLUGIN,exports.remoteConfigSchema=remoteConfigSchema,exports.remotePluginConfigSchema=remotePluginConfigSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_log_sourcing=require("./log-sourcing.cjs"),require_sdk_plugins_manifest=require("./plugins/manifest.cjs"),require_sdk_server_tracing=require("./server-tracing.cjs");let zod=require("zod");const remotePluginConfigSchema=zod.z.object(Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.map(p=>[p.name,zod.z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=zod.z.object({plugins:remotePluginConfigSchema,ingestUrl:zod.z.url().optional(),serverTracing:require_sdk_server_tracing.serverTracingModeSchema.optional(),logSourcing:require_sdk_log_sourcing.logSourcingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let injected=globalThis[PLUGINS_GLOBAL];if(injected==null)return null;let parsed=remotePluginConfigSchema.safeParse(injected);return parsed.success?parsed.data:null}const EVENT_TYPE_TO_PLUGIN=Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));exports.EVENT_TYPE_TO_PLUGIN=EVENT_TYPE_TO_PLUGIN,exports.PLUGINS_GLOBAL=PLUGINS_GLOBAL,exports.readBakedPlugins=readBakedPlugins,exports.remoteConfigSchema=remoteConfigSchema,exports.remotePluginConfigSchema=remotePluginConfigSchema;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventType } from "./envelope.cjs";
|
|
2
2
|
import { PluginKey } from "./plugins/manifest.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
5
4
|
//#region src/sdk/remote-config.d.ts
|
|
6
5
|
type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;
|
|
7
6
|
/**
|
|
@@ -31,8 +30,24 @@ declare const remoteConfigSchema: z.ZodObject<{
|
|
|
31
30
|
rageClick: z.ZodBoolean;
|
|
32
31
|
replay: z.ZodBoolean;
|
|
33
32
|
}, z.core.$strip>;
|
|
33
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
34
|
+
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
drain: "drain";
|
|
36
|
+
full: "full";
|
|
37
|
+
}>>;
|
|
38
|
+
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
drain: "drain";
|
|
40
|
+
sdk: "sdk";
|
|
41
|
+
}>>;
|
|
34
42
|
}, z.core.$strip>;
|
|
35
43
|
type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Global stamped into the bundle at build time (Next `withInterfere`) with the
|
|
46
|
+
* surface's resolved plugin config. Its presence signals the build-time
|
|
47
|
+
* `/v2/config` fetch succeeded, so the runtime config fetch can be skipped.
|
|
48
|
+
*/
|
|
49
|
+
declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
50
|
+
declare function readBakedPlugins(): RemotePluginConfig | null;
|
|
36
51
|
declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
|
|
37
52
|
//#endregion
|
|
38
|
-
export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
|
|
53
|
+
export { EVENT_TYPE_TO_PLUGIN, PLUGINS_GLOBAL, RemoteConfig, RemotePluginConfig, readBakedPlugins, remoteConfigSchema, remotePluginConfigSchema };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventType } from "./envelope.mjs";
|
|
2
2
|
import { PluginKey } from "./plugins/manifest.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
5
4
|
//#region src/sdk/remote-config.d.ts
|
|
6
5
|
type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;
|
|
7
6
|
/**
|
|
@@ -31,8 +30,24 @@ declare const remoteConfigSchema: z.ZodObject<{
|
|
|
31
30
|
rageClick: z.ZodBoolean;
|
|
32
31
|
replay: z.ZodBoolean;
|
|
33
32
|
}, z.core.$strip>;
|
|
33
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
34
|
+
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
drain: "drain";
|
|
36
|
+
full: "full";
|
|
37
|
+
}>>;
|
|
38
|
+
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
drain: "drain";
|
|
40
|
+
sdk: "sdk";
|
|
41
|
+
}>>;
|
|
34
42
|
}, z.core.$strip>;
|
|
35
43
|
type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Global stamped into the bundle at build time (Next `withInterfere`) with the
|
|
46
|
+
* surface's resolved plugin config. Its presence signals the build-time
|
|
47
|
+
* `/v2/config` fetch succeeded, so the runtime config fetch can be skipped.
|
|
48
|
+
*/
|
|
49
|
+
declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
50
|
+
declare function readBakedPlugins(): RemotePluginConfig | null;
|
|
36
51
|
declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
|
|
37
52
|
//#endregion
|
|
38
|
-
export { EVENT_TYPE_TO_PLUGIN, RemoteConfig, RemotePluginConfig, remoteConfigSchema, remotePluginConfigSchema };
|
|
53
|
+
export { EVENT_TYPE_TO_PLUGIN, PLUGINS_GLOBAL, RemoteConfig, RemotePluginConfig, readBakedPlugins, remoteConfigSchema, remotePluginConfigSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({plugins:remotePluginConfigSchema}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),EVENT_TYPE_TO_PLUGIN=Object.fromEntries(PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));export{EVENT_TYPE_TO_PLUGIN,remoteConfigSchema,remotePluginConfigSchema};
|
|
1
|
+
import{logSourcingModeSchema}from"./log-sourcing.mjs";import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{serverTracingModeSchema}from"./server-tracing.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({plugins:remotePluginConfigSchema,ingestUrl:z.url().optional(),serverTracing:serverTracingModeSchema.optional(),logSourcing:logSourcingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let injected=globalThis[PLUGINS_GLOBAL];if(injected==null)return null;let parsed=remotePluginConfigSchema.safeParse(injected);return parsed.success?parsed.data:null}const EVENT_TYPE_TO_PLUGIN=Object.fromEntries(PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));export{EVENT_TYPE_TO_PLUGIN,PLUGINS_GLOBAL,readBakedPlugins,remoteConfigSchema,remotePluginConfigSchema};
|
package/dist/sdk/runtime.d.cts
CHANGED
package/dist/sdk/runtime.d.mts
CHANGED
|
@@ -0,0 +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=typeof process>`u`?void 0:process.env){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;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/server-tracing.d.ts
|
|
3
|
+
declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
|
+
/**
|
|
5
|
+
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
|
+
* value-injection loader) from the surface's remote config. Read at cold
|
|
7
|
+
* start so the mode is known synchronously, before instrumentation registers.
|
|
8
|
+
*/
|
|
9
|
+
declare const SERVER_TRACING_GLOBAL = "__INTERFERE_SERVER_TRACING__";
|
|
10
|
+
declare const serverTracingModeSchema: z.ZodEnum<{
|
|
11
|
+
drain: "drain";
|
|
12
|
+
full: "full";
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* How the server-side SDK sources traces.
|
|
16
|
+
*
|
|
17
|
+
* - `full`: the SDK runs its own outbound HTTP (undici) instrumentation and
|
|
18
|
+
* exports spans directly.
|
|
19
|
+
* - `drain`: the SDK skips outbound HTTP instrumentation and defers
|
|
20
|
+
* server/edge traces to a platform trace drain, removing the per-fetch span
|
|
21
|
+
* creation from the request hot path.
|
|
22
|
+
*/
|
|
23
|
+
type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
|
+
declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the server tracing mode: the build-injected value wins, then the
|
|
27
|
+
* `INTERFERE_SERVER_TRACING` env var, then {@link DEFAULT_SERVER_TRACING_MODE}.
|
|
28
|
+
* Unrecognised values fall through to the next source.
|
|
29
|
+
*/
|
|
30
|
+
declare function resolveServerTracingMode(opts?: {
|
|
31
|
+
readonly injected?: string | null | undefined;
|
|
32
|
+
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
+
}): ServerTracingMode;
|
|
34
|
+
/**
|
|
35
|
+
* Server-runtime convenience over {@link resolveServerTracingMode}: reads the
|
|
36
|
+
* build-injected {@link SERVER_TRACING_GLOBAL} global and falls back to
|
|
37
|
+
* `process.env`. Zero-touch — no code option required.
|
|
38
|
+
*/
|
|
39
|
+
declare function readServerTracingMode(env?: Record<string, string | undefined> | undefined): ServerTracingMode;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { DEFAULT_SERVER_TRACING_MODE, SERVER_TRACING_ENV_VAR, SERVER_TRACING_GLOBAL, ServerTracingMode, readServerTracingMode, resolveServerTracingMode, serverTracingModeSchema };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/server-tracing.d.ts
|
|
3
|
+
declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
|
+
/**
|
|
5
|
+
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
|
+
* value-injection loader) from the surface's remote config. Read at cold
|
|
7
|
+
* start so the mode is known synchronously, before instrumentation registers.
|
|
8
|
+
*/
|
|
9
|
+
declare const SERVER_TRACING_GLOBAL = "__INTERFERE_SERVER_TRACING__";
|
|
10
|
+
declare const serverTracingModeSchema: z.ZodEnum<{
|
|
11
|
+
drain: "drain";
|
|
12
|
+
full: "full";
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* How the server-side SDK sources traces.
|
|
16
|
+
*
|
|
17
|
+
* - `full`: the SDK runs its own outbound HTTP (undici) instrumentation and
|
|
18
|
+
* exports spans directly.
|
|
19
|
+
* - `drain`: the SDK skips outbound HTTP instrumentation and defers
|
|
20
|
+
* server/edge traces to a platform trace drain, removing the per-fetch span
|
|
21
|
+
* creation from the request hot path.
|
|
22
|
+
*/
|
|
23
|
+
type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
|
+
declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the server tracing mode: the build-injected value wins, then the
|
|
27
|
+
* `INTERFERE_SERVER_TRACING` env var, then {@link DEFAULT_SERVER_TRACING_MODE}.
|
|
28
|
+
* Unrecognised values fall through to the next source.
|
|
29
|
+
*/
|
|
30
|
+
declare function resolveServerTracingMode(opts?: {
|
|
31
|
+
readonly injected?: string | null | undefined;
|
|
32
|
+
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
+
}): ServerTracingMode;
|
|
34
|
+
/**
|
|
35
|
+
* Server-runtime convenience over {@link resolveServerTracingMode}: reads the
|
|
36
|
+
* build-injected {@link SERVER_TRACING_GLOBAL} global and falls back to
|
|
37
|
+
* `process.env`. Zero-touch — no code option required.
|
|
38
|
+
*/
|
|
39
|
+
declare function readServerTracingMode(env?: Record<string, string | undefined> | undefined): ServerTracingMode;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { DEFAULT_SERVER_TRACING_MODE, SERVER_TRACING_ENV_VAR, SERVER_TRACING_GLOBAL, ServerTracingMode, readServerTracingMode, resolveServerTracingMode, serverTracingModeSchema };
|
|
@@ -0,0 +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=typeof process>`u`?void 0:process.env){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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/types",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "TypeScript & Zod types for Interfere",
|
|
6
6
|
"keywords": [
|
|
@@ -152,9 +152,9 @@
|
|
|
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.1
|
|
155
|
+
"@interfere/sdk": "^11.0.3",
|
|
156
|
+
"@interfere/test-utils": "^9.0.4",
|
|
157
|
+
"@interfere/typescript-config": "^9.0.1",
|
|
158
158
|
"@types/node": "^26.1.0",
|
|
159
159
|
"@typescript/native-preview": "7.0.0-dev.20260701.1",
|
|
160
160
|
"@vitest/coverage-v8": "4.1.9",
|