appwrite-utils
Version:
30 lines (29 loc) • 1.3 kB
TypeScript
/**
* @fileoverview Node-only directory resolution helpers for AppwriteConfig.
*
* These helpers touch the filesystem (fs/path) and are NOT browser-safe.
* They live under the `appwrite-utils/node` subpath so the default
* `appwrite-utils` entry stays free of Node-only imports.
*/
import type { AppwriteConfig } from "../schemas/appwriteConfig.js";
/**
* Helper function to determine the appropriate directory for collections/tables based on API mode.
*
* Intelligently selects between 'collections' and 'tables' directories based on:
* 1. Explicit API mode configuration
* 2. Filesystem analysis (when path provided)
* 3. Backward compatibility defaults
*/
export declare function getVersionAwareDirectory(config: AppwriteConfig, appwriteFolderPath?: string): string;
/**
* Explicit API mode override with fallback to config-based detection.
*/
export declare function resolveDirectoryForApiMode(config: AppwriteConfig, apiMode?: 'legacy' | 'tablesdb', appwriteFolderPath?: string): string;
/**
* Returns both directory paths simultaneously, enabling applications that need
* to support both APIs concurrently or during migration periods.
*/
export declare function getDualDirectoryPaths(config: AppwriteConfig): {
collectionsDirectory: string;
tablesDirectory: string;
};