diff --git a/docs/classes/_firebaseengine_.firebaseengine.html b/docs/classes/_firebaseengine_.firebaseengine.html index a1aa5b9c..c277a25c 100644 --- a/docs/classes/_firebaseengine_.firebaseengine.html +++ b/docs/classes/_firebaseengine_.firebaseengine.html @@ -123,7 +123,7 @@

constructor

  • @@ -152,7 +152,7 @@

    Private admin

    admin: App
    @@ -167,7 +167,7 @@

    jobs

    jobs: Jobs
    @@ -182,7 +182,7 @@

    Private settings

    settings: Settings
    @@ -204,7 +204,7 @@

    exit

  • diff --git a/docs/classes/_jobs_backup_auth_.jobbackupauth.html b/docs/classes/_jobs_backup_auth_.jobbackupauth.html index f6e9504c..cd23db88 100644 --- a/docs/classes/_jobs_backup_auth_.jobbackupauth.html +++ b/docs/classes/_jobs_backup_auth_.jobbackupauth.html @@ -128,7 +128,7 @@

    constructor

    @@ -166,7 +166,7 @@

    admin

    @@ -181,7 +181,7 @@

    Private auth

    auth: Auth.Auth
    @@ -197,7 +197,7 @@

    counter

    @@ -213,7 +213,7 @@

    settings

    @@ -229,7 +229,7 @@

    startTimestamp

    @@ -245,7 +245,7 @@

    stringiferStream

    @@ -261,7 +261,7 @@

    writer

    @@ -284,7 +284,7 @@

    getWorkTime

    @@ -306,7 +306,7 @@

    Private recursiveBackup
    @@ -335,7 +335,7 @@

    run

    diff --git a/docs/classes/_jobs_backup_firestore_.jobbackupfirestore.html b/docs/classes/_jobs_backup_firestore_.jobbackupfirestore.html index 8d27ac35..6f6bb396 100644 --- a/docs/classes/_jobs_backup_firestore_.jobbackupfirestore.html +++ b/docs/classes/_jobs_backup_firestore_.jobbackupfirestore.html @@ -129,7 +129,7 @@

    constructor

    @@ -167,7 +167,7 @@

    admin

    @@ -183,7 +183,7 @@

    counter

    @@ -198,7 +198,7 @@

    Private firestore

    firestore: Firestore.Firestore
    @@ -214,7 +214,7 @@

    settings

    @@ -230,7 +230,7 @@

    startTimestamp

    @@ -246,7 +246,7 @@

    stringiferStream

    @@ -262,7 +262,7 @@

    writer

    @@ -284,7 +284,7 @@

    Private documentBackup

    @@ -313,7 +313,7 @@

    getWorkTime

    @@ -335,7 +335,7 @@

    Private recursiveBackup
    @@ -364,7 +364,7 @@

    run

    diff --git a/docs/classes/_jobs_backup_storage_.jobbackupstorage.html b/docs/classes/_jobs_backup_storage_.jobbackupstorage.html index d5cfacfa..0b217e87 100644 --- a/docs/classes/_jobs_backup_storage_.jobbackupstorage.html +++ b/docs/classes/_jobs_backup_storage_.jobbackupstorage.html @@ -129,7 +129,7 @@

    constructor

    @@ -167,7 +167,7 @@

    admin

    @@ -182,7 +182,7 @@

    Private bucket

    bucket: any
    @@ -198,7 +198,7 @@

    counter

    @@ -214,7 +214,7 @@

    settings

    @@ -230,7 +230,7 @@

    startTimestamp

    @@ -245,7 +245,7 @@

    Private storage

    storage: Storage.Storage
    @@ -261,7 +261,7 @@

    stringiferStream

    @@ -277,7 +277,7 @@

    writer

    @@ -299,7 +299,7 @@

    backupFile

  • @@ -328,7 +328,7 @@

    getWorkTime

    @@ -351,7 +351,7 @@

    run

    diff --git a/docs/classes/_jobs_clean_auth_.jobcleanauth.html b/docs/classes/_jobs_clean_auth_.jobcleanauth.html index 7aed7a06..0a04dc93 100644 --- a/docs/classes/_jobs_clean_auth_.jobcleanauth.html +++ b/docs/classes/_jobs_clean_auth_.jobcleanauth.html @@ -126,7 +126,7 @@

    constructor

    @@ -164,7 +164,7 @@

    admin

    @@ -179,7 +179,7 @@

    Private auth

    auth: Auth.Auth
    @@ -195,7 +195,7 @@

    counter

    @@ -211,7 +211,7 @@

    settings

    @@ -227,7 +227,7 @@

    startTimestamp

    @@ -250,7 +250,7 @@

    getWorkTime

    @@ -272,7 +272,7 @@

    Private recursiveClean

    @@ -301,7 +301,7 @@

    run

    diff --git a/docs/classes/_jobs_clean_firestore_.jobcleanfirestore.html b/docs/classes/_jobs_clean_firestore_.jobcleanfirestore.html index b905add6..7c0ca9cf 100644 --- a/docs/classes/_jobs_clean_firestore_.jobcleanfirestore.html +++ b/docs/classes/_jobs_clean_firestore_.jobcleanfirestore.html @@ -129,7 +129,7 @@

    constructor

    @@ -167,7 +167,7 @@

    admin

    @@ -182,7 +182,7 @@

    Private batch

    batch: Firestore.WriteBatch
    @@ -198,7 +198,7 @@

    counter

    @@ -213,7 +213,7 @@

    Private firestore

    firestore: Firestore.Firestore
    @@ -229,7 +229,7 @@

    settings

    @@ -245,7 +245,7 @@

    startTimestamp

    @@ -260,7 +260,7 @@

    Static batchSize: number = 100

    @@ -282,7 +282,7 @@

    Private batchClean

  • @@ -311,7 +311,7 @@

    getWorkTime

    @@ -333,7 +333,7 @@

    Private recursiveClean

    @@ -362,7 +362,7 @@

    run

    diff --git a/docs/classes/_jobs_clean_storage_.jobcleanstorage.html b/docs/classes/_jobs_clean_storage_.jobcleanstorage.html index d8701d33..e2945924 100644 --- a/docs/classes/_jobs_clean_storage_.jobcleanstorage.html +++ b/docs/classes/_jobs_clean_storage_.jobcleanstorage.html @@ -126,7 +126,7 @@

    constructor

    @@ -164,7 +164,7 @@

    admin

    @@ -179,7 +179,7 @@

    Private bucket

    bucket: any
    @@ -195,7 +195,7 @@

    counter

    @@ -211,7 +211,7 @@

    settings

    @@ -227,7 +227,7 @@

    startTimestamp

    @@ -242,7 +242,7 @@

    Private storage

    storage: Storage.Storage
    @@ -265,7 +265,7 @@

    getWorkTime

    @@ -288,7 +288,7 @@

    run

    diff --git a/docs/classes/_jobs_jobs_.jobs.html b/docs/classes/_jobs_jobs_.jobs.html index cb9cd01e..c04f0da0 100644 --- a/docs/classes/_jobs_jobs_.jobs.html +++ b/docs/classes/_jobs_jobs_.jobs.html @@ -125,7 +125,7 @@

    constructor

    @@ -163,7 +163,7 @@

    admin

    @@ -178,7 +178,7 @@

    backup

    backup: JobsBackup
    @@ -193,7 +193,7 @@

    clean

    clean: JobsClean
    @@ -208,7 +208,7 @@

    restore

    restore: JobsRestore
    @@ -224,7 +224,7 @@

    settings

    diff --git a/docs/classes/_jobs_jobs_.jobsbackup.html b/docs/classes/_jobs_jobs_.jobsbackup.html index 6eeb8f90..ffdb68fa 100644 --- a/docs/classes/_jobs_jobs_.jobsbackup.html +++ b/docs/classes/_jobs_jobs_.jobsbackup.html @@ -130,7 +130,7 @@

    constructor

    @@ -168,7 +168,7 @@

    admin

    @@ -184,7 +184,7 @@

    settings

    @@ -207,7 +207,7 @@

    auth

    @@ -230,7 +230,7 @@

    firestore

    @@ -253,7 +253,7 @@

    storage

    diff --git a/docs/classes/_jobs_jobs_.jobsclean.html b/docs/classes/_jobs_jobs_.jobsclean.html index 552a712f..179666e7 100644 --- a/docs/classes/_jobs_jobs_.jobsclean.html +++ b/docs/classes/_jobs_jobs_.jobsclean.html @@ -130,7 +130,7 @@

    constructor

    @@ -168,7 +168,7 @@

    admin

    @@ -184,7 +184,7 @@

    settings

    @@ -207,7 +207,7 @@

    auth

    @@ -230,7 +230,7 @@

    firestore

    @@ -253,7 +253,7 @@

    storage

    diff --git a/docs/classes/_jobs_jobs_.jobsrestore.html b/docs/classes/_jobs_jobs_.jobsrestore.html index 5c17c0f0..3bef4a69 100644 --- a/docs/classes/_jobs_jobs_.jobsrestore.html +++ b/docs/classes/_jobs_jobs_.jobsrestore.html @@ -130,7 +130,7 @@

    constructor

    @@ -168,7 +168,7 @@

    admin

    @@ -184,7 +184,7 @@

    settings

    @@ -207,7 +207,7 @@

    auth

    @@ -230,7 +230,7 @@

    firestore

    @@ -253,7 +253,7 @@

    storage

    diff --git a/docs/classes/_jobs_restore_auth_.jobrestoreauth.html b/docs/classes/_jobs_restore_auth_.jobrestoreauth.html index 184f5294..2c5f1c5f 100644 --- a/docs/classes/_jobs_restore_auth_.jobrestoreauth.html +++ b/docs/classes/_jobs_restore_auth_.jobrestoreauth.html @@ -135,7 +135,7 @@

    constructor

    @@ -173,7 +173,7 @@

    admin

    @@ -188,7 +188,7 @@

    Private auth

    auth: Auth.Auth
    @@ -204,7 +204,7 @@

    counter

    @@ -220,7 +220,7 @@

    fileStream

    @@ -236,7 +236,7 @@

    Optional gunzipStream

    Inherited from JobBackupSRestoreTemplate.gunzipStream

    @@ -252,7 +252,7 @@

    parserStream

    @@ -268,7 +268,7 @@

    settings

    @@ -284,7 +284,7 @@

    startTimestamp

    @@ -299,7 +299,7 @@

    Private writeStream

    writeStream: Writable
    @@ -322,7 +322,7 @@

    getWorkTime

    @@ -345,7 +345,7 @@

    run

    @@ -366,7 +366,7 @@

    Private writeBuffer

    writeBuffer: object
    @@ -380,7 +380,7 @@

    batch

    batch: { uid: string }[] = [] as {uid: string, [key: string]: any}[]
    @@ -395,7 +395,7 @@

    batchSize

    batchSize: number = 100
    @@ -410,7 +410,7 @@

    iteration

    iteration: number = 0
    @@ -429,7 +429,7 @@

    clear

  • @@ -451,7 +451,7 @@

    commit

  • @@ -473,7 +473,7 @@

    set

  • diff --git a/docs/classes/_jobs_restore_firestore_.jobrestorefirestore.html b/docs/classes/_jobs_restore_firestore_.jobrestorefirestore.html index ed4180dd..4aeb2ee3 100644 --- a/docs/classes/_jobs_restore_firestore_.jobrestorefirestore.html +++ b/docs/classes/_jobs_restore_firestore_.jobrestorefirestore.html @@ -135,7 +135,7 @@

    constructor

    @@ -173,7 +173,7 @@

    admin

    @@ -189,7 +189,7 @@

    counter

    @@ -205,7 +205,7 @@

    fileStream

    @@ -220,7 +220,7 @@

    Private firestore

    firestore: Firestore.Firestore = this.admin.firestore()
    @@ -236,7 +236,7 @@

    Optional gunzipStream

    Inherited from JobBackupSRestoreTemplate.gunzipStream

    @@ -252,7 +252,7 @@

    parserStream

    @@ -268,7 +268,7 @@

    settings

    @@ -284,7 +284,7 @@

    startTimestamp

    @@ -299,7 +299,7 @@

    Private writeStream

    writeStream: Writable
    @@ -322,7 +322,7 @@

    getWorkTime

    @@ -345,7 +345,7 @@

    run

    @@ -366,7 +366,7 @@

    Private writeBuffer

    writeBuffer: object
    @@ -380,7 +380,7 @@

    batch

    batch: WriteBatch = this.firestore.batch()
    @@ -395,7 +395,7 @@

    batchSize

    batchSize: number = 100
    @@ -410,7 +410,7 @@

    iteration

    iteration: number = 0
    @@ -429,7 +429,7 @@

    clear

  • @@ -451,7 +451,7 @@

    commit

  • @@ -473,7 +473,7 @@

    set

  • diff --git a/docs/classes/_jobs_restore_storage_.jobrestorestorage.html b/docs/classes/_jobs_restore_storage_.jobrestorestorage.html index a7c05b57..150af00e 100644 --- a/docs/classes/_jobs_restore_storage_.jobrestorestorage.html +++ b/docs/classes/_jobs_restore_storage_.jobrestorestorage.html @@ -130,7 +130,7 @@

    constructor

    @@ -168,7 +168,7 @@

    admin

    @@ -183,7 +183,7 @@

    Private bucket

    bucket: any
    @@ -199,7 +199,7 @@

    counter

    @@ -215,7 +215,7 @@

    fileStream

    @@ -231,7 +231,7 @@

    Optional gunzipStream

    Inherited from JobBackupSRestoreTemplate.gunzipStream

    @@ -247,7 +247,7 @@

    parserStream

    @@ -263,7 +263,7 @@

    settings

    @@ -279,7 +279,7 @@

    startTimestamp

    @@ -294,7 +294,7 @@

    Private storage

    storage: Storage.Storage
    @@ -309,7 +309,7 @@

    Private writeStream

    writeStream: Writable
    @@ -332,7 +332,7 @@

    getWorkTime

    @@ -355,7 +355,7 @@

    run

    diff --git a/docs/classes/_utils_authconverter_.authconverter.html b/docs/classes/_utils_authconverter_.authconverter.html index 14e8660d..cce681c6 100644 --- a/docs/classes/_utils_authconverter_.authconverter.html +++ b/docs/classes/_utils_authconverter_.authconverter.html @@ -112,7 +112,7 @@

    Static userField: string[] = ["customClaims","disabled","displayName","email","emailVerified","metadata","multiFactor","passwordHash","passwordSalt","phoneNumber","photoURL","providerData","tenantId","uid",]

    @@ -136,7 +136,7 @@

    Static fromString

  • @@ -178,7 +178,7 @@

    Static toString

  • diff --git a/docs/classes/_utils_firestoreconverter_.firestoreconverter.html b/docs/classes/_utils_firestoreconverter_.firestoreconverter.html index be615839..087c5885 100644 --- a/docs/classes/_utils_firestoreconverter_.firestoreconverter.html +++ b/docs/classes/_utils_firestoreconverter_.firestoreconverter.html @@ -112,7 +112,7 @@

    Static
    @@ -143,7 +143,7 @@

    Static fromString

  • @@ -174,7 +174,7 @@

    Static
    @@ -213,7 +213,7 @@

    Static toString

  • diff --git a/docs/classes/_utils_initialization_.writer.html b/docs/classes/_utils_initialization_.writer.html index fb14b9bf..a3c955cc 100644 --- a/docs/classes/_utils_initialization_.writer.html +++ b/docs/classes/_utils_initialization_.writer.html @@ -117,7 +117,7 @@

    constructor

  • @@ -149,7 +149,7 @@

    compress

    compress: boolean = false
    @@ -164,7 +164,7 @@

    fileStream

    fileStream: WriteStream
    @@ -179,7 +179,7 @@

    Optional gzipStream

    gzipStream: Gzip
    diff --git a/docs/classes/_utils_logger_.logger.html b/docs/classes/_utils_logger_.logger.html index 67caea38..987e8e43 100644 --- a/docs/classes/_utils_logger_.logger.html +++ b/docs/classes/_utils_logger_.logger.html @@ -112,7 +112,7 @@

    Static error

  • @@ -140,7 +140,7 @@

    Static log

  • @@ -168,7 +168,7 @@

    Static table

  • @@ -196,7 +196,7 @@

    Static warn

  • diff --git a/docs/classes/_utils_storageconverter_.storageconverter.html b/docs/classes/_utils_storageconverter_.storageconverter.html index 1b9483a4..1efb0978 100644 --- a/docs/classes/_utils_storageconverter_.storageconverter.html +++ b/docs/classes/_utils_storageconverter_.storageconverter.html @@ -110,7 +110,7 @@

    Static fromString

  • @@ -141,7 +141,7 @@

    Static toString

  • diff --git a/docs/classes/_utils_template_.jobbackupservicetemplate.html b/docs/classes/_utils_template_.jobbackupservicetemplate.html index 454b86b5..34b179a6 100644 --- a/docs/classes/_utils_template_.jobbackupservicetemplate.html +++ b/docs/classes/_utils_template_.jobbackupservicetemplate.html @@ -144,7 +144,7 @@

    constructor

    @@ -182,7 +182,7 @@

    admin

    @@ -198,7 +198,7 @@

    counter

    @@ -214,7 +214,7 @@

    settings

    @@ -230,7 +230,7 @@

    startTimestamp

    @@ -245,7 +245,7 @@

    stringiferStream

    stringiferStream: Transform
    @@ -260,7 +260,7 @@

    writer

    writer: Writer
    @@ -283,7 +283,7 @@

    getWorkTime

    @@ -306,7 +306,7 @@

    run

    diff --git a/docs/classes/_utils_template_.jobbackupsrestoretemplate.html b/docs/classes/_utils_template_.jobbackupsrestoretemplate.html index 1d183ccb..6f485231 100644 --- a/docs/classes/_utils_template_.jobbackupsrestoretemplate.html +++ b/docs/classes/_utils_template_.jobbackupsrestoretemplate.html @@ -145,7 +145,7 @@

    constructor

    @@ -183,7 +183,7 @@

    admin

    @@ -199,7 +199,7 @@

    counter

    @@ -214,7 +214,7 @@

    fileStream

    fileStream: ReadStream
    @@ -229,7 +229,7 @@

    Optional gunzipStream

    gunzipStream: Gunzip
    @@ -244,7 +244,7 @@

    parserStream

    parserStream: Transform
    @@ -260,7 +260,7 @@

    settings

    @@ -276,7 +276,7 @@

    startTimestamp

    @@ -299,7 +299,7 @@

    getWorkTime

    @@ -322,7 +322,7 @@

    run

    diff --git a/docs/classes/_utils_template_.joboneservicetemplate.html b/docs/classes/_utils_template_.joboneservicetemplate.html index a4f2447a..de2e8eb4 100644 --- a/docs/classes/_utils_template_.joboneservicetemplate.html +++ b/docs/classes/_utils_template_.joboneservicetemplate.html @@ -148,7 +148,7 @@

    constructor

    @@ -186,7 +186,7 @@

    admin

    @@ -201,7 +201,7 @@

    counter

    counter: number = 0
    @@ -217,7 +217,7 @@

    settings

    @@ -232,7 +232,7 @@

    startTimestamp

    startTimestamp: number
    @@ -254,7 +254,7 @@

    getWorkTime

  • @@ -276,7 +276,7 @@

    run

  • diff --git a/docs/classes/_utils_template_.jobonetemplate.html b/docs/classes/_utils_template_.jobonetemplate.html index b44da111..f37d5a5d 100644 --- a/docs/classes/_utils_template_.jobonetemplate.html +++ b/docs/classes/_utils_template_.jobonetemplate.html @@ -141,7 +141,7 @@

    constructor

    @@ -179,7 +179,7 @@

    admin

    @@ -195,7 +195,7 @@

    settings

    @@ -217,7 +217,7 @@

    auth

  • @@ -239,7 +239,7 @@

    firestore

  • @@ -261,7 +261,7 @@

    storage

  • diff --git a/docs/classes/_utils_template_.jobtemplate.html b/docs/classes/_utils_template_.jobtemplate.html index d095a5bc..4e9923dd 100644 --- a/docs/classes/_utils_template_.jobtemplate.html +++ b/docs/classes/_utils_template_.jobtemplate.html @@ -127,7 +127,7 @@

    constructor

  • @@ -164,7 +164,7 @@

    admin

    admin: App
    @@ -179,7 +179,7 @@

    settings

    settings: Settings
    diff --git a/docs/interfaces/_utils_initialization_.parsedsettings.html b/docs/interfaces/_utils_initialization_.parsedsettings.html index 527fc8cb..47ba78e1 100644 --- a/docs/interfaces/_utils_initialization_.parsedsettings.html +++ b/docs/interfaces/_utils_initialization_.parsedsettings.html @@ -110,7 +110,7 @@

    Optional backup

    backup: undefined | string
    @@ -125,7 +125,7 @@

    compress

    compress: boolean
    @@ -140,7 +140,7 @@

    hash_config

    hash_config: { algorithm?: auth.HashAlgorithmType; base64_salt_separator?: Buffer; base64_signer_key?: Buffer; mem_cost?: undefined | number; rounds?: undefined | number }
    @@ -175,7 +175,7 @@

    operations

    operations: ("backup" | "clean" | "restore")[]
    @@ -190,7 +190,7 @@

    Optional path

    path: undefined | string
    @@ -205,7 +205,7 @@

    services

    services: ("firestore" | "auth" | "storage")[]
    diff --git a/docs/interfaces/_utils_initialization_.settings.html b/docs/interfaces/_utils_initialization_.settings.html index f7ed1dc1..06a0ffd1 100644 --- a/docs/interfaces/_utils_initialization_.settings.html +++ b/docs/interfaces/_utils_initialization_.settings.html @@ -109,7 +109,7 @@

    backup

    backup: string
    @@ -124,7 +124,7 @@

    compress

    compress: boolean
    @@ -139,7 +139,7 @@

    Optional hash_config

    hash_config: undefined | { algorithm: auth.HashAlgorithmType; key: Buffer; memoryCost: number; rounds: number; saltSeparator: Buffer }
    @@ -154,7 +154,7 @@

    path

    path: string
    @@ -169,7 +169,7 @@

    serviceAccount

    serviceAccount: {}
    diff --git a/docs/interfaces/_utils_initialization_.settingsbeforeinitialization.html b/docs/interfaces/_utils_initialization_.settingsbeforeinitialization.html index efef0136..a5ee6efd 100644 --- a/docs/interfaces/_utils_initialization_.settingsbeforeinitialization.html +++ b/docs/interfaces/_utils_initialization_.settingsbeforeinitialization.html @@ -108,7 +108,7 @@

    Optional backup

    backup: undefined | string
    @@ -123,7 +123,7 @@

    compress

    compress: boolean
    @@ -138,7 +138,7 @@

    Optional hash_config

    hash_config: undefined | { algorithm?: auth.HashAlgorithmType; base64_salt_separator?: Buffer; base64_signer_key?: Buffer; mem_cost?: undefined | number; rounds?: undefined | number }
    @@ -153,7 +153,7 @@

    Optional path

    path: undefined | string
    diff --git a/docs/interfaces/_utils_template_.datamodel.html b/docs/interfaces/_utils_template_.datamodel.html index d2205a8a..607c24c8 100644 --- a/docs/interfaces/_utils_template_.datamodel.html +++ b/docs/interfaces/_utils_template_.datamodel.html @@ -107,7 +107,7 @@

    data

    data: string
    @@ -122,7 +122,7 @@

    path

    path: string
    @@ -137,7 +137,7 @@

    service

    service: "firestore" | "auth" | "storage"
    diff --git a/docs/modules/_bin_firebase_engine_.html b/docs/modules/_bin_firebase_engine_.html index 6349ee61..66971e31 100644 --- a/docs/modules/_bin_firebase_engine_.html +++ b/docs/modules/_bin_firebase_engine_.html @@ -93,7 +93,7 @@

    Const arg

    arg: { Description: string; Name: string; Short name: string }[] = [{"Name": "operations","Short name": "o","Description": "backup (b), restore (r) or clean (c). Default: backup"},{"Name": "path","Short name": "p","Description": "Path to service account JSON file"},{"Name": "services","Short name": "s","Description": "firestore (f), storage (s), auth (a), can be separated by commas. Default: all"},{"Name": "backup","Short name": "b","Description": "Path to backup or restore file. Default: ./{$PROJECT_ID + $TIMESTAMP}.backup"},{"Name": "--nocompress","Short name": "-nc","Description": "Do not use data compression"},{"Name": "algorithm","Short name": "alg","Description": "The password hashing information (algorithm). Default: SCRYPT"},{"Name": "base64_signer_key","Short name": "bsk","Description": "The password hashing information (key in base64 encoding). Default: user passwords are not restored if not set."},{"Name": "base64_salt_separator","Short name": "bss","Description": "The password hashing information (salt separator in base64). Default: Bw=="},{"Name": "rounds","Short name": "rnd","Description": "The password hashing information (rounds). Default: 8"},{"Name": "mem_cost","Short name": "mc","Description": "The password hashing information (memory cost). Default: 14"}]
    @@ -115,7 +115,7 @@

    errorHandler

  • diff --git a/docs/modules/_utils_initialization_.html b/docs/modules/_utils_initialization_.html index 756f4a92..4bb8bb97 100644 --- a/docs/modules/_utils_initialization_.html +++ b/docs/modules/_utils_initialization_.html @@ -110,7 +110,7 @@

    Const store

    store: { admin?: app.App; settings?: Settings }
    @@ -146,7 +146,7 @@

    Const writers

    writers: {}
    @@ -176,7 +176,7 @@

    Const cmdParser

  • @@ -204,7 +204,7 @@

    Const createWriteFile
    @@ -240,7 +240,7 @@

    Const initialization

  • diff --git a/docs/modules/_utils_template_.html b/docs/modules/_utils_template_.html index faa35b51..9a1a759f 100644 --- a/docs/modules/_utils_template_.html +++ b/docs/modules/_utils_template_.html @@ -103,7 +103,7 @@

    Const Objectstream

    Objectstream: any = require("@sergdudko/objectstream")
    diff --git a/package.json b/package.json index b115d828..aa6e6d8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firebase-engine", - "version": "1.2.1", + "version": "1.2.2", "description": "Tools for firebase (backup, clean, restore)", "main": "./lib/index.js", "scripts": { diff --git a/src/utils/FirestoreConverter.ts b/src/utils/FirestoreConverter.ts index 4493e2fe..d665d82d 100644 --- a/src/utils/FirestoreConverter.ts +++ b/src/utils/FirestoreConverter.ts @@ -54,7 +54,7 @@ export class FirestoreConverter { _obj.data[key] = FirestoreConverter.toObject(d[key]) return _obj } - return { data: JSON.stringify(d), type: "custom" } + throw new Error("Invalid data type.") } /** * Convert string to object @@ -69,35 +69,33 @@ export class FirestoreConverter { * @param d - Object for serialization */ private static fromObject(d: any){ - if(d.type === "string") - return d.data - if(d.type === "number") - return d.data - if(d.type === "boolean") - return d.data - if(d.type === "null") - return null - if(d.type === "binary") - return Buffer.from(d.data, "base64") - if(d.type === "timestamp") - return new Firestore.Timestamp(d.data.sec, d.data.nano) - if(d.type === "document") - return Firestore().doc(d.data) - if(d.type === "geopoint") - return new Firestore.GeoPoint(d.data.lat, d.data.long) - if(d.type === "array"){ - const _arr: any[] = [] - for(const val of d.data) - _arr.push(FirestoreConverter.fromObject(val)) - return _arr - } - if(d.type === "map"){ - const _obj: {[key: string]: any} = {} - for(const key in d.data) - _obj[key] = FirestoreConverter.fromObject(d.data[key]) - return _obj + switch(d.type){ + case "string": + case "number": + case "boolean": + return d.data + case "null": + return null + case "binary": + return Buffer.from(d.data, "base64") + case "timestamp": + return new Firestore.Timestamp(d.data.sec, d.data.nano) + case "document": + return Firestore().doc(d.data) + case "geopoint": + return new Firestore.GeoPoint(d.data.lat, d.data.long) + case "array": + const _arr: any[] = [] + for(const val of d.data) + _arr.push(FirestoreConverter.fromObject(val)) + return _arr + case "map": + const _obj: {[key: string]: any} = {} + for(const key in d.data) + _obj[key] = FirestoreConverter.fromObject(d.data[key]) + return _obj + default: + throw new Error("Invalid data type.") } - if(d.type === "custom") - return JSON.parse(d.data) } } \ No newline at end of file