UNPKG

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.

27 lines (26 loc) 1.56 kB
import { Databases, Storage, Users, type Models } from "node-appwrite"; export interface TransferOptions { fromDb: Models.Database | undefined; targetDb: Models.Database | undefined; isRemote: boolean; collections?: string[]; transferEndpoint?: string; transferProject?: string; transferKey?: string; sourceBucket?: Models.Bucket; targetBucket?: Models.Bucket; transferUsers?: boolean; } export declare const transferStorageLocalToLocal: (storage: Storage, fromBucketId: string, toBucketId: string) => Promise<void>; export declare const transferStorageLocalToRemote: (localStorage: Storage, endpoint: string, projectId: string, apiKey: string, fromBucketId: string, toBucketId: string) => Promise<void>; /** * Transfers all collections and documents from one local database to another local database. * * @param {Databases} localDb - The local database instance. * @param {string} fromDbId - The ID of the source database. * @param {string} targetDbId - The ID of the target database. * @return {Promise<void>} A promise that resolves when the transfer is complete. */ export declare const transferDatabaseLocalToLocal: (localDb: Databases, fromDbId: string, targetDbId: string) => Promise<void>; export declare const transferDatabaseLocalToRemote: (localDb: Databases, endpoint: string, projectId: string, apiKey: string, fromDbId: string, toDbId: string) => Promise<void>; export declare const transferUsersLocalToRemote: (localUsers: Users, endpoint: string, projectId: string, apiKey: string) => Promise<void>;