API reference
ArgalaEngine
Section titled “ArgalaEngine”static newDeviceId(): stringstatic open<K>(opts: EngineOptions<K>): Promise<ArgalaEngine<K>>
// graphsopenGraph(graphId, o?: SubscriptionSpec & {create?: boolean}): Promise<GraphStatus>subscribe(graphId, spec: SubscriptionSpec): voidgraphs(): string[]hasKey(graphId): boolean
// recordsput(graphId, {id?, kind, data, deleted?, by?}): Promise<GraphRecord>putMany(graphId, partials[]): Promise<GraphRecord[]>remove(graphId, id): Promise<void>removeMany(graphId, ids[]): Promise<void>get(graphId, id): Promise<GraphRecord | null>list(graphId): Promise<GraphRecord[]>listKind(graphId, kind, limit?): Promise<GraphRecord[]>search(graphId, query, limit?): Promise<GraphRecord[]>searchAll(query, limit?): Promise<Array<{graphId, record}>>personalId(kind, target): Promise<string>
// reactivitywatch<T>(graphId, query, onResult): () => voidon(event: EngineEventName | '*', fn): () => voidreadonly status: EngineStatus
// syncsync(): Promise<void>syncGraph(graphId): Promise<void>flush(): Promise<void>poke(graphId): Promise<void>startAutoSync(everyMs?): voidstopAutoSync(): voidclose(): Promise<void>
// keys and devicescreateGraphKey(graphId): Promise<GraphStatus>grantPending(graphId): Promise<number>rotate(graphId): Promise<number>listDevices(): Promise<Array<{deviceId, pubJwk, sigJwk, selfSig, label, createdAt, revokedAt, current}>>
// approving a device before it is handed a key — see Part 14pendingDevices(graphId?): Promise<PendingDevice[]>myPairingCode(): Promise<string>approveDevice(deviceId, fingerprint): Promise<void>rejectDevice(deviceId): Promise<void>forgetDevice(deviceId): Promise<void>trustedDevices(): Array<{deviceId} & Pin>revokeDevice(deviceId): Promise<{rotated: string[]; failed: string[]; owed: number}>
// invites and recoverysealKeyringForInvite(graphId): Promise<{salt, sealedKeyring, keySecret} | null>acceptInviteKeyring(graphId, {salt, sealedKeyring, keySecret}, spec?): Promise<boolean>exportBundle(passphrase): Promise<string>importBundle(blob, passphrase): Promise<void>
// blobsuploadBlob(graphId, bytes, {policy?, ttlMs?}): Promise<string>downloadBlob(graphId, blobId): Promise<Uint8Array>ackBlob(graphId, blobId): Promise<void>@argala/client exports
Section titled “@argala/client exports”ArgalaEngine, HttpTransport, TransportErrorMemoryGraphStore, IdbGraphStore, OpfsGraphStore, SqlGraphStore, bestStore, migrateStoreMemoryKeyStore, IdbKeyStoredefineKinds, validateRecord, recordBytes, RESERVED_PREFIXrequestPersistence, storageEstimate, pressure, PRESSURE_WARNINGformatPairingCode// typesEngineOptions, EngineStatus, EngineEvent, EngineEventName, GraphStatus, GraphKeyState,LogVerification, LogAlarmReason, StorageStatus, RetryPolicy, SubscriptionSpec, Transport,HttpTransportOptions, PullFilter, GraphStore, KeyStore, KindRegistry, KindValidator,KindData, ValidationFailure, GraphRecord, RosterDevice, Pin, PendingDevice@argala/client/node: NodeSqliteGraphStore, FileKeyStore, SqlGraphStore.
@argala/client/opfs-worker: the worker entry point for OpfsGraphStore.
@argala/relay exports
Section titled “@argala/relay exports”registerRelay, sweepBlobs, DEFAULT_QUOTASopenDb, migrate, transact, now, Statements, SCHEMA_VERSIONSqliteDirectory, SqliteBlobStore, FileBlobStore, ALL_CAPABILITIESMemoryRateLimiter, SharedRateLimiter, MemoryCounterStore, NO_LIMIT// typesRelayOptions, RelayQuotas, RelayRateLimits, RelayEvent, ArgalaIdentity, PokeEvent,SweepOptions, Db, OpenDbOptions, Directory, Capability, BlobStore, RateLimiter,BucketSpec, CounterStore@argala/core exports
Section titled “@argala/core exports”argalacrypto // the whole crypto boundary, namespacedLIMITS, PBKDF2_ITERATIONS, CHECKPOINT_KIND, CHECKPOINT_STRIDE, clearKeyCache, sha256B64, parsecomposeInvite, splitInvite, chainGenesis, chainAdvancedeviceFingerprint, pairingCode, formatPairingCode, selfAttestationBytes, PAIRING_CODE_CHARSjwkThumbprint, crockford32, parseCrockford, stretchBytesrecordSigningBytes, recordAad, blobAad, storageKeyFor, isSafeId, splitFilter// schemas and typesGraphId, GraphOpIn, GraphOpOut, GraphPush, GraphPushResp, GraphPullResp, PullQuery,LogEntry, LogQuery, LogResp, Checkpoint,GraphRecordShape, RecordEnvelope, GraphRecord, Keyring, KeyringShape, DeviceRegister,RosterDevice, KeyGap, GraphKeysPut, GraphKeysResp, RecoveryBundle, RecoveryPayload,Sealed, WrappedKey, DeviceKeyPair