import type { CredentialBundle, Region } from "../types.js"; export type CredentialSourceState = "absent" | "partial" | "ready"; export interface RegionCredentialConfiguration { sessionConfigured: boolean; csrfConfigured: boolean; operationConfigured: boolean; } export interface CredentialConfigurationDescriptor { profileId: string; regions: Readonly>; } export interface CredentialProvider { getCredentials(region: Region): Promise; getConfiguration?(): Promise; isConfigured?(region: Region, requirement?: "session" | "operation"): boolean; getActiveProfileId?(): string | undefined; /** * Returns a process-local monotonic revision. Implementations must advance it * when profile selection, credential presence, or credential bytes change. */ getRevision?(): number; /** * Indicates whether this source is absent, incomplete (and therefore shadows * lower-priority sources), or contains a complete regional bundle. */ getSourceState?(region: Region): CredentialSourceState; } export interface RegionEnvironmentVariables { session: string; csrfToken: string; } export interface EnvCredentialProviderOptions { env?: Readonly>; profileId?: string; profileIdVariable?: string; fallbackProfileId?: () => string | undefined; variables?: Partial>>; } export declare const DEFAULT_CREDENTIAL_ENVIRONMENT: Readonly>; export declare const DEFAULT_PROFILE_ID_VARIABLE = "PI_LEETCODE_PROFILE_ID"; export declare const DEFAULT_PROFILE_ID = "default"; export declare const PROFILE_ID_PATTERN_SOURCE = "^[A-Za-z0-9._:-]+$"; export declare const PROFILE_ID_PATTERN: RegExp; export declare const MAX_PROFILE_ID_LENGTH = 128; export declare class CredentialsUnavailableError extends Error { readonly region: Region; constructor(region: Region); } export declare function isSafeCredentialValue(value: string): boolean; export declare function normalizeProfileId(profileId: string): string; export declare class EnvCredentialProvider implements CredentialProvider { #private; constructor(options?: EnvCredentialProviderOptions); get profileId(): string; getSourceState(region: Region): CredentialSourceState; getCredentials(region: Region): Promise; getConfiguration(): Promise; isConfigured(region: Region, _requirement?: "session" | "operation"): boolean; getActiveProfileId(): string | undefined; getRevision(): number; requireCredentials(region: Region): Promise; } //# sourceMappingURL=credentials.d.ts.map