@openvireo/sdk - v1.0.0
    Preparing search index...

    Class SelfHostedSync

    Index
    core: SelfHosted
    • get serverUrl(): string

      Returns string

    • Returns Promise<PairingCode>

    • Downloads databases/<databaseId> as the server has it, to save a first copy on this device (no key needed: the bytes are the .kdbx as uploaded, under the database's own password). null when the server has no such database.

      Parameters

      • databaseId: string

      Returns Promise<Uint8Array<ArrayBufferLike> | null>

    • event: database changes until close().

      Parameters

      • onEvent: (e: AccountEvent) => void
      • OptionalonError: (e: unknown) => void

      Returns { close(): void }

    • GET /health, as JSON text. An address that answers but isn't an OpenVireo sync server (a web page, a 404, JSON without status) is not_sync_server with the page's status; an unreachable one is network_error.

      Returns Promise<string>

    • Earlier versions of a database on the server.

      Parameters

      • databaseId: string

      Returns Promise<VaultVersion[]>

    • Returns Promise<BlobMeta[]>

    • Opens an earlier version of a database.

      Parameters

      • databaseId: string
      • revision: number
      • credentials: KdbxCredentials

      Returns Promise<Vault>

    • Syncs a local database (its bytes and credentials: a password, passwordHashCredentials(hash) and/or a key file) with databases/<databaseId>; returns the merged bytes.

      • localChanged: false: nothing changed here since the last sync, so a cheap HEAD check runs first and, when the server is unchanged too, kdbx comes back as it is (outcome "unchanged"). Default true.
      • acceptServerState: true: start over from what the server has, after the user confirmed a server_rolled_back or server_lost_database.

      Parameters

      Returns Promise<{ kdbx: Uint8Array; report: SyncReport }>

    • Claims a pairing code ("ABCD-EFGH") for a device token and keeps it in storage.

      Parameters

      Returns Promise<SelfHostedSync>