UNPKG

qraft

Version:

A powerful CLI tool to qraft structured project setups from GitHub template repositories

100 lines 4.41 kB
import { BoxRegistry, BoxRegistryEntry, BoxManifest } from '../types'; /** * BoxRegistryManager handles the mapping between box names and their remote paths * This enables Strategy 1: Separate Box Name and Remote Path */ export declare class BoxRegistryManager { private static readonly REGISTRY_FILE; private static readonly REGISTRY_VERSION; /** * Get the path to the registry file for a given registry directory * @param registryPath Path to the registry root * @returns string Path to the box-registry.json file */ private static getRegistryFilePath; /** * Load box registry from the registry directory * @param registryPath Path to the registry root * @param registryName Name of the registry * @returns Promise<BoxRegistry> The loaded registry or a new empty one */ loadRegistry(registryPath: string, registryName: string): Promise<BoxRegistry>; /** * Save box registry to the registry directory * @param registryPath Path to the registry root * @param registry Registry to save * @returns Promise<void> */ saveRegistry(registryPath: string, registry: BoxRegistry): Promise<void>; /** * Register a new box in the registry * @param registryPath Path to the registry root * @param registryName Name of the registry * @param boxName Name of the box * @param remotePath Remote path where the box is stored * @param manifest Box manifest for additional metadata * @returns Promise<void> */ registerBox(registryPath: string, registryName: string, boxName: string, remotePath: string, manifest: BoxManifest): Promise<void>; /** * Get the remote path for a box name * @param registryPath Path to the registry root * @param registryName Name of the registry * @param boxName Name of the box to look up * @returns Promise<string | null> Remote path or null if not found */ getRemotePath(registryPath: string, registryName: string, boxName: string): Promise<string | null>; /** * Get all registered boxes * @param registryPath Path to the registry root * @param registryName Name of the registry * @returns Promise<Record<string, BoxRegistryEntry>> Map of box names to entries */ getAllBoxes(registryPath: string, registryName: string): Promise<Record<string, BoxRegistryEntry>>; /** * Update an existing box entry * @param registryPath Path to the registry root * @param registryName Name of the registry * @param boxName Name of the box to update * @param manifest Updated manifest * @returns Promise<boolean> True if box was updated, false if not found */ updateBox(registryPath: string, registryName: string, boxName: string, manifest: BoxManifest): Promise<boolean>; /** * Remove a box from the registry * @param registryPath Path to the registry root * @param registryName Name of the registry * @param boxName Name of the box to remove * @returns Promise<boolean> True if box was removed, false if not found */ removeBox(registryPath: string, registryName: string, boxName: string): Promise<boolean>; /** * Check if a box name exists in the registry * @param registryPath Path to the registry root * @param registryName Name of the registry * @param boxName Name of the box to check * @returns Promise<boolean> True if box exists */ boxExists(registryPath: string, registryName: string, boxName: string): Promise<boolean>; /** * Find box name by remote path (reverse lookup) * @param registryPath Path to the registry root * @param registryName Name of the registry * @param remotePath Remote path to search for * @returns Promise<string | null> Box name or null if not found */ findBoxByRemotePath(registryPath: string, registryName: string, remotePath: string): Promise<string | null>; /** * Create an empty registry structure * @param registryName Name of the registry * @returns BoxRegistry Empty registry */ private createEmptyRegistry; /** * Validate registry structure * @param registry Registry to validate * @returns boolean True if valid */ static validateRegistry(registry: any): registry is BoxRegistry; } //# sourceMappingURL=boxRegistryManager.d.ts.map