UNPKG

@vorlefan/prisma-backup

Version:

Export all the databse models into json files and use them as backup

49 lines (48 loc) 1.56 kB
import { IFileManager_Files } from '@vorlefan/path/dist/types'; import { PathRoute } from '@vorlefan/path'; import { GetBackupHelper } from '../modules/get-backup/models/helper'; export declare type BackupModelsValue = Array<Record<any, any>>; export declare type BackupModels = Record<string, BackupModelsValue>; export declare type BackupProps = { encrypt?: boolean; password?: string; folder?: string; models: BackupModels; onRoute?: (route: PathRoute) => any; backupFolderName?: string; compress?: boolean; }; export declare type BackupRecursiveProps = { encrypt?: boolean; password?: string; folder?: string; models: BackupModels; route: PathRoute; keys: string[]; progress: any; }; export declare type BackupModelProps = { encrypt?: boolean; password?: string; folder?: string; currentModel: BackupModelsValue; key: string; route: PathRoute; }; export declare type BackupModelFileEncrypted = { iv: string; encrypted: string; }; export declare type GetBackupOnCurrentModelPropsContext = { instance: GetBackupHelper; currentModel: Record<any, any>; currentFile: IFileManager_Files; }; export declare type GetBackupOnCurrentModelProps = (props: GetBackupOnCurrentModelPropsContext) => Promise<void>; export declare type GetBackupProps = { password?: string; folder?: string; backupFolderName?: string; onRoute?: (route: PathRoute) => any; onCurrentModel: GetBackupOnCurrentModelProps; };