appwrite-utils-cli
Version:
Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.
38 lines (37 loc) • 1.75 kB
TypeScript
/**
* Expands tilde (~) in paths to the user's home directory
* @param pathStr - Path string that may contain ~
* @returns Expanded path with home directory
*/
export declare function expandTildePath(pathStr: string): string;
/**
* Normalizes function name to standard format (lowercase, dashes instead of spaces)
* @param name - Function name to normalize
* @returns Normalized function name
*/
export declare function normalizeFunctionName(name: string): string;
/**
* Validates that a directory exists and contains function markers
* @param dirPath - Directory path to validate
* @returns True if directory is a valid function directory
*/
export declare function validateFunctionDirectory(dirPath: string): boolean;
/**
* Helper function to search for function in standard locations
* @param configDirPath - Directory where config file is located
* @param normalizedName - Normalized function name
* @returns First valid function directory path or undefined
*/
export declare function findFunctionInStandardLocations(configDirPath: string, normalizedName: string): string | undefined;
/**
* Resolves the absolute path to a function directory
* Handles multiple resolution strategies with proper priority
*
* @param functionName - Name of the function
* @param configDirPath - Directory where config file is located
* @param dirPath - Optional explicit dirPath from config
* @param explicitPath - Optional path passed as parameter (highest priority)
* @returns Absolute path to the function directory
* @throws Error if function directory cannot be found or is invalid
*/
export declare function resolveFunctionDirectory(functionName: string, configDirPath: string, dirPath?: string, explicitPath?: string): string;