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.
26 lines (25 loc) • 1.36 kB
TypeScript
import { type AppwriteConfig } from "appwrite-utils";
/**
* Recursively searches for configuration files starting from the given directory.
* Priority: 1) YAML configs in .appwrite directories, 2) appwriteConfig.ts files in subdirectories
* @param dir The directory to start the search from.
* @returns The directory path where the config was found, suitable for passing to loadConfig().
*/
export declare const findAppwriteConfig: (dir: string) => string | null;
/**
* Loads the Appwrite configuration and returns both config and the path where it was found.
* @param configDir The directory to search for config files.
* @returns Object containing the config and the actual path where it was found.
*/
export declare const loadConfigWithPath: (configDir: string) => Promise<{
config: AppwriteConfig;
actualConfigPath: string;
}>;
/**
* Loads the Appwrite configuration and all collection configurations from a specified directory.
* Supports both YAML and TypeScript config formats with backward compatibility.
* @param configDir The directory containing the config file and collections folder.
* @returns The loaded Appwrite configuration including collections.
*/
export declare const loadConfig: (configDir: string) => Promise<AppwriteConfig>;
export declare const findFunctionsDir: (dir: string, depth?: number) => string | null;