import { Module, PreDB, TypedMap, UniqueId } from '@nu-art/ts-common'; import { DBApiConfigV3, ModuleBE_BaseDB } from '../../../backend/modules/db-api-gen/ModuleBE_BaseDB.js'; import { FirestoreQuery } from '@nu-art/firebase'; import { Readable } from 'stream'; import { FirestoreCollectionV3 } from '@nu-art/firebase/backend/firestore-v3/FirestoreCollectionV3'; import { DB_BackupDoc, DBProto_BackupDoc, FetchBackupDoc } from '../shared/types.js'; import { Request_BackupId, Response_BackupDocs } from '../shared/api-def.js'; export interface OnModuleCleanupV2 { __onCleanupInvokedV2: () => Promise; } type Config = DBApiConfigV3 & { keepInterval: number; minTimeThreshold: number; excludedDbKeys?: string[]; }; type DBModules = ModuleBE_BaseDB; /** * This module is in charge of making a backup of the db in firebase storage, * in order to test this module locally run firebase functions:shell command in a terminal * when the firebase> shows up write the name of the function you want to run and call it "functionName()" * **/ export declare class ModuleBE_BackupDocDB_Class extends Module { collection: FirestoreCollectionV3; constructor(); protected init(): void; getBackupStatusCollection: () => FirestoreCollectionV3; /** * Get metadata objects per each collection module that needs to be backed up. */ getBackupDetails: () => DBModules[]; getBackupInfo(backupId: string, baseUrl: string, headers: TypedMap): Promise; getBackupStreamFromId: (backupInfo: FetchBackupDoc) => Promise; query: (ourQuery: FirestoreQuery) => Promise; queryUnique: (backupDocId: UniqueId) => Promise; upsert: (instance: PreDB) => Promise; deleteItem: (instance: DB_BackupDoc) => Promise; private getDefaultPath; initiateBackup: (force?: boolean, pathInBucket?: string) => Promise<{ pathToBackup: string; backupId: string; } | undefined>; createBackupReadStream: (backupInfo: FetchBackupDoc) => Promise; createBackupReadStreamFromBucket: (pathInBucket: string) => Promise; /** * @param body - needs to contain backupId with the key to fetch. */ fetchBackupDocs: (body: Request_BackupId) => Promise; fetchLatestBackupDoc: () => Promise; private fetchDocImpl; } export declare const ModuleBE_BackupDocDB: ModuleBE_BackupDocDB_Class; export {};