Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/backup/backup

Manage backup data on the cloud

Index

Variables

Const BACKUP_FILENAME

BACKUP_FILENAME: "backup.txt" = "backup.txt"

Filename in zip file

Const BACKUP_ID_KEY

BACKUP_ID_KEY: "backupFileId" = "backupFileId"

Local Storage key for last backup fileId

Functions

addAllData

deleteAllData

  • deleteAllData(): Promise<void>

doBackup

  • doBackup(interactive?: boolean): Promise<void>
  • Perform the backup of our device

    throws

    An error on failure

    Parameters

    • Default value interactive: boolean = false

      true if user initiated

    Returns Promise<void>

doDelete

  • doDelete(fileId: DriveFileId, interactive?: boolean): Promise<void>
  • Delete a backup file

    Parameters

    • fileId: DriveFileId

      drive id to restore

    • Default value interactive: boolean = false

      true if user initiated

    Returns Promise<void>

doRestore

  • doRestore(fileId: DriveFileId, interactive?: boolean): Promise<void>
  • Perform a restore

    throws

    An error on failure

    Parameters

    • fileId: DriveFileId

      drive id to restore

    • Default value interactive: boolean = false

      true if user initiated

    Returns Promise<void>

doSync

  • doSync(file: BackupFile, interactive?: boolean): Promise<string>
  • Perform a sync between our data and a backup's

    Parameters

    • file: BackupFile

      file to sync with

    • Default value interactive: boolean = false

      true if user initiated

    Returns Promise<string>

    new Drive file id

getAllData

getMyAppProperties

getMyZipFilename

  • getMyZipFilename(): string

replaceBackup

  • Replace a backup on Google Drive

    throws

    An error on failure

    Parameters

    • backupFile: BackupFile

      file to replace

    • data: IBackupData

      for the backup

    • Default value interactive: boolean = false

    Returns Promise<string>

    new Drive file id

restoreTransaction

  • restoreTransaction(dbData: IBackupData): Promise<void>

syncTransaction

Object literals

Const ERR

ERR: object

Error messages

NO_BACKUP

NO_BACKUP: string = "Backup not enabled."

NO_DATA

NO_DATA: string = "No data to backup."

NO_FILE_ID

NO_FILE_ID: string = "No file id was found."

NO_SIGNIN

NO_SIGNIN: string = "Not signed in."

PARSE

PARSE: string = "Failed to parse data."

STRINGIFY

STRINGIFY: string = "Failed to stringify data."

Generated using TypeDoc