@interfere/types 10.4.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/log-sourcing.cjs +1 -1
- package/dist/sdk/log-sourcing.d.cts +4 -6
- package/dist/sdk/log-sourcing.d.mts +4 -6
- package/dist/sdk/log-sourcing.mjs +1 -1
- package/dist/sdk/server-tracing.cjs +1 -1
- package/dist/sdk/server-tracing.d.cts +17 -13
- package/dist/sdk/server-tracing.d.mts +17 -13
- package/dist/sdk/server-tracing.mjs +1 -1
- package/dist/sdk/service-name.d.cts +1 -1
- package/dist/sdk/service-name.d.mts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=zod.z.enum([`sdk`,`drain`]);function resolveLogSourcingMode(injected){let parsed=logSourcingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(injected));return parsed.success?parsed.data:`sdk`}function readLogSourcingMode(){let scope=globalThis;return resolveLogSourcingMode(`__INTERFERE_LOG_SOURCING__`in scope?scope[LOG_SOURCING_GLOBAL]:void 0)}exports.DEFAULT_LOG_SOURCING_MODE=`sdk`,exports.LOG_SOURCING_GLOBAL=LOG_SOURCING_GLOBAL,exports.logSourcingModeSchema=logSourcingModeSchema,exports.readLogSourcingMode=readLogSourcingMode,exports.resolveLogSourcingMode=resolveLogSourcingMode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
-
export declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -23,9 +22,8 @@ export declare const logSourcingModeSchema: z.ZodEnum<{
|
|
|
23
22
|
*/
|
|
24
23
|
export type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
24
|
export declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): "drain" | "sdk";
|
|
25
|
+
/** The build-injected surface configuration wins; otherwise {@link DEFAULT_LOG_SOURCING_MODE}. */
|
|
26
|
+
export declare function resolveLogSourcingMode(injected?: unknown): "drain" | "sdk";
|
|
27
|
+
/** Reads the build-injected {@link LOG_SOURCING_GLOBAL} global. */
|
|
28
|
+
export declare function readLogSourcingMode(): "drain" | "sdk";
|
|
31
29
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/log-sourcing.d.ts
|
|
3
|
-
export declare const LOG_SOURCING_ENV_VAR = "INTERFERE_LOG_SOURCING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -23,9 +22,8 @@ export declare const logSourcingModeSchema: z.ZodEnum<{
|
|
|
23
22
|
*/
|
|
24
23
|
export type LogSourcingMode = z.infer<typeof logSourcingModeSchema>;
|
|
25
24
|
export declare const DEFAULT_LOG_SOURCING_MODE = "sdk";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare function readLogSourcingMode(env?: Record<string, string | undefined> | undefined): "drain" | "sdk";
|
|
25
|
+
/** The build-injected surface configuration wins; otherwise {@link DEFAULT_LOG_SOURCING_MODE}. */
|
|
26
|
+
export declare function resolveLogSourcingMode(injected?: unknown): "drain" | "sdk";
|
|
27
|
+
/** Reads the build-injected {@link LOG_SOURCING_GLOBAL} global. */
|
|
28
|
+
export declare function readLogSourcingMode(): "drain" | "sdk";
|
|
31
29
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv
|
|
1
|
+
import{normalizeEnv}from"./runtime.mjs";import{z}from"zod";const LOG_SOURCING_GLOBAL=`__INTERFERE_LOG_SOURCING__`,logSourcingModeSchema=z.enum([`sdk`,`drain`]),DEFAULT_LOG_SOURCING_MODE=`sdk`;function resolveLogSourcingMode(injected){let parsed=logSourcingModeSchema.safeParse(normalizeEnv(injected));return parsed.success?parsed.data:`sdk`}function readLogSourcingMode(){let scope=globalThis;return resolveLogSourcingMode(`__INTERFERE_LOG_SOURCING__`in scope?scope[LOG_SOURCING_GLOBAL]:void 0)}export{DEFAULT_LOG_SOURCING_MODE,LOG_SOURCING_GLOBAL,logSourcingModeSchema,readLogSourcingMode,resolveLogSourcingMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");let zod=require("zod");const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=zod.z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(require_sdk_runtime.normalizeEnv(opts?.injected)),env=opts?.env??require_sdk_runtime.readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!require_sdk_runtime.normalizeEnv(env?.VERCEL)}}function readServerTracing(env=require_sdk_runtime.readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}exports.DEFAULT_SERVER_TRACING_MODE=DEFAULT_SERVER_TRACING_MODE,exports.SERVER_TRACING_GLOBAL=SERVER_TRACING_GLOBAL,exports.VERCEL_EXPORT_TIMEOUT_MS=2e3,exports.readServerTracing=readServerTracing,exports.resolveServerTracing=resolveServerTracing,exports.serverTracingModeSchema=serverTracingModeSchema;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/server-tracing.d.ts
|
|
3
|
-
export declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -22,19 +21,24 @@ export declare const serverTracingModeSchema: z.ZodEnum<{
|
|
|
22
21
|
*/
|
|
23
22
|
export type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
23
|
export declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
24
|
+
/** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
|
|
25
|
+
export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
|
|
25
26
|
/**
|
|
26
|
-
* Resolve the server tracing mode
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Resolve the server tracing mode from the build-injected surface
|
|
28
|
+
* configuration alone; unrecognised or absent values resolve to
|
|
29
|
+
* {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
|
|
30
|
+
* set, which callers use to cap direct export timeouts.
|
|
29
31
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
readonly injected?:
|
|
32
|
+
export declare function resolveServerTracing(opts?: {
|
|
33
|
+
readonly injected?: unknown;
|
|
32
34
|
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
-
}):
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}): {
|
|
36
|
+
mode: "drain" | "full";
|
|
37
|
+
vercel: boolean;
|
|
38
|
+
};
|
|
39
|
+
/** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
|
|
40
|
+
export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
|
|
41
|
+
mode: "drain" | "full";
|
|
42
|
+
vercel: boolean;
|
|
43
|
+
};
|
|
40
44
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/server-tracing.d.ts
|
|
3
|
-
export declare const SERVER_TRACING_ENV_VAR = "INTERFERE_SERVER_TRACING";
|
|
4
3
|
/**
|
|
5
4
|
* Global stamped into the server bundle at build time (via `withInterfere`'s
|
|
6
5
|
* value-injection loader) from the surface's remote config. Read at cold
|
|
@@ -22,19 +21,24 @@ export declare const serverTracingModeSchema: z.ZodEnum<{
|
|
|
22
21
|
*/
|
|
23
22
|
export type ServerTracingMode = z.infer<typeof serverTracingModeSchema>;
|
|
24
23
|
export declare const DEFAULT_SERVER_TRACING_MODE = "full";
|
|
24
|
+
/** Per-attempt and flush ceiling for direct exports on Vercel, where a flush holds the invocation open. */
|
|
25
|
+
export declare const VERCEL_EXPORT_TIMEOUT_MS = 2000;
|
|
25
26
|
/**
|
|
26
|
-
* Resolve the server tracing mode
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Resolve the server tracing mode from the build-injected surface
|
|
28
|
+
* configuration alone; unrecognised or absent values resolve to
|
|
29
|
+
* {@link DEFAULT_SERVER_TRACING_MODE}. `vercel` reports whether `VERCEL` is
|
|
30
|
+
* set, which callers use to cap direct export timeouts.
|
|
29
31
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
readonly injected?:
|
|
32
|
+
export declare function resolveServerTracing(opts?: {
|
|
33
|
+
readonly injected?: unknown;
|
|
32
34
|
readonly env?: Record<string, string | undefined> | undefined;
|
|
33
|
-
}):
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}): {
|
|
36
|
+
mode: "drain" | "full";
|
|
37
|
+
vercel: boolean;
|
|
38
|
+
};
|
|
39
|
+
/** Reads the build-injected {@link SERVER_TRACING_GLOBAL} global and `process.env`. */
|
|
40
|
+
export declare function readServerTracing(env?: Record<string, string | undefined> | undefined): {
|
|
41
|
+
mode: "drain" | "full";
|
|
42
|
+
vercel: boolean;
|
|
43
|
+
};
|
|
40
44
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const
|
|
1
|
+
import{normalizeEnv,readProcessEnv}from"./runtime.mjs";import{z}from"zod";const SERVER_TRACING_GLOBAL=`__INTERFERE_SERVER_TRACING__`,serverTracingModeSchema=z.enum([`full`,`drain`]),DEFAULT_SERVER_TRACING_MODE=`full`,VERCEL_EXPORT_TIMEOUT_MS=2e3;function resolveServerTracing(opts){let parsed=serverTracingModeSchema.safeParse(normalizeEnv(opts?.injected)),env=opts?.env??readProcessEnv();return{mode:parsed.success?parsed.data:DEFAULT_SERVER_TRACING_MODE,vercel:!!normalizeEnv(env?.VERCEL)}}function readServerTracing(env=readProcessEnv()){let scope=globalThis;return resolveServerTracing({env,injected:`__INTERFERE_SERVER_TRACING__`in scope?scope[SERVER_TRACING_GLOBAL]:void 0})}export{DEFAULT_SERVER_TRACING_MODE,SERVER_TRACING_GLOBAL,VERCEL_EXPORT_TIMEOUT_MS,readServerTracing,resolveServerTracing,serverTracingModeSchema};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/sdk/service-name.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Global a build stamps into the page with the default OTel `service.name`
|
|
4
|
-
* (the
|
|
4
|
+
* (the build integrations derive it from the package name). The kernel reads it
|
|
5
5
|
* when `init()` is called without `serviceName`; an explicit value wins.
|
|
6
6
|
*/
|
|
7
7
|
export declare const SERVICE_NAME_GLOBAL = "__INTERFERE_SERVICE_NAME__";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/sdk/service-name.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Global a build stamps into the page with the default OTel `service.name`
|
|
4
|
-
* (the
|
|
4
|
+
* (the build integrations derive it from the package name). The kernel reads it
|
|
5
5
|
* when `init()` is called without `serviceName`; an explicit value wins.
|
|
6
6
|
*/
|
|
7
7
|
export declare const SERVICE_NAME_GLOBAL = "__INTERFERE_SERVICE_NAME__";
|