feat: complete Ancestor quote bot with production-ready Docker support
This commit is contained in:
148
node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.d.ts
generated
vendored
148
node_modules/matrix-js-sdk/lib/crypto/store/indexeddb-crypto-store-backend.d.ts
generated
vendored
@@ -1,12 +1,14 @@
|
||||
import { type Logger } from "../../logger.ts";
|
||||
import { type CryptoStore, type IDeviceData, type ISession, type SessionExtended, type ISessionInfo, type IWithheld, MigrationState, type Mode, type SecretStorePrivateKeys, type InboundGroupSessionData, type IRoomEncryption } from "./base.ts";
|
||||
import { type CrossSigningKeyInfo } from "../../crypto-api/index.ts";
|
||||
import { PrefixedLogger } from "../../logger";
|
||||
import { CryptoStore, IDeviceData, IProblem, ISession, ISessionInfo, IWithheld, Mode, OutgoingRoomKeyRequest, ParkedSharedHistory, SecretStorePrivateKeys } from "./base";
|
||||
import { IRoomKeyRequestBody } from "../index";
|
||||
import { ICrossSigningKey } from "../../client";
|
||||
import { IOlmDevice } from "../algorithms/megolm";
|
||||
import { IRoomEncryption } from "../RoomList";
|
||||
import { InboundGroupSessionData } from "../OlmDevice";
|
||||
/**
|
||||
* Implementation of a CryptoStore which is backed by an existing
|
||||
* IndexedDB connection. Generally you want IndexedDBCryptoStore
|
||||
* which connects to the database and defers to one of these.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare class Backend implements CryptoStore {
|
||||
private db;
|
||||
@@ -14,80 +16,114 @@ export declare class Backend implements CryptoStore {
|
||||
/**
|
||||
*/
|
||||
constructor(db: IDBDatabase);
|
||||
containsData(): Promise<boolean>;
|
||||
startup(): Promise<CryptoStore>;
|
||||
deleteAllData(): Promise<void>;
|
||||
/**
|
||||
* Get data on how much of the libolm to Rust Crypto migration has been done.
|
||||
* Look for an existing outgoing room key request, and if none is found,
|
||||
* add a new one
|
||||
*
|
||||
* Implementation of {@link CryptoStore.getMigrationState}.
|
||||
*
|
||||
* @returns resolves to
|
||||
* {@link OutgoingRoomKeyRequest}: either the
|
||||
* same instance as passed in, or the existing one.
|
||||
*/
|
||||
getMigrationState(): Promise<MigrationState>;
|
||||
getOrAddOutgoingRoomKeyRequest(request: OutgoingRoomKeyRequest): Promise<OutgoingRoomKeyRequest>;
|
||||
/**
|
||||
* Set data on how much of the libolm to Rust Crypto migration has been done.
|
||||
* Look for an existing room key request
|
||||
*
|
||||
* Implementation of {@link CryptoStore.setMigrationState}.
|
||||
* @param requestBody - existing request to look for
|
||||
*
|
||||
* @returns resolves to the matching
|
||||
* {@link OutgoingRoomKeyRequest}, or null if
|
||||
* not found
|
||||
*/
|
||||
setMigrationState(migrationState: MigrationState): Promise<void>;
|
||||
getOutgoingRoomKeyRequest(requestBody: IRoomKeyRequestBody): Promise<OutgoingRoomKeyRequest | null>;
|
||||
/**
|
||||
* look for an existing room key request in the db
|
||||
*
|
||||
* @internal
|
||||
* @param txn - database transaction
|
||||
* @param requestBody - existing request to look for
|
||||
* @param callback - function to call with the results of the
|
||||
* search. Either passed a matching
|
||||
* {@link OutgoingRoomKeyRequest}, or null if
|
||||
* not found.
|
||||
*/
|
||||
private _getOutgoingRoomKeyRequest;
|
||||
/**
|
||||
* Look for room key requests by state
|
||||
*
|
||||
* @param wantedStates - list of acceptable states
|
||||
*
|
||||
* @returns resolves to the a
|
||||
* {@link OutgoingRoomKeyRequest}, or null if
|
||||
* there are no pending requests in those states. If there are multiple
|
||||
* requests in those states, an arbitrary one is chosen.
|
||||
*/
|
||||
getOutgoingRoomKeyRequestByState(wantedStates: number[]): Promise<OutgoingRoomKeyRequest | null>;
|
||||
/**
|
||||
*
|
||||
* @returns All elements in a given state
|
||||
*/
|
||||
getAllOutgoingRoomKeyRequestsByState(wantedState: number): Promise<OutgoingRoomKeyRequest[]>;
|
||||
getOutgoingRoomKeyRequestsByTarget(userId: string, deviceId: string, wantedStates: number[]): Promise<OutgoingRoomKeyRequest[]>;
|
||||
/**
|
||||
* Look for an existing room key request by id and state, and update it if
|
||||
* found
|
||||
*
|
||||
* @param requestId - ID of request to update
|
||||
* @param expectedState - state we expect to find the request in
|
||||
* @param updates - name/value map of updates to apply
|
||||
*
|
||||
* @returns resolves to
|
||||
* {@link OutgoingRoomKeyRequest}
|
||||
* updated request, or null if no matching row was found
|
||||
*/
|
||||
updateOutgoingRoomKeyRequest(requestId: string, expectedState: number, updates: Partial<OutgoingRoomKeyRequest>): Promise<OutgoingRoomKeyRequest | null>;
|
||||
/**
|
||||
* Look for an existing room key request by id and state, and delete it if
|
||||
* found
|
||||
*
|
||||
* @param requestId - ID of request to update
|
||||
* @param expectedState - state we expect to find the request in
|
||||
*
|
||||
* @returns resolves once the operation is completed
|
||||
*/
|
||||
deleteOutgoingRoomKeyRequest(requestId: string, expectedState: number): Promise<OutgoingRoomKeyRequest | null>;
|
||||
getAccount(txn: IDBTransaction, func: (accountPickle: string | null) => void): void;
|
||||
storeAccount(txn: IDBTransaction, accountPickle: string): void;
|
||||
getCrossSigningKeys(txn: IDBTransaction, func: (keys: Record<string, CrossSigningKeyInfo> | null) => void): void;
|
||||
getCrossSigningKeys(txn: IDBTransaction, func: (keys: Record<string, ICrossSigningKey> | null) => void): void;
|
||||
getSecretStorePrivateKey<K extends keyof SecretStorePrivateKeys>(txn: IDBTransaction, func: (key: SecretStorePrivateKeys[K] | null) => void, type: K): void;
|
||||
storeCrossSigningKeys(txn: IDBTransaction, keys: Record<string, ICrossSigningKey>): void;
|
||||
storeSecretStorePrivateKey<K extends keyof SecretStorePrivateKeys>(txn: IDBTransaction, type: K, key: SecretStorePrivateKeys[K]): void;
|
||||
countEndToEndSessions(txn: IDBTransaction, func: (count: number) => void): void;
|
||||
getEndToEndSessions(deviceKey: string, txn: IDBTransaction, func: (sessions: {
|
||||
[sessionId: string]: ISessionInfo;
|
||||
}) => void): void;
|
||||
getEndToEndSession(deviceKey: string, sessionId: string, txn: IDBTransaction, func: (session: ISessionInfo | null) => void): void;
|
||||
getAllEndToEndSessions(txn: IDBTransaction, func: (session: ISessionInfo | null) => void): void;
|
||||
storeEndToEndSession(deviceKey: string, sessionId: string, sessionInfo: ISessionInfo, txn: IDBTransaction): void;
|
||||
/**
|
||||
* Fetch a batch of Olm sessions from the database.
|
||||
*
|
||||
* Implementation of {@link CryptoStore.getEndToEndSessionsBatch}.
|
||||
*/
|
||||
getEndToEndSessionsBatch(): Promise<null | ISessionInfo[]>;
|
||||
/**
|
||||
* Delete a batch of Olm sessions from the database.
|
||||
*
|
||||
* Implementation of {@link CryptoStore.deleteEndToEndSessionsBatch}.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
deleteEndToEndSessionsBatch(sessions: {
|
||||
deviceKey: string;
|
||||
sessionId: string;
|
||||
}[]): Promise<void>;
|
||||
storeEndToEndSessionProblem(deviceKey: string, type: string, fixed: boolean): Promise<void>;
|
||||
getEndToEndSessionProblem(deviceKey: string, timestamp: number): Promise<IProblem | null>;
|
||||
filterOutNotifiedErrorDevices(devices: IOlmDevice[]): Promise<IOlmDevice[]>;
|
||||
getEndToEndInboundGroupSession(senderCurve25519Key: string, sessionId: string, txn: IDBTransaction, func: (groupSession: InboundGroupSessionData | null, groupSessionWithheld: IWithheld | null) => void): void;
|
||||
getAllEndToEndInboundGroupSessions(txn: IDBTransaction, func: (session: ISession | null) => void): void;
|
||||
addEndToEndInboundGroupSession(senderCurve25519Key: string, sessionId: string, sessionData: InboundGroupSessionData, txn: IDBTransaction): void;
|
||||
storeEndToEndInboundGroupSession(senderCurve25519Key: string, sessionId: string, sessionData: InboundGroupSessionData, txn: IDBTransaction): void;
|
||||
/**
|
||||
* Count the number of Megolm sessions in the database.
|
||||
*
|
||||
* Implementation of {@link CryptoStore.countEndToEndInboundGroupSessions}.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
countEndToEndInboundGroupSessions(): Promise<number>;
|
||||
/**
|
||||
* Fetch a batch of Megolm sessions from the database.
|
||||
*
|
||||
* Implementation of {@link CryptoStore.getEndToEndInboundGroupSessionsBatch}.
|
||||
*/
|
||||
getEndToEndInboundGroupSessionsBatch(): Promise<null | SessionExtended[]>;
|
||||
/**
|
||||
* Delete a batch of Megolm sessions from the database.
|
||||
*
|
||||
* Implementation of {@link CryptoStore.deleteEndToEndInboundGroupSessionsBatch}.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
deleteEndToEndInboundGroupSessionsBatch(sessions: {
|
||||
senderKey: string;
|
||||
sessionId: string;
|
||||
}[]): Promise<void>;
|
||||
storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key: string, sessionId: string, sessionData: IWithheld, txn: IDBTransaction): void;
|
||||
getEndToEndDeviceData(txn: IDBTransaction, func: (deviceData: IDeviceData | null) => void): void;
|
||||
storeEndToEndDeviceData(deviceData: IDeviceData, txn: IDBTransaction): void;
|
||||
storeEndToEndRoom(roomId: string, roomInfo: IRoomEncryption, txn: IDBTransaction): void;
|
||||
getEndToEndRooms(txn: IDBTransaction, func: (rooms: Record<string, IRoomEncryption>) => void): void;
|
||||
getSessionsNeedingBackup(limit: number): Promise<ISession[]>;
|
||||
countSessionsNeedingBackup(txn?: IDBTransaction): Promise<number>;
|
||||
unmarkSessionsNeedingBackup(sessions: ISession[], txn?: IDBTransaction): Promise<void>;
|
||||
markSessionsNeedingBackup(sessions: ISession[], txn?: IDBTransaction): Promise<void>;
|
||||
doTxn<T>(mode: Mode, stores: string | string[], func: (txn: IDBTransaction) => T, log?: Logger): Promise<T>;
|
||||
addSharedHistoryInboundGroupSession(roomId: string, senderKey: string, sessionId: string, txn?: IDBTransaction): void;
|
||||
getSharedHistoryInboundGroupSessions(roomId: string, txn?: IDBTransaction): Promise<[senderKey: string, sessionId: string][]>;
|
||||
addParkedSharedHistory(roomId: string, parkedData: ParkedSharedHistory, txn?: IDBTransaction): void;
|
||||
takeParkedSharedHistory(roomId: string, txn?: IDBTransaction): Promise<ParkedSharedHistory[]>;
|
||||
doTxn<T>(mode: Mode, stores: string | string[], func: (txn: IDBTransaction) => T, log?: PrefixedLogger): Promise<T>;
|
||||
}
|
||||
export declare const VERSION: number;
|
||||
export declare function upgradeDatabase(db: IDBDatabase, oldVersion: number): void;
|
||||
|
||||
Reference in New Issue
Block a user