@interfere/types 10.5.0 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const hostingPlatformSchema=require("zod").z.enum([`vercel`,`cloudflare`]);exports.PLATFORM_GLOBAL=`__INTERFERE_PLATFORM__`,exports.hostingPlatformSchema=hostingPlatformSchema;
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ //#region src/integrations/platforms/hosting.d.ts
3
+ /**
4
+ * Global stamped into the server bundle at build time with the surface's
5
+ * hosting platform from the remote config: a {@link HostingPlatform}, or
6
+ * `null` when the surface is not linked to one. Absent when the build could
7
+ * not load the remote config.
8
+ */
9
+ export declare const PLATFORM_GLOBAL = "__INTERFERE_PLATFORM__";
10
+ /** Hosting platform the surface is linked to through a destination connection. */
11
+ export declare const hostingPlatformSchema: z.ZodEnum<{
12
+ cloudflare: "cloudflare";
13
+ vercel: "vercel";
14
+ }>;
15
+ export type HostingPlatform = z.infer<typeof hostingPlatformSchema>;
16
+ //#endregion
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ //#region src/integrations/platforms/hosting.d.ts
3
+ /**
4
+ * Global stamped into the server bundle at build time with the surface's
5
+ * hosting platform from the remote config: a {@link HostingPlatform}, or
6
+ * `null` when the surface is not linked to one. Absent when the build could
7
+ * not load the remote config.
8
+ */
9
+ export declare const PLATFORM_GLOBAL = "__INTERFERE_PLATFORM__";
10
+ /** Hosting platform the surface is linked to through a destination connection. */
11
+ export declare const hostingPlatformSchema: z.ZodEnum<{
12
+ cloudflare: "cloudflare";
13
+ vercel: "vercel";
14
+ }>;
15
+ export type HostingPlatform = z.infer<typeof hostingPlatformSchema>;
16
+ //#endregion
@@ -0,0 +1 @@
1
+ import{z}from"zod";const PLATFORM_GLOBAL=`__INTERFERE_PLATFORM__`,hostingPlatformSchema=z.enum([`vercel`,`cloudflare`]);export{PLATFORM_GLOBAL,hostingPlatformSchema};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_releases_slug=require("./slug.cjs"),require_integrations_index=require("../integrations/index.cjs");let zod=require("zod");const releaseStatusSchema=zod.z.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=zod.z.object({id:zod.z.string(),slug:zod.z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=zod.z.object({id:zod.z.string(),slug:zod.z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=zod.z.object({buildId:zod.z.string(),destination:require_integrations_index.releaseDestinationMetadataSchema.nullable(),producerVersion:zod.z.string().optional(),slug:zod.z.string().optional(),source:require_integrations_index.releaseSourceMetadataSchema}).meta({description:`Request body for creating a release.`,id:`CreateReleaseRequest`,title:`CreateReleaseRequest`}),createReleaseResponse=zod.z.object({build:zod.z.object({hash:zod.z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`}),destination:zod.z.object({id:zod.z.string(),slug:require_releases_slug.releaseSlugSchema,environment:zod.z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),org:orgRefSchema,source:zod.z.object({id:zod.z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),surface:surfaceRefSchema}).meta({description:`Response body returned after creating a release.`,id:`CreateReleaseResponse`,title:`CreateReleaseResponse`});exports.createReleaseRequest=createReleaseRequest,exports.createReleaseResponse=createReleaseResponse,exports.releaseStatusSchema=releaseStatusSchema;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_releases_slug=require("./slug.cjs"),require_integrations_index=require("../integrations/index.cjs");let zod=require("zod");const releaseStatusSchema=zod.z.enum([`pending`,`building`,`ready`,`errored`,`canceled`,`unknown`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=zod.z.object({id:zod.z.string(),slug:zod.z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=zod.z.object({id:zod.z.string(),slug:zod.z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=zod.z.object({buildId:zod.z.string(),destination:require_integrations_index.releaseDestinationMetadataSchema.nullable(),producerVersion:zod.z.string().optional(),slug:zod.z.string().optional(),source:require_integrations_index.releaseSourceMetadataSchema}).meta({description:`Request body for creating a release.`,id:`CreateReleaseRequest`,title:`CreateReleaseRequest`}),createReleaseResponse=zod.z.object({build:zod.z.object({hash:zod.z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`}),destination:zod.z.object({id:zod.z.string(),slug:require_releases_slug.releaseSlugSchema,environment:zod.z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),org:orgRefSchema,source:zod.z.object({id:zod.z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),surface:surfaceRefSchema}).meta({description:`Response body returned after creating a release.`,id:`CreateReleaseResponse`,title:`CreateReleaseResponse`});exports.createReleaseRequest=createReleaseRequest,exports.createReleaseResponse=createReleaseResponse,exports.releaseStatusSchema=releaseStatusSchema;
@@ -6,6 +6,7 @@ export declare const releaseStatusSchema: z.ZodEnum<{
6
6
  errored: "errored";
7
7
  pending: "pending";
8
8
  ready: "ready";
9
+ unknown: "unknown";
9
10
  }>;
10
11
  export type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
11
12
  export declare const createReleaseRequest: z.ZodObject<{
@@ -6,6 +6,7 @@ export declare const releaseStatusSchema: z.ZodEnum<{
6
6
  errored: "errored";
7
7
  pending: "pending";
8
8
  ready: "ready";
9
+ unknown: "unknown";
9
10
  }>;
10
11
  export type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
11
12
  export declare const createReleaseRequest: z.ZodObject<{
@@ -1 +1 @@
1
- import{releaseSlugSchema}from"./slug.mjs";import{releaseDestinationMetadataSchema,releaseSourceMetadataSchema}from"../integrations/index.mjs";import{z}from"zod";const releaseStatusSchema=z.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=z.object({buildId:z.string(),destination:releaseDestinationMetadataSchema.nullable(),producerVersion:z.string().optional(),slug:z.string().optional(),source:releaseSourceMetadataSchema}).meta({description:`Request body for creating a release.`,id:`CreateReleaseRequest`,title:`CreateReleaseRequest`}),createReleaseResponse=z.object({build:z.object({hash:z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`}),destination:z.object({id:z.string(),slug:releaseSlugSchema,environment:z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),org:orgRefSchema,source:z.object({id:z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),surface:surfaceRefSchema}).meta({description:`Response body returned after creating a release.`,id:`CreateReleaseResponse`,title:`CreateReleaseResponse`});export{createReleaseRequest,createReleaseResponse,releaseStatusSchema};
1
+ import{releaseSlugSchema}from"./slug.mjs";import{releaseDestinationMetadataSchema,releaseSourceMetadataSchema}from"../integrations/index.mjs";import{z}from"zod";const releaseStatusSchema=z.enum([`pending`,`building`,`ready`,`errored`,`canceled`,`unknown`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=z.object({buildId:z.string(),destination:releaseDestinationMetadataSchema.nullable(),producerVersion:z.string().optional(),slug:z.string().optional(),source:releaseSourceMetadataSchema}).meta({description:`Request body for creating a release.`,id:`CreateReleaseRequest`,title:`CreateReleaseRequest`}),createReleaseResponse=z.object({build:z.object({hash:z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`}),destination:z.object({id:z.string(),slug:releaseSlugSchema,environment:z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),org:orgRefSchema,source:z.object({id:z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),surface:surfaceRefSchema}).meta({description:`Response body returned after creating a release.`,id:`CreateReleaseResponse`,title:`CreateReleaseResponse`});export{createReleaseRequest,createReleaseResponse,releaseStatusSchema};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_remote_config=require("./remote-config.cjs");let zod=require("zod");const remoteConfigFields=require_sdk_remote_config.remoteConfigSchema.shape,buildConfigSchema=(0,zod.catch)(zod.z.object({ingestUrl:(0,zod.catch)(remoteConfigFields.ingestUrl,void 0),logSourcing:(0,zod.catch)(remoteConfigFields.logSourcing,void 0),plugins:(0,zod.catch)(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:(0,zod.catch)(remoteConfigFields.serverTracing,void 0)}),{});exports.buildConfigSchema=buildConfigSchema;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_remote_config=require("./remote-config.cjs");let zod=require("zod");const remoteConfigFields=require_sdk_remote_config.remoteConfigSchema.shape,buildConfigSchema=(0,zod.catch)(zod.z.object({ingestUrl:(0,zod.catch)(remoteConfigFields.ingestUrl,void 0),logSourcing:(0,zod.catch)(remoteConfigFields.logSourcing,void 0),platform:(0,zod.catch)(remoteConfigFields.platform,void 0),plugins:(0,zod.catch)(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:(0,zod.catch)(remoteConfigFields.serverTracing,void 0)}),{});exports.buildConfigSchema=buildConfigSchema;
@@ -6,6 +6,10 @@ export declare const buildConfigSchema: z.ZodCatch<z.ZodObject<{
6
6
  drain: "drain";
7
7
  sdk: "sdk";
8
8
  }>>>;
9
+ platform: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
10
+ cloudflare: "cloudflare";
11
+ vercel: "vercel";
12
+ }>>>;
9
13
  plugins: z.ZodCatch<z.ZodOptional<z.ZodObject<{
10
14
  device: z.ZodOptional<z.ZodBoolean>;
11
15
  errors: z.ZodOptional<z.ZodBoolean>;
@@ -6,6 +6,10 @@ export declare const buildConfigSchema: z.ZodCatch<z.ZodObject<{
6
6
  drain: "drain";
7
7
  sdk: "sdk";
8
8
  }>>>;
9
+ platform: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
10
+ cloudflare: "cloudflare";
11
+ vercel: "vercel";
12
+ }>>>;
9
13
  plugins: z.ZodCatch<z.ZodOptional<z.ZodObject<{
10
14
  device: z.ZodOptional<z.ZodBoolean>;
11
15
  errors: z.ZodOptional<z.ZodBoolean>;
@@ -1 +1 @@
1
- import{remoteConfigSchema}from"./remote-config.mjs";import{catch as catch$1,z}from"zod";const remoteConfigFields=remoteConfigSchema.shape,buildConfigSchema=catch$1(z.object({ingestUrl:catch$1(remoteConfigFields.ingestUrl,void 0),logSourcing:catch$1(remoteConfigFields.logSourcing,void 0),plugins:catch$1(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:catch$1(remoteConfigFields.serverTracing,void 0)}),{});export{buildConfigSchema};
1
+ import{remoteConfigSchema}from"./remote-config.mjs";import{catch as catch$1,z}from"zod";const remoteConfigFields=remoteConfigSchema.shape,buildConfigSchema=catch$1(z.object({ingestUrl:catch$1(remoteConfigFields.ingestUrl,void 0),logSourcing:catch$1(remoteConfigFields.logSourcing,void 0),platform:catch$1(remoteConfigFields.platform,void 0),plugins:catch$1(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:catch$1(remoteConfigFields.serverTracing,void 0)}),{});export{buildConfigSchema};
@@ -1 +1 @@
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({ingestUrl:zod.z.url().optional(),logSourcing:require_sdk_log_sourcing.logSourcingModeSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:require_sdk_server_tracing.serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;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.remoteConfigInputSchema=remoteConfigInputSchema,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_integrations_platforms_hosting=require("../integrations/platforms/hosting.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({ingestUrl:zod.z.url().optional(),logSourcing:require_sdk_log_sourcing.logSourcingModeSchema.optional(),platform:require_integrations_platforms_hosting.hostingPlatformSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:require_sdk_server_tracing.serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;if(injected==null)return null;let parsed=partialRemotePluginConfigSchema.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.remoteConfigInputSchema=remoteConfigInputSchema,exports.remoteConfigSchema=remoteConfigSchema,exports.remotePluginConfigSchema=remotePluginConfigSchema;
@@ -17,6 +17,10 @@ export declare const remoteConfigSchema: z.ZodObject<{
17
17
  drain: "drain";
18
18
  sdk: "sdk";
19
19
  }>>;
20
+ platform: z.ZodOptional<z.ZodEnum<{
21
+ cloudflare: "cloudflare";
22
+ vercel: "vercel";
23
+ }>>;
20
24
  plugins: z.ZodObject<{
21
25
  device: z.ZodBoolean;
22
26
  errors: z.ZodBoolean;
@@ -45,6 +49,10 @@ export declare const remoteConfigInputSchema: z.ZodObject<{
45
49
  drain: "drain";
46
50
  sdk: "sdk";
47
51
  }>>;
52
+ platform: z.ZodOptional<z.ZodEnum<{
53
+ cloudflare: "cloudflare";
54
+ vercel: "vercel";
55
+ }>>;
48
56
  serverTracing: z.ZodOptional<z.ZodEnum<{
49
57
  drain: "drain";
50
58
  full: "full";
@@ -65,12 +73,12 @@ export declare const remoteConfigInputSchema: z.ZodObject<{
65
73
  */
66
74
  export declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
67
75
  export declare function readBakedPlugins(): {
68
- device: boolean;
69
- errors: boolean;
70
- logs: boolean;
71
- pageEvents: boolean;
72
- rageClick: boolean;
73
- replay: boolean;
76
+ device?: boolean | undefined;
77
+ errors?: boolean | undefined;
78
+ logs?: boolean | undefined;
79
+ pageEvents?: boolean | undefined;
80
+ rageClick?: boolean | undefined;
81
+ replay?: boolean | undefined;
74
82
  } | null;
75
83
  export declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
76
84
  //#endregion
@@ -17,6 +17,10 @@ export declare const remoteConfigSchema: z.ZodObject<{
17
17
  drain: "drain";
18
18
  sdk: "sdk";
19
19
  }>>;
20
+ platform: z.ZodOptional<z.ZodEnum<{
21
+ cloudflare: "cloudflare";
22
+ vercel: "vercel";
23
+ }>>;
20
24
  plugins: z.ZodObject<{
21
25
  device: z.ZodBoolean;
22
26
  errors: z.ZodBoolean;
@@ -45,6 +49,10 @@ export declare const remoteConfigInputSchema: z.ZodObject<{
45
49
  drain: "drain";
46
50
  sdk: "sdk";
47
51
  }>>;
52
+ platform: z.ZodOptional<z.ZodEnum<{
53
+ cloudflare: "cloudflare";
54
+ vercel: "vercel";
55
+ }>>;
48
56
  serverTracing: z.ZodOptional<z.ZodEnum<{
49
57
  drain: "drain";
50
58
  full: "full";
@@ -65,12 +73,12 @@ export declare const remoteConfigInputSchema: z.ZodObject<{
65
73
  */
66
74
  export declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
67
75
  export declare function readBakedPlugins(): {
68
- device: boolean;
69
- errors: boolean;
70
- logs: boolean;
71
- pageEvents: boolean;
72
- rageClick: boolean;
73
- replay: boolean;
76
+ device?: boolean | undefined;
77
+ errors?: boolean | undefined;
78
+ logs?: boolean | undefined;
79
+ pageEvents?: boolean | undefined;
80
+ rageClick?: boolean | undefined;
81
+ replay?: boolean | undefined;
74
82
  } | null;
75
83
  export declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
76
84
  //#endregion
@@ -1 +1 @@
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({ingestUrl:z.url().optional(),logSourcing:logSourcingModeSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;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,remoteConfigInputSchema,remoteConfigSchema,remotePluginConfigSchema};
1
+ import{logSourcingModeSchema}from"./log-sourcing.mjs";import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{hostingPlatformSchema}from"../integrations/platforms/hosting.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({ingestUrl:z.url().optional(),logSourcing:logSourcingModeSchema.optional(),platform:hostingPlatformSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;if(injected==null)return null;let parsed=partialRemotePluginConfigSchema.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,remoteConfigInputSchema,remoteConfigSchema,remotePluginConfigSchema};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected)),env=opts?.env??require_sdk_runtime.readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!require_sdk_runtime.normalizeEnv(env?.VERCEL)}}function readServerTracing(env=require_sdk_runtime.readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}exports.DEFAULT_SERVER_TRACING_MODE=DEFAULT_SERVER_TRACING_MODE,exports.SERVER_TRACING_GLOBAL=SERVER_TRACING_GLOBAL,exports.VERCEL_EXPORT_TIMEOUT_MS=2e3,exports.readServerTracing=readServerTracing,exports.resolveServerTracing=resolveServerTracing,exports.serverTracingModeSchema=serverTracingModeSchema;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs"),require_integrations_platforms_hosting=require("../integrations/platforms/hosting.cjs");let zod=require("zod");const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected)),vercel=opts?.platform===void 0?!!require_sdk_runtime.normalizeEnv((opts?.env??require_sdk_runtime.readProcessEnv())?.VERCEL):require_integrations_platforms_hosting.hostingPlatformSchema.safeParse(require_sdk_runtime.normalizeEnv(opts.platform)).data===`vercel`;return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel}}function readServerTracing(env=require_sdk_runtime.readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0,platform:`__INTERFERE_PLATFORM__`in scope?scope[require_integrations_platforms_hosting.PLATFORM_GLOBAL]:void 0})}exports.DEFAULT_SERVER_TRACING_MODE=DEFAULT_SERVER_TRACING_MODE,exports.SERVER_TRACING_GLOBAL=SERVER_TRACING_GLOBAL,exports.VERCEL_EXPORT_TIMEOUT_MS=2e3,exports.readServerTracing=readServerTracing,exports.resolveServerTracing=resolveServerTracing,exports.serverTracingModeSchema=serverTracingModeSchema;
@@ -24,19 +24,21 @@ export declare const DEFAULT_SERVER_TRACING_MODE = "full";
24
24
  /** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
25
25
  export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
26
26
  /**
27
- * Resolve the server tracing mode from the build-injected surface
28
- * configuration alone; unrecognised or absent values resolve to
29
- * {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
30
- * set, which callers use to cap direct export timeouts.
27
+ * Resolve the server tracing mode and hosting platform from the
28
+ * build-injected surface configuration. Unrecognised or absent modes resolve
29
+ * to {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether the
30
+ * injected platform is Vercel, which callers use to cap direct export
31
+ * timeouts; `VERCEL` is read only when the build injected no platform.
31
32
  */
32
33
  export declare function resolveServerTracing(opts?: {
33
34
  readonly injected?: unknown;
35
+ readonly platform?: unknown;
34
36
  readonly env?: Record<string, string | undefined> | undefined;
35
37
  }): {
36
38
  mode: "drain" | "full";
37
39
  vercel: boolean;
38
40
  };
39
- /** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
41
+ /** Reads the build-injected {@link SERVER_TRACING_GLOBAL} and {@link PLATFORM_GLOBAL} globals. */
40
42
  export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
41
43
  mode: "drain" | "full";
42
44
  vercel: boolean;
@@ -24,19 +24,21 @@ export declare const DEFAULT_SERVER_TRACING_MODE = "full";
24
24
  /** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
25
25
  export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
26
26
  /**
27
- * Resolve the server tracing mode from the build-injected surface
28
- * configuration alone; unrecognised or absent values resolve to
29
- * {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
30
- * set, which callers use to cap direct export timeouts.
27
+ * Resolve the server tracing mode and hosting platform from the
28
+ * build-injected surface configuration. Unrecognised or absent modes resolve
29
+ * to {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether the
30
+ * injected platform is Vercel, which callers use to cap direct export
31
+ * timeouts; `VERCEL` is read only when the build injected no platform.
31
32
  */
32
33
  export declare function resolveServerTracing(opts?: {
33
34
  readonly injected?: unknown;
35
+ readonly platform?: unknown;
34
36
  readonly env?: Record<string, string | undefined> | undefined;
35
37
  }): {
36
38
  mode: "drain" | "full";
37
39
  vercel: boolean;
38
40
  };
39
- /** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
41
+ /** Reads the build-injected {@link SERVER_TRACING_GLOBAL} and {@link PLATFORM_GLOBAL} globals. */
40
42
  export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
41
43
  mode: "drain" | "full";
42
44
  vercel: boolean;
@@ -1 +1 @@
1
- import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`,VERCEL_EXPORT_TIMEOUT_MS=2e3;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected)),env=opts?.env??readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!normalizeEnv(env?.VERCEL)}}function readServerTracing(env=readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}export{DEFAULT_SERVER_TRACING_MODE,SERVER_TRACING_GLOBAL,VERCEL_EXPORT_TIMEOUT_MS,readServerTracing,resolveServerTracing,serverTracingModeSchema};
1
+ import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{PLATFORM_GLOBAL,hostingPlatformSchema}from"../integrations/platforms/hosting.mjs";import{z}from"zod";const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`,VERCEL_EXPORT_TIMEOUT_MS=2e3;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected)),vercel=opts?.platform===void 0?!!normalizeEnv((opts?.env??readProcessEnv())?.VERCEL):hostingPlatformSchema.safeParse(normalizeEnv(opts.platform)).data===`vercel`;return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel}}function readServerTracing(env=readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0,platform:`__INTERFERE_PLATFORM__`in scope?scope[PLATFORM_GLOBAL]:void 0})}export{DEFAULT_SERVER_TRACING_MODE,SERVER_TRACING_GLOBAL,VERCEL_EXPORT_TIMEOUT_MS,readServerTracing,resolveServerTracing,serverTracingModeSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfere/types",
3
- "version": "10.5.0",
3
+ "version": "10.6.0",
4
4
  "description": "TypeScript & Zod types for Interfere",
5
5
  "keywords": [
6
6
  "logging",
@@ -143,6 +143,7 @@
143
143
  },
144
144
  "scripts": {
145
145
  "build": "tsdown",
146
+ "lint:oxlint": "cd ../../../.. && GOMAXPROCS=2 oxlint --max-warnings=0 --report-unused-disable-directives-severity=error --no-error-on-unmatched-pattern --threads=2 src/packages/public/types",
146
147
  "test": "node ../../private/vitest-config/src/cli.ts run --config ../../../../vitest.config.ts",
147
148
  "typecheck": "bun check"
148
149
  },