import { Secret } from "./secret.js"; //#region src/profiles/profile.d.ts /** * Holds configuration values resolved from a databrickscfg file and/or * environment variables. All fields are optional; an absent field means the * value was not configured. */ interface Profile { /** Profile name (INI section name). */ name?: string; /** Databricks workspace or Accounts API endpoint URL. */ host?: string; /** * Databricks Workspace ID, used with unified hosts. Accepts either a classic * numeric workspace ID or another workspace identifier format that the server * understands. */ workspaceId?: string; /** Databricks Account ID for Accounts API. */ accountId?: string; /** Personal access token for PAT authentication. */ token?: Secret; /** Selects a specific auth method when multiple credentials are available. */ authType?: string; /** OAuth client ID for M2M authentication. */ clientId?: string; /** OAuth client secret for M2M authentication. */ clientSecret?: Secret; /** Path to the Databricks CLI binary (>= 0.100.0) for CLI-based auth. */ databricksCliPath?: string; /** * INI keys not mapped to a known field. Only populated when loading from a * config file; environment variables do not contribute to extra. */ extra?: Record; } /** * Configures how a profile is resolved by {@link resolve}. * * Resolution is enabled by default: with no options, {@link resolve} reads the * config file and overlays DATABRICKS_* environment variables on top. Each * source can be disabled independently with {@link ProfileOptions.noProfile} * and {@link ProfileOptions.disableEnv}. */ interface ProfileOptions { /** * Profile name (INI section) to load. If not set, resolves from the * DATABRICKS_CONFIG_PROFILE environment variable, then the default_profile * key in the __settings__ section, then falls back to the DEFAULT section. */ profile?: string; /** * Path to the databrickscfg file. If not set, reads DATABRICKS_CONFIG_FILE * from the environment, falling back to ~/.databrickscfg. */ configFile?: string; /** * Disable reading the config file. Cannot be combined with * {@link ProfileOptions.profile} or {@link ProfileOptions.configFile}, * which would have nothing to read. */ noProfile?: boolean; /** * Disable overlaying DATABRICKS_* environment variables. */ disableEnv?: boolean; } /** * Reserved INI section name for SDK settings. It is never treated as a * profile. */ declare const SETTINGS_SECTION = "__settings__"; /** * Maps a {@link Profile} field to its environment variable and INI key, * with typed getter and setter closures. This avoids reflection while * keeping the mapping declarative, matching the Go SDK's approach. */ interface PropertyDef { /** The Profile field name this property maps to. */ readonly field: keyof Profile; readonly envVar: string; readonly iniKey: string; /** Sets the profile field from a raw INI/env string value. */ readonly set: (profile: Profile, raw: string) => void; /** Returns the profile field as a string, or undefined if unset. */ readonly get: (profile: Profile) => string | undefined; } /** * Declarative property mapping table for all known profile fields. */ declare const PROPERTY_DEFS: readonly PropertyDef[]; //#endregion export { PROPERTY_DEFS, Profile, ProfileOptions, PropertyDef, SETTINGS_SECTION }; //# sourceMappingURL=profile.d.ts.map