/** * Credentials Resolution * * This module provides the core logic for resolving credentials from various sources: * - Explicit credentials option * - Deprecated token option * - Environment variables (new and deprecated) * - CLI login stored tokens */ import type { Credentials, ResolvedCredentials } from "./types/credentials"; /** * Options for resolving credentials. */ export interface ResolveCredentialsOptions { credentials?: Credentials; /** @deprecated Use `credentials` instead */ token?: string; /** SDK base URL - used to derive auth base URL if not specified in credentials */ baseUrl?: string; } /** * Resolve credentials from environment variables. * * Precedence: * 1. ZAPIER_CREDENTIALS (string token) * 2. ZAPIER_CREDENTIALS_CLIENT_ID + ZAPIER_CREDENTIALS_CLIENT_SECRET (client credentials) * 3. ZAPIER_CREDENTIALS_CLIENT_ID alone (PKCE) * 4. Deprecated ZAPIER_TOKEN, ZAPIER_AUTH_* vars (with warnings) * * @param sdkBaseUrl - SDK base URL used to derive auth base URL if not specified */ export declare function resolveCredentialsFromEnv(sdkBaseUrl?: string): ResolvedCredentials | undefined; /** * Resolve credentials from all possible sources. * * Precedence: * 1. Explicit credentials option * 2. Deprecated token option (with warning) * 3. Environment variables * 4. CLI login stored token (handled separately in auth.ts) * * If credentials is a function, it is called and must return * a string or credentials object (not another function). * * The baseUrl option is used to derive the auth base URL if not * specified in credentials. */ export declare function resolveCredentials(options?: ResolveCredentialsOptions): Promise; /** * Extract the base URL from credentials for use in auth flows. */ export declare function getBaseUrlFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined; /** * Extract the client ID from credentials for use in auth flows. */ export declare function getClientIdFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined; //# sourceMappingURL=credentials.d.ts.map