@cavi-ai/api-client/core/env
Package subpath: ./core/env
GLOBAL_REPO_ROOT_KEY
Kind: variable
export declare const GLOBAL_REPO_ROOT_KEY: "__CAVI_REPO_ROOT__";HttpApiEnvSource
Kind: type
export type HttpApiEnvSource = Record<string, string | undefined>;HttpApiSurfaceConfig
Kind: type
export type HttpApiSurfaceConfig = {
baseUrl: string;
authToken: string | null;
clientId: string;
};HttpSurfaceEnvAliases
Kind: type
/** Fallback env-var names checked (in order) when the primary key is unset. */
export type HttpSurfaceEnvAliases = {
baseUrl?: readonly string[];
authToken?: readonly string[];
clientId?: readonly string[];
};HttpSurfaceEnvFallback
Kind: type
/** Last-resort values used when neither the primary nor any alias env var is set. */
export type HttpSurfaceEnvFallback = {
baseUrl: string;
authToken?: string | null;
clientId: string;
};HttpSurfaceEnvKeys
Kind: type
/** Primary env-var names for one HTTP surface. */
export type HttpSurfaceEnvKeys = {
baseUrl: string;
authToken: string;
clientId: string;
};HttpSurfaceEnvSpec
Kind: type
export type HttpSurfaceEnvSpec = {
keys: HttpSurfaceEnvKeys;
aliases?: HttpSurfaceEnvAliases;
fallback: HttpSurfaceEnvFallback;
};REPO_ROOT_ENV_KEY
Kind: variable
export declare const REPO_ROOT_ENV_KEY: "REPO_ROOT";RepoRootEnv
Kind: type
export type RepoRootEnv = Record<string, string | undefined>;requireRepoRoot
Kind: function
export declare function requireRepoRoot(options?: ResolveRepoRootOptions): string;resolveHttpSurfaceConfigFromEnv
Kind: function
/**
* Resolve a single HTTP surface's config from an env bag.
* Precedence per field: primary key → aliases → caller `defaults` → spec `fallback`.
*/
export declare function resolveHttpSurfaceConfigFromEnv(env: HttpApiEnvSource, spec: HttpSurfaceEnvSpec, options?: ResolveHttpSurfaceConfigOptions): HttpApiSurfaceConfig;ResolveHttpSurfaceConfigOptions
Kind: type
export type ResolveHttpSurfaceConfigOptions = {
defaults?: Partial<HttpApiSurfaceConfig>;
trimValues?: boolean;
includeAliases?: boolean;
};resolveRepoRoot
Kind: function
export declare function resolveRepoRoot(options?: ResolveRepoRootOptions): string | null;ResolveRepoRootOptions
Kind: type
export type ResolveRepoRootOptions = {
repoRoot?: string | null;
env?: RepoRootEnv;
globalRepoRoot?: string | null;
};