/** * Docker Registry Client * * Provides Docker registry operations including authentication, * health checks, image validation, and metadata fetching */ import type { Logger } from 'pino'; import Docker from 'dockerode'; import { type Result } from '../../types'; /** * Registry authentication configuration */ export interface RegistryConfig { /** Registry URL (e.g., 'https://registry.example.com' or 'docker.io') */ url: string; /** Username for authentication */ username?: string; /** Password for authentication */ password?: string; /** Token for authentication (alternative to username/password) */ token?: string; } export interface ImageMetadata { name: string; tag: string; digest?: string; size?: number; lastUpdated?: string; architecture?: string; os?: string; } /** * Get image metadata with fallback to estimates */ export declare function getImageMetadata(imageName: string, tag: string, logger: Logger): Promise; /** * Authenticate with a Docker registry * * Validates credentials with the registry and stores them for subsequent operations. * Supports both username/password and token-based authentication. * * @param docker - Docker client instance * @param config - Registry configuration with credentials * @param logger - Logger instance * @returns Result with auth config on success */ export declare function authenticateRegistry(docker: Docker, config: RegistryConfig, logger: Logger): Promise>; /** * Check if a registry is accessible * * Performs a health check by attempting to connect to the registry's API. * For Docker Hub, pings the v2 API endpoint. For private registries, * checks the /v2/ endpoint which should return 200 or 401. * * @param registryUrl - Registry URL to check * @param logger - Logger instance * @returns Result with boolean indicating if registry is accessible */ export declare function checkRegistryHealth(registryUrl: string, logger: Logger): Promise>; /** * Check if an image exists locally in the Docker daemon * * Checks if a specific image exists in the local Docker daemon cache. * This does not query remote registries - it only checks locally pulled images. * Use `docker pull` first if you need to verify remote image availability. * * @param docker - Docker client instance * @param imageName - Full image name (repository:tag or repository@digest) * @param logger - Logger instance * @returns Result with boolean indicating if image exists locally */ export declare function checkImageExists(docker: Docker, imageName: string, logger: Logger): Promise>; /** * List available tags for a repository * * Retrieves all tags for a given repository from the registry. * For Docker Hub, uses the public API. For private registries, * requires authentication. * * @param repository - Repository name (e.g., 'library/node' or 'myorg/myapp') * @param logger - Logger instance * @param authConfig - Optional authentication config for private registries * @returns Result with array of tag names */ export declare function listRepositoryTags(repository: string, logger: Logger, authConfig?: { username: string; password: string; serveraddress: string; }): Promise>; //# sourceMappingURL=registry.d.ts.map