diff --git a/.eslintrc.js b/.eslintrc.js index 918ae4365e2..3059df17f4d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -85,5 +85,14 @@ module.exports = { // We use a `logger` intermediary module "no-console": "error", }, + }, { + files: [ + "spec/**/*.ts", + ], + rules: { + // We don't need super strict typing in test utilities + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-member-accessibility": "off", + }, }], }; diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 0054561f47d..fc366fc3aaa 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -72,3 +72,38 @@ jobs: path: _docs # We'll only use this in a workflow_run, then we're done with it retention-days: 1 + + tsc-strict: + name: Typescript Strict Error Checker + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + permissions: + pull-requests: read + checks: write + steps: + - uses: actions/checkout@v3 + + - name: Get diff lines + id: diff + uses: Equip-Collaboration/diff-line-numbers@v1.0.0 + with: + include: '["\\.tsx?$"]' + + - name: Detecting files changed + id: files + uses: futuratrepadeira/changed-files@v4.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + pattern: '^.*\.tsx?$' + + - uses: t3chguy/typescript-check-action@main + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + use-check: false + check-fail-mode: added + output-behaviour: annotate + ts-extra-args: '--noImplicitAny' + files-changed: ${{ steps.files.outputs.files_updated }} + files-added: ${{ steps.files.outputs.files_created }} + files-deleted: ${{ steps.files.outputs.files_deleted }} + line-numbers: ${{ steps.diff.outputs.lineNumbers }} diff --git a/package.json b/package.json index 17d6ef45008..46a062cc826 100644 --- a/package.json +++ b/package.json @@ -99,12 +99,12 @@ "eslint-config-google": "^0.14.0", "eslint-import-resolver-typescript": "^3.5.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-matrix-org": "^0.7.0", + "eslint-plugin-matrix-org": "^0.8.0", "eslint-plugin-unicorn": "^44.0.2", "exorcist": "^2.0.0", "fake-indexeddb": "^4.0.0", "jest": "^29.0.0", - "jest-environment-jsdom": "^28.1.3", + "jest-environment-jsdom": "^29.0.0", "jest-localstorage-mock": "^2.4.6", "jest-mock": "^29.0.0", "matrix-mock-request": "^2.5.0", diff --git a/spec/integ/matrix-client-syncing.spec.ts b/spec/integ/matrix-client-syncing.spec.ts index 216fbdbb1f6..8c3969bee7d 100644 --- a/spec/integ/matrix-client-syncing.spec.ts +++ b/spec/integ/matrix-client-syncing.spec.ts @@ -709,11 +709,11 @@ describe("MatrixClient syncing", () => { const room = client!.getRoom(roomOne)!; const stateAtStart = room.getLiveTimeline().getState(EventTimeline.BACKWARDS)!; const startRoomNameEvent = stateAtStart.getStateEvents('m.room.name', ''); - expect(startRoomNameEvent.getContent().name).toEqual('Old room name'); + expect(startRoomNameEvent!.getContent().name).toEqual('Old room name'); const stateAtEnd = room.getLiveTimeline().getState(EventTimeline.FORWARDS)!; const endRoomNameEvent = stateAtEnd.getStateEvents('m.room.name', ''); - expect(endRoomNameEvent.getContent().name).toEqual('A new room name'); + expect(endRoomNameEvent!.getContent().name).toEqual('A new room name'); }); }); @@ -1599,7 +1599,7 @@ describe("MatrixClient syncing", () => { expect(room.roomId).toBe(roomOne); expect(room.getMyMembership()).toBe("leave"); expect(room.name).toBe("Room Name"); - expect(room.currentState.getStateEvents("m.room.name", "").getId()).toBe("$eventId"); + expect(room.currentState.getStateEvents("m.room.name", "")?.getId()).toBe("$eventId"); expect(room.timeline[0].getContent().body).toBe("Message 1"); expect(room.timeline[1].getContent().body).toBe("Message 2"); client?.stopPeeking(); diff --git a/spec/unit/embedded.spec.ts b/spec/unit/embedded.spec.ts index 436909be73c..3e0ead87169 100644 --- a/spec/unit/embedded.spec.ts +++ b/spec/unit/embedded.spec.ts @@ -179,7 +179,7 @@ describe("RoomWidgetClient", () => { // It should've also inserted the event into the room object const room = client.getRoom("!1:example.org"); expect(room).not.toBeNull(); - expect(room!.currentState.getStateEvents("org.example.foo", "bar").getEffectiveEvent()).toEqual(event); + expect(room!.currentState.getStateEvents("org.example.foo", "bar")?.getEffectiveEvent()).toEqual(event); }); it("backfills", async () => { @@ -195,7 +195,7 @@ describe("RoomWidgetClient", () => { const room = client.getRoom("!1:example.org"); expect(room).not.toBeNull(); - expect(room!.currentState.getStateEvents("org.example.foo", "bar").getEffectiveEvent()).toEqual(event); + expect(room!.currentState.getStateEvents("org.example.foo", "bar")?.getEffectiveEvent()).toEqual(event); }); }); diff --git a/spec/unit/room-state.spec.ts b/spec/unit/room-state.spec.ts index 5ee44f6116f..1ac3721a121 100644 --- a/spec/unit/room-state.spec.ts +++ b/spec/unit/room-state.spec.ts @@ -152,7 +152,7 @@ describe("RoomState", function() { it("should return a single MatrixEvent if a state_key was specified", function() { const event = state.getStateEvents("m.room.member", userA); - expect(event.getContent()).toMatchObject({ + expect(event?.getContent()).toMatchObject({ membership: "join", }); }); diff --git a/src/ReEmitter.ts b/src/ReEmitter.ts index 6822e3d1e98..2fa6eface1e 100644 --- a/src/ReEmitter.ts +++ b/src/ReEmitter.ts @@ -22,7 +22,7 @@ import { EventEmitter } from "events"; import { ListenerMap, TypedEventEmitter } from "./models/typed-event-emitter"; export class ReEmitter { - constructor(private readonly target: EventEmitter) {} + public constructor(private readonly target: EventEmitter) {} // Map from emitter to event name to re-emitter private reEmitters = new Map void>>(); @@ -38,7 +38,7 @@ export class ReEmitter { // We include the source as the last argument for event handlers which may need it, // such as read receipt listeners on the client class which won't have the context // of the room. - const forSource = (...args: any[]) => { + const forSource = (...args: any[]): void => { // EventEmitter special cases 'error' to make the emit function throw if no // handler is attached, which sort of makes sense for making sure that something // handles an error, but for re-emitting, there could be a listener on the original @@ -74,7 +74,7 @@ export class TypedReEmitter< Events extends string, Arguments extends ListenerMap, > extends ReEmitter { - constructor(target: TypedEventEmitter) { + public constructor(target: TypedEventEmitter) { super(target); } diff --git a/src/ToDeviceMessageQueue.ts b/src/ToDeviceMessageQueue.ts index 815927679a4..0b5b1786a63 100644 --- a/src/ToDeviceMessageQueue.ts +++ b/src/ToDeviceMessageQueue.ts @@ -31,7 +31,7 @@ export class ToDeviceMessageQueue { private retryTimeout: ReturnType | null = null; private retryAttempts = 0; - constructor(private client: MatrixClient) { + public constructor(private client: MatrixClient) { } public start(): void { diff --git a/src/client.ts b/src/client.ts index a3b44dfa0a2..c38160c53fb 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1010,7 +1010,7 @@ export class MatrixClient extends TypedEventEmitter { + this.clientOpts.canResetEntireTimeline = (roomId): boolean => { if (!this.canResetTimelineCallback) { return false; } @@ -1259,7 +1259,7 @@ export class MatrixClient extends TypedEventEmitter * @param {boolean} guest True if this is a guest account. */ - public setGuest(guest: boolean) { + public setGuest(guest: boolean): void { // EXPERIMENTAL: // If the token is a macaroon, it should be encoded in it that it is a 'guest' // access token, which means that the SDK can determine this entirely without @@ -1721,7 +1721,7 @@ export class MatrixClient extends TypedEventEmitter { if (!this.crypto) { throw new Error("End-to-end encryption disabled"); } @@ -2352,11 +2352,11 @@ export class MatrixClient extends TypedEventEmitter { if (!this.crypto) { throw new Error("End-to-end encryption disabled"); } @@ -2575,7 +2575,7 @@ export class MatrixClient extends TypedEventEmitter { if (!this.crypto) { throw new Error("End-to-end encryption disabled"); } @@ -2716,7 +2716,7 @@ export class MatrixClient extends TypedEventEmitter { if (!this.crypto) { throw new Error("End-to-end encryption disabled"); } @@ -3401,7 +3401,7 @@ export class MatrixClient extends TypedEventEmitter { if (!this.crypto) { throw new Error("End-to-end encryption disabled"); } @@ -3685,7 +3685,7 @@ export class MatrixClient extends TypedEventEmitter { return this.unstable_setLiveBeacon(roomId, beaconInfoContent); } @@ -3849,7 +3849,7 @@ export class MatrixClient extends TypedEventEmitter { return this.sendStateEvent(roomId, M_BEACON_INFO.name, beaconInfoContent, this.getUserId()!); } @@ -4121,7 +4121,7 @@ export class MatrixClient extends TypedEventEmitter[] = []; - const doLeave = (roomId: string) => { + const doLeave = (roomId: string): Promise => { return this.leave(roomId).then(() => { delete populationResults[roomId]; }).catch((err) => { + // suppress error populationResults[roomId] = err; - return null; // suppress error }); }; @@ -5904,7 +5904,7 @@ export class MatrixClient extends TypedEventEmitter) { + function intersect(s: Record): void { for (const k of Object.keys(stored)) { if (!s[k]) { delete stored[k]; @@ -586,7 +586,14 @@ export class CrossSigningInfo { } } -function deviceToObject(device: DeviceInfo, userId: string) { +interface DeviceObject extends IObject { + algorithms: string[]; + keys: Record; + device_id: string; + user_id: string; +} + +function deviceToObject(device: DeviceInfo, userId: string): DeviceObject { return { algorithms: device.algorithms, keys: device.keys, @@ -606,7 +613,7 @@ export enum CrossSigningLevel { * Represents the ways in which we trust a user */ export class UserTrustLevel { - constructor( + public constructor( private readonly crossSigningVerified: boolean, private readonly crossSigningVerifiedBefore: boolean, private readonly tofu: boolean, @@ -646,7 +653,7 @@ export class UserTrustLevel { * Represents the ways in which we trust a device */ export class DeviceTrustLevel { - constructor( + public constructor( public readonly crossSigningVerified: boolean, public readonly tofu: boolean, private readonly localVerified: boolean, @@ -775,7 +782,7 @@ export async function requestKeysDuringVerification( // CrossSigningInfo.getCrossSigningKey() to validate/cache const crossSigning = new CrossSigningInfo( original.userId, - { getCrossSigningKey: async (type) => { + { getCrossSigningKey: async (type): Promise => { logger.debug("Cross-signing: requesting secret", type, deviceId); const { promise } = client.requestSecret( `m.cross_signing.${type}`, [deviceId], @@ -801,7 +808,7 @@ export async function requestKeysDuringVerification( }); // also request and cache the key backup key - const backupKeyPromise = (async () => { + const backupKeyPromise = (async (): Promise => { const cachedKey = await client.crypto!.getSessionBackupPrivateKey(); if (!cachedKey) { logger.info("No cached backup key found. Requesting..."); diff --git a/src/crypto/DeviceList.ts b/src/crypto/DeviceList.ts index c4345437c3e..da40a03f231 100644 --- a/src/crypto/DeviceList.ts +++ b/src/crypto/DeviceList.ts @@ -102,7 +102,7 @@ export class DeviceList extends TypedEventEmitter { await this.cryptoStore.doTxn( 'readonly', [IndexedDBCryptoStore.STORE_DEVICE_DATA], (txn) => { this.cryptoStore.getEndToEndDeviceData(txn, (deviceData) => { @@ -150,7 +150,7 @@ export class DeviceList extends TypedEventEmitter} accountData pre-existing account data, will only be read, not written. * @param {CryptoCallbacks} delegateCryptoCallbacks crypto callbacks to delegate to if the key isn't in cache yet */ - constructor(accountData: Record, delegateCryptoCallbacks?: ICryptoCallbacks) { + public constructor(accountData: Record, delegateCryptoCallbacks?: ICryptoCallbacks) { this.accountDataClientAdapter = new AccountDataClientAdapter(accountData); this.crossSigningCallbacks = new CrossSigningCallbacks(); this.ssssCryptoCallbacks = new SSSSCryptoCallbacks(delegateCryptoCallbacks); @@ -192,7 +192,7 @@ export class EncryptionSetupOperation { * @param {Object} keyBackupInfo * @param {Object} keySignatures */ - constructor( + public constructor( private readonly accountData: Map, private readonly crossSigningKeys?: ICrossSigningKeys, private readonly keyBackupInfo?: IKeyBackupInfo, @@ -272,7 +272,7 @@ class AccountDataClientAdapter /** * @param {Object.} existingValues existing account data */ - constructor(private readonly existingValues: Record) { + public constructor(private readonly existingValues: Record) { super(); } @@ -342,7 +342,7 @@ class CrossSigningCallbacks implements ICryptoCallbacks, ICacheCallbacks { return Promise.resolve(this.privateKeys.get(type) ?? null); } - public saveCrossSigningKeys(privateKeys: Record) { + public saveCrossSigningKeys(privateKeys: Record): void { for (const [type, privateKey] of Object.entries(privateKeys)) { this.privateKeys.set(type, privateKey); } @@ -356,7 +356,7 @@ class CrossSigningCallbacks implements ICryptoCallbacks, ICacheCallbacks { class SSSSCryptoCallbacks { private readonly privateKeys = new Map(); - constructor(private readonly delegateCryptoCallbacks?: ICryptoCallbacks) {} + public constructor(private readonly delegateCryptoCallbacks?: ICryptoCallbacks) {} public async getSecretStorageKey( { keys }: { keys: Record }, diff --git a/src/crypto/OlmDevice.ts b/src/crypto/OlmDevice.ts index 84eec463cc7..efa34ad4159 100644 --- a/src/crypto/OlmDevice.ts +++ b/src/crypto/OlmDevice.ts @@ -177,13 +177,13 @@ export class OlmDevice { // Used by olm to serialise prekey message decryptions public olmPrekeyPromise: Promise = Promise.resolve(); // set by consumers - constructor(private readonly cryptoStore: CryptoStore) { + public constructor(private readonly cryptoStore: CryptoStore) { } /** * @return {array} The version of Olm. */ - static getOlmVersion(): [number, number, number] { + public static getOlmVersion(): [number, number, number] { return global.Olm.get_library_version(); } @@ -1515,7 +1515,9 @@ export class OlmDevice { }); } - async getSharedHistoryInboundGroupSessions(roomId: string): Promise<[senderKey: string, sessionId: string][]> { + public async getSharedHistoryInboundGroupSessions( + roomId: string, + ): Promise<[senderKey: string, sessionId: string][]> { let result: Promise<[senderKey: string, sessionId: string][]>; await this.cryptoStore.doTxn( 'readonly', [ diff --git a/src/crypto/OutgoingRoomKeyRequestManager.ts b/src/crypto/OutgoingRoomKeyRequestManager.ts index d5d1c3003f2..42723434778 100644 --- a/src/crypto/OutgoingRoomKeyRequestManager.ts +++ b/src/crypto/OutgoingRoomKeyRequestManager.ts @@ -102,7 +102,7 @@ export class OutgoingRoomKeyRequestManager { private clientRunning = true; - constructor( + public constructor( private readonly baseApis: MatrixClient, private readonly deviceId: string, private readonly cryptoStore: CryptoStore, @@ -352,7 +352,7 @@ export class OutgoingRoomKeyRequestManager { return; } - const startSendingOutgoingRoomKeyRequests = () => { + const startSendingOutgoingRoomKeyRequests = (): void => { if (this.sendOutgoingRoomKeyRequestsRunning) { throw new Error("RoomKeyRequestSend already in progress!"); } diff --git a/src/crypto/RoomList.ts b/src/crypto/RoomList.ts index f0e09b657a0..672ef473c05 100644 --- a/src/crypto/RoomList.ts +++ b/src/crypto/RoomList.ts @@ -38,7 +38,7 @@ export class RoomList { // Object of roomId -> room e2e info object (body of the m.room.encryption event) private roomEncryption: Record = {}; - constructor(private readonly cryptoStore?: CryptoStore) {} + public constructor(private readonly cryptoStore?: CryptoStore) {} public async init(): Promise { await this.cryptoStore!.doTxn( diff --git a/src/crypto/SecretStorage.ts b/src/crypto/SecretStorage.ts index d1d6285fcce..5c13ba4b0bb 100644 --- a/src/crypto/SecretStorage.ts +++ b/src/crypto/SecretStorage.ts @@ -78,7 +78,7 @@ export class SecretStorage { // as you don't request any secrets. // A better solution would probably be to split this class up into secret storage and // secret sharing which are really two separate things, even though they share an MSC. - constructor( + public constructor( private readonly accountDataAdapter: IAccountDataClient, private readonly cryptoCallbacks: ICryptoCallbacks, private readonly baseApis: B, @@ -381,7 +381,7 @@ export class SecretStorage { const deferred = defer(); this.requests.set(requestId, { name, devices, deferred }); - const cancel = (reason: string) => { + const cancel = (reason: string): void => { // send cancellation event const cancelData = { action: "request_cancellation", diff --git a/src/crypto/algorithms/base.ts b/src/crypto/algorithms/base.ts index 190bfa437ab..d6c70bc1067 100644 --- a/src/crypto/algorithms/base.ts +++ b/src/crypto/algorithms/base.ts @@ -78,7 +78,7 @@ export abstract class EncryptionAlgorithm { protected readonly baseApis: MatrixClient; protected readonly roomId?: string; - constructor(params: IParams) { + public constructor(params: IParams) { this.userId = params.userId; this.deviceId = params.deviceId; this.crypto = params.crypto; @@ -150,7 +150,7 @@ export abstract class DecryptionAlgorithm { protected readonly baseApis: MatrixClient; protected readonly roomId?: string; - constructor(params: DecryptionClassParams) { + public constructor(params: DecryptionClassParams) { this.userId = params.userId; this.crypto = params.crypto; this.olmDevice = params.olmDevice; @@ -242,7 +242,7 @@ export abstract class DecryptionAlgorithm { export class DecryptionError extends Error { public readonly detailedString: string; - constructor(public readonly code: string, msg: string, details?: Record) { + public constructor(public readonly code: string, msg: string, details?: Record) { super(msg); this.code = code; this.name = 'DecryptionError'; @@ -272,7 +272,7 @@ function detailedStringForDecryptionError(err: DecryptionError, details?: Record * @extends Error */ export class UnknownDeviceError extends Error { - constructor( + public constructor( msg: string, public readonly devices: Record>, public event?: MatrixEvent, diff --git a/src/crypto/algorithms/megolm.ts b/src/crypto/algorithms/megolm.ts index dd53bfa0507..cbad327a608 100644 --- a/src/crypto/algorithms/megolm.ts +++ b/src/crypto/algorithms/megolm.ts @@ -136,7 +136,7 @@ class OutboundSessionInfo { public sharedWithDevices: Record> = {}; public blockedDevicesNotified: Record> = {}; - constructor(public readonly sessionId: string, public readonly sharedHistory = false) { + public constructor(public readonly sessionId: string, public readonly sharedHistory = false) { this.creationTime = new Date().getTime(); } @@ -248,7 +248,7 @@ class MegolmEncryption extends EncryptionAlgorithm { protected readonly roomId: string; - constructor(params: IParams & Required>) { + public constructor(params: IParams & Required>) { super(params); this.roomId = params.roomId; @@ -347,7 +347,7 @@ class MegolmEncryption extends EncryptionAlgorithm { singleOlmCreationPhase: boolean, blocked: IBlockedMap, session: OutboundSessionInfo, - ) { + ): Promise { // now check if we need to share with any devices const shareMap: Record = {}; @@ -386,13 +386,13 @@ class MegolmEncryption extends EncryptionAlgorithm { ); await Promise.all([ - (async () => { + (async (): Promise => { // share keys with devices that we already have a session for logger.debug(`Sharing keys with existing Olm sessions in ${this.roomId}`, olmSessions); await this.shareKeyWithOlmSessions(session, key, payload, olmSessions); logger.debug(`Shared keys with existing Olm sessions in ${this.roomId}`); })(), - (async () => { + (async (): Promise => { logger.debug( `Sharing keys (start phase 1) with new Olm sessions in ${this.roomId}`, devicesWithoutSession, @@ -415,7 +415,7 @@ class MegolmEncryption extends EncryptionAlgorithm { if (!singleOlmCreationPhase && (Date.now() - start < 10000)) { // perform the second phase of olm session creation if requested, // and if the first phase didn't take too long - (async () => { + (async (): Promise => { // Retry sending keys to devices that we were unable to establish // an olm session for. This time, we use a longer timeout, but we // do this in the background and don't block anything else while we @@ -452,7 +452,7 @@ class MegolmEncryption extends EncryptionAlgorithm { } logger.debug(`Shared keys (all phases done) with new Olm sessions in ${this.roomId}`); })(), - (async () => { + (async (): Promise => { logger.debug(`There are ${Object.entries(blocked).length} blocked devices in ${this.roomId}`, Object.entries(blocked)); @@ -809,7 +809,7 @@ class MegolmEncryption extends EncryptionAlgorithm { errorDevices: IOlmDevice[], otkTimeout: number, failedServers?: string[], - ) { + ): Promise { logger.debug(`Ensuring Olm sessions for devices in ${this.roomId}`); const devicemap = await olmlib.ensureOlmSessionsForDevices( this.olmDevice, this.baseApis, devicesByUser, false, otkTimeout, failedServers, @@ -969,7 +969,7 @@ class MegolmEncryption extends EncryptionAlgorithm { this.encryptionPreparation = { startTime: Date.now(), - promise: (async () => { + promise: (async (): Promise => { try { logger.debug(`Getting devices in ${this.roomId}`); const [devicesInRoom, blocked] = await this.getDevicesInRoom(room); @@ -1231,7 +1231,7 @@ class MegolmDecryption extends DecryptionAlgorithm { protected readonly roomId: string; - constructor(params: DecryptionClassParams>>) { + public constructor(params: DecryptionClassParams>>) { super(params); this.roomId = params.roomId; } diff --git a/src/crypto/backup.ts b/src/crypto/backup.ts index d9c1ba4587c..f2160165bd8 100644 --- a/src/crypto/backup.ts +++ b/src/crypto/backup.ts @@ -120,7 +120,7 @@ export class BackupManager { private sendingBackups: boolean; // Are we currently sending backups? private sessionLastCheckAttemptedTime: Record = {}; // When did we last try to check the server for a given session id? - constructor(private readonly baseApis: MatrixClient, public readonly getKey: GetKey) { + public constructor(private readonly baseApis: MatrixClient, public readonly getKey: GetKey) { this.checkedForBackup = false; this.sendingBackups = false; } @@ -609,7 +609,7 @@ export class BackupManager { export class Curve25519 implements BackupAlgorithm { public static algorithmName = "m.megolm_backup.v1.curve25519-aes-sha2"; - constructor( + public constructor( public authData: ICurve25519AuthData, private publicKey: any, // FIXME: PkEncryption private getKey: () => Promise, @@ -661,7 +661,7 @@ export class Curve25519 implements BackupAlgorithm { } } - public get untrusted() { return true; } + public get untrusted(): boolean { return true; } public async encryptSession(data: Record): Promise { const plainText: Record = Object.assign({}, data); @@ -735,7 +735,7 @@ const UNSTABLE_MSC3270_NAME = new UnstableValue( export class Aes256 implements BackupAlgorithm { public static algorithmName = UNSTABLE_MSC3270_NAME.name; - constructor( + public constructor( public readonly authData: IAes256AuthData, private readonly key: Uint8Array, ) {} @@ -786,7 +786,7 @@ export class Aes256 implements BackupAlgorithm { } } - public get untrusted() { return false; } + public get untrusted(): boolean { return false; } public encryptSession(data: Record): Promise { const plainText: Record = Object.assign({}, data); diff --git a/src/crypto/dehydration.ts b/src/crypto/dehydration.ts index 5b12159ae5d..cc6b252da59 100644 --- a/src/crypto/dehydration.ts +++ b/src/crypto/dehydration.ts @@ -62,7 +62,7 @@ export class DehydrationManager { private keyInfo?: {[props: string]: any}; private deviceDisplayName?: string; - constructor(private readonly crypto: Crypto) { + public constructor(private readonly crypto: Crypto) { this.getDehydrationKeyFromCache(); } @@ -294,7 +294,7 @@ export class DehydrationManager { } } - public stop() { + public stop(): void { if (this.timeoutId) { global.clearTimeout(this.timeoutId); this.timeoutId = undefined; diff --git a/src/crypto/deviceinfo.ts b/src/crypto/deviceinfo.ts index 00ebf7c389f..3b4d53f6813 100644 --- a/src/crypto/deviceinfo.ts +++ b/src/crypto/deviceinfo.ts @@ -94,7 +94,7 @@ export class DeviceInfo { public unsigned: Record = {}; public signatures: ISignatures = {}; - constructor(public readonly deviceId: string) {} + public constructor(public readonly deviceId: string) {} /** * Prepare a DeviceInfo for JSON serialisation in the session store diff --git a/src/crypto/index.ts b/src/crypto/index.ts index 2a55d75fee8..04a6e5e1ae6 100644 --- a/src/crypto/index.ts +++ b/src/crypto/index.ts @@ -278,7 +278,7 @@ export class Crypto extends TypedEventEmitter { + cryptoCallbacks.getCrossSigningKey = async (type): Promise => { return CrossSigningInfo.getFromSecretStorage(type, this.secretStorage); }; } @@ -709,7 +709,7 @@ export class Crypto extends TypedEventEmitter { + const resetCrossSigning = async (): Promise => { crossSigningInfo.resetKeys(); // Sign master key with device key await this.signObject(crossSigningInfo.keys.master); @@ -846,12 +846,12 @@ export class Crypto extends TypedEventEmitter ({} as IRecoveryKey), + createSecretStorageKey = async (): Promise => ({} as IRecoveryKey), keyBackupInfo, setupNewKeyBackup, setupNewSecretStorage, getKeyBackupPassphrase, - }: ICreateSecretStorageOpts = {}) { + }: ICreateSecretStorageOpts = {}): Promise { logger.log("Bootstrapping Secure Secret Storage"); const delegateCryptoCallbacks = this.baseApis.cryptoCallbacks; const builder = new EncryptionSetupBuilder( @@ -868,7 +868,7 @@ export class Crypto extends TypedEventEmitter { + const createSSSS = async (opts: IAddSecretStorageKeyOpts, privateKey?: Uint8Array): Promise => { if (privateKey) { opts.key = privateKey; } @@ -884,7 +884,7 @@ export class Crypto extends TypedEventEmitter { + const ensureCanCheckPassphrase = async (keyId: string, keyInfo: ISecretStorageKeyInfo): Promise => { if (!keyInfo.mac) { const key = await this.baseApis.cryptoCallbacks.getSecretStorageKey?.( { keys: { [keyId]: keyInfo } }, "", @@ -903,7 +903,7 @@ export class Crypto extends TypedEventEmitter { + const signKeyBackupWithCrossSigning = async (keyBackupAuthData: IKeyBackupInfo["auth_data"]): Promise => { if ( this.crossSigningInfo.getId() && await this.crossSigningInfo.isStoredInKeyCache("master") @@ -1241,7 +1241,7 @@ export class Crypto extends TypedEventEmitter { + const upload = ({ shouldEmit = false }): Promise => { return this.baseApis.uploadKeySignatures({ [this.userId]: { [this.deviceId]: signedDevice!, @@ -1475,7 +1475,7 @@ export class Crypto extends TypedEventEmitter { + private onDeviceListUserCrossSigningUpdated = async (userId: string): Promise => { if (userId === this.userId) { // An update to our own cross-signing key. // Get the new key first: @@ -1657,7 +1657,7 @@ export class Crypto extends TypedEventEmitter { + const upload = ({ shouldEmit = false }): Promise => { logger.info(`Starting background key sig upload for ${keysToUpload}`); return this.baseApis.uploadKeySignatures({ [this.userId]: keySignatures }) .then((response) => { @@ -1864,7 +1864,7 @@ export class Crypto extends TypedEventEmitter { + const uploadLoop = async (keyCount: number): Promise => { while (keyLimit > keyCount || this.getNeedsNewFallback()) { // Ask olm to generate new one time keys, then upload them to synapse. if (keyLimit > keyCount) { @@ -2155,7 +2155,7 @@ export class Crypto extends TypedEventEmitter { + const upload = async ({ shouldEmit = false }): Promise => { logger.info("Uploading signature for " + userId + "..."); const response = await this.baseApis.uploadKeySignatures({ [userId]: { @@ -2246,7 +2246,7 @@ export class Crypto extends TypedEventEmitter { + const upload = async ({ shouldEmit = false }): Promise => { logger.info("Uploading signature for " + deviceId); const response = await this.baseApis.uploadKeySignatures({ [userId]: { @@ -2645,7 +2645,7 @@ export class Crypto extends TypedEventEmitter { - const trackMembers = async () => { + const trackMembers = async (): Promise => { // not an encrypted room if (!this.roomEncryptors.has(roomId)) { return; @@ -2747,7 +2747,7 @@ export class Crypto extends TypedEventEmitter { + private onMembership = (event: MatrixEvent, member: RoomMember, oldMembership?: string): void => { try { this.onRoomMembership(event, member, oldMembership); } catch (e) { @@ -3340,7 +3340,7 @@ export class Crypto extends TypedEventEmitter { + const createRequest = (event: MatrixEvent): VerificationRequest => { const channel = new InRoomChannel(this.baseApis, event.getRoomId()!); return new VerificationRequest( channel, this.verificationMethods, this.baseApis); @@ -3361,7 +3361,7 @@ export class Crypto extends TypedEventEmitter((resolve, reject) => { eventIdListener = resolve; - statusListener = () => { + statusListener = (): void => { if (event.status == EventStatus.CANCELLED) { reject(new Error("Event status set to CANCELLED.")); } @@ -3420,7 +3420,7 @@ export class Crypto extends TypedEventEmitter { + const retryDecryption = (): void => { const roomDecryptors = this.getRoomDecryptors(olmlib.MEGOLM_ALGORITHM); for (const decryptor of roomDecryptors) { decryptor.retryDecryptionFromSender(deviceKey); @@ -3692,7 +3692,7 @@ export class Crypto extends TypedEventEmitter { + req.share = (): void => { decryptor.shareKeysWithDevice(req); }; @@ -3863,14 +3863,14 @@ export class IncomingRoomKeyRequest { public readonly requestBody: IRoomKeyRequestBody; public share: () => void; - constructor(event: MatrixEvent) { + public constructor(event: MatrixEvent) { const content = event.getContent(); this.userId = event.getSender()!; this.deviceId = content.requesting_device_id; this.requestId = content.request_id; this.requestBody = content.body || {}; - this.share = () => { + this.share = (): void => { throw new Error("don't know how to share keys for this request yet"); }; } @@ -3888,7 +3888,7 @@ class IncomingRoomKeyRequestCancellation { public readonly deviceId: string; public readonly requestId: string; - constructor(event: MatrixEvent) { + public constructor(event: MatrixEvent) { const content = event.getContent(); this.userId = event.getSender()!; diff --git a/src/crypto/olmlib.ts b/src/crypto/olmlib.ts index b77c0b16f58..111e4c16de3 100644 --- a/src/crypto/olmlib.ts +++ b/src/crypto/olmlib.ts @@ -82,7 +82,7 @@ export async function encryptMessageForDevice( recipientUserId: string, recipientDevice: DeviceInfo, payloadFields: Record, -) { +): Promise { const deviceKey = recipientDevice.getIdentityKey(); const sessionId = await olmDevice.getSessionIdForDevice(deviceKey); if (sessionId === null) { @@ -173,7 +173,7 @@ export async function getExistingOlmSessions( for (const deviceInfo of devices) { const deviceId = deviceInfo.deviceId; const key = deviceInfo.getIdentityKey(); - promises.push((async () => { + promises.push((async (): Promise => { const sessionId = await olmDevice.getSessionIdForDevice( key, true, ); @@ -256,7 +256,7 @@ export async function ensureOlmSessionsForDevices( // conditions. If we find that we already have a session, then // we'll resolve olmDevice.sessionsInProgress[key] = new Promise(resolve => { - resolveSession[key] = (v: any) => { + resolveSession[key] = (v: any): void => { delete olmDevice.sessionsInProgress[key]; resolve(v); }; @@ -463,7 +463,7 @@ export async function verifySignature( signingUserId: string, signingDeviceId: string, signingKey: string, -) { +): Promise { const signKeyId = "ed25519:" + signingDeviceId; const signatures = obj.signatures || {}; const userSigs = signatures[signingUserId] || {}; @@ -527,7 +527,7 @@ export function pkSign(obj: IObject, key: PkSigning, userId: string, pubKey: str * @param {string} pubKey The public key to use to verify * @param {string} userId The user ID who signed the object */ -export function pkVerify(obj: IObject, pubKey: string, userId: string) { +export function pkVerify(obj: IObject, pubKey: string, userId: string): void { const keyId = "ed25519:" + pubKey; if (!(obj.signatures && obj.signatures[userId] && obj.signatures[userId][keyId])) { throw new Error("No signature"); diff --git a/src/crypto/store/indexeddb-crypto-store-backend.ts b/src/crypto/store/indexeddb-crypto-store-backend.ts index f525c0c959a..cdf35e787a5 100644 --- a/src/crypto/store/indexeddb-crypto-store-backend.ts +++ b/src/crypto/store/indexeddb-crypto-store-backend.ts @@ -48,11 +48,11 @@ export class Backend implements CryptoStore { /** * @param {IDBDatabase} db */ - constructor(private db: IDBDatabase) { + public constructor(private db: IDBDatabase) { // make sure we close the db on `onversionchange` - otherwise // attempts to delete the database will block (and subsequent // attempts to re-create it will also block). - db.onversionchange = () => { + db.onversionchange = (): void => { logger.log(`versionchange for indexeddb ${this.db.name}: closing`); db.close(); }; @@ -103,7 +103,7 @@ export class Backend implements CryptoStore { `enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id, ); - txn.oncomplete = () => {resolve(request);}; + txn.oncomplete = (): void => {resolve(request);}; const store = txn.objectStore("outgoingRoomKeyRequests"); store.add(request); }); @@ -157,7 +157,7 @@ export class Backend implements CryptoStore { requestBody.session_id, ]); - cursorReq.onsuccess = () => { + cursorReq.onsuccess = (): void => { const cursor = cursorReq.result; if (!cursor) { // no match found @@ -201,7 +201,7 @@ export class Backend implements CryptoStore { let stateIndex = 0; let result: OutgoingRoomKeyRequest; - function onsuccess(this: IDBRequest) { + function onsuccess(this: IDBRequest): void { const cursor = this.result; if (cursor) { // got a match @@ -243,8 +243,8 @@ export class Backend implements CryptoStore { const index = store.index("state"); const request = index.getAll(wantedState); - request.onsuccess = () => resolve(request.result); - request.onerror = () => reject(request.error); + request.onsuccess = (): void => resolve(request.result); + request.onerror = (): void => reject(request.error); }); } @@ -256,7 +256,7 @@ export class Backend implements CryptoStore { let stateIndex = 0; const results: OutgoingRoomKeyRequest[] = []; - function onsuccess(this: IDBRequest) { + function onsuccess(this: IDBRequest): void { const cursor = this.result; if (cursor) { const keyReq = cursor.value; @@ -309,7 +309,7 @@ export class Backend implements CryptoStore { ): Promise { let result: OutgoingRoomKeyRequest | null = null; - function onsuccess(this: IDBRequest) { + function onsuccess(this: IDBRequest): void { const cursor = this.result; if (!cursor) { return; @@ -348,7 +348,7 @@ export class Backend implements CryptoStore { ): Promise { const txn = this.db.transaction("outgoingRoomKeyRequests", "readwrite"); const cursorReq = txn.objectStore("outgoingRoomKeyRequests").openCursor(requestId); - cursorReq.onsuccess = () => { + cursorReq.onsuccess = (): void => { const cursor = cursorReq.result; if (!cursor) { return; @@ -371,7 +371,7 @@ export class Backend implements CryptoStore { public getAccount(txn: IDBTransaction, func: (accountPickle: string | null) => void): void { const objectStore = txn.objectStore("account"); const getReq = objectStore.get("-"); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { func(getReq.result || null); } catch (e) { @@ -391,7 +391,7 @@ export class Backend implements CryptoStore { ): void { const objectStore = txn.objectStore("account"); const getReq = objectStore.get("crossSigningKeys"); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { func(getReq.result || null); } catch (e) { @@ -407,7 +407,7 @@ export class Backend implements CryptoStore { ): void { const objectStore = txn.objectStore("account"); const getReq = objectStore.get(`ssss_cache:${type}`); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { func(getReq.result || null); } catch (e) { @@ -435,7 +435,7 @@ export class Backend implements CryptoStore { public countEndToEndSessions(txn: IDBTransaction, func: (count: number) => void): void { const objectStore = txn.objectStore("sessions"); const countReq = objectStore.count(); - countReq.onsuccess = function() { + countReq.onsuccess = function(): void { try { func(countReq.result); } catch (e) { @@ -453,7 +453,7 @@ export class Backend implements CryptoStore { const idx = objectStore.index("deviceKey"); const getReq = idx.openCursor(deviceKey); const results: Parameters[2]>[0] = {}; - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { const cursor = getReq.result; if (cursor) { results[cursor.value.sessionId] = { @@ -479,7 +479,7 @@ export class Backend implements CryptoStore { ): void { const objectStore = txn.objectStore("sessions"); const getReq = objectStore.get([deviceKey, sessionId]); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { if (getReq.result) { func({ @@ -498,7 +498,7 @@ export class Backend implements CryptoStore { public getAllEndToEndSessions(txn: IDBTransaction, func: (session: ISessionInfo | null) => void): void { const objectStore = txn.objectStore("sessions"); const getReq = objectStore.openCursor(); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { const cursor = getReq.result; if (cursor) { @@ -546,7 +546,7 @@ export class Backend implements CryptoStore { const objectStore = txn.objectStore("session_problems"); const index = objectStore.index("deviceKey"); const req = index.getAll(deviceKey); - req.onsuccess = () => { + req.onsuccess = (): void => { const problems = req.result; if (!problems.length) { result = null; @@ -583,7 +583,7 @@ export class Backend implements CryptoStore { return new Promise((resolve) => { const { userId, deviceInfo } = device; const getReq = objectStore.get([userId, deviceInfo.deviceId]); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { if (!getReq.result) { objectStore.put({ userId, deviceId: deviceInfo.deviceId }); ret.push(device); @@ -608,7 +608,7 @@ export class Backend implements CryptoStore { let withheld: IWithheld | null | boolean = false; const objectStore = txn.objectStore("inbound_group_sessions"); const getReq = objectStore.get([senderCurve25519Key, sessionId]); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { if (getReq.result) { session = getReq.result.session; @@ -625,7 +625,7 @@ export class Backend implements CryptoStore { const withheldObjectStore = txn.objectStore("inbound_group_sessions_withheld"); const withheldGetReq = withheldObjectStore.get([senderCurve25519Key, sessionId]); - withheldGetReq.onsuccess = function() { + withheldGetReq.onsuccess = function(): void { try { if (withheldGetReq.result) { withheld = withheldGetReq.result.session; @@ -644,7 +644,7 @@ export class Backend implements CryptoStore { public getAllEndToEndInboundGroupSessions(txn: IDBTransaction, func: (session: ISession | null) => void): void { const objectStore = txn.objectStore("inbound_group_sessions"); const getReq = objectStore.openCursor(); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { const cursor = getReq.result; if (cursor) { try { @@ -677,7 +677,7 @@ export class Backend implements CryptoStore { const addReq = objectStore.add({ senderCurve25519Key, sessionId, session: sessionData, }); - addReq.onerror = (ev) => { + addReq.onerror = (ev): void => { if (addReq.error?.name === 'ConstraintError') { // This stops the error from triggering the txn's onerror ev.stopPropagation(); @@ -722,7 +722,7 @@ export class Backend implements CryptoStore { public getEndToEndDeviceData(txn: IDBTransaction, func: (deviceData: IDeviceData | null) => void): void { const objectStore = txn.objectStore("device_data"); const getReq = objectStore.get("-"); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { try { func(getReq.result || null); } catch (e) { @@ -745,7 +745,7 @@ export class Backend implements CryptoStore { const rooms: Parameters[1]>[0] = {}; const objectStore = txn.objectStore("rooms"); const getReq = objectStore.openCursor(); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { const cursor = getReq.result; if (cursor) { rooms[cursor.key as string] = cursor.value; @@ -771,17 +771,17 @@ export class Backend implements CryptoStore { "readonly", ); txn.onerror = reject; - txn.oncomplete = function() { + txn.oncomplete = function(): void { resolve(sessions); }; const objectStore = txn.objectStore("sessions_needing_backup"); const sessionStore = txn.objectStore("inbound_group_sessions"); const getReq = objectStore.openCursor(); - getReq.onsuccess = function() { + getReq.onsuccess = function(): void { const cursor = getReq.result; if (cursor) { const sessionGetReq = sessionStore.get(cursor.key); - sessionGetReq.onsuccess = function() { + sessionGetReq.onsuccess = function(): void { sessions.push({ senderKey: sessionGetReq.result.senderCurve25519Key, sessionId: sessionGetReq.result.sessionId, @@ -804,7 +804,7 @@ export class Backend implements CryptoStore { return new Promise((resolve, reject) => { const req = objectStore.count(); req.onerror = reject; - req.onsuccess = () => resolve(req.result); + req.onsuccess = (): void => resolve(req.result); }); } @@ -852,7 +852,7 @@ export class Backend implements CryptoStore { } const objectStore = txn.objectStore("shared_history_inbound_group_sessions"); const req = objectStore.get([roomId]); - req.onsuccess = () => { + req.onsuccess = (): void => { const { sessions } = req.result || { sessions: [] }; sessions.push([senderKey, sessionId]); objectStore.put({ roomId, sessions }); @@ -871,7 +871,7 @@ export class Backend implements CryptoStore { const objectStore = txn.objectStore("shared_history_inbound_group_sessions"); const req = objectStore.get([roomId]); return new Promise((resolve, reject) => { - req.onsuccess = () => { + req.onsuccess = (): void => { const { sessions } = req.result || { sessions: [] }; resolve(sessions); }; @@ -891,7 +891,7 @@ export class Backend implements CryptoStore { } const objectStore = txn.objectStore("parked_shared_history"); const req = objectStore.get([roomId]); - req.onsuccess = () => { + req.onsuccess = (): void => { const { parked } = req.result || { parked: [] }; parked.push(parkedData); objectStore.put({ roomId, parked }); @@ -909,7 +909,7 @@ export class Backend implements CryptoStore { } const cursorReq = txn.objectStore("parked_shared_history").openCursor(roomId); return new Promise((resolve, reject) => { - cursorReq.onsuccess = () => { + cursorReq.onsuccess = (): void => { const cursor = cursorReq.result; if (!cursor) { resolve([]); @@ -957,32 +957,32 @@ export class Backend implements CryptoStore { type DbMigration = (db: IDBDatabase) => void; const DB_MIGRATIONS: DbMigration[] = [ - (db) => { createDatabase(db); }, - (db) => { db.createObjectStore("account"); }, - (db) => { + (db): void => { createDatabase(db); }, + (db): void => { db.createObjectStore("account"); }, + (db): void => { const sessionsStore = db.createObjectStore("sessions", { keyPath: ["deviceKey", "sessionId"], }); sessionsStore.createIndex("deviceKey", "deviceKey"); }, - (db) => { + (db): void => { db.createObjectStore("inbound_group_sessions", { keyPath: ["senderCurve25519Key", "sessionId"], }); }, - (db) => { db.createObjectStore("device_data"); }, - (db) => { db.createObjectStore("rooms"); }, - (db) => { + (db): void => { db.createObjectStore("device_data"); }, + (db): void => { db.createObjectStore("rooms"); }, + (db): void => { db.createObjectStore("sessions_needing_backup", { keyPath: ["senderCurve25519Key", "sessionId"], }); }, - (db) => { + (db): void => { db.createObjectStore("inbound_group_sessions_withheld", { keyPath: ["senderCurve25519Key", "sessionId"], }); }, - (db) => { + (db): void => { const problemsStore = db.createObjectStore("session_problems", { keyPath: ["deviceKey", "time"], }); @@ -992,12 +992,12 @@ const DB_MIGRATIONS: DbMigration[] = [ keyPath: ["userId", "deviceId"], }); }, - (db) => { + (db): void => { db.createObjectStore("shared_history_inbound_group_sessions", { keyPath: ["roomId"], }); }, - (db) => { + (db): void => { db.createObjectStore("parked_shared_history", { keyPath: ["roomId"], }); @@ -1037,7 +1037,7 @@ interface IWrappedIDBTransaction extends IDBTransaction { * Aborts a transaction with a given exception * The transaction promise will be rejected with this exception. */ -function abortWithException(txn: IDBTransaction, e: Error) { +function abortWithException(txn: IDBTransaction, e: Error): void { // We cheekily stick our exception onto the transaction object here // We could alternatively make the thing we pass back to the app // an object containing the transaction and exception. @@ -1052,13 +1052,13 @@ function abortWithException(txn: IDBTransaction, e: Error) { function promiseifyTxn(txn: IDBTransaction): Promise { return new Promise((resolve, reject) => { - txn.oncomplete = () => { + txn.oncomplete = (): void => { if ((txn as IWrappedIDBTransaction)._mx_abortexception !== undefined) { reject((txn as IWrappedIDBTransaction)._mx_abortexception); } resolve(null); }; - txn.onerror = (event) => { + txn.onerror = (event): void => { if ((txn as IWrappedIDBTransaction)._mx_abortexception !== undefined) { reject((txn as IWrappedIDBTransaction)._mx_abortexception); } else { @@ -1066,7 +1066,7 @@ function promiseifyTxn(txn: IDBTransaction): Promise { reject(txn.error); } }; - txn.onabort = (event) => { + txn.onabort = (event): void => { if ((txn as IWrappedIDBTransaction)._mx_abortexception !== undefined) { reject((txn as IWrappedIDBTransaction)._mx_abortexception); } else { diff --git a/src/crypto/store/indexeddb-crypto-store.ts b/src/crypto/store/indexeddb-crypto-store.ts index 4fbeafe19df..d743a95decc 100644 --- a/src/crypto/store/indexeddb-crypto-store.ts +++ b/src/crypto/store/indexeddb-crypto-store.ts @@ -73,7 +73,7 @@ export class IndexedDBCryptoStore implements CryptoStore { * @param {IDBFactory} indexedDB global indexedDB instance * @param {string} dbName name of db to connect to */ - constructor(private readonly indexedDB: IDBFactory, private readonly dbName: string) {} + public constructor(private readonly indexedDB: IDBFactory, private readonly dbName: string) {} /** * Ensure the database exists and is up-to-date, or fall back to @@ -99,24 +99,24 @@ export class IndexedDBCryptoStore implements CryptoStore { const req = this.indexedDB.open(this.dbName, IndexedDBCryptoStoreBackend.VERSION); - req.onupgradeneeded = (ev) => { + req.onupgradeneeded = (ev): void => { const db = req.result; const oldVersion = ev.oldVersion; IndexedDBCryptoStoreBackend.upgradeDatabase(db, oldVersion); }; - req.onblocked = () => { + req.onblocked = (): void => { logger.log( `can't yet open IndexedDBCryptoStore because it is open elsewhere`, ); }; - req.onerror = (ev) => { + req.onerror = (ev): void => { logger.log("Error connecting to indexeddb", ev); reject(req.error); }; - req.onsuccess = () => { + req.onsuccess = (): void => { const db = req.result; logger.log(`connected to indexeddb ${this.dbName}`); @@ -179,18 +179,18 @@ export class IndexedDBCryptoStore implements CryptoStore { logger.log(`Removing indexeddb instance: ${this.dbName}`); const req = this.indexedDB.deleteDatabase(this.dbName); - req.onblocked = () => { + req.onblocked = (): void => { logger.log( `can't yet delete IndexedDBCryptoStore because it is open elsewhere`, ); }; - req.onerror = (ev) => { + req.onerror = (ev): void => { logger.log("Error deleting data from indexeddb", ev); reject(req.error); }; - req.onsuccess = () => { + req.onsuccess = (): void => { logger.log(`Removed indexeddb instance: ${this.dbName}`); resolve(); }; @@ -322,7 +322,7 @@ export class IndexedDBCryptoStore implements CryptoStore { * @param {*} txn An active transaction. See doTxn(). * @param {function(string)} func Called with the account pickle */ - public getAccount(txn: IDBTransaction, func: (accountPickle: string | null) => void) { + public getAccount(txn: IDBTransaction, func: (accountPickle: string | null) => void): void { this.backend!.getAccount(txn, func); } diff --git a/src/crypto/store/localStorage-crypto-store.ts b/src/crypto/store/localStorage-crypto-store.ts index 4bc8b45ef7f..977236ef93f 100644 --- a/src/crypto/store/localStorage-crypto-store.ts +++ b/src/crypto/store/localStorage-crypto-store.ts @@ -76,7 +76,7 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore { return false; } - constructor(private readonly store: Storage) { + public constructor(private readonly store: Storage) { super(); } @@ -154,7 +154,7 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore { setJsonItem(this.store, key, problems); } - async getEndToEndSessionProblem(deviceKey: string, timestamp: number): Promise { + public async getEndToEndSessionProblem(deviceKey: string, timestamp: number): Promise { const key = keyEndToEndSessionProblems(deviceKey); const problems = getJsonItem(this.store, key) || []; if (!problems.length) { @@ -408,7 +408,7 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore { setJsonItem(this.store, E2E_PREFIX + `ssss_cache.${type}`, key); } - doTxn(mode: Mode, stores: Iterable, func: (txn: unknown) => T): Promise { + public doTxn(mode: Mode, stores: Iterable, func: (txn: unknown) => T): Promise { return Promise.resolve(func(null)); } } diff --git a/src/crypto/store/memory-crypto-store.ts b/src/crypto/store/memory-crypto-store.ts index 8b0206eef7a..f22379ee81e 100644 --- a/src/crypto/store/memory-crypto-store.ts +++ b/src/crypto/store/memory-crypto-store.ts @@ -279,7 +279,7 @@ export class MemoryCryptoStore implements CryptoStore { // Olm Account - public getAccount(txn: unknown, func: (accountPickle: string | null) => void) { + public getAccount(txn: unknown, func: (accountPickle: string | null) => void): void { func(this.account); } diff --git a/src/crypto/verification/Base.ts b/src/crypto/verification/Base.ts index f2fc1d5f99a..55b349e99c9 100644 --- a/src/crypto/verification/Base.ts +++ b/src/crypto/verification/Base.ts @@ -34,7 +34,7 @@ import { ListenerMap, TypedEventEmitter } from "../../models/typed-event-emitter const timeoutException = new Error("Verification timed out"); export class SwitchStartEventError extends Error { - constructor(public readonly startEvent: MatrixEvent | null) { + public constructor(public readonly startEvent: MatrixEvent | null) { super(); } } @@ -91,7 +91,7 @@ export class VerificationBase< * @param {object} [request] the key verification request object related to * this verification, if any */ - constructor( + public constructor( public readonly channel: IVerificationChannel, public readonly baseApis: MatrixClient, public readonly userId: string, @@ -286,12 +286,12 @@ export class VerificationBase< if (this.promise) return this.promise; this.promise = new Promise((resolve, reject) => { - this.resolve = (...args) => { + this.resolve = (...args): void => { this._done = true; this.endTimer(); resolve(...args); }; - this.reject = (e: Error | MatrixEvent) => { + this.reject = (e: Error | MatrixEvent): void => { this._done = true; this.endTimer(); reject(e); diff --git a/src/crypto/verification/QRCode.ts b/src/crypto/verification/QRCode.ts index 9ff9315a95f..f6bdda17e1a 100644 --- a/src/crypto/verification/QRCode.ts +++ b/src/crypto/verification/QRCode.ts @@ -154,7 +154,7 @@ interface IQrData { } export class QRCodeData { - constructor( + public constructor( public readonly mode: Mode, private readonly sharedSecret: string, // only set when mode is MODE_VERIFY_OTHER_USER, master key of other party at time of generating QR code @@ -283,21 +283,21 @@ export class QRCodeData { private static generateBuffer(qrData: IQrData): Buffer { let buf = Buffer.alloc(0); // we'll concat our way through life - const appendByte = (b) => { + const appendByte = (b): void => { const tmpBuf = Buffer.from([b]); buf = Buffer.concat([buf, tmpBuf]); }; - const appendInt = (i) => { + const appendInt = (i): void => { const tmpBuf = Buffer.alloc(2); tmpBuf.writeInt16BE(i, 0); buf = Buffer.concat([buf, tmpBuf]); }; - const appendStr = (s, enc, withLengthPrefix = true) => { + const appendStr = (s, enc, withLengthPrefix = true): void => { const tmpBuf = Buffer.from(s, enc); if (withLengthPrefix) appendInt(tmpBuf.byteLength); buf = Buffer.concat([buf, tmpBuf]); }; - const appendEncBase64 = (b64) => { + const appendEncBase64 = (b64): void => { const b = decodeBase64(b64); const tmpBuf = Buffer.from(b); buf = Buffer.concat([buf, tmpBuf]); diff --git a/src/crypto/verification/SAS.ts b/src/crypto/verification/SAS.ts index 806b4bf5ec5..5df6d48f6c8 100644 --- a/src/crypto/verification/SAS.ts +++ b/src/crypto/verification/SAS.ts @@ -170,10 +170,12 @@ const macMethods = { "hmac-sha256": "calculate_mac_long_kdf", }; -function calculateMAC(olmSAS: OlmSAS, method: string) { - return function(...args) { +type Method = keyof typeof macMethods; + +function calculateMAC(olmSAS: OlmSAS, method: Method) { + return function(...args): string { const macFunction = olmSAS[macMethods[method]]; - const mac = macFunction.apply(olmSAS, args); + const mac: string = macFunction.apply(olmSAS, args); logger.log("SAS calculateMAC:", method, args, mac); return mac; }; @@ -208,7 +210,7 @@ const calculateKeyAgreement = { */ const KEY_AGREEMENT_LIST = ["curve25519-hkdf-sha256", "curve25519"]; const HASHES_LIST = ["sha256"]; -const MAC_LIST = ["org.matrix.msc3783.hkdf-hmac-sha256", "hkdf-hmac-sha256", "hmac-sha256"]; +const MAC_LIST: Method[] = ["org.matrix.msc3783.hkdf-hmac-sha256", "hkdf-hmac-sha256", "hmac-sha256"]; const SAS_LIST = Object.keys(sasGenerators); const KEY_AGREEMENT_SET = new Set(KEY_AGREEMENT_LIST); @@ -300,13 +302,13 @@ export class SAS extends Base { keyAgreement: string, sasMethods: string[], olmSAS: OlmSAS, - macMethod: string, + macMethod: Method, ): Promise { const sasBytes = calculateKeyAgreement[keyAgreement](this, olmSAS, 6); const verifySAS = new Promise((resolve, reject) => { this.sasEvent = { sas: generateSas(sasBytes, sasMethods), - confirm: async () => { + confirm: async (): Promise => { try { await this.sendMAC(olmSAS, macMethod); resolve(); @@ -443,7 +445,7 @@ export class SAS extends Base { } } - private sendMAC(olmSAS: OlmSAS, method: string): Promise { + private sendMAC(olmSAS: OlmSAS, method: Method): Promise { const mac = {}; const keyList: string[] = []; const baseInfo = "MATRIX_KEY_VERIFICATION_MAC" @@ -475,7 +477,7 @@ export class SAS extends Base { return this.send(EventType.KeyVerificationMac, { mac, keys }); } - private async checkMAC(olmSAS: OlmSAS, content: IContent, method: string): Promise { + private async checkMAC(olmSAS: OlmSAS, content: IContent, method: Method): Promise { const baseInfo = "MATRIX_KEY_VERIFICATION_MAC" + this.userId + this.deviceId + this.baseApis.getUserId() + this.baseApis.deviceId diff --git a/src/crypto/verification/request/InRoomChannel.ts b/src/crypto/verification/request/InRoomChannel.ts index 2a4fb8d8106..664a2dad6a8 100644 --- a/src/crypto/verification/request/InRoomChannel.ts +++ b/src/crypto/verification/request/InRoomChannel.ts @@ -44,7 +44,7 @@ export class InRoomChannel implements IVerificationChannel { * @param {string} roomId id of the room where verification events should be posted in, should be a DM with the given user. * @param {string} userId id of user that the verification request is directed at, should be present in the room. */ - constructor( + public constructor( private readonly client: MatrixClient, public readonly roomId: string, public userId?: string, diff --git a/src/crypto/verification/request/ToDeviceChannel.ts b/src/crypto/verification/request/ToDeviceChannel.ts index 11227291483..30d61525139 100644 --- a/src/crypto/verification/request/ToDeviceChannel.ts +++ b/src/crypto/verification/request/ToDeviceChannel.ts @@ -42,7 +42,7 @@ export class ToDeviceChannel implements IVerificationChannel { public request?: VerificationRequest; // userId and devices of user we're about to verify - constructor( + public constructor( private readonly client: MatrixClient, public readonly userId: string, private readonly devices: string[], diff --git a/src/crypto/verification/request/VerificationRequest.ts b/src/crypto/verification/request/VerificationRequest.ts index 2ff71d62c19..58de4b9a2b0 100644 --- a/src/crypto/verification/request/VerificationRequest.ts +++ b/src/crypto/verification/request/VerificationRequest.ts @@ -116,7 +116,7 @@ export class VerificationRequest< public _cancellingUserId?: string; // Used in tests only private _verifier?: VerificationBase; - constructor( + public constructor( public readonly channel: C, private readonly verificationMethods: Map, private readonly client: MatrixClient, @@ -498,7 +498,7 @@ export class VerificationRequest< */ public waitFor(fn: (request: VerificationRequest) => boolean): Promise { return new Promise((resolve, reject) => { - const check = () => { + const check = (): boolean => { let handled = false; if (fn(this)) { resolve(this); @@ -539,7 +539,7 @@ export class VerificationRequest< private calculatePhaseTransitions(): ITransition[] { const transitions: ITransition[] = [{ phase: PHASE_UNSENT }]; - const phase = () => transitions[transitions.length - 1].phase; + const phase = (): Phase => transitions[transitions.length - 1].phase; // always pass by .request first to be sure channel.userId has been set const hasRequestByThem = this.eventsByThem.has(REQUEST_TYPE); @@ -816,7 +816,7 @@ export class VerificationRequest< } } - private cancelOnTimeout = async () => { + private cancelOnTimeout = async (): Promise => { try { if (this.initiatedByMe) { await this.cancel({ diff --git a/src/embedded.ts b/src/embedded.ts index d1dfb50bf2f..27cf564a670 100644 --- a/src/embedded.ts +++ b/src/embedded.ts @@ -101,7 +101,7 @@ export class RoomWidgetClient extends MatrixClient { private lifecycle?: AbortController; private syncState: SyncState | null = null; - constructor( + public constructor( private readonly widgetApi: WidgetApi, private readonly capabilities: ICapabilities, private readonly roomId: string, @@ -211,7 +211,7 @@ export class RoomWidgetClient extends MatrixClient { if (this.capabilities.turnServers) this.watchTurnServers(); } - public stopClient() { + public stopClient(): void { this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendEvent}`, this.onEvent); this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendToDevice}`, this.onToDevice); @@ -288,7 +288,7 @@ export class RoomWidgetClient extends MatrixClient { return this.syncState; } - private setSyncState(state: SyncState) { + private setSyncState(state: SyncState): void { const oldState = this.syncState; this.syncState = state; this.emit(ClientEvent.Sync, state, oldState); @@ -298,7 +298,7 @@ export class RoomWidgetClient extends MatrixClient { await this.widgetApi.transport.reply(ev.detail, {}); } - private onEvent = async (ev: CustomEvent) => { + private onEvent = async (ev: CustomEvent): Promise => { ev.preventDefault(); // Verify the room ID matches, since it's possible for the client to @@ -317,7 +317,7 @@ export class RoomWidgetClient extends MatrixClient { await this.ack(ev); }; - private onToDevice = async (ev: CustomEvent) => { + private onToDevice = async (ev: CustomEvent): Promise => { ev.preventDefault(); const event = new MatrixEvent({ @@ -333,9 +333,11 @@ export class RoomWidgetClient extends MatrixClient { await this.ack(ev); }; - private async watchTurnServers() { + private async watchTurnServers(): Promise { const servers = this.widgetApi.getTurnServers(); - const onClientStopped = () => servers.return(undefined); + const onClientStopped = (): void => { + servers.return(undefined); + }; this.lifecycle!.signal.addEventListener("abort", onClientStopped); try { diff --git a/src/event-mapper.ts b/src/event-mapper.ts index 57d36c9f68d..6f2e25c1bdd 100644 --- a/src/event-mapper.ts +++ b/src/event-mapper.ts @@ -29,7 +29,7 @@ export function eventMapperFor(client: MatrixClient, options: MapperOpts): Event let preventReEmit = Boolean(options.preventReEmit); const decrypt = options.decrypt !== false; - function mapper(plainOldJsObject: Partial) { + function mapper(plainOldJsObject: Partial): MatrixEvent { if (options.toDevice) { delete plainOldJsObject.room_id; } diff --git a/src/filter-component.ts b/src/filter-component.ts index 759c979216e..85afb0ea707 100644 --- a/src/filter-component.ts +++ b/src/filter-component.ts @@ -73,7 +73,7 @@ export interface IFilterComponent { * @param {Object} filterJson the definition of this filter JSON, e.g. { 'contains_url': true } */ export class FilterComponent { - constructor(private filterJson: IFilterComponent, public readonly userId?: string | undefined | null) {} + public constructor(private filterJson: IFilterComponent, public readonly userId?: string | undefined | null) {} /** * Checks with the filter component matches the given event diff --git a/src/filter.ts b/src/filter.ts index fb499c4da2a..57bd0540d87 100644 --- a/src/filter.ts +++ b/src/filter.ts @@ -31,7 +31,7 @@ import { MatrixEvent } from "./models/event"; * @param {string} keyNesting * @param {*} val */ -function setProp(obj: object, keyNesting: string, val: any) { +function setProp(obj: object, keyNesting: string, val: any): void { const nestedKeys = keyNesting.split("."); let currentObj = obj; for (let i = 0; i < (nestedKeys.length - 1); i++) { @@ -88,7 +88,7 @@ interface IRoomFilter { * @prop {?string} filterId The filter ID */ export class Filter { - static LAZY_LOADING_MESSAGES_FILTER = { + public static LAZY_LOADING_MESSAGES_FILTER = { lazy_load_members: true, }; @@ -110,7 +110,7 @@ export class Filter { private roomFilter?: FilterComponent; private roomTimelineFilter?: FilterComponent; - constructor(public readonly userId: string | undefined | null, public filterId?: string) {} + public constructor(public readonly userId: string | undefined | null, public filterId?: string) {} /** * Get the ID of this filter on your homeserver (if known) @@ -132,7 +132,7 @@ export class Filter { * Set the JSON body of the filter * @param {Object} definition The filter definition */ - public setDefinition(definition: IFilterDefinition) { + public setDefinition(definition: IFilterDefinition): void { this.definition = definition; // This is all ported from synapse's FilterCollection() @@ -225,7 +225,7 @@ export class Filter { * Set the max number of events to return for each room's timeline. * @param {Number} limit The max number of events to return for each room. */ - public setTimelineLimit(limit: number) { + public setTimelineLimit(limit: number): void { setProp(this.definition, "room.timeline.limit", limit); } @@ -255,7 +255,7 @@ export class Filter { * @param {boolean} includeLeave True to make rooms the user has left appear * in responses. */ - public setIncludeLeaveRooms(includeLeave: boolean) { + public setIncludeLeaveRooms(includeLeave: boolean): void { setProp(this.definition, "room.include_leave", includeLeave); } } diff --git a/src/http-api/errors.ts b/src/http-api/errors.ts index be63c94fdf0..5ae0a0f5099 100644 --- a/src/http-api/errors.ts +++ b/src/http-api/errors.ts @@ -31,7 +31,7 @@ interface IErrorJson extends Partial { * @param {number} httpStatus The HTTP response status code. */ export class HTTPError extends Error { - constructor(msg: string, public readonly httpStatus?: number) { + public constructor(msg: string, public readonly httpStatus?: number) { super(msg); } } @@ -51,7 +51,7 @@ export class MatrixError extends HTTPError { public readonly errcode?: string; public data: IErrorJson; - constructor( + public constructor( errorJson: IErrorJson = {}, public readonly httpStatus?: number, public url?: string, @@ -79,11 +79,11 @@ export class MatrixError extends HTTPError { * @constructor */ export class ConnectionError extends Error { - constructor(message: string, cause?: Error) { + public constructor(message: string, cause?: Error) { super(message + (cause ? `: ${cause.message}` : "")); } - get name() { + public get name(): string { return "ConnectionError"; } } diff --git a/src/http-api/fetch.ts b/src/http-api/fetch.ts index 92413c094af..71ba098e303 100644 --- a/src/http-api/fetch.ts +++ b/src/http-api/fetch.ts @@ -41,7 +41,7 @@ export type ResponseType = export class FetchHttpApi { private abortController = new AbortController(); - constructor( + public constructor( private eventEmitter: TypedEventEmitter, public readonly opts: O, ) { diff --git a/src/http-api/index.ts b/src/http-api/index.ts index 0c9b0b62314..c7f782d8972 100644 --- a/src/http-api/index.ts +++ b/src/http-api/index.ts @@ -77,7 +77,7 @@ export class MatrixHttpApi extends FetchHttpApi { if (global.XMLHttpRequest) { const xhr = new global.XMLHttpRequest(); - const timeoutFn = function() { + const timeoutFn = function(): void { xhr.abort(); defer.reject(new Error("Timeout")); }; @@ -85,7 +85,7 @@ export class MatrixHttpApi extends FetchHttpApi { // set an initial timeout of 30s; we'll advance it each time we get a progress notification let timeoutTimer = callbacks.setTimeout(timeoutFn, 30000); - xhr.onreadystatechange = function() { + xhr.onreadystatechange = function(): void { switch (xhr.readyState) { case global.XMLHttpRequest.DONE: callbacks.clearTimeout(timeoutTimer); @@ -113,7 +113,7 @@ export class MatrixHttpApi extends FetchHttpApi { } }; - xhr.upload.onprogress = (ev: ProgressEvent) => { + xhr.upload.onprogress = (ev: ProgressEvent): void => { callbacks.clearTimeout(timeoutTimer); upload.loaded = ev.loaded; upload.total = ev.total; diff --git a/src/http-api/utils.ts b/src/http-api/utils.ts index c7e39477089..50466095002 100644 --- a/src/http-api/utils.ts +++ b/src/http-api/utils.ts @@ -36,13 +36,13 @@ export function anySignal(signals: AbortSignal[]): { } { const controller = new AbortController(); - function cleanup() { + function cleanup(): void { for (const signal of signals) { signal.removeEventListener("abort", onAbort); } } - function onAbort() { + function onAbort(): void { controller.abort(); cleanup(); } diff --git a/src/indexeddb-helpers.ts b/src/indexeddb-helpers.ts index 84de7c0e9ef..695a3145ff2 100644 --- a/src/indexeddb-helpers.ts +++ b/src/indexeddb-helpers.ts @@ -26,13 +26,13 @@ export function exists(indexedDB: IDBFactory, dbName: string): Promise return new Promise((resolve, reject) => { let exists = true; const req = indexedDB.open(dbName); - req.onupgradeneeded = () => { + req.onupgradeneeded = (): void => { // Since we did not provide an explicit version when opening, this event // should only fire if the DB did not exist before at any version. exists = false; }; - req.onblocked = () => reject(req.error); - req.onsuccess = () => { + req.onblocked = (): void => reject(req.error); + req.onsuccess = (): void => { const db = req.result; db.close(); if (!exists) { @@ -45,6 +45,6 @@ export function exists(indexedDB: IDBFactory, dbName: string): Promise } resolve(exists); }; - req.onerror = ev => reject(req.error); + req.onerror = (): void => reject(req.error); }); } diff --git a/src/interactive-auth.ts b/src/interactive-auth.ts index 80f3e95cf40..df4a42c2726 100644 --- a/src/interactive-auth.ts +++ b/src/interactive-auth.ts @@ -100,7 +100,7 @@ class NoAuthFlowFoundError extends Error { public name = "NoAuthFlowFoundError"; // eslint-disable-next-line @typescript-eslint/naming-convention, camelcase - constructor(m: string, public readonly required_stages: string[], public readonly flows: IFlow[]) { + public constructor(m: string, public readonly required_stages: string[], public readonly flows: IFlow[]) { super(m); } } @@ -218,7 +218,7 @@ export class InteractiveAuth { // the promise the will resolve/reject when it completes private submitPromise: Promise | null = null; - constructor(opts: IOpts) { + public constructor(opts: IOpts) { this.matrixClient = opts.matrixClient; this.data = opts.authData || {}; this.requestCallback = opts.doRequest; @@ -419,7 +419,7 @@ export class InteractiveAuth { /** * Requests a new email token and sets the email sid for the validation session */ - public requestEmailToken = async () => { + public requestEmailToken = async (): Promise => { if (!this.requestingEmailToken) { logger.trace("Requesting email token. Attempt: " + this.emailAttempt); // If we've picked a flow with email auth, we send the email diff --git a/src/logger.ts b/src/logger.ts index f2fb821673f..de1ca6619c1 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -35,7 +35,7 @@ const DEFAULT_NAMESPACE = "matrix"; // console methods at initialization time by a factory that looks up the console methods // when logging so we always get the current value of console methods. log.methodFactory = function(methodName, logLevel, loggerName) { - return function(this: PrefixedLogger, ...args) { + return function(this: PrefixedLogger, ...args): void { /* eslint-disable @typescript-eslint/no-invalid-this */ if (this.prefix) { args.unshift(this.prefix); @@ -67,7 +67,7 @@ export interface PrefixedLogger extends Logger { prefix: string; } -function extendLogger(logger: Logger) { +function extendLogger(logger: Logger): void { (logger).withPrefix = function(prefix: string): PrefixedLogger { const existingPrefix = this.prefix || ""; return getPrefixedLogger(existingPrefix + prefix); diff --git a/src/matrix.ts b/src/matrix.ts index e89feddeb04..421e0e6ed87 100644 --- a/src/matrix.ts +++ b/src/matrix.ts @@ -21,6 +21,7 @@ import { MemoryStore } from "./store/memory"; import { MatrixScheduler } from "./scheduler"; import { MatrixClient, ICreateClientOpts } from "./client"; import { RoomWidgetClient, ICapabilities } from "./embedded"; +import { CryptoStore } from "./crypto/store/base"; export * from "./client"; export * from "./embedded"; @@ -64,7 +65,7 @@ export { } from "./webrtc/groupCall"; export type { GroupCall } from "./webrtc/groupCall"; -let cryptoStoreFactory = () => new MemoryCryptoStore; +let cryptoStoreFactory = (): CryptoStore => new MemoryCryptoStore; /** * Configure a different factory to be used for creating crypto stores @@ -72,7 +73,7 @@ let cryptoStoreFactory = () => new MemoryCryptoStore; * @param {Function} fac a function which will return a new * {@link module:crypto.store.base~CryptoStore}. */ -export function setCryptoStoreFactory(fac) { +export function setCryptoStoreFactory(fac: () => CryptoStore): void { cryptoStoreFactory = fac; } diff --git a/src/models/MSC3089TreeSpace.ts b/src/models/MSC3089TreeSpace.ts index 762ef586ab6..f437eab84da 100644 --- a/src/models/MSC3089TreeSpace.ts +++ b/src/models/MSC3089TreeSpace.ts @@ -172,7 +172,7 @@ export class MSC3089TreeSpace { const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, ""); if (Array.isArray(currentPls)) throw new Error("Unexpected return type for power levels"); - const pls = currentPls.getContent() || {}; + const pls = currentPls?.getContent() || {}; const viewLevel = pls['users_default'] || 0; const editLevel = pls['events_default'] || 50; const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100; @@ -207,7 +207,7 @@ export class MSC3089TreeSpace { const currentPls = this.room.currentState.getStateEvents(EventType.RoomPowerLevels, ""); if (Array.isArray(currentPls)) throw new Error("Unexpected return type for power levels"); - const pls = currentPls.getContent() || {}; + const pls = currentPls?.getContent() || {}; const viewLevel = pls['users_default'] || 0; const editLevel = pls['events_default'] || 50; const adminLevel = pls['events']?.[EventType.RoomPowerLevels] || 100; diff --git a/src/models/beacon.ts b/src/models/beacon.ts index fc817b05e24..6e20b229bd5 100644 --- a/src/models/beacon.ts +++ b/src/models/beacon.ts @@ -56,7 +56,7 @@ export class Beacon extends TypedEventEmitter; private _latestLocationEvent?: MatrixEvent; - constructor( + public constructor( private rootEvent: MatrixEvent, ) { super(); @@ -180,7 +180,7 @@ export class Beacon extends TypedEventEmitter { + private clearLatestLocation = (): void => { this._latestLocationEvent = undefined; this.emit(BeaconEvent.LocationUpdate, this.latestLocationState!); }; diff --git a/src/models/event-context.ts b/src/models/event-context.ts index a1a43e98f50..60252627bde 100644 --- a/src/models/event-context.ts +++ b/src/models/event-context.ts @@ -42,7 +42,7 @@ export class EventContext { * * @constructor */ - constructor(public readonly ourEvent: MatrixEvent) { + public constructor(public readonly ourEvent: MatrixEvent) { this.timeline = [ourEvent]; } diff --git a/src/models/event-timeline-set.ts b/src/models/event-timeline-set.ts index a69715dc381..6dd2a0e7740 100644 --- a/src/models/event-timeline-set.ts +++ b/src/models/event-timeline-set.ts @@ -36,7 +36,7 @@ if (DEBUG) { // using bind means that we get to keep useful line numbers in the console debuglog = logger.log.bind(logger); } else { - debuglog = function() {}; + debuglog = function(): void {}; } interface IOpts { @@ -135,7 +135,7 @@ export class EventTimelineSet extends TypedEventEmitterThis property is experimental and may change. */ - constructor(public event: Partial = {}) { + public constructor(public event: Partial = {}) { super(); // intern the values of matrix events to force share strings and reduce the @@ -352,7 +352,7 @@ export class MatrixEvent extends TypedEventEmitter { await this.client.redactEvent(event.getRoomId()!, event.getId()!); } @@ -314,7 +314,7 @@ export class IgnoredInvites { /** * Modify in place the `IGNORE_INVITES_POLICIES` object from account data. */ - private async withIgnoreInvitesPolicies(cb: (ignoreInvitesPolicies: {[key: string]: any}) => void) { + private async withIgnoreInvitesPolicies(cb: (ignoreInvitesPolicies: {[key: string]: any}) => void): Promise { const { policies, ignoreInvitesPolicies } = this.getPoliciesAndIgnoreInvitesPolicies(); cb(ignoreInvitesPolicies); policies[IGNORE_INVITES_ACCOUNT_EVENT_KEY.name] = ignoreInvitesPolicies; diff --git a/src/models/related-relations.ts b/src/models/related-relations.ts index 09c618ae8ee..f619ea059fe 100644 --- a/src/models/related-relations.ts +++ b/src/models/related-relations.ts @@ -29,11 +29,11 @@ export class RelatedRelations { return this.relations.reduce((c, p) => [...c, ...p.getRelations()], []); } - public on(ev: T, fn: Listener) { + public on(ev: T, fn: Listener): void { this.relations.forEach(r => r.on(ev, fn)); } - public off(ev: T, fn: Listener) { + public off(ev: T, fn: Listener): void { this.relations.forEach(r => r.off(ev, fn)); } } diff --git a/src/models/relations-container.ts b/src/models/relations-container.ts index edb2616107e..55e098a3f6d 100644 --- a/src/models/relations-container.ts +++ b/src/models/relations-container.ts @@ -26,7 +26,7 @@ export class RelationsContainer { // this.relations.get(parentEventId).get(relationType).get(relationEventType) private relations = new Map>>(); - constructor(private readonly client: MatrixClient, private readonly room?: Room) { + public constructor(private readonly client: MatrixClient, private readonly room?: Room) { } /** @@ -98,7 +98,7 @@ export class RelationsContainer { const relation = event.getRelation(); if (!relation) return; - const onEventDecrypted = () => { + const onEventDecrypted = (): void => { if (event.isDecryptionFailure()) { // This could for example happen if the encryption keys are not yet available. // The event may still be decrypted later. Register the listener again. diff --git a/src/models/relations.ts b/src/models/relations.ts index a384c9b7f26..00fb7f6e979 100644 --- a/src/models/relations.ts +++ b/src/models/relations.ts @@ -60,7 +60,7 @@ export class Relations extends TypedEventEmitter { if (this.relationEventIds.has(event.getId()!)) { return; } @@ -123,7 +123,7 @@ export class Relations extends TypedEventEmitter { if (!this.relations.has(event)) { return; } @@ -160,7 +160,7 @@ export class Relations extends TypedEventEmitter { + private onEventStatus = (event: MatrixEvent, status: EventStatus | null): void => { if (!event.isSending()) { // Sending is done, so we don't need to listen anymore event.removeListener(MatrixEventEvent.Status, this.onEventStatus); @@ -356,7 +356,7 @@ export class Relations extends TypedEventEmitter { if (this.targetEvent) { return; } @@ -374,7 +374,7 @@ export class Relations extends TypedEventEmitter * events dictionary, keyed on the event type and then the state_key value. * @prop {string} paginationToken The pagination token for this state. */ - constructor(public readonly roomId: string, private oobMemberFlags = { status: OobStatus.NotStarted }) { + public constructor(public readonly roomId: string, private oobMemberFlags = { status: OobStatus.NotStarted }) { super(); this.updateModifiedTime(); } @@ -250,8 +250,8 @@ export class RoomState extends TypedEventEmitter * undefined, else a single event (or null if no match found). */ public getStateEvents(eventType: EventType | string): MatrixEvent[]; - public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent; - public getStateEvents(eventType: EventType | string, stateKey?: string) { + public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent | null; + public getStateEvents(eventType: EventType | string, stateKey?: string): MatrixEvent[] | MatrixEvent | null { if (!this.events.has(eventType)) { // no match return stateKey === undefined ? [] : null; @@ -342,7 +342,7 @@ export class RoomState extends TypedEventEmitter * @fires module:client~MatrixClient#event:"RoomState.events" * @fires module:client~MatrixClient#event:"RoomStateEvent.Marker" */ - public setStateEvents(stateEvents: MatrixEvent[], markerFoundOptions?: IMarkerFoundOptions) { + public setStateEvents(stateEvents: MatrixEvent[], markerFoundOptions?: IMarkerFoundOptions): void { this.updateModifiedTime(); // update the core event dict diff --git a/src/models/room-summary.ts b/src/models/room-summary.ts index d01b470ae8e..ba279d2d4fc 100644 --- a/src/models/room-summary.ts +++ b/src/models/room-summary.ts @@ -46,6 +46,6 @@ interface IInfo { * @param {Number} info.timestamp The timestamp for this room. */ export class RoomSummary { - constructor(public readonly roomId: string, info?: IInfo) {} + public constructor(public readonly roomId: string, info?: IInfo) {} } diff --git a/src/models/room.ts b/src/models/room.ts index 21b06a6ced6..0d16940273e 100644 --- a/src/models/room.ts +++ b/src/models/room.ts @@ -317,7 +317,7 @@ export class Room extends ReadReceipt { * @param {boolean} [opts.timelineSupport = false] Set to true to enable improved * timeline support. */ - constructor( + public constructor( public readonly roomId: string, public readonly client: MatrixClient, public readonly myUserId: string, @@ -1950,7 +1950,7 @@ export class Room extends ReadReceipt { )); } - private updateThreadRootEvents = (thread: Thread, toStartOfTimeline: boolean) => { + private updateThreadRootEvents = (thread: Thread, toStartOfTimeline: boolean): void => { if (thread.length) { this.updateThreadRootEvent(this.threadsTimelineSets?.[0], thread, toStartOfTimeline); if (thread.hasCurrentUserParticipated) { @@ -1963,7 +1963,7 @@ export class Room extends ReadReceipt { timelineSet: Optional, thread: Thread, toStartOfTimeline: boolean, - ) => { + ): void => { if (timelineSet && thread.rootEvent) { if (Thread.hasServerSideSupport) { timelineSet.addLiveEvent(thread.rootEvent, { @@ -2050,7 +2050,7 @@ export class Room extends ReadReceipt { redactedEvent.getType(), redactedEvent.getStateKey()!, ); - if (currentStateEvent.getId() === redactedEvent.getId()) { + if (currentStateEvent?.getId() === redactedEvent.getId()) { this.currentState.setStateEvents([redactedEvent]); } } @@ -2913,7 +2913,7 @@ export class Room extends ReadReceipt { let excludedUserIds: string[] = []; const mFunctionalMembers = this.currentState.getStateEvents(UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name, ""); if (Array.isArray(mFunctionalMembers?.getContent().service_members)) { - excludedUserIds = mFunctionalMembers.getContent().service_members; + excludedUserIds = mFunctionalMembers!.getContent().service_members; } // get members that are NOT ourselves and are actually in the room. @@ -3077,7 +3077,7 @@ export class Room extends ReadReceipt { originalEvent.applyVisibilityEvent(visibilityChange); } - private redactVisibilityChangeEvent(event: MatrixEvent) { + private redactVisibilityChangeEvent(event: MatrixEvent): void { // Sanity checks. if (!event.isVisibilityEvent) { throw new Error("expected a visibility change event"); diff --git a/src/models/search-result.ts b/src/models/search-result.ts index 99f9c5ddaa3..f598301d785 100644 --- a/src/models/search-result.ts +++ b/src/models/search-result.ts @@ -60,5 +60,5 @@ export class SearchResult { * * @constructor */ - constructor(public readonly rank: number, public readonly context: EventContext) {} + public constructor(public readonly rank: number, public readonly context: EventContext) {} } diff --git a/src/models/thread.ts b/src/models/thread.ts index 3c02558bf34..5abe63d6c2f 100644 --- a/src/models/thread.ts +++ b/src/models/thread.ts @@ -94,7 +94,7 @@ export class Thread extends ReadReceipt { public initialEventsFetched = !Thread.hasServerSideSupport; - constructor( + public constructor( public readonly id: string, public rootEvent: MatrixEvent | undefined, opts: IThreadOpts, @@ -167,7 +167,7 @@ export class Thread extends ReadReceipt { Thread.hasServerSideFwdPaginationSupport = status; } - private onBeforeRedaction = (event: MatrixEvent, redaction: MatrixEvent) => { + private onBeforeRedaction = (event: MatrixEvent, redaction: MatrixEvent): void => { if (event?.isRelation(THREAD_RELATION_TYPE.name) && this.room.eventShouldLiveIn(event).threadId === this.id && event.getId() !== this.id && // the root event isn't counted in the length so ignore this redaction @@ -178,7 +178,7 @@ export class Thread extends ReadReceipt { } }; - private onRedaction = async (event: MatrixEvent) => { + private onRedaction = async (event: MatrixEvent): Promise => { if (event.threadRootId !== this.id) return; // ignore redactions for other timelines if (this.replyCount <= 0) { for (const threadEvent of this.events) { @@ -192,7 +192,7 @@ export class Thread extends ReadReceipt { } }; - private onEcho = async (event: MatrixEvent) => { + private onEcho = async (event: MatrixEvent): Promise => { if (event.threadRootId !== this.id) return; // ignore echoes for other timelines if (this.lastEvent === event) return; if (!event.isRelation(THREAD_RELATION_TYPE.name)) return; @@ -349,7 +349,7 @@ export class Thread extends ReadReceipt { /** * Finds an event by ID in the current thread */ - public findEventById(eventId: string) { + public findEventById(eventId: string): MatrixEvent | undefined { // Check the lastEvent as it may have been created based on a bundled relationship and not in a timeline if (this.lastEvent?.getId() === eventId) { return this.lastEvent; @@ -361,7 +361,7 @@ export class Thread extends ReadReceipt { /** * Return last reply to the thread, if known. */ - public lastReply(matches: (ev: MatrixEvent) => boolean = () => true): MatrixEvent | null { + public lastReply(matches: (ev: MatrixEvent) => boolean = (): boolean => true): MatrixEvent | null { for (let i = this.events.length - 1; i >= 0; i--) { const event = this.events[i]; if (matches(event)) { diff --git a/src/models/user.ts b/src/models/user.ts index 31d113dbe72..5d92ca494cb 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -76,7 +76,7 @@ export class User extends TypedEventEmitter { * @prop {Object} events The events describing this user. * @prop {MatrixEvent} events.presence The m.presence event for this user. */ - constructor(public readonly userId: string) { + public constructor(public readonly userId: string) { super(); this.displayName = userId; this.rawDisplayName = userId; diff --git a/src/pushprocessor.ts b/src/pushprocessor.ts index 7c127d4c7ca..4538b97214e 100644 --- a/src/pushprocessor.ts +++ b/src/pushprocessor.ts @@ -126,7 +126,7 @@ export class PushProcessor { * @constructor * @param {Object} client The Matrix client object to use */ - constructor(private readonly client: MatrixClient) {} + public constructor(private readonly client: MatrixClient) {} /** * Convert a list of actions into a object with the actions as keys and their values diff --git a/src/realtime-callbacks.ts b/src/realtime-callbacks.ts index 222c9476390..4677b0c1ed1 100644 --- a/src/realtime-callbacks.ts +++ b/src/realtime-callbacks.ts @@ -48,7 +48,7 @@ type Callback = { const callbackList: Callback[] = []; // var debuglog = logger.log.bind(logger); -const debuglog = function(...params: any[]) {}; +const debuglog = function(...params: any[]): void {}; /** * reimplementation of window.setTimeout, which will call the callback if diff --git a/src/rendezvous/MSC3906Rendezvous.ts b/src/rendezvous/MSC3906Rendezvous.ts index c18af591268..a93d4c476ac 100644 --- a/src/rendezvous/MSC3906Rendezvous.ts +++ b/src/rendezvous/MSC3906Rendezvous.ts @@ -143,11 +143,11 @@ export class MSC3906Rendezvous { return await this.channel.receive() as MSC3906RendezvousPayload; } - private async send(payload: MSC3906RendezvousPayload) { + private async send(payload: MSC3906RendezvousPayload): Promise { await this.channel.send(payload); } - public async declineLoginOnExistingDevice() { + public async declineLoginOnExistingDevice(): Promise { logger.info('User declined sign in'); await this.send({ type: PayloadType.Finish, outcome: Outcome.Declined }); } diff --git a/src/rendezvous/RendezvousError.ts b/src/rendezvous/RendezvousError.ts index 1c1f6af9c7c..8b76fc1186c 100644 --- a/src/rendezvous/RendezvousError.ts +++ b/src/rendezvous/RendezvousError.ts @@ -17,7 +17,7 @@ limitations under the License. import { RendezvousFailureReason } from "."; export class RendezvousError extends Error { - constructor(message: string, public readonly code: RendezvousFailureReason) { + public constructor(message: string, public readonly code: RendezvousFailureReason) { super(message); } } diff --git a/src/room-hierarchy.ts b/src/room-hierarchy.ts index 6d95db2a5f9..c15f2ac56dc 100644 --- a/src/room-hierarchy.ts +++ b/src/room-hierarchy.ts @@ -47,7 +47,7 @@ export class RoomHierarchy { * @param {boolean} suggestedOnly whether to only return rooms with suggested=true. * @constructor */ - constructor( + public constructor( public readonly root: Room, private readonly pageSize?: number, private readonly maxDepth?: number, diff --git a/src/scheduler.ts b/src/scheduler.ts index 7a1a99dedb3..f6d66198a01 100644 --- a/src/scheduler.ts +++ b/src/scheduler.ts @@ -97,7 +97,7 @@ export class MatrixScheduler { * @see module:scheduler~queueAlgorithm */ // eslint-disable-next-line @typescript-eslint/naming-convention - public static QUEUE_MESSAGES(event: MatrixEvent) { + public static QUEUE_MESSAGES(event: MatrixEvent): "message" | null { // enqueue messages or events that associate with another event (redactions and relations) if (event.getType() === EventType.RoomMessage || event.hasAssocation()) { // put these events in the 'message' queue. @@ -116,7 +116,7 @@ export class MatrixScheduler { private activeQueues: string[] = []; private procFn: ProcessFunction | null = null; - constructor( + public constructor( public readonly retryAlgorithm = MatrixScheduler.RETRY_BACKOFF_RATELIMIT, public readonly queueAlgorithm = MatrixScheduler.QUEUE_MESSAGES, ) {} @@ -283,7 +283,7 @@ export class MatrixScheduler { } } -function debuglog(...args: any[]) { +function debuglog(...args: any[]): void { if (DEBUG) { logger.log(...args); } diff --git a/src/sliding-sync-sdk.ts b/src/sliding-sync-sdk.ts index 962d824a8e5..4f3867f5446 100644 --- a/src/sliding-sync-sdk.ts +++ b/src/sliding-sync-sdk.ts @@ -45,7 +45,7 @@ import { RoomMemberEvent } from "./models/room-member"; const FAILED_SYNC_ERROR_THRESHOLD = 3; class ExtensionE2EE implements Extension { - constructor(private readonly crypto: Crypto) {} + public constructor(private readonly crypto: Crypto) {} public name(): string { return "e2ee"; @@ -95,7 +95,7 @@ class ExtensionE2EE implements Extension { class ExtensionToDevice implements Extension { private nextBatch: string | null = null; - constructor(private readonly client: MatrixClient) {} + public constructor(private readonly client: MatrixClient) {} public name(): string { return "to_device"; @@ -170,7 +170,7 @@ class ExtensionToDevice implements Extension { } class ExtensionAccountData implements Extension { - constructor(private readonly client: MatrixClient) {} + public constructor(private readonly client: MatrixClient) {} public name(): string { return "account_data"; @@ -244,7 +244,7 @@ export class SlidingSyncSdk { private failCount = 0; private notifEvents: MatrixEvent[] = []; // accumulator of sync events in the current sync response - constructor( + public constructor( private readonly slidingSync: SlidingSync, private readonly client: MatrixClient, private readonly opts: Partial = {}, @@ -256,7 +256,7 @@ export class SlidingSyncSdk { this.opts.experimentalThreadSupport = this.opts.experimentalThreadSupport === true; if (!opts.canResetEntireTimeline) { - opts.canResetEntireTimeline = (_roomId: string) => { + opts.canResetEntireTimeline = (_roomId: string): boolean => { return false; }; } @@ -348,7 +348,7 @@ export class SlidingSyncSdk { * Sync rooms the user has left. * @return {Promise} Resolved when they've been added to the store. */ - public async syncLeftRooms() { + public async syncLeftRooms(): Promise { return []; // TODO } @@ -457,7 +457,7 @@ export class SlidingSyncSdk { return false; } - private async processRoomData(client: MatrixClient, room: Room, roomData: MSC3575RoomData) { + private async processRoomData(client: MatrixClient, room: Room, roomData: MSC3575RoomData): Promise { roomData = ensureNameEvent(client, room.roomId, roomData); const stateEvents = mapEvents(this.client, room.roomId, roomData.required_state); // Prevent events from being decrypted ahead of time @@ -632,7 +632,7 @@ export class SlidingSyncSdk { // we'll purge this once we've fully processed the sync response this.addNotifications(timelineEvents); - const processRoomEvent = async (e: MatrixEvent) => { + const processRoomEvent = async (e: MatrixEvent): Promise => { client.emit(ClientEvent.Event, e); if (e.isState() && e.getType() == EventType.RoomEncryption && this.opts.crypto) { await this.opts.crypto.onCryptoEvent(e); @@ -767,7 +767,7 @@ export class SlidingSyncSdk { /** * Main entry point. Blocks until stop() is called. */ - public async sync() { + public async sync(): Promise { logger.debug("Sliding sync init loop"); // 1) We need to get push rules so we can check if events should bing as we get diff --git a/src/sliding-sync.ts b/src/sliding-sync.ts index e091c98833e..171bf55c32d 100644 --- a/src/sliding-sync.ts +++ b/src/sliding-sync.ts @@ -169,7 +169,7 @@ class SlidingList { * Construct a new sliding list. * @param {MSC3575List} list The range, sort and filter values to use for this list. */ - constructor(list: MSC3575List) { + public constructor(list: MSC3575List) { this.replaceList(list); } @@ -373,7 +373,7 @@ export class SlidingSync extends TypedEventEmitter { this.abortController = new AbortController(); let currentPos: string | undefined; diff --git a/src/store/indexeddb-local-backend.ts b/src/store/indexeddb-local-backend.ts index 597ed511741..af4b5fc6519 100644 --- a/src/store/indexeddb-local-backend.ts +++ b/src/store/indexeddb-local-backend.ts @@ -25,7 +25,7 @@ import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDevice type DbMigration = (db: IDBDatabase) => void; const DB_MIGRATIONS: DbMigration[] = [ - (db) => { + (db): void => { // Make user store, clobber based on user ID. (userId property of User objects) db.createObjectStore("users", { keyPath: ["userId"] }); @@ -36,15 +36,15 @@ const DB_MIGRATIONS: DbMigration[] = [ // Make /sync store (sync tokens, room data, etc), always clobber (const key). db.createObjectStore("sync", { keyPath: ["clobber"] }); }, - (db) => { + (db): void => { const oobMembersStore = db.createObjectStore( "oob_membership_events", { keyPath: ["room_id", "state_key"], }); oobMembersStore.createIndex("room", "room_id"); }, - (db) => { db.createObjectStore("client_options", { keyPath: ["clobber"] }); }, - (db) => { db.createObjectStore("to_device_queue", { autoIncrement: true }); }, + (db): void => { db.createObjectStore("client_options", { keyPath: ["clobber"] }); }, + (db): void => { db.createObjectStore("to_device_queue", { autoIncrement: true }); }, // Expand as needed. ]; const VERSION = DB_MIGRATIONS.length; @@ -67,11 +67,11 @@ function selectQuery( const query = store.openCursor(keyRange); return new Promise((resolve, reject) => { const results: T[] = []; - query.onerror = () => { + query.onerror = (): void => { reject(new Error("Query failed: " + query.error)); }; // collect results - query.onsuccess = () => { + query.onsuccess = (): void => { const cursor = query.result; if (!cursor) { resolve(results); @@ -85,10 +85,10 @@ function selectQuery( function txnAsPromise(txn: IDBTransaction): Promise { return new Promise((resolve, reject) => { - txn.oncomplete = function(event) { + txn.oncomplete = function(event): void { resolve(event); }; - txn.onerror = function() { + txn.onerror = function(): void { reject(txn.error); }; }); @@ -96,10 +96,10 @@ function txnAsPromise(txn: IDBTransaction): Promise { function reqAsEventPromise(req: IDBRequest): Promise { return new Promise((resolve, reject) => { - req.onsuccess = function(event) { + req.onsuccess = function(event): void { resolve(event); }; - req.onerror = function() { + req.onerror = function(): void { reject(req.error); }; }); @@ -107,8 +107,8 @@ function reqAsEventPromise(req: IDBRequest): Promise { function reqAsPromise(req: IDBRequest): Promise { return new Promise((resolve, reject) => { - req.onsuccess = () => resolve(req); - req.onerror = (err) => reject(err); + req.onsuccess = (): void => resolve(req); + req.onerror = (err): void => reject(err); }); } @@ -141,7 +141,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { * @param {string=} dbName Optional database name. The same name must be used * to open the same database. */ - constructor(private readonly indexedDB: IDBFactory, dbName = "default") { + public constructor(private readonly indexedDB: IDBFactory, dbName = "default") { this.dbName = "matrix-js-sdk:" + dbName; this.syncAccumulator = new SyncAccumulator(); } @@ -161,7 +161,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { logger.log(`LocalIndexedDBStoreBackend.connect: connecting...`); const req = this.indexedDB.open(this.dbName, VERSION); - req.onupgradeneeded = (ev) => { + req.onupgradeneeded = (ev): void => { const db = req.result; const oldVersion = ev.oldVersion; logger.log( @@ -176,22 +176,22 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { }); }; - req.onblocked = () => { + req.onblocked = (): void => { logger.log(`can't yet open LocalIndexedDBStoreBackend because it is open elsewhere`); }; logger.log(`LocalIndexedDBStoreBackend.connect: awaiting connection...`); - return reqAsEventPromise(req).then(() => { + return reqAsEventPromise(req).then(async () => { logger.log(`LocalIndexedDBStoreBackend.connect: connected`); this.db = req.result; // add a poorly-named listener for when deleteDatabase is called // so we can close our db connections. - this.db.onversionchange = () => { + this.db.onversionchange = (): void => { this.db?.close(); }; - return this.init(); + await this.init(); }); } @@ -204,7 +204,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { * Having connected, load initial data from the database and prepare for use * @return {Promise} Resolves on success */ - private init() { + private init(): Promise { return Promise.all([ this.loadAccountData(), this.loadSyncData(), @@ -243,7 +243,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { // were all known already let oobWritten = false; - request.onsuccess = () => { + request.onsuccess = (): void => { const cursor = request.result; if (!cursor) { // Unknown room @@ -260,7 +260,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { } cursor.continue(); }; - request.onerror = (err) => { + request.onerror = (err): void => { reject(err); }; }).then((events) => { @@ -346,11 +346,11 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { logger.log(`Removing indexeddb instance: ${this.dbName}`); const req = this.indexedDB.deleteDatabase(this.dbName); - req.onblocked = () => { + req.onblocked = (): void => { logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`); }; - req.onerror = () => { + req.onerror = (): void => { // in firefox, with indexedDB disabled, this fails with a // DOMError. We treat this as non-fatal, so that we can still // use the app. @@ -358,7 +358,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend { resolve(); }; - req.onsuccess = () => { + req.onsuccess = (): void => { logger.log(`Removed indexeddb instance: ${this.dbName}`); resolve(); }; diff --git a/src/store/indexeddb-remote-backend.ts b/src/store/indexeddb-remote-backend.ts index 39486fe2325..1ca6fc03a38 100644 --- a/src/store/indexeddb-remote-backend.ts +++ b/src/store/indexeddb-remote-backend.ts @@ -42,7 +42,7 @@ export class RemoteIndexedDBStoreBackend implements IIndexedDBBackend { * @param {string=} dbName Optional database name. The same name must be used * to open the same database. */ - constructor( + public constructor( private readonly workerFactory: () => Worker, private readonly dbName?: string, ) {} diff --git a/src/store/indexeddb-store-worker.ts b/src/store/indexeddb-store-worker.ts index 691a21f861b..57e7da983be 100644 --- a/src/store/indexeddb-store-worker.ts +++ b/src/store/indexeddb-store-worker.ts @@ -45,7 +45,7 @@ export class IndexedDBStoreWorker { * @param {function} postMessage The web worker postMessage function that * should be used to communicate back to the main script. */ - constructor(private readonly postMessage: InstanceType["postMessage"]) {} + public constructor(private readonly postMessage: InstanceType["postMessage"]) {} /** * Passes a message event from the main script into the class. This method diff --git a/src/store/indexeddb.ts b/src/store/indexeddb.ts index 961e66fd3e0..55f8261faa8 100644 --- a/src/store/indexeddb.ts +++ b/src/store/indexeddb.ts @@ -53,7 +53,7 @@ type EventHandlerMap = { }; export class IndexedDBStore extends MemoryStore { - static exists(indexedDB: IDBFactory, dbName: string): Promise { + public static exists(indexedDB: IDBFactory, dbName: string): Promise { return LocalIndexedDBStoreBackend.exists(indexedDB, dbName); } @@ -109,7 +109,7 @@ export class IndexedDBStore extends MemoryStore { * this API if you need to perform specific indexeddb actions like deleting the * database. */ - constructor(opts: IOpts) { + public constructor(opts: IOpts) { super(opts); if (!opts.indexedDB) { diff --git a/src/store/memory.ts b/src/store/memory.ts index 24b79fccbd6..f24ab2d976d 100644 --- a/src/store/memory.ts +++ b/src/store/memory.ts @@ -69,7 +69,7 @@ export class MemoryStore implements IStore { private pendingToDeviceBatches: IndexedToDeviceBatch[] = []; private nextToDeviceBatchId = 0; - constructor(opts: IOpts = {}) { + public constructor(opts: IOpts = {}) { this.localStorage = opts.localStorage; } @@ -90,7 +90,7 @@ export class MemoryStore implements IStore { * Set the token to stream from. * @param {string} token The token to stream from. */ - public setSyncToken(token: string) { + public setSyncToken(token: string): void { this.syncToken = token; } @@ -98,7 +98,7 @@ export class MemoryStore implements IStore { * Store the given room. * @param {Room} room The room to be stored. All properties must be stored. */ - public storeRoom(room: Room) { + public storeRoom(room: Room): void { this.rooms[room.roomId] = room; // add listeners for room member changes so we can keep the room member // map up-to-date. @@ -116,7 +116,7 @@ export class MemoryStore implements IStore { * @param {RoomState} state * @param {RoomMember} member */ - private onRoomMember = (event: MatrixEvent | null, state: RoomState, member: RoomMember) => { + private onRoomMember = (event: MatrixEvent | null, state: RoomState, member: RoomMember): void => { if (member.membership === "invite") { // We do NOT add invited members because people love to typo user IDs // which would then show up in these lists (!) @@ -217,7 +217,7 @@ export class MemoryStore implements IStore { * @param {string} token The token associated with these events. * @param {boolean} toStart True if these are paginated results. */ - public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) { + public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean): void { // no-op because they've already been added to the room instance. } @@ -275,7 +275,7 @@ export class MemoryStore implements IStore { * @param {string} filterName * @param {string} filterId */ - public setFilterIdByName(filterName: string, filterId?: string) { + public setFilterIdByName(filterName: string, filterId?: string): void { if (!this.localStorage) { return; } diff --git a/src/store/stub.ts b/src/store/stub.ts index 64a35d513eb..746bc521ffb 100644 --- a/src/store/stub.ts +++ b/src/store/stub.ts @@ -56,7 +56,7 @@ export class StubStore implements IStore { * Set the sync token. * @param {string} token */ - public setSyncToken(token: string) { + public setSyncToken(token: string): void { this.fromToken = token; } @@ -64,7 +64,7 @@ export class StubStore implements IStore { * No-op. * @param {Room} room */ - public storeRoom(room: Room) {} + public storeRoom(room: Room): void {} /** * No-op. @@ -87,7 +87,7 @@ export class StubStore implements IStore { * Permanently delete a room. * @param {string} roomId */ - public removeRoom(roomId: string) { + public removeRoom(roomId: string): void { return; } @@ -103,7 +103,7 @@ export class StubStore implements IStore { * No-op. * @param {User} user */ - public storeUser(user: User) {} + public storeUser(user: User): void {} /** * No-op. @@ -139,13 +139,13 @@ export class StubStore implements IStore { * @param {string} token The token associated with these events. * @param {boolean} toStart True if these are paginated results. */ - public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean) {} + public storeEvents(room: Room, events: MatrixEvent[], token: string, toStart: boolean): void {} /** * Store a filter. * @param {Filter} filter */ - public storeFilter(filter: Filter) {} + public storeFilter(filter: Filter): void {} /** * Retrieve a filter. @@ -171,13 +171,13 @@ export class StubStore implements IStore { * @param {string} filterName * @param {string} filterId */ - public setFilterIdByName(filterName: string, filterId?: string) {} + public setFilterIdByName(filterName: string, filterId?: string): void {} /** * Store user-scoped account data events * @param {Array} events The events to store. */ - public storeAccountDataEvents(events: MatrixEvent[]) {} + public storeAccountDataEvents(events: MatrixEvent[]): void {} /** * Get account data event by event type @@ -209,7 +209,7 @@ export class StubStore implements IStore { /** * Save does nothing as there is no backing data store. */ - public save() {} + public save(): void {} /** * Startup does nothing. diff --git a/src/sync-accumulator.ts b/src/sync-accumulator.ts index 484e96e4f70..19d5cf1312e 100644 --- a/src/sync-accumulator.ts +++ b/src/sync-accumulator.ts @@ -211,7 +211,7 @@ export class SyncAccumulator { * never be more. This cannot be 0 or else it makes it impossible to scroll * back in a room. Default: 50. */ - constructor(private readonly opts: IOpts = {}) { + public constructor(private readonly opts: IOpts = {}) { this.opts.maxTimelineEntries = this.opts.maxTimelineEntries || 50; } diff --git a/src/sync.ts b/src/sync.ts index d85bfc4cb6f..f32ccf7d239 100644 --- a/src/sync.ts +++ b/src/sync.ts @@ -106,7 +106,7 @@ function getFilterName(userId: string, suffix?: string): string { return `FILTER_SYNC_${userId}` + (suffix ? "_" + suffix : ""); } -function debuglog(...params) { +function debuglog(...params): void { if (!DEBUG) return; logger.log(...params); } @@ -175,7 +175,7 @@ export class SyncApi { private failedSyncCount = 0; // Number of consecutive failed /sync requests private storeIsInvalid = false; // flag set if the store needs to be cleared before we can start - constructor(private readonly client: MatrixClient, private readonly opts: Partial = {}) { + public constructor(private readonly client: MatrixClient, private readonly opts: Partial = {}) { this.opts.initialSyncLimit = this.opts.initialSyncLimit ?? 8; this.opts.resolveInvitesToProfiles = this.opts.resolveInvitesToProfiles || false; this.opts.pollTimeout = this.opts.pollTimeout || (30 * 1000); @@ -183,7 +183,7 @@ export class SyncApi { this.opts.experimentalThreadSupport = this.opts.experimentalThreadSupport === true; if (!opts.canResetEntireTimeline) { - opts.canResetEntireTimeline = (roomId: string) => { + opts.canResetEntireTimeline = (roomId: string): boolean => { return false; }; } @@ -554,7 +554,7 @@ export class SyncApi { return false; } - private getPushRules = async () => { + private getPushRules = async (): Promise => { try { debuglog("Getting push rules..."); const result = await this.client.getPushRules(); @@ -572,7 +572,7 @@ export class SyncApi { } }; - private buildDefaultFilter = () => { + private buildDefaultFilter = (): Filter => { const filter = new Filter(this.client.credentials.userId); if (this.client.canSupport.get(Feature.ThreadUnreadNotifications) !== ServerSupport.Unsupported) { filter.setUnreadThreadNotifications(true); @@ -580,7 +580,7 @@ export class SyncApi { return filter; }; - private checkLazyLoadStatus = async () => { + private checkLazyLoadStatus = async (): Promise => { debuglog("Checking lazy load status..."); if (this.opts.lazyLoadMembers && this.client.isGuest()) { this.opts.lazyLoadMembers = false; @@ -1389,7 +1389,7 @@ export class SyncApi { this.processEventsForNotifs(room, events); - const processRoomEvent = async (e) => { + const processRoomEvent = async (e): Promise => { client.emit(ClientEvent.Event, e); if (e.isState() && e.getType() == "m.room.encryption" && this.opts.crypto) { await this.opts.crypto.onCryptoEvent(e); @@ -1521,7 +1521,7 @@ export class SyncApi { * @param {boolean} connDidFail True if a connectivity failure has been detected. Optional. */ private pokeKeepAlive(connDidFail = false): void { - const success = () => { + const success = (): void => { clearTimeout(this.keepAliveTimer); if (this.connectionReturnedDefer) { this.connectionReturnedDefer.resolve(connDidFail); diff --git a/src/timeline-window.ts b/src/timeline-window.ts index c5560bdf4b0..5498600a99c 100644 --- a/src/timeline-window.ts +++ b/src/timeline-window.ts @@ -32,7 +32,7 @@ const DEBUG = false; /** * @private */ -const debuglog = DEBUG ? logger.log.bind(logger) : function() {}; +const debuglog = DEBUG ? logger.log.bind(logger) : function(): void {}; /** * the number of times we ask the server for more events before giving up @@ -84,7 +84,7 @@ export class TimelineWindow { * * @constructor */ - constructor( + public constructor( private readonly client: MatrixClient, private readonly timelineSet: EventTimelineSet, opts: IOpts = {}, @@ -104,7 +104,7 @@ export class TimelineWindow { public load(initialEventId?: string, initialWindowSize = 20): Promise { // given an EventTimeline, find the event we were looking for, and initialise our // fields so that the event in question is in the middle of the window. - const initFields = (timeline: Optional) => { + const initFields = (timeline: Optional): void => { if (!timeline) { throw new Error("No timeline given to initFields"); } @@ -430,7 +430,7 @@ export class TimelineIndex { public pendingPaginate?: Promise; // index: the indexes are relative to BaseIndex, so could well be negative. - constructor(public timeline: EventTimeline, public index: number) {} + public constructor(public timeline: EventTimeline, public index: number) {} /** * @return {number} the minimum possible value for the index in the current diff --git a/src/utils.ts b/src/utils.ts index d4364f18a54..201be5b3e4a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -178,7 +178,7 @@ export function removeElement( * @param {*} value The thing to check. * @return {boolean} True if it is a function. */ -export function isFunction(value: any) { +export function isFunction(value: any): boolean { return Object.prototype.toString.call(value) === "[object Function]"; } @@ -189,7 +189,7 @@ export function isFunction(value: any) { * @throws If the object is missing keys. */ // note using 'keys' here would shadow the 'keys' function defined above -export function checkObjectHasKeys(obj: object, keys: string[]) { +export function checkObjectHasKeys(obj: object, keys: string[]): void { for (const key of keys) { if (!obj.hasOwnProperty(key)) { throw new Error("Missing required key: " + key); @@ -383,7 +383,7 @@ export function globToRegexp(glob: string, extended = false): string { if (!extended) { replacements.push([ /\\\[(!|)(.*)\\]/g, - (_match: string, neg: string, pat: string) => [ + (_match: string, neg: string, pat: string): string => [ '[', neg ? '^' : '', pat.replace(/\\-/, '-'), @@ -490,7 +490,7 @@ export function simpleRetryOperation(promiseFn: (attempt: number) => Promise< * The default alphabet used by string averaging in this SDK. This matches * all usefully printable ASCII characters (0x20-0x7E, inclusive). */ -export const DEFAULT_ALPHABET = (() => { +export const DEFAULT_ALPHABET = ((): string => { let str = ""; for (let c = 0x20; c <= 0x7E; c++) { str += String.fromCharCode(c); diff --git a/src/webrtc/audioContext.ts b/src/webrtc/audioContext.ts index 8a9ceb15da6..0e08574b8c8 100644 --- a/src/webrtc/audioContext.ts +++ b/src/webrtc/audioContext.ts @@ -35,7 +35,7 @@ export const acquireContext = (): AudioContext => { * released, allowing the context and associated hardware resources to be * cleaned up if nothing else is using it. */ -export const releaseContext = () => { +export const releaseContext = (): void => { refCount--; if (refCount === 0) { audioContext?.close(); diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 22a6d8ec10c..0e4a664fbb3 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -268,7 +268,7 @@ const CALL_TIMEOUT_MS = 60000; export class CallError extends Error { public readonly code: string; - constructor(code: CallErrorCode, msg: string, err: Error) { + public constructor(code: CallErrorCode, msg: string, err: Error) { // Still don't think there's any way to have proper nested errors super(msg + ": " + err); @@ -404,7 +404,7 @@ export class MatrixCall extends TypedEventEmitter !feed.isLocal()); } - private async initOpponentCrypto() { + private async initOpponentCrypto(): Promise { if (!this.opponentDeviceId) return; if (!this.client.getUseE2eForGroupCall()) return; // It's possible to want E2EE and yet not have the means to manage E2EE @@ -938,7 +938,7 @@ export class MatrixCall extends TypedEventEmitter { + const onState = (state: CallState): void => { if (state !== CallState.Ringing) { clearTimeout(ringingTimer); this.off(CallEvent.State, onState); @@ -2132,7 +2132,7 @@ export class MatrixCall extends TypedEventEmitter { + const onRemoveTrack = (): void => { if (stream.getTracks().length === 0) { logger.info(`Call ${this.callId} removing track streamId: ${stream.id}`); this.deleteFeedByStream(stream); diff --git a/src/webrtc/callEventHandler.ts b/src/webrtc/callEventHandler.ts index c4c48cf5058..7cbefd46eb0 100644 --- a/src/webrtc/callEventHandler.ts +++ b/src/webrtc/callEventHandler.ts @@ -46,7 +46,7 @@ export class CallEventHandler { private candidateEventsByCall: Map>; private eventBufferPromiseChain?: Promise; - constructor(client: MatrixClient) { + public constructor(client: MatrixClient) { this.client = client; this.calls = new Map(); // The sync code always emits one event at a time, so it will patiently @@ -61,13 +61,13 @@ export class CallEventHandler { this.candidateEventsByCall = new Map>(); } - public start() { + public start(): void { this.client.on(ClientEvent.Sync, this.onSync); this.client.on(RoomEvent.Timeline, this.onRoomTimeline); this.client.on(ClientEvent.ToDeviceEvent, this.onToDeviceEvent); } - public stop() { + public stop(): void { this.client.removeListener(ClientEvent.Sync, this.onSync); this.client.removeListener(RoomEvent.Timeline, this.onRoomTimeline); this.client.removeListener(ClientEvent.ToDeviceEvent, this.onToDeviceEvent); @@ -87,7 +87,7 @@ export class CallEventHandler { } }; - private async evaluateEventBuffer(eventBuffer: MatrixEvent[]) { + private async evaluateEventBuffer(eventBuffer: MatrixEvent[]): Promise { await Promise.all(eventBuffer.map((event) => this.client.decryptEventIfNeeded(event))); const callEvents = eventBuffer.filter((event) => { @@ -125,7 +125,7 @@ export class CallEventHandler { } } - private onRoomTimeline = (event: MatrixEvent) => { + private onRoomTimeline = (event: MatrixEvent): void => { this.callEventBuffer.push(event); }; @@ -178,7 +178,7 @@ export class CallEventHandler { } }; - private async handleCallEvent(event: MatrixEvent) { + private async handleCallEvent(event: MatrixEvent): Promise { this.client.emit(ClientEvent.ReceivedVoipEvent, event); const content = event.getContent(); diff --git a/src/webrtc/callFeed.ts b/src/webrtc/callFeed.ts index 965a0444123..6f71b504087 100644 --- a/src/webrtc/callFeed.ts +++ b/src/webrtc/callFeed.ts @@ -80,7 +80,7 @@ export class CallFeed extends TypedEventEmitter private volumeLooperTimeout?: ReturnType; private _disposed = false; - constructor(opts: ICallFeedOpts) { + public constructor(opts: ICallFeedOpts) { super(); this.client = opts.client; @@ -227,11 +227,11 @@ export class CallFeed extends TypedEventEmitter } } - public setSpeakingThreshold(threshold: number) { + public setSpeakingThreshold(threshold: number): void { this.speakingThreshold = threshold; } - private volumeLooper = () => { + private volumeLooper = (): void => { if (!this.analyser) return; if (!this.measuringVolumeActivity) return; diff --git a/src/webrtc/groupCall.ts b/src/webrtc/groupCall.ts index 65ae86f4cf9..3a73cac43d2 100644 --- a/src/webrtc/groupCall.ts +++ b/src/webrtc/groupCall.ts @@ -73,7 +73,7 @@ export enum GroupCallErrorCode { export class GroupCallError extends Error { public code: string; - constructor(code: GroupCallErrorCode, msg: string, err?: Error) { + public constructor(code: GroupCallErrorCode, msg: string, err?: Error) { // Still don't think there's any way to have proper nested errors if (err) { super(msg + ": " + err); @@ -86,13 +86,13 @@ export class GroupCallError extends Error { } export class GroupCallUnknownDeviceError extends GroupCallError { - constructor(public userId: string) { + public constructor(public userId: string) { super(GroupCallErrorCode.UnknownDevice, "No device found for " + userId); } } export class OtherUserSpeakingError extends Error { - constructor() { + public constructor() { super("Cannot unmute: another user is speaking"); } } @@ -187,7 +187,7 @@ export class GroupCall extends TypedEventEmitter< private initWithAudioMuted = false; private initWithVideoMuted = false; - constructor( + public constructor( private client: MatrixClient, public room: Room, public type: GroupCallType, @@ -206,7 +206,7 @@ export class GroupCall extends TypedEventEmitter< } } - public async create() { + public async create(): Promise { this.client.groupCallEventHandler!.groupCalls.set(this.room.roomId, this); await this.client.sendStateEvent( @@ -258,7 +258,7 @@ export class GroupCall extends TypedEventEmitter< let stream: MediaStream; let disposed = false; - const onState = (state: GroupCallState) => { + const onState = (state: GroupCallState): void => { if (state === GroupCallState.LocalCallFeedUninitialized) { disposed = true; } @@ -300,7 +300,7 @@ export class GroupCall extends TypedEventEmitter< return callFeed; } - public async updateLocalUsermediaStream(stream: MediaStream) { + public async updateLocalUsermediaStream(stream: MediaStream): Promise { if (this.localCallFeed) { const oldStream = this.localCallFeed.stream; this.localCallFeed.setNewStream(stream); @@ -315,7 +315,7 @@ export class GroupCall extends TypedEventEmitter< } } - public async enter() { + public async enter(): Promise { if (!(this.state === GroupCallState.LocalCallFeedUninitialized || this.state === GroupCallState.LocalCallFeedInitialized)) { throw new Error(`Cannot enter call in the "${this.state}" state`); @@ -354,7 +354,7 @@ export class GroupCall extends TypedEventEmitter< this.onActiveSpeakerLoop(); } - private dispose() { + private dispose(): void { if (this.localCallFeed) { this.removeUserMediaFeed(this.localCallFeed); this.localCallFeed = undefined; @@ -400,7 +400,7 @@ export class GroupCall extends TypedEventEmitter< this.client.removeListener(CallEventHandlerEvent.Incoming, this.onIncomingCall); } - public leave() { + public leave(): void { if (this.transmitTimer !== null) { clearTimeout(this.transmitTimer); this.transmitTimer = null; @@ -410,7 +410,7 @@ export class GroupCall extends TypedEventEmitter< this.setState(GroupCallState.LocalCallFeedUninitialized); } - public async terminate(emitStateEvent = true) { + public async terminate(emitStateEvent = true): Promise { this.dispose(); if (this.transmitTimer !== null) { @@ -430,7 +430,7 @@ export class GroupCall extends TypedEventEmitter< this.room.roomId, EventType.GroupCallPrefix, { - ...existingStateEvent.getContent(), + ...existingStateEvent!.getContent(), ["m.terminated"]: GroupCallTerminationReason.CallEnded, }, this.groupCallId, @@ -445,7 +445,7 @@ export class GroupCall extends TypedEventEmitter< * Local Usermedia */ - public isLocalVideoMuted() { + public isLocalVideoMuted(): boolean { if (this.localCallFeed) { return this.localCallFeed.isVideoMuted(); } @@ -453,7 +453,7 @@ export class GroupCall extends TypedEventEmitter< return true; } - public isMicrophoneMuted() { + public isMicrophoneMuted(): boolean { if (this.localCallFeed) { return this.localCallFeed.isAudioMuted(); } @@ -576,7 +576,7 @@ export class GroupCall extends TypedEventEmitter< const stream = await this.client.getMediaHandler().getScreensharingStream(opts); for (const track of stream.getTracks()) { - const onTrackEnded = () => { + const onTrackEnded = (): void => { this.setScreensharingEnabled(false); track.removeEventListener("ended", onTrackEnded); }; @@ -651,7 +651,7 @@ export class GroupCall extends TypedEventEmitter< * as they are observed by the RoomState.members event. */ - private onIncomingCall = (newCall: MatrixCall) => { + private onIncomingCall = (newCall: MatrixCall): void => { // The incoming calls may be for another room, which we will ignore. if (newCall.roomId !== this.room.roomId) { return; @@ -700,7 +700,7 @@ export class GroupCall extends TypedEventEmitter< private getMemberStateEvents(userId?: string): MatrixEvent[] | MatrixEvent | null { if (userId != null) { const event = this.room.currentState.getStateEvents(EventType.GroupCallMemberPrefix, userId); - return callMemberStateIsExpired(event) ? null : event; + return callMemberStateIsExpired(event!) ? null : event; } else { return this.room.currentState.getStateEvents(EventType.GroupCallMemberPrefix) .filter(event => !callMemberStateIsExpired(event)); @@ -708,7 +708,7 @@ export class GroupCall extends TypedEventEmitter< } private async sendMemberStateEvent(): Promise { - const send = () => this.updateMemberCallState({ + const send = (): Promise => this.updateMemberCallState({ "m.call_id": this.groupCallId, "m.devices": [ { @@ -779,7 +779,7 @@ export class GroupCall extends TypedEventEmitter< ); } - public onMemberStateChanged = async (event: MatrixEvent) => { + public onMemberStateChanged = async (event: MatrixEvent): Promise => { // If we haven't entered the call yet, we don't care if (this.state !== GroupCallState.Entered) { return; @@ -800,7 +800,7 @@ export class GroupCall extends TypedEventEmitter< logger.debug(`Processing member state event for ${member.userId}`); - const ignore = () => { + const ignore = (): void => { this.removeParticipant(member); clearTimeout(this.memberStateExpirationTimers.get(member.userId)); this.memberStateExpirationTimers.delete(member.userId); @@ -953,7 +953,7 @@ export class GroupCall extends TypedEventEmitter< return memberDevices[0]; } - private onRetryCallLoop = () => { + private onRetryCallLoop = (): void => { for (const event of this.getMemberStateEvents()) { const memberId = event.getStateKey()!; const existingCall = this.calls.find((call) => getCallUserId(call) === memberId); @@ -976,13 +976,17 @@ export class GroupCall extends TypedEventEmitter< return this.calls.find((call) => getCallUserId(call) === userId); } - private addCall(call: MatrixCall) { + private addCall(call: MatrixCall): void { this.calls.push(call); this.initCall(call); this.emit(GroupCallEvent.CallsChanged, this.calls); } - private replaceCall(existingCall: MatrixCall, replacementCall: MatrixCall, hangupReason = CallErrorCode.Replaced) { + private replaceCall( + existingCall: MatrixCall, + replacementCall: MatrixCall, + hangupReason = CallErrorCode.Replaced, + ): void { const existingCallIndex = this.calls.indexOf(existingCall); if (existingCallIndex === -1) { @@ -997,7 +1001,7 @@ export class GroupCall extends TypedEventEmitter< this.emit(GroupCallEvent.CallsChanged, this.calls); } - private removeCall(call: MatrixCall, hangupReason: CallErrorCode) { + private removeCall(call: MatrixCall, hangupReason: CallErrorCode): void { this.disposeCall(call, hangupReason); const callIndex = this.calls.indexOf(call); @@ -1011,18 +1015,20 @@ export class GroupCall extends TypedEventEmitter< this.emit(GroupCallEvent.CallsChanged, this.calls); } - private initCall(call: MatrixCall) { + private initCall(call: MatrixCall): void { const opponentMemberId = getCallUserId(call); if (!opponentMemberId) { throw new Error("Cannot init call without user id"); } - const onCallFeedsChanged = () => this.onCallFeedsChanged(call); - const onCallStateChanged = - (state: CallState, oldState: CallState | undefined) => this.onCallStateChanged(call, state, oldState); + const onCallFeedsChanged = (): void => this.onCallFeedsChanged(call); + const onCallStateChanged = ( + state: CallState, + oldState?: CallState, + ): void => this.onCallStateChanged(call, state, oldState); const onCallHangup = this.onCallHangup; - const onCallReplaced = (newCall: MatrixCall) => this.replaceCall(call, newCall); + const onCallReplaced = (newCall: MatrixCall): void => this.replaceCall(call, newCall); this.callHandlers.set(opponentMemberId, { onCallFeedsChanged, @@ -1041,7 +1047,7 @@ export class GroupCall extends TypedEventEmitter< onCallFeedsChanged(); } - private disposeCall(call: MatrixCall, hangupReason: CallErrorCode) { + private disposeCall(call: MatrixCall, hangupReason: CallErrorCode): void { const opponentMemberId = getCallUserId(call); if (!opponentMemberId) { @@ -1083,7 +1089,7 @@ export class GroupCall extends TypedEventEmitter< } } - private onCallFeedsChanged = (call: MatrixCall) => { + private onCallFeedsChanged = (call: MatrixCall): void => { const opponentMemberId = getCallUserId(call); if (!opponentMemberId) { @@ -1119,7 +1125,7 @@ export class GroupCall extends TypedEventEmitter< } }; - private onCallStateChanged = (call: MatrixCall, state: CallState, _oldState: CallState | undefined) => { + private onCallStateChanged = (call: MatrixCall, state: CallState, _oldState: CallState | undefined): void => { const audioMuted = this.localCallFeed!.isAudioMuted(); if ( @@ -1143,7 +1149,7 @@ export class GroupCall extends TypedEventEmitter< } }; - private onCallHangup = (call: MatrixCall) => { + private onCallHangup = (call: MatrixCall): void => { if (call.hangupReason === CallErrorCode.Replaced) { return; } @@ -1155,17 +1161,17 @@ export class GroupCall extends TypedEventEmitter< * UserMedia CallFeed Event Handlers */ - public getUserMediaFeedByUserId(userId: string) { + public getUserMediaFeedByUserId(userId: string): CallFeed | undefined { return this.userMediaFeeds.find((feed) => feed.userId === userId); } - private addUserMediaFeed(callFeed: CallFeed) { + private addUserMediaFeed(callFeed: CallFeed): void { this.userMediaFeeds.push(callFeed); callFeed.measureVolumeActivity(true); this.emit(GroupCallEvent.UserMediaFeedsChanged, this.userMediaFeeds); } - private replaceUserMediaFeed(existingFeed: CallFeed, replacementFeed: CallFeed) { + private replaceUserMediaFeed(existingFeed: CallFeed, replacementFeed: CallFeed): void { const feedIndex = this.userMediaFeeds.findIndex((feed) => feed.userId === existingFeed.userId); if (feedIndex === -1) { @@ -1179,7 +1185,7 @@ export class GroupCall extends TypedEventEmitter< this.emit(GroupCallEvent.UserMediaFeedsChanged, this.userMediaFeeds); } - private removeUserMediaFeed(callFeed: CallFeed) { + private removeUserMediaFeed(callFeed: CallFeed): void { const feedIndex = this.userMediaFeeds.findIndex((feed) => feed.userId === callFeed.userId); if (feedIndex === -1) { @@ -1200,7 +1206,7 @@ export class GroupCall extends TypedEventEmitter< } } - private onActiveSpeakerLoop = () => { + private onActiveSpeakerLoop = (): void => { let topAvg: number | undefined = undefined; let nextActiveSpeaker: string | undefined = undefined; @@ -1239,16 +1245,16 @@ export class GroupCall extends TypedEventEmitter< * Screenshare Call Feed Event Handlers */ - public getScreenshareFeedByUserId(userId: string) { + public getScreenshareFeedByUserId(userId: string): CallFeed | undefined { return this.screenshareFeeds.find((feed) => feed.userId === userId); } - private addScreenshareFeed(callFeed: CallFeed) { + private addScreenshareFeed(callFeed: CallFeed): void { this.screenshareFeeds.push(callFeed); this.emit(GroupCallEvent.ScreenshareFeedsChanged, this.screenshareFeeds); } - private replaceScreenshareFeed(existingFeed: CallFeed, replacementFeed: CallFeed) { + private replaceScreenshareFeed(existingFeed: CallFeed, replacementFeed: CallFeed): void { const feedIndex = this.screenshareFeeds.findIndex((feed) => feed.userId === existingFeed.userId); if (feedIndex === -1) { @@ -1261,7 +1267,7 @@ export class GroupCall extends TypedEventEmitter< this.emit(GroupCallEvent.ScreenshareFeedsChanged, this.screenshareFeeds); } - private removeScreenshareFeed(callFeed: CallFeed) { + private removeScreenshareFeed(callFeed: CallFeed): void { const feedIndex = this.screenshareFeeds.findIndex((feed) => feed.userId === callFeed.userId); if (feedIndex === -1) { @@ -1278,7 +1284,7 @@ export class GroupCall extends TypedEventEmitter< * Participant Management */ - private addParticipant(member: RoomMember) { + private addParticipant(member: RoomMember): void { if (this.participants.find((m) => m.userId === member.userId)) { return; } @@ -1289,7 +1295,7 @@ export class GroupCall extends TypedEventEmitter< this.client.emit(GroupCallEventHandlerEvent.Participants, this.participants, this); } - private removeParticipant(member: RoomMember) { + private removeParticipant(member: RoomMember): void { const index = this.participants.findIndex((m) => m.userId === member.userId); if (index === -1) { diff --git a/src/webrtc/groupCallEventHandler.ts b/src/webrtc/groupCallEventHandler.ts index 86df722895d..6a1084152a9 100644 --- a/src/webrtc/groupCallEventHandler.ts +++ b/src/webrtc/groupCallEventHandler.ts @@ -55,7 +55,7 @@ export class GroupCallEventHandler { // and get private roomDeferreds = new Map(); - constructor(private client: MatrixClient) { } + public constructor(private client: MatrixClient) { } public async start(): Promise { // We wait until the client has started syncing for real. @@ -66,7 +66,7 @@ export class GroupCallEventHandler { if (this.client.getSyncState() !== SyncState.Syncing) { logger.debug("Waiting for client to start syncing..."); await new Promise(resolve => { - const onSync = () => { + const onSync = (): void => { if (this.client.getSyncState() === SyncState.Syncing) { this.client.off(ClientEvent.Sync, onSync); return resolve(); @@ -192,7 +192,7 @@ export class GroupCallEventHandler { return groupCall; } - private onRoomsChanged = (room: Room) => { + private onRoomsChanged = (room: Room): void => { this.createGroupCallForRoom(room); }; diff --git a/src/webrtc/mediaHandler.ts b/src/webrtc/mediaHandler.ts index c4b912ef38a..c7c84876bf9 100644 --- a/src/webrtc/mediaHandler.ts +++ b/src/webrtc/mediaHandler.ts @@ -56,11 +56,11 @@ export class MediaHandler extends TypedEventEmitter< public userMediaStreams: MediaStream[] = []; public screensharingStreams: MediaStream[] = []; - constructor(private client: MatrixClient) { + public constructor(private client: MatrixClient) { super(); } - public restoreMediaSettings(audioInput: string, videoInput: string) { + public restoreMediaSettings(audioInput: string, videoInput: string): void { this.audioInput = audioInput; this.videoInput = videoInput; } @@ -275,7 +275,7 @@ export class MediaHandler extends TypedEventEmitter< /** * Stops all tracks on the provided usermedia stream */ - public stopUserMediaStream(mediaStream: MediaStream) { + public stopUserMediaStream(mediaStream: MediaStream): void { logger.log(`mediaHandler stopUserMediaStream stopping stream ${mediaStream.id}`); for (const track of mediaStream.getTracks()) { track.stop(); @@ -333,7 +333,7 @@ export class MediaHandler extends TypedEventEmitter< /** * Stops all tracks on the provided screensharing stream */ - public stopScreensharingStream(mediaStream: MediaStream) { + public stopScreensharingStream(mediaStream: MediaStream): void { logger.debug("Stopping screensharing stream", mediaStream.id); for (const track of mediaStream.getTracks()) { track.stop(); @@ -352,7 +352,7 @@ export class MediaHandler extends TypedEventEmitter< /** * Stops all local media tracks */ - public stopAllStreams() { + public stopAllStreams(): void { for (const stream of this.userMediaStreams) { logger.log(`mediaHandler stopAllStreams stopping stream ${stream.id}`); for (const track of stream.getTracks()) { diff --git a/yarn.lock b/yarn.lock index 5df6f84a311..56821e35f9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -100,7 +100,7 @@ dependencies: eslint-rule-composer "^0.3.0" -"@babel/generator@^7.12.11", "@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": +"@babel/generator@^7.12.11": version "7.20.3" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.3.tgz#e58c9ae2f7bf7fdf4899160cf1e04400a82cd641" integrity sha512-Wl5ilw2UD1+ZYprHVprxHZJCFeBWlzZYOovE4SDYLZnqCOD11j+0QzNeEWKLLTWM7nixrZEh7vNIyb76MyJg3A== @@ -109,6 +109,15 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== + dependencies: + "@babel/types" "^7.20.2" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" @@ -1090,28 +1099,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.1.tgz#5f2c62dcdd5ce66e94b6d6729e021758bceea090" - integrity sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw== +"@jest/console@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" + integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" -"@jest/core@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.0.tgz#7042d3fd673b51d89d6f6bf8b9f85fb65573629e" - integrity sha512-5DyNvV8452bwqcYyXHCYaAD8UrTiWosrhBY+rc0MBMyXyDzcIL+w5gdlCYhlHbNsHoWnf4nUbRmg++LWfWVtMQ== +"@jest/core@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" + integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== dependencies: - "@jest/console" "^29.2.1" - "@jest/reporters" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/reporters" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -1119,42 +1128,32 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.3.0" - jest-haste-map "^29.3.0" - jest-message-util "^29.2.1" + jest-config "^29.3.1" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-resolve-dependencies "^29.3.0" - jest-runner "^29.3.0" - jest-runtime "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" - jest-watcher "^29.2.2" + jest-resolve "^29.3.1" + jest-resolve-dependencies "^29.3.1" + jest-runner "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + jest-watcher "^29.3.1" micromatch "^4.0.4" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" - integrity sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA== - dependencies: - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" - "@types/node" "*" - jest-mock "^28.1.3" - -"@jest/environment@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.0.tgz#e7bfe22531813f86040feb75c046faab32fd534d" - integrity sha512-8wgn3br51bx+7rgC8FOKmAD62Q39iswdiy5/p6acoekp/9Bb/IQbh3zydOrnGp74LwStSrKgpQSKBlOKlAQq0g== +"@jest/environment@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" + integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== dependencies: - "@jest/fake-timers" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^29.3.0" + jest-mock "^29.3.1" "@jest/expect-utils@^28.1.3": version "28.1.3" @@ -1163,65 +1162,53 @@ dependencies: jest-get-type "^28.0.2" -"@jest/expect-utils@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.2.tgz#460a5b5a3caf84d4feb2668677393dd66ff98665" - integrity sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg== +"@jest/expect-utils@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" + integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.0.tgz#06907ffc02541c8d5186e8324765a72f391f3125" - integrity sha512-Lz/3x4Se5g6nBuLjTO+xE8D4OXY9fFmosZPwkXXZUJUsp9r9seN81cJa54wOGr1QjCQnhngMqclblhM4X/hcCg== - dependencies: - expect "^29.3.0" - jest-snapshot "^29.3.0" - -"@jest/fake-timers@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" - integrity sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw== +"@jest/expect@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" + integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== dependencies: - "@jest/types" "^28.1.3" - "@sinonjs/fake-timers" "^9.1.2" - "@types/node" "*" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-util "^28.1.3" + expect "^29.3.1" + jest-snapshot "^29.3.1" -"@jest/fake-timers@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.0.tgz#ffa74e5b2937676849866cac79cac6a742697f00" - integrity sha512-SzmWtN6Rld+xebMRGuWeMGhytc7qHnYfFk1Zd/1QavQWsFOmA9SgtvGHCBue1wXQhdDMaSIm1aPGj2Zmyrr1Zg== +"@jest/fake-timers@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" + integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.2.1" - jest-mock "^29.3.0" - jest-util "^29.2.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" -"@jest/globals@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.0.tgz#f58c14d727fd7d02d7851bc03fc0445eefa2dbe2" - integrity sha512-okYDVzYNrt/4ysR8XnX6u0I1bGG4kmfdXtUu7kwWHZ9OP13RCjmphgve0tfOrNluwksWvOPYS1f/HOrFTHLygQ== +"@jest/globals@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" + integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== dependencies: - "@jest/environment" "^29.3.0" - "@jest/expect" "^29.3.0" - "@jest/types" "^29.2.1" - jest-mock "^29.3.0" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/types" "^29.3.1" + jest-mock "^29.3.1" -"@jest/reporters@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.0.tgz#e5e2af97d7754510393d7c04084744841cce2eaf" - integrity sha512-MV76tB3Kd80vcv2yMDZfQpMkwkHaY9hlvVhCtHXkVRCWwN+SX3EOmCdX8pT/X4Xh+NusA7l2Rc3yhx4q5p3+Fg== +"@jest/reporters@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" + integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.2.1" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -1234,9 +1221,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.2.1" - jest-util "^29.2.1" - jest-worker "^29.3.0" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + jest-worker "^29.3.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -1265,42 +1252,42 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.1.tgz#f42dbf7b9ae465d0a93eee6131473b8bb3bd2edb" - integrity sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA== +"@jest/test-result@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" + integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== dependencies: - "@jest/console" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/types" "^29.3.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.0.tgz#0c2198fe482c26d763abbcb183992ae769bb7978" - integrity sha512-XQlTP/S6Yf6NKV0Mt4oopFKyDxiEkDMD7hIFcCTeltKQszE0Z+LI5KLukwNW6Qxr1YzaZ/s6PlKJusiCLJNTcw== +"@jest/test-sequencer@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" + integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== dependencies: - "@jest/test-result" "^29.2.1" + "@jest/test-result" "^29.3.1" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" slash "^3.0.0" -"@jest/transform@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.0.tgz#7f71c9596d5bad1613a3a5eb26729dd84fc71a5a" - integrity sha512-4T8h61ItCakAlJkdYa7XVWP3r39QldlCeOSNmRpiJisi5PrrlzwZdpJDIH13ZZjh+MlSPQ2cq8YbUs3TuH+tRA== +"@jest/transform@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" + integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" jest-regex-util "^29.2.0" - jest-util "^29.2.1" + jest-util "^29.3.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -1318,10 +1305,10 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jest/types@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" - integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== +"@jest/types@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" + integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -1648,21 +1635,21 @@ "@types/istanbul-lib-report" "*" "@types/jest@^29.0.0": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.2.tgz#874e7dc6702fa6a3fe6107792aa98636dcc480b4" - integrity sha512-og1wAmdxKoS71K2ZwSVqWPX6OVn3ihZ6ZT2qvZvZQm90lJVDyXIjYcu4Khx2CNIeaFv12rOU/YObOsI3VOkzog== + version "29.2.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.3.tgz#f5fd88e43e5a9e4221ca361e23790d48fcf0a211" + integrity sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w== dependencies: expect "^29.0.0" pretty-format "^29.0.0" -"@types/jsdom@^16.2.4": - version "16.2.15" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.15.tgz#6c09990ec43b054e49636cba4d11d54367fc90d6" - integrity sha512-nwF87yjBKuX/roqGYerZZM0Nv1pZDMAT5YhOHYeM/72Fic+VEqJh4nyoqoapzJnW3pUlfxPY5FhgsJtM+dRnQQ== +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== dependencies: "@types/node" "*" - "@types/parse5" "^6.0.3" "@types/tough-cookie" "*" + parse5 "^7.0.0" "@types/json-schema@^7.0.9": version "7.0.11" @@ -1689,11 +1676,6 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== -"@types/parse5@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" - integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== - "@types/prettier@^2.1.5": version "2.7.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" @@ -1742,13 +1724,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.6.0": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.1.tgz#696b9cc21dfd4749c1c8ad1307f76a36a00aa0e3" - integrity sha512-LyR6x784JCiJ1j6sH5Y0K6cdExqCCm8DJUTcwG5ThNXJj/G8o5E56u5EdG4SLy+bZAwZBswC+GYn3eGdttBVCg== + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.43.0.tgz#4a5248eb31b454715ddfbf8cfbf497529a0a78bc" + integrity sha512-wNPzG+eDR6+hhW4yobEmpR36jrqqQv1vxBq5LJO3fBAktjkvekfr4BRl+3Fn1CM/A+s8/EiGUbOMDoYqWdbtXA== dependencies: - "@typescript-eslint/scope-manager" "5.42.1" - "@typescript-eslint/type-utils" "5.42.1" - "@typescript-eslint/utils" "5.42.1" + "@typescript-eslint/scope-manager" "5.43.0" + "@typescript-eslint/type-utils" "5.43.0" + "@typescript-eslint/utils" "5.43.0" debug "^4.3.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" @@ -1757,71 +1739,71 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.6.0": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.42.1.tgz#3e66156f2f74b11690b45950d8f5f28a62751d35" - integrity sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q== + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.43.0.tgz#9c86581234b88f2ba406f0b99a274a91c11630fd" + integrity sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug== dependencies: - "@typescript-eslint/scope-manager" "5.42.1" - "@typescript-eslint/types" "5.42.1" - "@typescript-eslint/typescript-estree" "5.42.1" + "@typescript-eslint/scope-manager" "5.43.0" + "@typescript-eslint/types" "5.43.0" + "@typescript-eslint/typescript-estree" "5.43.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.42.1.tgz#05e5e1351485637d466464237e5259b49f609b18" - integrity sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ== +"@typescript-eslint/scope-manager@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz#566e46303392014d5d163704724872e1f2dd3c15" + integrity sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw== dependencies: - "@typescript-eslint/types" "5.42.1" - "@typescript-eslint/visitor-keys" "5.42.1" + "@typescript-eslint/types" "5.43.0" + "@typescript-eslint/visitor-keys" "5.43.0" -"@typescript-eslint/type-utils@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.42.1.tgz#21328feb2d4b193c5852b35aabd241ccc1449daa" - integrity sha512-WWiMChneex5w4xPIX56SSnQQo0tEOy5ZV2dqmj8Z371LJ0E+aymWD25JQ/l4FOuuX+Q49A7pzh/CGIQflxMVXg== +"@typescript-eslint/type-utils@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.43.0.tgz#91110fb827df5161209ecca06f70d19a96030be6" + integrity sha512-K21f+KY2/VvYggLf5Pk4tgBOPs2otTaIHy2zjclo7UZGLyFH86VfUOm5iq+OtDtxq/Zwu2I3ujDBykVW4Xtmtg== dependencies: - "@typescript-eslint/typescript-estree" "5.42.1" - "@typescript-eslint/utils" "5.42.1" + "@typescript-eslint/typescript-estree" "5.43.0" + "@typescript-eslint/utils" "5.43.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.1.tgz#0d4283c30e9b70d2aa2391c36294413de9106df2" - integrity sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA== +"@typescript-eslint/types@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.43.0.tgz#e4ddd7846fcbc074325293515fa98e844d8d2578" + integrity sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg== -"@typescript-eslint/typescript-estree@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.1.tgz#f9a223ecb547a781d37e07a5ac6ba9ff681eaef0" - integrity sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw== +"@typescript-eslint/typescript-estree@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz#b6883e58ba236a602c334be116bfc00b58b3b9f2" + integrity sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg== dependencies: - "@typescript-eslint/types" "5.42.1" - "@typescript-eslint/visitor-keys" "5.42.1" + "@typescript-eslint/types" "5.43.0" + "@typescript-eslint/visitor-keys" "5.43.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.1.tgz#2789b1cd990f0c07aaa3e462dbe0f18d736d5071" - integrity sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ== +"@typescript-eslint/utils@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.43.0.tgz#00fdeea07811dbdf68774a6f6eacfee17fcc669f" + integrity sha512-8nVpA6yX0sCjf7v/NDfeaOlyaIIqL7OaIGOWSPFqUKK59Gnumd3Wa+2l8oAaYO2lk0sO+SbWFWRSvhu8gLGv4A== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.42.1" - "@typescript-eslint/types" "5.42.1" - "@typescript-eslint/typescript-estree" "5.42.1" + "@typescript-eslint/scope-manager" "5.43.0" + "@typescript-eslint/types" "5.43.0" + "@typescript-eslint/typescript-estree" "5.43.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.42.1": - version "5.42.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.1.tgz#df10839adf6605e1cdb79174cf21e46df9be4872" - integrity sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A== +"@typescript-eslint/visitor-keys@5.43.0": + version "5.43.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz#cbbdadfdfea385310a20a962afda728ea106befa" + integrity sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg== dependencies: - "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/types" "5.43.0" eslint-visitor-keys "^3.3.0" JSONStream@^1.0.3: @@ -1832,7 +1814,7 @@ JSONStream@^1.0.3: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.5, abab@^2.0.6: +abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== @@ -1849,13 +1831,13 @@ acorn-globals@^3.0.0: dependencies: acorn "^4.0.4" -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" + acorn "^8.1.0" + acorn-walk "^8.0.2" acorn-jsx@^5.3.2: version "5.3.2" @@ -1871,11 +1853,16 @@ acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.8.2: acorn-walk "^7.0.0" xtend "^4.0.2" -acorn-walk@^7.0.0, acorn-walk@^7.1.1: +acorn-walk@^7.0.0: version "7.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.0.2: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -1886,12 +1873,12 @@ acorn@^4.0.4, acorn@~4.0.2: resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" integrity sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug== -acorn@^7.0.0, acorn@^7.1.1: +acorn@^7.0.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.5.0, acorn@^8.8.0: +acorn@^8.1.0, acorn@^8.5.0, acorn@^8.8.0: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -2068,12 +2055,12 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -babel-jest@^29.0.0, babel-jest@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.0.tgz#31fd7ef97dd6a77ddd1b4ab1f8cf77c29e20bb5c" - integrity sha512-LzQWdGm6hUugVeyGpIKI/T4SVT+PgAA5WFPqBDbneK7C/PqfckNb0tc4KvcKXq/PLA1yY6wTvB8Bc/REQdUxFg== +babel-jest@^29.0.0, babel-jest@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" + integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== dependencies: - "@jest/transform" "^29.3.0" + "@jest/transform" "^29.3.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -2285,11 +2272,6 @@ browser-pack@^6.0.1: through2 "^2.0.0" umd "^3.0.0" -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browser-resolve@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b" @@ -2572,7 +2554,12 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.3.2" -ci-info@^3.2.0, ci-info@^3.4.0: +ci-info@^3.2.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.6.1.tgz#7594f1c95cb7fdfddee7af95a13af7dbc67afdcf" + integrity sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w== + +ci-info@^3.4.0: version "3.5.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== @@ -2876,7 +2863,7 @@ dash-ast@^1.0.0: resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== -data-urls@^3.0.1: +data-urls@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== @@ -2916,7 +2903,7 @@ decamelize@^1.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.3.1: +decimal.js@^10.4.1: version "10.4.2" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.2.tgz#0341651d1d997d86065a2ce3a441fbd0d8e8b98e" integrity sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA== @@ -3006,10 +2993,10 @@ diff-sequences@^28.1.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== -diff-sequences@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" - integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== +diff-sequences@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" + integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== diffie-hellman@^5.0.0: version "5.0.3" @@ -3113,6 +3100,11 @@ enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" +entities@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" + integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -3286,10 +3278,10 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-matrix-org@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.7.0.tgz#4b7456b31e30e7575b62c2aada91915478829f88" - integrity sha512-FLmwE4/cRalB7J+J1BBuTccaXvKtRgAoHlbqSCbdsRqhh27xpxEWXe08KlNiET7drEnnz+xMHXdmvW469gch7g== +eslint-plugin-matrix-org@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.8.0.tgz#daa1396900a8cb1c1d88f1a370e45fc32482cd9e" + integrity sha512-/Poz/F8lXYDsmQa29iPSt+kO+Jn7ArvRdq10g0CCk8wbRS0sb2zb6fvd9xL1BgR5UDQL771V0l8X32etvY5yKA== eslint-plugin-unicorn@^44.0.2: version "44.0.2" @@ -3508,16 +3500,16 @@ expect@^28.1.0: jest-message-util "^28.1.3" jest-util "^28.1.3" -expect@^29.0.0, expect@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.0.tgz#2dad3a73ac837dd8074ff91d25cf1614c3e91504" - integrity sha512-bms139btnQNZh4uxCPmzbWz46YOjtEpYIZ847OfY9GCeSBEfzedHWH0CkdR20Sy+XBs8/FI2lFJPZiuH0NGv+w== +expect@^29.0.0, expect@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" + integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== dependencies: - "@jest/expect-utils" "^29.2.2" + "@jest/expect-utils" "^29.3.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" ext@^1.1.2: version "1.7.0" @@ -3944,7 +3936,7 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== -https-proxy-agent@^5.0.0: +https-proxy-agent@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== @@ -4331,74 +4323,74 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.0.tgz#997354276d24706e14549cab98ac2995d63c92fd" - integrity sha512-xL1cmbUGBGy923KBZpZ2LRKspHlIhrltrwGaefJ677HXCPY5rTF758BtweamBype2ogcSEK/oqcp1SmYZ/ATig== +jest-circus@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" + integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== dependencies: - "@jest/environment" "^29.3.0" - "@jest/expect" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.2.1" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-runtime "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" + jest-each "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" p-limit "^3.1.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.0.tgz#7ca1913f6088570ae58bbb312d70500e00120d41" - integrity sha512-rDb9iasZvqTkgrlwzVGemR5i20T0/XN1ug46Ch2vxTRa0zS5PHaVXQXYzYbuLFHs1xpc+XsB9xPfEkkwbnLJBg== +jest-cli@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" + integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== dependencies: - "@jest/core" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/core" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-config "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.0.tgz#4b30188390636106414ea6b43aa6b2fb30d1a54d" - integrity sha512-sTSDs/M+//njznsytxiBxwfDnSWRb6OqiNSlO/B2iw1HUaa1YLsdWmV4AWLXss1XKzv1F0yVK+kA4XOhZ0I1qQ== +jest-config@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" + integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.3.0" - "@jest/types" "^29.2.1" - babel-jest "^29.3.0" + "@jest/test-sequencer" "^29.3.1" + "@jest/types" "^29.3.1" + babel-jest "^29.3.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.3.0" - jest-environment-node "^29.3.0" + jest-circus "^29.3.1" + jest-environment-node "^29.3.1" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-runner "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-resolve "^29.3.1" + jest-runner "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" strip-json-comments "^3.1.1" @@ -4412,15 +4404,15 @@ jest-diff@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" -jest-diff@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" - integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== +jest-diff@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" + integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== dependencies: chalk "^4.0.0" - diff-sequences "^29.2.0" + diff-sequences "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-docblock@^29.2.0: version "29.2.0" @@ -4429,42 +4421,42 @@ jest-docblock@^29.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.1.tgz#6b0a88ee85c2ba27b571a6010c2e0c674f5c9b29" - integrity sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw== +jest-each@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" + integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" jest-get-type "^29.2.0" - jest-util "^29.2.1" - pretty-format "^29.2.1" - -jest-environment-jsdom@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-28.1.3.tgz#2d4e5d61b7f1d94c3bddfbb21f0308ee506c09fb" - integrity sha512-HnlGUmZRdxfCByd3GM2F100DgQOajUBzEitjGqIREcb45kGjZvRrKUdlaF6escXBdcXNl0OBh+1ZrfeZT3GnAg== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" - "@types/jsdom" "^16.2.4" + jest-util "^29.3.1" + pretty-format "^29.3.1" + +jest-environment-jsdom@^29.0.0: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.3.1.tgz#14ca63c3e0ef5c63c5bcb46033e50bc649e3b639" + integrity sha512-G46nKgiez2Gy4zvYNhayfMEAFlVHhWfncqvqS6yCd0i+a4NsSUD2WtrKSaYQrYiLQaupHXxCRi8xxVL2M9PbhA== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^28.1.3" - jest-util "^28.1.3" - jsdom "^19.0.0" - -jest-environment-node@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.0.tgz#aed95a8e566d80f9f8564fba01ca5caa9d0aa59a" - integrity sha512-oikVE5pyiBUMrqi7J/kFGd1zeT14+EnJulyqzopDNijLX13ygwjiOF/GVpVKSGyBrrAwSkaj/ohEQJCcjkCtOA== - dependencies: - "@jest/environment" "^29.3.0" - "@jest/fake-timers" "^29.3.0" - "@jest/types" "^29.2.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" + jsdom "^20.0.0" + +jest-environment-node@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" + integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^29.3.0" - jest-util "^29.2.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" jest-get-type@^28.0.2: version "28.0.2" @@ -4476,32 +4468,32 @@ jest-get-type@^29.2.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.0.tgz#9786f501ed6ab1c7adc35d3f83c1c21ed4172c77" - integrity sha512-ugdLIreycMRRg3+6AjiExECmuFI2D9PS+BmNU7eGvBt3fzVMKybb9USAZXN6kw4Q6Mn8DSK+7OFCloY2rN820Q== +jest-haste-map@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" + integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.2.1" - jest-worker "^29.3.0" + jest-util "^29.3.1" + jest-worker "^29.3.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz#ec551686b7d512ec875616c2c3534298b1ffe2fc" - integrity sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug== +jest-leak-detector@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" + integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== dependencies: jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-localstorage-mock@^2.4.6: version "2.4.22" @@ -4518,15 +4510,15 @@ jest-matcher-utils@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" -jest-matcher-utils@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz#9202f8e8d3a54733266784ce7763e9a08688269c" - integrity sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw== +jest-matcher-utils@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" + integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== dependencies: chalk "^4.0.0" - jest-diff "^29.2.1" + jest-diff "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-message-util@^28.1.3: version "28.1.3" @@ -4543,130 +4535,122 @@ jest-message-util@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" - integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== +jest-message-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" + integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" - integrity sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA== - dependencies: - "@jest/types" "^28.1.3" - "@types/node" "*" - -jest-mock@^29.0.0, jest-mock@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.0.tgz#aa6f1d5118fd4b9d007df782e0624e6efab6d33d" - integrity sha512-BRKfsAaeP3pTWeog+1D0ILeJF96SzB6y3k0JDxY63kssxiUy9nDLHmNUoVkBGILjMbpHULhbzVTsb3harPXuUQ== +jest-mock@^29.0.0, jest-mock@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" + integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-util "^29.2.1" + jest-util "^29.3.1" jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.0.tgz#9a2c3389d1a4cce95445f7c34b0b25f44fff9fad" - integrity sha512-ykSbDbWmIaHprOBig57AExw7i6Fj0y69M6baiAd75Ivx1UMQt4wsM6A+SNqIhycV6Zy8XV3L40Ac3HYSrDSq7w== +jest-resolve-dependencies@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" + integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.3.0" + jest-snapshot "^29.3.1" -jest-resolve@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.0.tgz#038711e9af86f4b4f55a407db14310bc57a8beb4" - integrity sha512-xH6C6loDlOWEWHdCgioLDlbpmsolNdNsV/UR35ChuK217x0ttHuhyEPdh5wa6CTQ/Eq4OGW2/EZTlh0ay5aojQ== +jest-resolve@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" + integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-util "^29.3.1" + jest-validate "^29.3.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.0.tgz#fc255482594c1536a34e2b41f610355c4f3d2ee6" - integrity sha512-E/ROzAVj7gy44FvIe+Tbz0xGWG1sa8WLkhUg/hsXHewPC0Z48kqWySdfYRtXkB7RmMn4OcWE+hIBfsRAMVV+sQ== +jest-runner@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" + integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== dependencies: - "@jest/console" "^29.2.1" - "@jest/environment" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/environment" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.3.0" - jest-haste-map "^29.3.0" - jest-leak-detector "^29.2.1" - jest-message-util "^29.2.1" - jest-resolve "^29.3.0" - jest-runtime "^29.3.0" - jest-util "^29.2.1" - jest-watcher "^29.2.2" - jest-worker "^29.3.0" + jest-environment-node "^29.3.1" + jest-haste-map "^29.3.1" + jest-leak-detector "^29.3.1" + jest-message-util "^29.3.1" + jest-resolve "^29.3.1" + jest-runtime "^29.3.1" + jest-util "^29.3.1" + jest-watcher "^29.3.1" + jest-worker "^29.3.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.0.tgz#e44f838f469ab1f6b524178bae6233697748eb27" - integrity sha512-ufgX/hbpa7MLnjWRW82T5mVF73FBk3W38dGCLPXWtYZ5Zr1ZFh8QnaAtITKJt0p3kGXR8ZqlIjadSiBTk/QJ/A== +jest-runtime@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" + integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== dependencies: - "@jest/environment" "^29.3.0" - "@jest/fake-timers" "^29.3.0" - "@jest/globals" "^29.3.0" + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/globals" "^29.3.1" "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" - jest-message-util "^29.2.1" - jest-mock "^29.3.0" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" + jest-resolve "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.0.tgz#e319cb98cf36640194717fb37a9bd048a3e448f8" - integrity sha512-+4mX3T8XI3ABbZFzBd/AM74mfwOb6gMpYVFNTc0Cgg2F2fGYvHii8D6jWWka99a3wyNFmni3ov8meEVTF8n13Q== +jest-snapshot@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" + integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -4674,23 +4658,23 @@ jest-snapshot@^29.3.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.2.2" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/expect-utils" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.3.0" + expect "^29.3.1" graceful-fs "^4.2.9" - jest-diff "^29.2.1" + jest-diff "^29.3.1" jest-get-type "^29.2.0" - jest-haste-map "^29.3.0" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-haste-map "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" natural-compare "^1.4.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" semver "^7.3.5" jest-util@^28.1.3: @@ -4705,63 +4689,63 @@ jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" - integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== +jest-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" + integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.2.tgz#e43ce1931292dfc052562a11bc681af3805eadce" - integrity sha512-eJXATaKaSnOuxNfs8CLHgdABFgUrd0TtWS8QckiJ4L/QVDF4KVbZFBBOwCBZHOS0Rc5fOxqngXeGXE3nGQkpQA== +jest-validate@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" + integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" -jest-watcher@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.2.tgz#7093d4ea8177e0a0da87681a9e7b09a258b9daf7" - integrity sha512-j2otfqh7mOvMgN2WlJ0n7gIx9XCMWntheYGlBK7+5g3b1Su13/UAK7pdKGyd4kDlrLwtH2QPvRv5oNIxWvsJ1w== +jest-watcher@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" + integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== dependencies: - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.2.1" + jest-util "^29.3.1" string-length "^4.0.1" -jest-worker@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.0.tgz#240a1cd731c7d6645e8bcc37a3d584f122afb44a" - integrity sha512-rP8LYClB5NCWW0p8GdQT9vRmZNrDmjypklEYZuGCIU5iNviVWCZK5MILS3rQwD0FY1u96bY7b+KoU17DdZy6Ww== +jest-worker@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" + integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== dependencies: "@types/node" "*" - jest-util "^29.2.1" + jest-util "^29.3.1" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.0.tgz#edb9ef5b308e90e1c717c8accc04b28f133ac66d" - integrity sha512-lWmHtOcJSjR6FYRw+4oo7456QUe6LN73Lw6HLwOWKTPLcyQF60cMh0EoIHi67dV74SY5tw/kL+jYC+Ji43ScUg== + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122" + integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== dependencies: - "@jest/core" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/core" "^29.3.1" + "@jest/types" "^29.3.1" import-local "^3.0.2" - jest-cli "^29.3.0" + jest-cli "^29.3.1" js-sdsl@^4.1.4: version "4.1.5" @@ -4793,37 +4777,36 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsdom@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-19.0.0.tgz#93e67c149fe26816d38a849ea30ac93677e16b6a" - integrity sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A== +jsdom@^20.0.0: + version "20.0.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.2.tgz#65ccbed81d5e877c433f353c58bb91ff374127db" + integrity sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA== dependencies: - abab "^2.0.5" - acorn "^8.5.0" - acorn-globals "^6.0.0" + abab "^2.0.6" + acorn "^8.8.0" + acorn-globals "^7.0.0" cssom "^0.5.0" cssstyle "^2.3.0" - data-urls "^3.0.1" - decimal.js "^10.3.1" + data-urls "^3.0.2" + decimal.js "^10.4.1" domexception "^4.0.0" escodegen "^2.0.0" form-data "^4.0.0" html-encoding-sniffer "^3.0.0" http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" + tough-cookie "^4.1.2" w3c-xmlserializer "^3.0.0" webidl-conversions "^7.0.0" whatwg-encoding "^2.0.0" whatwg-mimetype "^3.0.0" - whatwg-url "^10.0.0" - ws "^8.2.3" + whatwg-url "^11.0.0" + ws "^8.9.0" xml-name-validator "^4.0.0" jsesc@^2.5.1: @@ -5300,7 +5283,7 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -nwsapi@^2.2.0: +nwsapi@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== @@ -5486,10 +5469,12 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== +parse5@^7.0.0, parse5@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.1.tgz#4649f940ccfb95d8754f37f73078ea20afe0c746" + integrity sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg== + dependencies: + entities "^4.4.0" path-browserify@^1.0.0: version "1.0.1" @@ -5601,10 +5586,10 @@ pretty-format@^28.1.3: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^29.0.0, pretty-format@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" - integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== +pretty-format@^29.0.0, pretty-format@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" + integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" @@ -6137,10 +6122,10 @@ safe-regex@^2.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== dependencies: xmlchars "^2.2.0" @@ -6311,9 +6296,9 @@ sprintf-js@~1.0.2: integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" @@ -6596,7 +6581,7 @@ token-stream@0.0.1: resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a" integrity sha512-nfjOAu/zAWmX9tgwi5NRp7O7zTDUD1miHiB40klUnAh9qnL1iXdgzcz/i5dMaL5jahcBAaSfmNOBBJBLJW8TEg== -tough-cookie@^4.0.0: +tough-cookie@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== @@ -6993,13 +6978,6 @@ vue2-ace-editor@^0.0.15: dependencies: brace "^0.11.0" -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - w3c-xmlserializer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz#06cdc3eefb7e4d0b20a560a5a3aeb0d2d9a65923" @@ -7046,14 +7024,6 @@ whatwg-mimetype@^3.0.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== -whatwg-url@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-10.0.0.tgz#37264f720b575b4a311bd4094ed8c760caaa05da" - integrity sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w== - dependencies: - tr46 "^3.0.0" - webidl-conversions "^7.0.0" - whatwg-url@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" @@ -7154,7 +7124,7 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@^8.2.3: +ws@^8.9.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==