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.
24 lines (23 loc) • 1.97 kB
TypeScript
import { Databases, type Models } from "node-appwrite";
import type { AppwriteConfig, CollectionCreate } from "appwrite-utils";
export declare const documentExists: (db: Databases, dbId: string, targetCollectionId: string, toCreateObject: any) => Promise<Models.Document | null>;
export declare const checkForCollection: (db: Databases, dbId: string, collection: Partial<CollectionCreate>) => Promise<Models.Collection | null>;
export declare const fetchAndCacheCollectionByName: (db: Databases, dbId: string, collectionName: string) => Promise<Models.Collection | undefined>;
export declare const wipeDatabase: (database: Databases, databaseId: string) => Promise<{
collectionId: string;
collectionName: string;
}[]>;
export declare const wipeCollection: (database: Databases, databaseId: string, collectionId: string) => Promise<void>;
export declare const generateSchemas: (config: AppwriteConfig, appwriteFolderPath: string) => Promise<void>;
export declare const createOrUpdateCollections: (database: Databases, databaseId: string, config: AppwriteConfig, deletedCollections?: {
collectionId: string;
collectionName: string;
}[], selectedCollections?: Models.Collection[]) => Promise<void>;
export declare const generateMockData: (database: Databases, databaseId: string, configCollections: any[]) => Promise<void>;
export declare const fetchAllCollections: (dbId: string, database: Databases) => Promise<Models.Collection[]>;
/**
* Transfers all documents from one collection to another in a different database
* within the same Appwrite Project
*/
export declare const transferDocumentsBetweenDbsLocalToLocal: (db: Databases, fromDbId: string, toDbId: string, fromCollId: string, toCollId: string) => Promise<void>;
export declare const transferDocumentsBetweenDbsLocalToRemote: (localDb: Databases, endpoint: string, projectId: string, apiKey: string, fromDbId: string, toDbId: string, fromCollId: string, toCollId: string) => Promise<void>;