summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-js-sdk/lib/store
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/matrix/node_modules/matrix-js-sdk/lib/store
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/store')
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts191
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js6
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts23
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js6
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts128
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js568
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts78
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js199
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts35
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js148
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts144
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js295
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts30
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js44
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts206
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js425
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts156
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map1
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js256
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js.map1
36 files changed, 0 insertions, 2956 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts
deleted file mode 100644
index 5e45739..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-import { EventType } from "../@types/event";
-import { Room } from "../models/room";
-import { User } from "../models/user";
-import { IEvent, MatrixEvent } from "../models/event";
-import { Filter } from "../filter";
-import { RoomSummary } from "../models/room-summary";
-import { IMinimalEvent, IRooms, ISyncResponse } from "../sync-accumulator";
-import { IStartClientOpts } from "../client";
-import { IStateEventWithRoomId } from "../@types/search";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-import { EventEmitterEvents } from "../models/typed-event-emitter";
-export interface ISavedSync {
- nextBatch: string;
- roomsData: IRooms;
- accountData: IMinimalEvent[];
-}
-/**
- * A store for most of the data js-sdk needs to store, apart from crypto data
- */
-export interface IStore {
- readonly accountData: Map<string, MatrixEvent>;
- on?: (event: EventEmitterEvents | "degraded" | "closed", handler: (...args: any[]) => void) => void;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated(): Promise<boolean>;
- /**
- * Get the sync token.
- */
- getSyncToken(): string | null;
- /**
- * Set the sync token.
- */
- setSyncToken(token: string): void;
- /**
- * Store the given room.
- * @param room - The room to be stored. All properties must be stored.
- */
- storeRoom(room: Room): void;
- /**
- * Retrieve a room by its' room ID.
- * @param roomId - The room ID.
- * @returns The room or null.
- */
- getRoom(roomId: string): Room | null;
- /**
- * Retrieve all known rooms.
- * @returns A list of rooms, which may be empty.
- */
- getRooms(): Room[];
- /**
- * Permanently delete a room.
- */
- removeRoom(roomId: string): void;
- /**
- * Retrieve a summary of all the rooms.
- * @returns A summary of each room.
- */
- getRoomSummaries(): RoomSummary[];
- /**
- * Store a User.
- * @param user - The user to store.
- */
- storeUser(user: User): void;
- /**
- * Retrieve a User by its' user ID.
- * @param userId - The user ID.
- * @returns The user or null.
- */
- getUser(userId: string): User | null;
- /**
- * Retrieve all known users.
- * @returns A list of users, which may be empty.
- */
- getUsers(): User[];
- /**
- * Retrieve scrollback for this room.
- * @param room - The matrix room
- * @param limit - The max number of old events to retrieve.
- * @returns An array of objects which will be at most 'limit'
- * length and at least 0. The objects are the raw event JSON.
- */
- scrollback(room: Room, limit: number): MatrixEvent[];
- /**
- * Store events for a room.
- * @param room - The room to store events for.
- * @param events - The events to store.
- * @param token - The token associated with these events.
- * @param toStart - True if these are paginated results.
- */
- storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void;
- /**
- * Store a filter.
- */
- storeFilter(filter: Filter): void;
- /**
- * Retrieve a filter.
- * @returns A filter or null.
- */
- getFilter(userId: string, filterId: string): Filter | null;
- /**
- * Retrieve a filter ID with the given name.
- * @param filterName - The filter name.
- * @returns The filter ID or null.
- */
- getFilterIdByName(filterName: string): string | null;
- /**
- * Set a filter name to ID mapping.
- */
- setFilterIdByName(filterName: string, filterId?: string): void;
- /**
- * Store user-scoped account data events
- * @param events - The events to store.
- */
- storeAccountDataEvents(events: MatrixEvent[]): void;
- /**
- * Get account data event by event type
- * @param eventType - The event type being queried
- */
- getAccountData(eventType: EventType | string): MatrixEvent | undefined;
- /**
- * setSyncData does nothing as there is no backing data store.
- *
- * @param syncData - The sync data
- * @returns An immediately resolved promise.
- */
- setSyncData(syncData: ISyncResponse): Promise<void>;
- /**
- * We never want to save because we have nothing to save to.
- *
- * @returns If the store wants to save
- */
- wantsSave(): boolean;
- /**
- * Save does nothing as there is no backing data store.
- */
- save(force?: boolean): void;
- /**
- * Startup does nothing.
- * @returns An immediately resolved promise.
- */
- startup(): Promise<void>;
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(): Promise<ISavedSync | null>;
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken(): Promise<string | null>;
- /**
- * Delete all data from this store. Does nothing since this store
- * doesn't store anything.
- * @returns An immediately resolved promise.
- */
- deleteAllData(): Promise<void>;
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(roomId: string): Promise<void>;
- getClientOptions(): Promise<IStartClientOpts | undefined>;
- storeClientOptions(options: IStartClientOpts): Promise<void>;
- getPendingEvents(roomId: string): Promise<Partial<IEvent>[]>;
- setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void>;
- /**
- * Stores batches of outgoing to-device messages
- */
- saveToDeviceBatches(batch: ToDeviceBatchWithTxnId[]): Promise<void>;
- /**
- * Fetches the oldest batch of to-device messages in the queue
- */
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- /**
- * Removes a specific batch of to-device messages from the queue
- */
- removeToDeviceBatch(id: number): Promise<void>;
-}
-//# sourceMappingURL=index.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts.map
deleted file mode 100644
index 91540d2..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,aAAa,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAK/C,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,UAAU,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAAK,IAAI,CAAC;IAEpG,8EAA8E;IAC9E,cAA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AO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAE7D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE;;OAEG;IACH,sBAAsB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAE/D;;OAEG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js
deleted file mode 100644
index 951c783..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js.map
deleted file mode 100644
index 5c2a9a3..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","names":[],"sources":["../../src/store/index.ts"],"sourcesContent":["/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { EventType } from \"../@types/event\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { Filter } from \"../filter\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { IMinimalEvent, IRooms, ISyncResponse } from \"../sync-accumulator\";\nimport { IStartClientOpts } from \"../client\";\nimport { IStateEventWithRoomId } from \"../@types/search\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\nimport { EventEmitterEvents } from \"../models/typed-event-emitter\";\n\nexport interface ISavedSync {\n nextBatch: string;\n roomsData: IRooms;\n accountData: IMinimalEvent[];\n}\n\n/**\n * A store for most of the data js-sdk needs to store, apart from crypto data\n */\nexport interface IStore {\n readonly accountData: Map<string, MatrixEvent>; // type : content\n\n // XXX: The indexeddb store exposes a non-standard emitter for:\n // \"degraded\" event for when it falls back to being a memory store due to errors.\n // \"closed\" event for when the database closes unexpectedly\n on?: (event: EventEmitterEvents | \"degraded\" | \"closed\", handler: (...args: any[]) => void) => void;\n\n /** @returns whether or not the database was newly created in this session. */\n isNewlyCreated(): Promise<boolean>;\n\n /**\n * Get the sync token.\n */\n getSyncToken(): string | null;\n\n /**\n * Set the sync token.\n */\n setSyncToken(token: string): void;\n\n /**\n * Store the given room.\n * @param room - The room to be stored. All properties must be stored.\n */\n storeRoom(room: Room): void;\n\n /**\n * Retrieve a room by its' room ID.\n * @param roomId - The room ID.\n * @returns The room or null.\n */\n getRoom(roomId: string): Room | null;\n\n /**\n * Retrieve all known rooms.\n * @returns A list of rooms, which may be empty.\n */\n getRooms(): Room[];\n\n /**\n * Permanently delete a room.\n */\n removeRoom(roomId: string): void;\n\n /**\n * Retrieve a summary of all the rooms.\n * @returns A summary of each room.\n */\n getRoomSummaries(): RoomSummary[];\n\n /**\n * Store a User.\n * @param user - The user to store.\n */\n storeUser(user: User): void;\n\n /**\n * Retrieve a User by its' user ID.\n * @param userId - The user ID.\n * @returns The user or null.\n */\n getUser(userId: string): User | null;\n\n /**\n * Retrieve all known users.\n * @returns A list of users, which may be empty.\n */\n getUsers(): User[];\n\n /**\n * Retrieve scrollback for this room.\n * @param room - The matrix room\n * @param limit - The max number of old events to retrieve.\n * @returns An array of objects which will be at most 'limit'\n * length and at least 0. The objects are the raw event JSON.\n */\n scrollback(room: Room, limit: number): MatrixEvent[];\n\n /**\n * Store events for a room.\n * @param room - The room to store events for.\n * @param events - The events to store.\n * @param token - The token associated with these events.\n * @param toStart - True if these are paginated results.\n */\n storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void;\n\n /**\n * Store a filter.\n */\n storeFilter(filter: Filter): void;\n\n /**\n * Retrieve a filter.\n * @returns A filter or null.\n */\n getFilter(userId: string, filterId: string): Filter | null;\n\n /**\n * Retrieve a filter ID with the given name.\n * @param filterName - The filter name.\n * @returns The filter ID or null.\n */\n getFilterIdByName(filterName: string): string | null;\n\n /**\n * Set a filter name to ID mapping.\n */\n setFilterIdByName(filterName: string, filterId?: string): void;\n\n /**\n * Store user-scoped account data events\n * @param events - The events to store.\n */\n storeAccountDataEvents(events: MatrixEvent[]): void;\n\n /**\n * Get account data event by event type\n * @param eventType - The event type being queried\n */\n getAccountData(eventType: EventType | string): MatrixEvent | undefined;\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param syncData - The sync data\n * @returns An immediately resolved promise.\n */\n setSyncData(syncData: ISyncResponse): Promise<void>;\n\n /**\n * We never want to save because we have nothing to save to.\n *\n * @returns If the store wants to save\n */\n wantsSave(): boolean;\n\n /**\n * Save does nothing as there is no backing data store.\n */\n save(force?: boolean): void;\n\n /**\n * Startup does nothing.\n * @returns An immediately resolved promise.\n */\n startup(): Promise<void>;\n\n /**\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n getSavedSync(): Promise<ISavedSync | null>;\n\n /**\n * @returns If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n getSavedSyncToken(): Promise<string | null>;\n\n /**\n * Delete all data from this store. Does nothing since this store\n * doesn't store anything.\n * @returns An immediately resolved promise.\n */\n deleteAllData(): Promise<void>;\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @returns the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns in case the members for this room haven't been stored yet\n */\n getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param membershipEvents - the membership events to store\n * @returns when all members have been stored\n */\n setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;\n\n clearOutOfBandMembers(roomId: string): Promise<void>;\n\n getClientOptions(): Promise<IStartClientOpts | undefined>;\n\n storeClientOptions(options: IStartClientOpts): Promise<void>;\n\n getPendingEvents(roomId: string): Promise<Partial<IEvent>[]>;\n\n setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void>;\n\n /**\n * Stores batches of outgoing to-device messages\n */\n saveToDeviceBatches(batch: ToDeviceBatchWithTxnId[]): Promise<void>;\n\n /**\n * Fetches the oldest batch of to-device messages in the queue\n */\n getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;\n\n /**\n * Removes a specific batch of to-device messages from the queue\n */\n removeToDeviceBatch(id: number): Promise<void>;\n}\n"],"mappings":""} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts
deleted file mode 100644
index d0cefc5..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { ISavedSync } from "./index";
-import { IEvent, IStateEventWithRoomId, IStoredClientOpts, ISyncResponse } from "../matrix";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-export interface IIndexedDBBackend {
- connect(onClose?: () => void): Promise<void>;
- syncToDatabase(userTuples: UserTuple[]): Promise<void>;
- isNewlyCreated(): Promise<boolean>;
- setSyncData(syncData: ISyncResponse): Promise<void>;
- getSavedSync(): Promise<ISavedSync | null>;
- getNextBatchToken(): Promise<string>;
- clearDatabase(): Promise<void>;
- getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(roomId: string): Promise<void>;
- getUserPresenceEvents(): Promise<UserTuple[]>;
- getClientOptions(): Promise<IStoredClientOpts | undefined>;
- storeClientOptions(options: IStoredClientOpts): Promise<void>;
- saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
-}
-export type UserTuple = [userId: string, presenceEvent: Partial<IEvent>];
-//# sourceMappingURL=indexeddb-backend.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts.map
deleted file mode 100644
index 4d4b679..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-backend.d.ts","sourceRoot":"","sources":["../../src/store/indexeddb-backend.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,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GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js
deleted file mode 100644
index aeb3a9a..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-//# sourceMappingURL=indexeddb-backend.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js.map
deleted file mode 100644
index 250db4a..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-backend.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-backend.js","names":[],"sources":["../../src/store/indexeddb-backend.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { ISavedSync } from \"./index\";\nimport { IEvent, IStateEventWithRoomId, IStoredClientOpts, ISyncResponse } from \"../matrix\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\n\nexport interface IIndexedDBBackend {\n connect(onClose?: () => void): Promise<void>;\n syncToDatabase(userTuples: UserTuple[]): Promise<void>;\n isNewlyCreated(): Promise<boolean>;\n setSyncData(syncData: ISyncResponse): Promise<void>;\n getSavedSync(): Promise<ISavedSync | null>;\n getNextBatchToken(): Promise<string>;\n clearDatabase(): Promise<void>;\n getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;\n setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;\n clearOutOfBandMembers(roomId: string): Promise<void>;\n getUserPresenceEvents(): Promise<UserTuple[]>;\n getClientOptions(): Promise<IStoredClientOpts | undefined>;\n storeClientOptions(options: IStoredClientOpts): Promise<void>;\n saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;\n getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;\n removeToDeviceBatch(id: number): Promise<void>;\n}\n\nexport type UserTuple = [userId: string, presenceEvent: Partial<IEvent>];\n"],"mappings":""} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts
deleted file mode 100644
index 56fa177..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import { ISyncResponse } from "../sync-accumulator";
-import { IStateEventWithRoomId, IStoredClientOpts } from "../matrix";
-import { ISavedSync } from "./index";
-import { IIndexedDBBackend, UserTuple } from "./indexeddb-backend";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-export declare class LocalIndexedDBStoreBackend implements IIndexedDBBackend {
- private readonly indexedDB;
- static exists(indexedDB: IDBFactory, dbName: string): Promise<boolean>;
- private readonly dbName;
- private readonly syncAccumulator;
- private db?;
- private disconnected;
- private _isNewlyCreated;
- private syncToDatabasePromise?;
- private pendingUserPresenceData;
- /**
- * Does the actual reading from and writing to the indexeddb
- *
- * Construct a new Indexed Database store backend. This requires a call to
- * `connect()` before this store can be used.
- * @param indexedDB - The Indexed DB interface e.g
- * `window.indexedDB`
- * @param dbName - Optional database name. The same name must be used
- * to open the same database.
- */
- constructor(indexedDB: IDBFactory, dbName?: string);
- /**
- * Attempt to connect to the database. This can fail if the user does not
- * grant permission.
- * @returns Promise which resolves if successfully connected.
- */
- connect(onClose?: () => void): Promise<void>;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated(): Promise<boolean>;
- /**
- * Having connected, load initial data from the database and prepare for use
- * @returns Promise which resolves on success
- */
- private init;
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- */
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(roomId: string): Promise<void>;
- /**
- * Clear the entire database. This should be used when logging out of a client
- * to prevent mixing data between accounts.
- * @returns Resolved when the database is cleared.
- */
- clearDatabase(): Promise<void>;
- /**
- * @param copy - If false, the data returned is from internal
- * buffers and must not be mutated. Otherwise, a copy is made before
- * returning such that the data can be safely mutated. Default: true.
- *
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(copy?: boolean): Promise<ISavedSync | null>;
- getNextBatchToken(): Promise<string>;
- setSyncData(syncData: ISyncResponse): Promise<void>;
- /**
- * Sync users and all accumulated sync data to the database.
- * If a previous sync is in flight, the new data will be added to the
- * next sync and the current sync's promise will be returned.
- * @param userTuples - The user tuples
- * @returns Promise which resolves if the data was persisted.
- */
- syncToDatabase(userTuples: UserTuple[]): Promise<void>;
- private doSyncToDatabase;
- /**
- * Persist rooms /sync data along with the next batch token.
- * @param nextBatch - The next_batch /sync value.
- * @param roomsData - The 'rooms' /sync data from a SyncAccumulator
- * @returns Promise which resolves if the data was persisted.
- */
- private persistSyncData;
- /**
- * Persist a list of account data events. Events with the same 'type' will
- * be replaced.
- * @param accountData - An array of raw user-scoped account data events
- * @returns Promise which resolves if the events were persisted.
- */
- private persistAccountData;
- /**
- * Persist a list of [user id, presence event] they are for.
- * Users with the same 'userId' will be replaced.
- * Presence events should be the event in its raw form (not the Event
- * object)
- * @param tuples - An array of [userid, event] tuples
- * @returns Promise which resolves if the users were persisted.
- */
- private persistUserPresenceEvents;
- /**
- * Load all user presence events from the database. This is not cached.
- * FIXME: It would probably be more sensible to store the events in the
- * sync.
- * @returns A list of presence events in their raw form.
- */
- getUserPresenceEvents(): Promise<UserTuple[]>;
- /**
- * Load all the account data events from the database. This is not cached.
- * @returns A list of raw global account events.
- */
- private loadAccountData;
- /**
- * Load the sync data from the database.
- * @returns An object with "roomsData" and "nextBatch" keys.
- */
- private loadSyncData;
- getClientOptions(): Promise<IStoredClientOpts | undefined>;
- storeClientOptions(options: IStoredClientOpts): Promise<void>;
- saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
-}
-//# sourceMappingURL=indexeddb-local-backend.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map
deleted file mode 100644
index a0bb8fe..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-local-backend.d.ts","sourceRoot":"","sources":["../../src/store/indexeddb-local-backend.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA4B,aAAa,EAAmB,MAAM,qBAAqB,CAA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AAC;IAgCjE;;;;OAIG;IACI,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBrC;;;;;;;;OAQG;IACI,YAAY,CAAC,IAAI,UAAO,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAYrD,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIpC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1D;;;;;;OAMG;IACU,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAWrD,gBAAgB;IAa9B;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAgBvB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;IAcjC;;;;;OAKG;IACI,qBAAqB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAUpD;;;OAGG;IACH,OAAO,CAAC,eAAe;IAcvB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAiBb,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAUpD,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAU7D,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE,sBAAsB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAgB9D,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM9D"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js
deleted file mode 100644
index ebedef3..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js
+++ /dev/null
@@ -1,568 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.LocalIndexedDBStoreBackend = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-var _syncAccumulator = require("../sync-accumulator");
-var utils = _interopRequireWildcard(require("../utils"));
-var IndexedDBHelpers = _interopRequireWildcard(require("../indexeddb-helpers"));
-var _logger = require("../logger");
-function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-/*
-Copyright 2017 - 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-const DB_MIGRATIONS = [db => {
- // Make user store, clobber based on user ID. (userId property of User objects)
- db.createObjectStore("users", {
- keyPath: ["userId"]
- });
-
- // Make account data store, clobber based on event type.
- // (event.type property of MatrixEvent objects)
- db.createObjectStore("accountData", {
- keyPath: ["type"]
- });
-
- // Make /sync store (sync tokens, room data, etc), always clobber (const key).
- db.createObjectStore("sync", {
- keyPath: ["clobber"]
- });
-}, db => {
- 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
- });
-}
-// Expand as needed.
-];
-
-const VERSION = DB_MIGRATIONS.length;
-
-/**
- * Helper method to collect results from a Cursor and promiseify it.
- * @param store - The store to perform openCursor on.
- * @param keyRange - Optional key range to apply on the cursor.
- * @param resultMapper - A function which is repeatedly called with a
- * Cursor.
- * Return the data you want to keep.
- * @returns Promise which resolves to an array of whatever you returned from
- * resultMapper.
- */
-function selectQuery(store, keyRange, resultMapper) {
- const query = store.openCursor(keyRange);
- return new Promise((resolve, reject) => {
- const results = [];
- query.onerror = () => {
- reject(new Error("Query failed: " + query.error));
- };
- // collect results
- query.onsuccess = () => {
- const cursor = query.result;
- if (!cursor) {
- resolve(results);
- return; // end of results
- }
-
- results.push(resultMapper(cursor));
- cursor.continue();
- };
- });
-}
-function txnAsPromise(txn) {
- return new Promise((resolve, reject) => {
- txn.oncomplete = function (event) {
- resolve(event);
- };
- txn.onerror = function () {
- reject(txn.error);
- };
- });
-}
-function reqAsEventPromise(req) {
- return new Promise((resolve, reject) => {
- req.onsuccess = function (event) {
- resolve(event);
- };
- req.onerror = function () {
- reject(req.error);
- };
- });
-}
-function reqAsPromise(req) {
- return new Promise((resolve, reject) => {
- req.onsuccess = () => resolve(req);
- req.onerror = err => reject(err);
- });
-}
-function reqAsCursorPromise(req) {
- return reqAsEventPromise(req).then(event => req.result);
-}
-class LocalIndexedDBStoreBackend {
- static exists(indexedDB, dbName) {
- dbName = "matrix-js-sdk:" + (dbName || "default");
- return IndexedDBHelpers.exists(indexedDB, dbName);
- }
- /**
- * Does the actual reading from and writing to the indexeddb
- *
- * Construct a new Indexed Database store backend. This requires a call to
- * `connect()` before this store can be used.
- * @param indexedDB - The Indexed DB interface e.g
- * `window.indexedDB`
- * @param dbName - Optional database name. The same name must be used
- * to open the same database.
- */
- constructor(indexedDB, dbName = "default") {
- this.indexedDB = indexedDB;
- (0, _defineProperty2.default)(this, "dbName", void 0);
- (0, _defineProperty2.default)(this, "syncAccumulator", void 0);
- (0, _defineProperty2.default)(this, "db", void 0);
- (0, _defineProperty2.default)(this, "disconnected", true);
- (0, _defineProperty2.default)(this, "_isNewlyCreated", false);
- (0, _defineProperty2.default)(this, "syncToDatabasePromise", void 0);
- (0, _defineProperty2.default)(this, "pendingUserPresenceData", []);
- this.dbName = "matrix-js-sdk:" + dbName;
- this.syncAccumulator = new _syncAccumulator.SyncAccumulator();
- }
-
- /**
- * Attempt to connect to the database. This can fail if the user does not
- * grant permission.
- * @returns Promise which resolves if successfully connected.
- */
- connect(onClose) {
- if (!this.disconnected) {
- _logger.logger.log(`LocalIndexedDBStoreBackend.connect: already connected or connecting`);
- return Promise.resolve();
- }
- this.disconnected = false;
- _logger.logger.log(`LocalIndexedDBStoreBackend.connect: connecting...`);
- const req = this.indexedDB.open(this.dbName, VERSION);
- req.onupgradeneeded = ev => {
- const db = req.result;
- const oldVersion = ev.oldVersion;
- _logger.logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${oldVersion}`);
- if (oldVersion < 1) {
- // The database did not previously exist
- this._isNewlyCreated = true;
- }
- DB_MIGRATIONS.forEach((migration, index) => {
- if (oldVersion <= index) migration(db);
- });
- };
- req.onblocked = () => {
- _logger.logger.log(`can't yet open LocalIndexedDBStoreBackend because it is open elsewhere`);
- };
- _logger.logger.log(`LocalIndexedDBStoreBackend.connect: awaiting connection...`);
- return reqAsEventPromise(req).then(async () => {
- _logger.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 = () => {
- var _this$db;
- (_this$db = this.db) === null || _this$db === void 0 ? void 0 : _this$db.close(); // this does not call onclose
- this.disconnected = true;
- this.db = undefined;
- onClose === null || onClose === void 0 ? void 0 : onClose();
- };
- this.db.onclose = () => {
- this.disconnected = true;
- this.db = undefined;
- onClose === null || onClose === void 0 ? void 0 : onClose();
- };
- await this.init();
- });
- }
-
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated() {
- return Promise.resolve(this._isNewlyCreated);
- }
-
- /**
- * Having connected, load initial data from the database and prepare for use
- * @returns Promise which resolves on success
- */
- init() {
- return Promise.all([this.loadAccountData(), this.loadSyncData()]).then(([accountData, syncData]) => {
- _logger.logger.log(`LocalIndexedDBStoreBackend: loaded initial data`);
- this.syncAccumulator.accumulate({
- next_batch: syncData.nextBatch,
- rooms: syncData.roomsData,
- account_data: {
- events: accountData
- }
- }, true);
- });
- }
-
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId) {
- return new Promise((resolve, reject) => {
- const tx = this.db.transaction(["oob_membership_events"], "readonly");
- const store = tx.objectStore("oob_membership_events");
- const roomIndex = store.index("room");
- const range = IDBKeyRange.only(roomId);
- const request = roomIndex.openCursor(range);
- const membershipEvents = [];
- // did we encounter the oob_written marker object
- // amongst the results? That means OOB member
- // loading already happened for this room
- // but there were no members to persist as they
- // were all known already
- let oobWritten = false;
- request.onsuccess = () => {
- const cursor = request.result;
- if (!cursor) {
- // Unknown room
- if (!membershipEvents.length && !oobWritten) {
- return resolve(null);
- }
- return resolve(membershipEvents);
- }
- const record = cursor.value;
- if (record.oob_written) {
- oobWritten = true;
- } else {
- membershipEvents.push(record);
- }
- cursor.continue();
- };
- request.onerror = err => {
- reject(err);
- };
- }).then(events => {
- _logger.logger.log(`LL: got ${events === null || events === void 0 ? void 0 : events.length} membershipEvents from storage for room ${roomId} ...`);
- return events;
- });
- }
-
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- */
- async setOutOfBandMembers(roomId, membershipEvents) {
- _logger.logger.log(`LL: backend about to store ${membershipEvents.length}` + ` members for ${roomId}`);
- const tx = this.db.transaction(["oob_membership_events"], "readwrite");
- const store = tx.objectStore("oob_membership_events");
- membershipEvents.forEach(e => {
- store.put(e);
- });
- // aside from all the events, we also write a marker object to the store
- // to mark the fact that OOB members have been written for this room.
- // It's possible that 0 members need to be written as all where previously know
- // but we still need to know whether to return null or [] from getOutOfBandMembers
- // where null means out of band members haven't been stored yet for this room
- const markerObject = {
- room_id: roomId,
- oob_written: true,
- state_key: 0
- };
- store.put(markerObject);
- await txnAsPromise(tx);
- _logger.logger.log(`LL: backend done storing for ${roomId}!`);
- }
- async clearOutOfBandMembers(roomId) {
- // the approach to delete all members for a room
- // is to get the min and max state key from the index
- // for that room, and then delete between those
- // keys in the store.
- // this should be way faster than deleting every member
- // individually for a large room.
- const readTx = this.db.transaction(["oob_membership_events"], "readonly");
- const store = readTx.objectStore("oob_membership_events");
- const roomIndex = store.index("room");
- const roomRange = IDBKeyRange.only(roomId);
- const minStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, "next")).then(cursor => (cursor === null || cursor === void 0 ? void 0 : cursor.primaryKey)[1]);
- const maxStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, "prev")).then(cursor => (cursor === null || cursor === void 0 ? void 0 : cursor.primaryKey)[1]);
- const [minStateKey, maxStateKey] = await Promise.all([minStateKeyProm, maxStateKeyProm]);
- const writeTx = this.db.transaction(["oob_membership_events"], "readwrite");
- const writeStore = writeTx.objectStore("oob_membership_events");
- const membersKeyRange = IDBKeyRange.bound([roomId, minStateKey], [roomId, maxStateKey]);
- _logger.logger.log(`LL: Deleting all users + marker in storage for room ${roomId}, with key range:`, [roomId, minStateKey], [roomId, maxStateKey]);
- await reqAsPromise(writeStore.delete(membersKeyRange));
- }
-
- /**
- * Clear the entire database. This should be used when logging out of a client
- * to prevent mixing data between accounts.
- * @returns Resolved when the database is cleared.
- */
- clearDatabase() {
- return new Promise(resolve => {
- _logger.logger.log(`Removing indexeddb instance: ${this.dbName}`);
- const req = this.indexedDB.deleteDatabase(this.dbName);
- req.onblocked = () => {
- _logger.logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`);
- };
- req.onerror = () => {
- // in firefox, with indexedDB disabled, this fails with a
- // DOMError. We treat this as non-fatal, so that we can still
- // use the app.
- _logger.logger.warn(`unable to delete js-sdk store indexeddb: ${req.error}`);
- resolve();
- };
- req.onsuccess = () => {
- _logger.logger.log(`Removed indexeddb instance: ${this.dbName}`);
- resolve();
- };
- });
- }
-
- /**
- * @param copy - If false, the data returned is from internal
- * buffers and must not be mutated. Otherwise, a copy is made before
- * returning such that the data can be safely mutated. Default: true.
- *
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(copy = true) {
- const data = this.syncAccumulator.getJSON();
- if (!data.nextBatch) return Promise.resolve(null);
- if (copy) {
- // We must deep copy the stored data so that the /sync processing code doesn't
- // corrupt the internal state of the sync accumulator (it adds non-clonable keys)
- return Promise.resolve(utils.deepCopy(data));
- } else {
- return Promise.resolve(data);
- }
- }
- getNextBatchToken() {
- return Promise.resolve(this.syncAccumulator.getNextBatchToken());
- }
- setSyncData(syncData) {
- return Promise.resolve().then(() => {
- this.syncAccumulator.accumulate(syncData);
- });
- }
-
- /**
- * Sync users and all accumulated sync data to the database.
- * If a previous sync is in flight, the new data will be added to the
- * next sync and the current sync's promise will be returned.
- * @param userTuples - The user tuples
- * @returns Promise which resolves if the data was persisted.
- */
- async syncToDatabase(userTuples) {
- if (this.syncToDatabasePromise) {
- _logger.logger.warn("Skipping syncToDatabase() as persist already in flight");
- this.pendingUserPresenceData.push(...userTuples);
- return this.syncToDatabasePromise;
- }
- userTuples.unshift(...this.pendingUserPresenceData);
- this.syncToDatabasePromise = this.doSyncToDatabase(userTuples);
- return this.syncToDatabasePromise;
- }
- async doSyncToDatabase(userTuples) {
- try {
- const syncData = this.syncAccumulator.getJSON(true);
- await Promise.all([this.persistUserPresenceEvents(userTuples), this.persistAccountData(syncData.accountData), this.persistSyncData(syncData.nextBatch, syncData.roomsData)]);
- } finally {
- this.syncToDatabasePromise = undefined;
- }
- }
-
- /**
- * Persist rooms /sync data along with the next batch token.
- * @param nextBatch - The next_batch /sync value.
- * @param roomsData - The 'rooms' /sync data from a SyncAccumulator
- * @returns Promise which resolves if the data was persisted.
- */
- persistSyncData(nextBatch, roomsData) {
- _logger.logger.log("Persisting sync data up to", nextBatch);
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["sync"], "readwrite");
- const store = txn.objectStore("sync");
- store.put({
- clobber: "-",
- // constant key so will always clobber
- nextBatch,
- roomsData
- }); // put == UPSERT
- return txnAsPromise(txn).then(() => {
- _logger.logger.log("Persisted sync data up to", nextBatch);
- });
- });
- }
-
- /**
- * Persist a list of account data events. Events with the same 'type' will
- * be replaced.
- * @param accountData - An array of raw user-scoped account data events
- * @returns Promise which resolves if the events were persisted.
- */
- persistAccountData(accountData) {
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["accountData"], "readwrite");
- const store = txn.objectStore("accountData");
- for (const event of accountData) {
- store.put(event); // put == UPSERT
- }
-
- return txnAsPromise(txn).then();
- });
- }
-
- /**
- * Persist a list of [user id, presence event] they are for.
- * Users with the same 'userId' will be replaced.
- * Presence events should be the event in its raw form (not the Event
- * object)
- * @param tuples - An array of [userid, event] tuples
- * @returns Promise which resolves if the users were persisted.
- */
- persistUserPresenceEvents(tuples) {
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["users"], "readwrite");
- const store = txn.objectStore("users");
- for (const tuple of tuples) {
- store.put({
- userId: tuple[0],
- event: tuple[1]
- }); // put == UPSERT
- }
-
- return txnAsPromise(txn).then();
- });
- }
-
- /**
- * Load all user presence events from the database. This is not cached.
- * FIXME: It would probably be more sensible to store the events in the
- * sync.
- * @returns A list of presence events in their raw form.
- */
- getUserPresenceEvents() {
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["users"], "readonly");
- const store = txn.objectStore("users");
- return selectQuery(store, undefined, cursor => {
- return [cursor.value.userId, cursor.value.event];
- });
- });
- }
-
- /**
- * Load all the account data events from the database. This is not cached.
- * @returns A list of raw global account events.
- */
- loadAccountData() {
- _logger.logger.log(`LocalIndexedDBStoreBackend: loading account data...`);
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["accountData"], "readonly");
- const store = txn.objectStore("accountData");
- return selectQuery(store, undefined, cursor => {
- return cursor.value;
- }).then(result => {
- _logger.logger.log(`LocalIndexedDBStoreBackend: loaded account data`);
- return result;
- });
- });
- }
-
- /**
- * Load the sync data from the database.
- * @returns An object with "roomsData" and "nextBatch" keys.
- */
- loadSyncData() {
- _logger.logger.log(`LocalIndexedDBStoreBackend: loading sync data...`);
- return utils.promiseTry(() => {
- const txn = this.db.transaction(["sync"], "readonly");
- const store = txn.objectStore("sync");
- return selectQuery(store, undefined, cursor => {
- return cursor.value;
- }).then(results => {
- _logger.logger.log(`LocalIndexedDBStoreBackend: loaded sync data`);
- if (results.length > 1) {
- _logger.logger.warn("loadSyncData: More than 1 sync row found.");
- }
- return results.length > 0 ? results[0] : {};
- });
- });
- }
- getClientOptions() {
- return Promise.resolve().then(() => {
- const txn = this.db.transaction(["client_options"], "readonly");
- const store = txn.objectStore("client_options");
- return selectQuery(store, undefined, cursor => {
- var _cursor$value;
- return (_cursor$value = cursor.value) === null || _cursor$value === void 0 ? void 0 : _cursor$value.options;
- }).then(results => results[0]);
- });
- }
- async storeClientOptions(options) {
- const txn = this.db.transaction(["client_options"], "readwrite");
- const store = txn.objectStore("client_options");
- store.put({
- clobber: "-",
- // constant key so will always clobber
- options: options
- }); // put == UPSERT
- await txnAsPromise(txn);
- }
- async saveToDeviceBatches(batches) {
- const txn = this.db.transaction(["to_device_queue"], "readwrite");
- const store = txn.objectStore("to_device_queue");
- for (const batch of batches) {
- store.add(batch);
- }
- await txnAsPromise(txn);
- }
- async getOldestToDeviceBatch() {
- const txn = this.db.transaction(["to_device_queue"], "readonly");
- const store = txn.objectStore("to_device_queue");
- const cursor = await reqAsCursorPromise(store.openCursor());
- if (!cursor) return null;
- const resultBatch = cursor.value;
- return {
- id: cursor.key,
- txnId: resultBatch.txnId,
- eventType: resultBatch.eventType,
- batch: resultBatch.batch
- };
- }
- async removeToDeviceBatch(id) {
- const txn = this.db.transaction(["to_device_queue"], "readwrite");
- const store = txn.objectStore("to_device_queue");
- store.delete(id);
- await txnAsPromise(txn);
- }
-}
-exports.LocalIndexedDBStoreBackend = LocalIndexedDBStoreBackend;
-//# sourceMappingURL=indexeddb-local-backend.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map
deleted file mode 100644
index ae1d65b..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-local-backend.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-local-backend.js","names":["_syncAccumulator","require","utils","_interopRequireWildcard","IndexedDBHelpers","_logger","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DB_MIGRATIONS","db","createObjectStore","keyPath","oobMembersStore","createIndex","autoIncrement","VERSION","length","selectQuery","store","keyRange","resultMapper","query","openCursor","Promise","resolve","reject","results","onerror","Error","error","onsuccess","cursor","result","push","continue","txnAsPromise","txn","oncomplete","event","reqAsEventPromise","req","reqAsPromise","err","reqAsCursorPromise","then","LocalIndexedDBStoreBackend","exists","indexedDB","dbName","constructor","_defineProperty2","syncAccumulator","SyncAccumulator","connect","onClose","disconnected","logger","log","open","onupgradeneeded","ev","oldVersion","_isNewlyCreated","forEach","migration","index","onblocked","onversionchange","_this$db","close","undefined","onclose","init","isNewlyCreated","all","loadAccountData","loadSyncData","accountData","syncData","accumulate","next_batch","nextBatch","rooms","roomsData","account_data","events","getOutOfBandMembers","roomId","tx","transaction","objectStore","roomIndex","range","IDBKeyRange","only","request","membershipEvents","oobWritten","record","value","oob_written","setOutOfBandMembers","e","put","markerObject","room_id","state_key","clearOutOfBandMembers","readTx","roomRange","minStateKeyProm","openKeyCursor","primaryKey","maxStateKeyProm","minStateKey","maxStateKey","writeTx","writeStore","membersKeyRange","bound","delete","clearDatabase","deleteDatabase","warn","getSavedSync","copy","data","getJSON","deepCopy","getNextBatchToken","setSyncData","syncToDatabase","userTuples","syncToDatabasePromise","pendingUserPresenceData","unshift","doSyncToDatabase","persistUserPresenceEvents","persistAccountData","persistSyncData","promiseTry","clobber","tuples","tuple","userId","getUserPresenceEvents","getClientOptions","_cursor$value","options","storeClientOptions","saveToDeviceBatches","batches","batch","add","getOldestToDeviceBatch","resultBatch","id","txnId","eventType","removeToDeviceBatch","exports"],"sources":["../../src/store/indexeddb-local-backend.ts"],"sourcesContent":["/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { IMinimalEvent, ISyncData, ISyncResponse, SyncAccumulator } from \"../sync-accumulator\";\nimport * as utils from \"../utils\";\nimport * as IndexedDBHelpers from \"../indexeddb-helpers\";\nimport { logger } from \"../logger\";\nimport { IStateEventWithRoomId, IStoredClientOpts } from \"../matrix\";\nimport { ISavedSync } from \"./index\";\nimport { IIndexedDBBackend, UserTuple } from \"./indexeddb-backend\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\n\ntype DbMigration = (db: IDBDatabase) => void;\nconst DB_MIGRATIONS: DbMigration[] = [\n (db): void => {\n // Make user store, clobber based on user ID. (userId property of User objects)\n db.createObjectStore(\"users\", { keyPath: [\"userId\"] });\n\n // Make account data store, clobber based on event type.\n // (event.type property of MatrixEvent objects)\n db.createObjectStore(\"accountData\", { keyPath: [\"type\"] });\n\n // Make /sync store (sync tokens, room data, etc), always clobber (const key).\n db.createObjectStore(\"sync\", { keyPath: [\"clobber\"] });\n },\n (db): void => {\n const oobMembersStore = db.createObjectStore(\"oob_membership_events\", {\n keyPath: [\"room_id\", \"state_key\"],\n });\n oobMembersStore.createIndex(\"room\", \"room_id\");\n },\n (db): void => {\n db.createObjectStore(\"client_options\", { keyPath: [\"clobber\"] });\n },\n (db): void => {\n db.createObjectStore(\"to_device_queue\", { autoIncrement: true });\n },\n // Expand as needed.\n];\nconst VERSION = DB_MIGRATIONS.length;\n\n/**\n * Helper method to collect results from a Cursor and promiseify it.\n * @param store - The store to perform openCursor on.\n * @param keyRange - Optional key range to apply on the cursor.\n * @param resultMapper - A function which is repeatedly called with a\n * Cursor.\n * Return the data you want to keep.\n * @returns Promise which resolves to an array of whatever you returned from\n * resultMapper.\n */\nfunction selectQuery<T>(\n store: IDBObjectStore,\n keyRange: IDBKeyRange | IDBValidKey | undefined,\n resultMapper: (cursor: IDBCursorWithValue) => T,\n): Promise<T[]> {\n const query = store.openCursor(keyRange);\n return new Promise((resolve, reject) => {\n const results: T[] = [];\n query.onerror = (): void => {\n reject(new Error(\"Query failed: \" + query.error));\n };\n // collect results\n query.onsuccess = (): void => {\n const cursor = query.result;\n if (!cursor) {\n resolve(results);\n return; // end of results\n }\n results.push(resultMapper(cursor));\n cursor.continue();\n };\n });\n}\n\nfunction txnAsPromise(txn: IDBTransaction): Promise<Event> {\n return new Promise((resolve, reject) => {\n txn.oncomplete = function (event): void {\n resolve(event);\n };\n txn.onerror = function (): void {\n reject(txn.error);\n };\n });\n}\n\nfunction reqAsEventPromise(req: IDBRequest): Promise<Event> {\n return new Promise((resolve, reject) => {\n req.onsuccess = function (event): void {\n resolve(event);\n };\n req.onerror = function (): void {\n reject(req.error);\n };\n });\n}\n\nfunction reqAsPromise(req: IDBRequest): Promise<IDBRequest> {\n return new Promise((resolve, reject) => {\n req.onsuccess = (): void => resolve(req);\n req.onerror = (err): void => reject(err);\n });\n}\n\nfunction reqAsCursorPromise<T>(req: IDBRequest<T>): Promise<T> {\n return reqAsEventPromise(req).then((event) => req.result);\n}\n\nexport class LocalIndexedDBStoreBackend implements IIndexedDBBackend {\n public static exists(indexedDB: IDBFactory, dbName: string): Promise<boolean> {\n dbName = \"matrix-js-sdk:\" + (dbName || \"default\");\n return IndexedDBHelpers.exists(indexedDB, dbName);\n }\n\n private readonly dbName: string;\n private readonly syncAccumulator: SyncAccumulator;\n private db?: IDBDatabase;\n private disconnected = true;\n private _isNewlyCreated = false;\n private syncToDatabasePromise?: Promise<void>;\n private pendingUserPresenceData: UserTuple[] = [];\n\n /**\n * Does the actual reading from and writing to the indexeddb\n *\n * Construct a new Indexed Database store backend. This requires a call to\n * `connect()` before this store can be used.\n * @param indexedDB - The Indexed DB interface e.g\n * `window.indexedDB`\n * @param dbName - Optional database name. The same name must be used\n * to open the same database.\n */\n public constructor(private readonly indexedDB: IDBFactory, dbName = \"default\") {\n this.dbName = \"matrix-js-sdk:\" + dbName;\n this.syncAccumulator = new SyncAccumulator();\n }\n\n /**\n * Attempt to connect to the database. This can fail if the user does not\n * grant permission.\n * @returns Promise which resolves if successfully connected.\n */\n public connect(onClose?: () => void): Promise<void> {\n if (!this.disconnected) {\n logger.log(`LocalIndexedDBStoreBackend.connect: already connected or connecting`);\n return Promise.resolve();\n }\n\n this.disconnected = false;\n\n logger.log(`LocalIndexedDBStoreBackend.connect: connecting...`);\n const req = this.indexedDB.open(this.dbName, VERSION);\n req.onupgradeneeded = (ev): void => {\n const db = req.result;\n const oldVersion = ev.oldVersion;\n logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${oldVersion}`);\n if (oldVersion < 1) {\n // The database did not previously exist\n this._isNewlyCreated = true;\n }\n DB_MIGRATIONS.forEach((migration, index) => {\n if (oldVersion <= index) migration(db);\n });\n };\n\n req.onblocked = (): void => {\n logger.log(`can't yet open LocalIndexedDBStoreBackend because it is open elsewhere`);\n };\n\n logger.log(`LocalIndexedDBStoreBackend.connect: awaiting connection...`);\n return reqAsEventPromise(req).then(async () => {\n logger.log(`LocalIndexedDBStoreBackend.connect: connected`);\n this.db = req.result;\n\n // add a poorly-named listener for when deleteDatabase is called\n // so we can close our db connections.\n this.db.onversionchange = (): void => {\n this.db?.close(); // this does not call onclose\n this.disconnected = true;\n this.db = undefined;\n onClose?.();\n };\n this.db.onclose = (): void => {\n this.disconnected = true;\n this.db = undefined;\n onClose?.();\n };\n\n await this.init();\n });\n }\n\n /** @returns whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise<boolean> {\n return Promise.resolve(this._isNewlyCreated);\n }\n\n /**\n * Having connected, load initial data from the database and prepare for use\n * @returns Promise which resolves on success\n */\n private init(): Promise<unknown> {\n return Promise.all([this.loadAccountData(), this.loadSyncData()]).then(([accountData, syncData]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded initial data`);\n this.syncAccumulator.accumulate(\n {\n next_batch: syncData.nextBatch,\n rooms: syncData.roomsData,\n account_data: {\n events: accountData,\n },\n },\n true,\n );\n });\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @returns the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null> {\n return new Promise<IStateEventWithRoomId[] | null>((resolve, reject) => {\n const tx = this.db!.transaction([\"oob_membership_events\"], \"readonly\");\n const store = tx.objectStore(\"oob_membership_events\");\n const roomIndex = store.index(\"room\");\n const range = IDBKeyRange.only(roomId);\n const request = roomIndex.openCursor(range);\n\n const membershipEvents: IStateEventWithRoomId[] = [];\n // did we encounter the oob_written marker object\n // amongst the results? That means OOB member\n // loading already happened for this room\n // but there were no members to persist as they\n // were all known already\n let oobWritten = false;\n\n request.onsuccess = (): void => {\n const cursor = request.result;\n if (!cursor) {\n // Unknown room\n if (!membershipEvents.length && !oobWritten) {\n return resolve(null);\n }\n return resolve(membershipEvents);\n }\n const record = cursor.value;\n if (record.oob_written) {\n oobWritten = true;\n } else {\n membershipEvents.push(record);\n }\n cursor.continue();\n };\n request.onerror = (err): void => {\n reject(err);\n };\n }).then((events) => {\n logger.log(`LL: got ${events?.length} membershipEvents from storage for room ${roomId} ...`);\n return events;\n });\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param membershipEvents - the membership events to store\n */\n public async setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void> {\n logger.log(`LL: backend about to store ${membershipEvents.length}` + ` members for ${roomId}`);\n const tx = this.db!.transaction([\"oob_membership_events\"], \"readwrite\");\n const store = tx.objectStore(\"oob_membership_events\");\n membershipEvents.forEach((e) => {\n store.put(e);\n });\n // aside from all the events, we also write a marker object to the store\n // to mark the fact that OOB members have been written for this room.\n // It's possible that 0 members need to be written as all where previously know\n // but we still need to know whether to return null or [] from getOutOfBandMembers\n // where null means out of band members haven't been stored yet for this room\n const markerObject = {\n room_id: roomId,\n oob_written: true,\n state_key: 0,\n };\n store.put(markerObject);\n await txnAsPromise(tx);\n logger.log(`LL: backend done storing for ${roomId}!`);\n }\n\n public async clearOutOfBandMembers(roomId: string): Promise<void> {\n // the approach to delete all members for a room\n // is to get the min and max state key from the index\n // for that room, and then delete between those\n // keys in the store.\n // this should be way faster than deleting every member\n // individually for a large room.\n const readTx = this.db!.transaction([\"oob_membership_events\"], \"readonly\");\n const store = readTx.objectStore(\"oob_membership_events\");\n const roomIndex = store.index(\"room\");\n const roomRange = IDBKeyRange.only(roomId);\n\n const minStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, \"next\")).then(\n (cursor) => (<IDBValidKey[]>cursor?.primaryKey)[1],\n );\n const maxStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, \"prev\")).then(\n (cursor) => (<IDBValidKey[]>cursor?.primaryKey)[1],\n );\n const [minStateKey, maxStateKey] = await Promise.all([minStateKeyProm, maxStateKeyProm]);\n\n const writeTx = this.db!.transaction([\"oob_membership_events\"], \"readwrite\");\n const writeStore = writeTx.objectStore(\"oob_membership_events\");\n const membersKeyRange = IDBKeyRange.bound([roomId, minStateKey], [roomId, maxStateKey]);\n\n logger.log(\n `LL: Deleting all users + marker in storage for room ${roomId}, with key range:`,\n [roomId, minStateKey],\n [roomId, maxStateKey],\n );\n await reqAsPromise(writeStore.delete(membersKeyRange));\n }\n\n /**\n * Clear the entire database. This should be used when logging out of a client\n * to prevent mixing data between accounts.\n * @returns Resolved when the database is cleared.\n */\n public clearDatabase(): Promise<void> {\n return new Promise((resolve) => {\n logger.log(`Removing indexeddb instance: ${this.dbName}`);\n const req = this.indexedDB.deleteDatabase(this.dbName);\n\n req.onblocked = (): void => {\n logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`);\n };\n\n req.onerror = (): void => {\n // in firefox, with indexedDB disabled, this fails with a\n // DOMError. We treat this as non-fatal, so that we can still\n // use the app.\n logger.warn(`unable to delete js-sdk store indexeddb: ${req.error}`);\n resolve();\n };\n\n req.onsuccess = (): void => {\n logger.log(`Removed indexeddb instance: ${this.dbName}`);\n resolve();\n };\n });\n }\n\n /**\n * @param copy - If false, the data returned is from internal\n * buffers and must not be mutated. Otherwise, a copy is made before\n * returning such that the data can be safely mutated. Default: true.\n *\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(copy = true): Promise<ISavedSync | null> {\n const data = this.syncAccumulator.getJSON();\n if (!data.nextBatch) return Promise.resolve(null);\n if (copy) {\n // We must deep copy the stored data so that the /sync processing code doesn't\n // corrupt the internal state of the sync accumulator (it adds non-clonable keys)\n return Promise.resolve(utils.deepCopy(data));\n } else {\n return Promise.resolve(data);\n }\n }\n\n public getNextBatchToken(): Promise<string> {\n return Promise.resolve(this.syncAccumulator.getNextBatchToken());\n }\n\n public setSyncData(syncData: ISyncResponse): Promise<void> {\n return Promise.resolve().then(() => {\n this.syncAccumulator.accumulate(syncData);\n });\n }\n\n /**\n * Sync users and all accumulated sync data to the database.\n * If a previous sync is in flight, the new data will be added to the\n * next sync and the current sync's promise will be returned.\n * @param userTuples - The user tuples\n * @returns Promise which resolves if the data was persisted.\n */\n public async syncToDatabase(userTuples: UserTuple[]): Promise<void> {\n if (this.syncToDatabasePromise) {\n logger.warn(\"Skipping syncToDatabase() as persist already in flight\");\n this.pendingUserPresenceData.push(...userTuples);\n return this.syncToDatabasePromise;\n }\n userTuples.unshift(...this.pendingUserPresenceData);\n this.syncToDatabasePromise = this.doSyncToDatabase(userTuples);\n return this.syncToDatabasePromise;\n }\n\n private async doSyncToDatabase(userTuples: UserTuple[]): Promise<void> {\n try {\n const syncData = this.syncAccumulator.getJSON(true);\n await Promise.all([\n this.persistUserPresenceEvents(userTuples),\n this.persistAccountData(syncData.accountData),\n this.persistSyncData(syncData.nextBatch, syncData.roomsData),\n ]);\n } finally {\n this.syncToDatabasePromise = undefined;\n }\n }\n\n /**\n * Persist rooms /sync data along with the next batch token.\n * @param nextBatch - The next_batch /sync value.\n * @param roomsData - The 'rooms' /sync data from a SyncAccumulator\n * @returns Promise which resolves if the data was persisted.\n */\n private persistSyncData(nextBatch: string, roomsData: ISyncResponse[\"rooms\"]): Promise<void> {\n logger.log(\"Persisting sync data up to\", nextBatch);\n return utils.promiseTry<void>(() => {\n const txn = this.db!.transaction([\"sync\"], \"readwrite\");\n const store = txn.objectStore(\"sync\");\n store.put({\n clobber: \"-\", // constant key so will always clobber\n nextBatch,\n roomsData,\n }); // put == UPSERT\n return txnAsPromise(txn).then(() => {\n logger.log(\"Persisted sync data up to\", nextBatch);\n });\n });\n }\n\n /**\n * Persist a list of account data events. Events with the same 'type' will\n * be replaced.\n * @param accountData - An array of raw user-scoped account data events\n * @returns Promise which resolves if the events were persisted.\n */\n private persistAccountData(accountData: IMinimalEvent[]): Promise<void> {\n return utils.promiseTry<void>(() => {\n const txn = this.db!.transaction([\"accountData\"], \"readwrite\");\n const store = txn.objectStore(\"accountData\");\n for (const event of accountData) {\n store.put(event); // put == UPSERT\n }\n return txnAsPromise(txn).then();\n });\n }\n\n /**\n * Persist a list of [user id, presence event] they are for.\n * Users with the same 'userId' will be replaced.\n * Presence events should be the event in its raw form (not the Event\n * object)\n * @param tuples - An array of [userid, event] tuples\n * @returns Promise which resolves if the users were persisted.\n */\n private persistUserPresenceEvents(tuples: UserTuple[]): Promise<void> {\n return utils.promiseTry<void>(() => {\n const txn = this.db!.transaction([\"users\"], \"readwrite\");\n const store = txn.objectStore(\"users\");\n for (const tuple of tuples) {\n store.put({\n userId: tuple[0],\n event: tuple[1],\n }); // put == UPSERT\n }\n return txnAsPromise(txn).then();\n });\n }\n\n /**\n * Load all user presence events from the database. This is not cached.\n * FIXME: It would probably be more sensible to store the events in the\n * sync.\n * @returns A list of presence events in their raw form.\n */\n public getUserPresenceEvents(): Promise<UserTuple[]> {\n return utils.promiseTry<UserTuple[]>(() => {\n const txn = this.db!.transaction([\"users\"], \"readonly\");\n const store = txn.objectStore(\"users\");\n return selectQuery(store, undefined, (cursor) => {\n return [cursor.value.userId, cursor.value.event];\n });\n });\n }\n\n /**\n * Load all the account data events from the database. This is not cached.\n * @returns A list of raw global account events.\n */\n private loadAccountData(): Promise<IMinimalEvent[]> {\n logger.log(`LocalIndexedDBStoreBackend: loading account data...`);\n return utils.promiseTry<IMinimalEvent[]>(() => {\n const txn = this.db!.transaction([\"accountData\"], \"readonly\");\n const store = txn.objectStore(\"accountData\");\n return selectQuery(store, undefined, (cursor) => {\n return cursor.value;\n }).then((result: IMinimalEvent[]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded account data`);\n return result;\n });\n });\n }\n\n /**\n * Load the sync data from the database.\n * @returns An object with \"roomsData\" and \"nextBatch\" keys.\n */\n private loadSyncData(): Promise<ISyncData> {\n logger.log(`LocalIndexedDBStoreBackend: loading sync data...`);\n return utils.promiseTry<ISyncData>(() => {\n const txn = this.db!.transaction([\"sync\"], \"readonly\");\n const store = txn.objectStore(\"sync\");\n return selectQuery(store, undefined, (cursor) => {\n return cursor.value;\n }).then((results: ISyncData[]) => {\n logger.log(`LocalIndexedDBStoreBackend: loaded sync data`);\n if (results.length > 1) {\n logger.warn(\"loadSyncData: More than 1 sync row found.\");\n }\n return results.length > 0 ? results[0] : ({} as ISyncData);\n });\n });\n }\n\n public getClientOptions(): Promise<IStoredClientOpts | undefined> {\n return Promise.resolve().then(() => {\n const txn = this.db!.transaction([\"client_options\"], \"readonly\");\n const store = txn.objectStore(\"client_options\");\n return selectQuery(store, undefined, (cursor) => {\n return cursor.value?.options;\n }).then((results) => results[0]);\n });\n }\n\n public async storeClientOptions(options: IStoredClientOpts): Promise<void> {\n const txn = this.db!.transaction([\"client_options\"], \"readwrite\");\n const store = txn.objectStore(\"client_options\");\n store.put({\n clobber: \"-\", // constant key so will always clobber\n options: options,\n }); // put == UPSERT\n await txnAsPromise(txn);\n }\n\n public async saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void> {\n const txn = this.db!.transaction([\"to_device_queue\"], \"readwrite\");\n const store = txn.objectStore(\"to_device_queue\");\n for (const batch of batches) {\n store.add(batch);\n }\n await txnAsPromise(txn);\n }\n\n public async getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null> {\n const txn = this.db!.transaction([\"to_device_queue\"], \"readonly\");\n const store = txn.objectStore(\"to_device_queue\");\n const cursor = await reqAsCursorPromise(store.openCursor());\n if (!cursor) return null;\n\n const resultBatch = cursor.value as ToDeviceBatchWithTxnId;\n\n return {\n id: cursor.key as number,\n txnId: resultBatch.txnId,\n eventType: resultBatch.eventType,\n batch: resultBatch.batch,\n };\n }\n\n public async removeToDeviceBatch(id: number): Promise<void> {\n const txn = this.db!.transaction([\"to_device_queue\"], \"readwrite\");\n const store = txn.objectStore(\"to_device_queue\");\n store.delete(id);\n await txnAsPromise(txn);\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAmC,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,C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AG,CAACsD,WAAW,CAAC,iBAAiB,CAAC;IAChD,MAAM3D,MAAM,GAAG,MAAMY,kBAAkB,CAACzB,KAAK,CAACI,UAAU,EAAE,CAAC;IAC3D,IAAI,CAACS,MAAM,EAAE,OAAO,IAAI;IAExB,MAAM4H,WAAW,GAAG5H,MAAM,CAACoE,KAA+B;IAE1D,OAAO;MACHyD,EAAE,EAAE7H,MAAM,CAAC7B,GAAa;MACxB2J,KAAK,EAAEF,WAAW,CAACE,KAAK;MACxBC,SAAS,EAAEH,WAAW,CAACG,SAAS;MAChCN,KAAK,EAAEG,WAAW,CAACH;IACvB,CAAC;EACL;EAEA,MAAaO,mBAAmBA,CAACH,EAAU,EAAiB;IACxD,MAAMxH,GAAG,GAAG,IAAI,CAAC3B,EAAE,CAAEgF,WAAW,CAAC,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAClE,MAAMvE,KAAK,GAAGkB,GAAG,CAACsD,WAAW,CAAC,iBAAiB,CAAC;IAChDxE,KAAK,CAACsG,MAAM,CAACoC,EAAE,CAAC;IAChB,MAAMzH,YAAY,CAACC,GAAG,CAAC;EAC3B;AACJ;AAAC4H,OAAA,CAAAnH,0BAAA,GAAAA,0BAAA"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts
deleted file mode 100644
index 1661f27..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import { ISavedSync } from "./index";
-import { IStoredClientOpts } from "../client";
-import { IStateEventWithRoomId, ISyncResponse } from "../matrix";
-import { IIndexedDBBackend, UserTuple } from "./indexeddb-backend";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-export declare class RemoteIndexedDBStoreBackend implements IIndexedDBBackend {
- private readonly workerFactory;
- private readonly dbName?;
- private worker?;
- private nextSeq;
- private inFlight;
- private startPromise?;
- private onClose;
- /**
- * An IndexedDB store backend where the actual backend sits in a web
- * worker.
- *
- * Construct a new Indexed Database store backend. This requires a call to
- * `connect()` before this store can be used.
- * @param workerFactory - Factory which produces a Worker
- * @param dbName - Optional database name. The same name must be used
- * to open the same database.
- */
- constructor(workerFactory: () => Worker, dbName?: string | undefined);
- /**
- * Attempt to connect to the database. This can fail if the user does not
- * grant permission.
- * @returns Promise which resolves if successfully connected.
- */
- connect(onClose?: () => void): Promise<void>;
- /**
- * Clear the entire database. This should be used when logging out of a client
- * to prevent mixing data between accounts.
- * @returns Resolved when the database is cleared.
- */
- clearDatabase(): Promise<void>;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated(): Promise<boolean>;
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(): Promise<ISavedSync>;
- getNextBatchToken(): Promise<string>;
- setSyncData(syncData: ISyncResponse): Promise<void>;
- syncToDatabase(userTuples: UserTuple[]): Promise<void>;
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(roomId: string): Promise<void>;
- getClientOptions(): Promise<IStoredClientOpts | undefined>;
- storeClientOptions(options: IStoredClientOpts): Promise<void>;
- /**
- * Load all user presence events from the database. This is not cached.
- * @returns A list of presence events in their raw form.
- */
- getUserPresenceEvents(): Promise<UserTuple[]>;
- saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
- private ensureStarted;
- private doCmd;
- private onWorkerMessage;
-}
-//# sourceMappingURL=indexeddb-remote-backend.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map
deleted file mode 100644
index 0758468..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-remote-backend.d.ts","sourceRoot":"","sources":["../../src/store/indexeddb-remote-backend.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEzF,qBAAa,2BAA4B,YAAW,iBAAiB;IAqB9C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAAgB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IApBzF,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,OAAO,CAAK;IAEpB,OAAO,CAAC,QAAQ,CAAsC;IAGtD,OAAO,CAAC,YAAY,CAAC,CAAgB;IAErC,OAAO,CAAC,OAAO;IAEf;;;;;;;;;OASG;gBACiC,aAAa,EAAE,MAAM,MAAM,EAAmB,MAAM,CAAC,oBAAQ;IAEjG;;;;OAIG;IACI,OAAO,CAAC,OAAO,CAAC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/matrix-js-sdk/lib/store/indexeddb-remote-backend.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js
deleted file mode 100644
index 702d6ac..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js
+++ /dev/null
@@ -1,199 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.RemoteIndexedDBStoreBackend = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-var _logger = require("../logger");
-var _utils = require("../utils");
-/*
-Copyright 2017 - 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-class RemoteIndexedDBStoreBackend {
- // The currently in-flight requests to the actual backend
- // seq: promise
- // Once we start connecting, we keep the promise and re-use it
- // if we try to connect again
-
- // Callback for when the IndexedDB gets closed unexpectedly
-
- /**
- * An IndexedDB store backend where the actual backend sits in a web
- * worker.
- *
- * Construct a new Indexed Database store backend. This requires a call to
- * `connect()` before this store can be used.
- * @param workerFactory - Factory which produces a Worker
- * @param dbName - Optional database name. The same name must be used
- * to open the same database.
- */
- constructor(workerFactory, dbName) {
- this.workerFactory = workerFactory;
- this.dbName = dbName;
- (0, _defineProperty2.default)(this, "worker", void 0);
- (0, _defineProperty2.default)(this, "nextSeq", 0);
- (0, _defineProperty2.default)(this, "inFlight", {});
- (0, _defineProperty2.default)(this, "startPromise", void 0);
- (0, _defineProperty2.default)(this, "onWorkerMessage", ev => {
- const msg = ev.data;
- if (msg.command == "closed") {
- var _this$onClose;
- (_this$onClose = this.onClose) === null || _this$onClose === void 0 ? void 0 : _this$onClose.call(this);
- } else if (msg.command == "cmd_success" || msg.command == "cmd_fail") {
- if (msg.seq === undefined) {
- _logger.logger.error("Got reply from worker with no seq");
- return;
- }
- const def = this.inFlight[msg.seq];
- if (def === undefined) {
- _logger.logger.error("Got reply for unknown seq " + msg.seq);
- return;
- }
- delete this.inFlight[msg.seq];
- if (msg.command == "cmd_success") {
- def.resolve(msg.result);
- } else {
- const error = new Error(msg.error.message);
- error.name = msg.error.name;
- def.reject(error);
- }
- } else {
- _logger.logger.warn("Unrecognised message from worker: ", msg);
- }
- });
- }
-
- /**
- * Attempt to connect to the database. This can fail if the user does not
- * grant permission.
- * @returns Promise which resolves if successfully connected.
- */
- connect(onClose) {
- this.onClose = onClose;
- return this.ensureStarted().then(() => this.doCmd("connect"));
- }
-
- /**
- * Clear the entire database. This should be used when logging out of a client
- * to prevent mixing data between accounts.
- * @returns Resolved when the database is cleared.
- */
- clearDatabase() {
- return this.ensureStarted().then(() => this.doCmd("clearDatabase"));
- }
-
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated() {
- return this.doCmd("isNewlyCreated");
- }
-
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync() {
- return this.doCmd("getSavedSync");
- }
- getNextBatchToken() {
- return this.doCmd("getNextBatchToken");
- }
- setSyncData(syncData) {
- return this.doCmd("setSyncData", [syncData]);
- }
- syncToDatabase(userTuples) {
- return this.doCmd("syncToDatabase", [userTuples]);
- }
-
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId) {
- return this.doCmd("getOutOfBandMembers", [roomId]);
- }
-
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers(roomId, membershipEvents) {
- return this.doCmd("setOutOfBandMembers", [roomId, membershipEvents]);
- }
- clearOutOfBandMembers(roomId) {
- return this.doCmd("clearOutOfBandMembers", [roomId]);
- }
- getClientOptions() {
- return this.doCmd("getClientOptions");
- }
- storeClientOptions(options) {
- return this.doCmd("storeClientOptions", [options]);
- }
-
- /**
- * Load all user presence events from the database. This is not cached.
- * @returns A list of presence events in their raw form.
- */
- getUserPresenceEvents() {
- return this.doCmd("getUserPresenceEvents");
- }
- async saveToDeviceBatches(batches) {
- return this.doCmd("saveToDeviceBatches", [batches]);
- }
- async getOldestToDeviceBatch() {
- return this.doCmd("getOldestToDeviceBatch");
- }
- async removeToDeviceBatch(id) {
- return this.doCmd("removeToDeviceBatch", [id]);
- }
- ensureStarted() {
- if (!this.startPromise) {
- this.worker = this.workerFactory();
- this.worker.onmessage = this.onWorkerMessage;
-
- // tell the worker the db name.
- this.startPromise = this.doCmd("setupWorker", [this.dbName]).then(() => {
- _logger.logger.log("IndexedDB worker is ready");
- });
- }
- return this.startPromise;
- }
- doCmd(command, args) {
- // wrap in a q so if the postMessage throws,
- // the promise automatically gets rejected
- return Promise.resolve().then(() => {
- var _this$worker;
- const seq = this.nextSeq++;
- const def = (0, _utils.defer)();
- this.inFlight[seq] = def;
- (_this$worker = this.worker) === null || _this$worker === void 0 ? void 0 : _this$worker.postMessage({
- command,
- seq,
- args
- });
- return def.promise;
- });
- }
-}
-exports.RemoteIndexedDBStoreBackend = RemoteIndexedDBStoreBackend;
-//# sourceMappingURL=indexeddb-remote-backend.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map
deleted file mode 100644
index be65138..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-remote-backend.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-remote-backend.js","names":["_logger","require","_utils","RemoteIndexedDBStoreBackend","constructor","workerFactory","dbName","_defineProperty2","default","ev","msg","data","command","_this$onClose","onClose","call","seq","undefined","logger","error","def","inFlight","resolve","result","Error","message","name","reject","warn","connect","ensureStarted","then","doCmd","clearDatabase","isNewlyCreated","getSavedSync","getNextBatchToken","setSyncData","syncData","syncToDatabase","userTuples","getOutOfBandMembers","roomId","setOutOfBandMembers","membershipEvents","clearOutOfBandMembers","getClientOptions","storeClientOptions","options","getUserPresenceEvents","saveToDeviceBatches","batches","getOldestToDeviceBatch","removeToDeviceBatch","id","startPromise","worker","onmessage","onWorkerMessage","log","args","Promise","_this$worker","nextSeq","defer","postMessage","promise","exports"],"sources":["../../src/store/indexeddb-remote-backend.ts"],"sourcesContent":["/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { logger } from \"../logger\";\nimport { defer, IDeferred } from \"../utils\";\nimport { ISavedSync } from \"./index\";\nimport { IStoredClientOpts } from \"../client\";\nimport { IStateEventWithRoomId, ISyncResponse } from \"../matrix\";\nimport { IIndexedDBBackend, UserTuple } from \"./indexeddb-backend\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\n\nexport class RemoteIndexedDBStoreBackend implements IIndexedDBBackend {\n private worker?: Worker;\n private nextSeq = 0;\n // The currently in-flight requests to the actual backend\n private inFlight: Record<number, IDeferred<any>> = {}; // seq: promise\n // Once we start connecting, we keep the promise and re-use it\n // if we try to connect again\n private startPromise?: Promise<void>;\n // Callback for when the IndexedDB gets closed unexpectedly\n private onClose?(): void;\n\n /**\n * An IndexedDB store backend where the actual backend sits in a web\n * worker.\n *\n * Construct a new Indexed Database store backend. This requires a call to\n * `connect()` before this store can be used.\n * @param workerFactory - Factory which produces a Worker\n * @param dbName - Optional database name. The same name must be used\n * to open the same database.\n */\n public constructor(private readonly workerFactory: () => Worker, private readonly dbName?: string) {}\n\n /**\n * Attempt to connect to the database. This can fail if the user does not\n * grant permission.\n * @returns Promise which resolves if successfully connected.\n */\n public connect(onClose?: () => void): Promise<void> {\n this.onClose = onClose;\n return this.ensureStarted().then(() => this.doCmd(\"connect\"));\n }\n\n /**\n * Clear the entire database. This should be used when logging out of a client\n * to prevent mixing data between accounts.\n * @returns Resolved when the database is cleared.\n */\n public clearDatabase(): Promise<void> {\n return this.ensureStarted().then(() => this.doCmd(\"clearDatabase\"));\n }\n\n /** @returns whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise<boolean> {\n return this.doCmd(\"isNewlyCreated\");\n }\n\n /**\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise<ISavedSync> {\n return this.doCmd(\"getSavedSync\");\n }\n\n public getNextBatchToken(): Promise<string> {\n return this.doCmd(\"getNextBatchToken\");\n }\n\n public setSyncData(syncData: ISyncResponse): Promise<void> {\n return this.doCmd(\"setSyncData\", [syncData]);\n }\n\n public syncToDatabase(userTuples: UserTuple[]): Promise<void> {\n return this.doCmd(\"syncToDatabase\", [userTuples]);\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @returns the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null> {\n return this.doCmd(\"getOutOfBandMembers\", [roomId]);\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param membershipEvents - the membership events to store\n * @returns when all members have been stored\n */\n public setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void> {\n return this.doCmd(\"setOutOfBandMembers\", [roomId, membershipEvents]);\n }\n\n public clearOutOfBandMembers(roomId: string): Promise<void> {\n return this.doCmd(\"clearOutOfBandMembers\", [roomId]);\n }\n\n public getClientOptions(): Promise<IStoredClientOpts | undefined> {\n return this.doCmd(\"getClientOptions\");\n }\n\n public storeClientOptions(options: IStoredClientOpts): Promise<void> {\n return this.doCmd(\"storeClientOptions\", [options]);\n }\n\n /**\n * Load all user presence events from the database. This is not cached.\n * @returns A list of presence events in their raw form.\n */\n public getUserPresenceEvents(): Promise<UserTuple[]> {\n return this.doCmd(\"getUserPresenceEvents\");\n }\n\n public async saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void> {\n return this.doCmd(\"saveToDeviceBatches\", [batches]);\n }\n\n public async getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null> {\n return this.doCmd(\"getOldestToDeviceBatch\");\n }\n\n public async removeToDeviceBatch(id: number): Promise<void> {\n return this.doCmd(\"removeToDeviceBatch\", [id]);\n }\n\n private ensureStarted(): Promise<void> {\n if (!this.startPromise) {\n this.worker = this.workerFactory();\n this.worker.onmessage = this.onWorkerMessage;\n\n // tell the worker the db name.\n this.startPromise = this.doCmd(\"setupWorker\", [this.dbName]).then(() => {\n logger.log(\"IndexedDB worker is ready\");\n });\n }\n return this.startPromise;\n }\n\n private doCmd<T>(command: string, args?: any): Promise<T> {\n // wrap in a q so if the postMessage throws,\n // the promise automatically gets rejected\n return Promise.resolve().then(() => {\n const seq = this.nextSeq++;\n const def = defer<T>();\n\n this.inFlight[seq] = def;\n\n this.worker?.postMessage({ command, seq, args });\n\n return def.promise;\n });\n }\n\n private onWorkerMessage = (ev: MessageEvent): void => {\n const msg = ev.data;\n\n if (msg.command == \"closed\") {\n this.onClose?.();\n } else if (msg.command == \"cmd_success\" || msg.command == \"cmd_fail\") {\n if (msg.seq === undefined) {\n logger.error(\"Got reply from worker with no seq\");\n return;\n }\n\n const def = this.inFlight[msg.seq];\n if (def === undefined) {\n logger.error(\"Got reply for unknown seq \" + msg.seq);\n return;\n }\n delete this.inFlight[msg.seq];\n\n if (msg.command == \"cmd_success\") {\n def.resolve(msg.result);\n } else {\n const error = new Error(msg.error.message);\n error.name = msg.error.name;\n def.reject(error);\n }\n } else {\n logger.warn(\"Unrecognised message from worker: \", msg);\n }\n };\n}\n"],"mappings":";;;;;;;;AAgBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAME,2BAA2B,CAA8B;EAGlE;EACuD;EACvD;EACA;;EAEA;;EAGA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACWC,WAAWA,CAAkBC,aAA2B,EAAmBC,MAAe,EAAE;IAAA,KAA/DD,aAA2B,GAA3BA,aAA2B;IAAA,KAAmBC,MAAe,GAAfA,MAAe;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,mBAnB/E,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEgC,CAAC,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,2BAiJ1BC,EAAgB,IAAW;MAClD,MAAMC,GAAG,GAAGD,EAAE,CAACE,IAAI;MAEnB,IAAID,GAAG,CAACE,OAAO,IAAI,QAAQ,EAAE;QAAA,IAAAC,aAAA;QACzB,CAAAA,aAAA,OAAI,CAACC,OAAO,cAAAD,aAAA,uBAAZA,aAAA,CAAAE,IAAA,KAAI,CAAY;MACpB,CAAC,MAAM,IAAIL,GAAG,C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AErD,OAAO;QAAEI,GAAG;QAAE4C;MAAK,CAAC,CAAC;MAEhD,OAAOxC,GAAG,CAAC8C,OAAO;IACtB,CAAC,CAAC;EACN;AA+BJ;AAACC,OAAA,CAAAhE,2BAAA,GAAAA,2BAAA"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts
deleted file mode 100644
index ebe093f..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * This class lives in the webworker and drives a LocalIndexedDBStoreBackend
- * controlled by messages from the main process.
- *
- * @example
- * It should be instantiated by a web worker script provided by the application
- * in a script, for example:
- * ```
- * import {IndexedDBStoreWorker} from 'matrix-js-sdk/lib/indexeddb-worker.js';
- * const remoteWorker = new IndexedDBStoreWorker(postMessage);
- * onmessage = remoteWorker.onMessage;
- * ```
- *
- * Note that it is advisable to import this class by referencing the file directly to
- * avoid a dependency on the whole js-sdk.
- *
- */
-export declare class IndexedDBStoreWorker {
- private readonly postMessage;
- private backend?;
- /**
- * @param postMessage - The web worker postMessage function that
- * should be used to communicate back to the main script.
- */
- constructor(postMessage: InstanceType<typeof Worker>["postMessage"]);
- private onClose;
- /**
- * Passes a message event from the main script into the class. This method
- * can be directly assigned to the web worker `onmessage` variable.
- *
- * @param ev - The message event
- */
- onMessage: (ev: MessageEvent) => void;
-}
-//# sourceMappingURL=indexeddb-store-worker.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts.map
deleted file mode 100644
index 5ffb470..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-store-worker.d.ts","sourceRoot":"","sources":["../../src/store/indexeddb-store-worker.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,oBAAoB;IAOV,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN/C,OAAO,CAAC,OAAO,CAAC,CAA6B;IAE7C;;;OAGG;gBACiC,WAAW,EAAE,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC;IAE3F,OAAO,CAAC,OAAO,CAIb;IAEF;;;;;OAKG;IACI,SAAS,OAAQ,YAAY,KAAG,IAAI,CA4FzC;CACL"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js
deleted file mode 100644
index 2032b67..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js
+++ /dev/null
@@ -1,148 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.IndexedDBStoreWorker = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-var _indexeddbLocalBackend = require("./indexeddb-local-backend");
-var _logger = require("../logger");
-/*
-Copyright 2017 - 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-/**
- * This class lives in the webworker and drives a LocalIndexedDBStoreBackend
- * controlled by messages from the main process.
- *
- * @example
- * It should be instantiated by a web worker script provided by the application
- * in a script, for example:
- * ```
- * import {IndexedDBStoreWorker} from 'matrix-js-sdk/lib/indexeddb-worker.js';
- * const remoteWorker = new IndexedDBStoreWorker(postMessage);
- * onmessage = remoteWorker.onMessage;
- * ```
- *
- * Note that it is advisable to import this class by referencing the file directly to
- * avoid a dependency on the whole js-sdk.
- *
- */
-class IndexedDBStoreWorker {
- /**
- * @param postMessage - The web worker postMessage function that
- * should be used to communicate back to the main script.
- */
- constructor(postMessage) {
- this.postMessage = postMessage;
- (0, _defineProperty2.default)(this, "backend", void 0);
- (0, _defineProperty2.default)(this, "onClose", () => {
- this.postMessage.call(null, {
- command: "closed"
- });
- });
- (0, _defineProperty2.default)(this, "onMessage", ev => {
- var _this$backend, _this$backend2, _this$backend3, _this$backend4, _this$backend5, _this$backend6, _this$backend7, _this$backend8, _this$backend9, _this$backend10, _this$backend11, _this$backend12, _this$backend13, _this$backend14, _this$backend15, _this$backend16;
- const msg = ev.data;
- let prom;
- switch (msg.command) {
- case "setupWorker":
- // this is the 'indexedDB' global (where global != window
- // because it's a web worker and there is no window).
- this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(indexedDB, msg.args[0]);
- prom = Promise.resolve();
- break;
- case "connect":
- prom = (_this$backend = this.backend) === null || _this$backend === void 0 ? void 0 : _this$backend.connect(this.onClose);
- break;
- case "isNewlyCreated":
- prom = (_this$backend2 = this.backend) === null || _this$backend2 === void 0 ? void 0 : _this$backend2.isNewlyCreated();
- break;
- case "clearDatabase":
- prom = (_this$backend3 = this.backend) === null || _this$backend3 === void 0 ? void 0 : _this$backend3.clearDatabase();
- break;
- case "getSavedSync":
- prom = (_this$backend4 = this.backend) === null || _this$backend4 === void 0 ? void 0 : _this$backend4.getSavedSync(false);
- break;
- case "setSyncData":
- prom = (_this$backend5 = this.backend) === null || _this$backend5 === void 0 ? void 0 : _this$backend5.setSyncData(msg.args[0]);
- break;
- case "syncToDatabase":
- prom = (_this$backend6 = this.backend) === null || _this$backend6 === void 0 ? void 0 : _this$backend6.syncToDatabase(msg.args[0]);
- break;
- case "getUserPresenceEvents":
- prom = (_this$backend7 = this.backend) === null || _this$backend7 === void 0 ? void 0 : _this$backend7.getUserPresenceEvents();
- break;
- case "getNextBatchToken":
- prom = (_this$backend8 = this.backend) === null || _this$backend8 === void 0 ? void 0 : _this$backend8.getNextBatchToken();
- break;
- case "getOutOfBandMembers":
- prom = (_this$backend9 = this.backend) === null || _this$backend9 === void 0 ? void 0 : _this$backend9.getOutOfBandMembers(msg.args[0]);
- break;
- case "clearOutOfBandMembers":
- prom = (_this$backend10 = this.backend) === null || _this$backend10 === void 0 ? void 0 : _this$backend10.clearOutOfBandMembers(msg.args[0]);
- break;
- case "setOutOfBandMembers":
- prom = (_this$backend11 = this.backend) === null || _this$backend11 === void 0 ? void 0 : _this$backend11.setOutOfBandMembers(msg.args[0], msg.args[1]);
- break;
- case "getClientOptions":
- prom = (_this$backend12 = this.backend) === null || _this$backend12 === void 0 ? void 0 : _this$backend12.getClientOptions();
- break;
- case "storeClientOptions":
- prom = (_this$backend13 = this.backend) === null || _this$backend13 === void 0 ? void 0 : _this$backend13.storeClientOptions(msg.args[0]);
- break;
- case "saveToDeviceBatches":
- prom = (_this$backend14 = this.backend) === null || _this$backend14 === void 0 ? void 0 : _this$backend14.saveToDeviceBatches(msg.args[0]);
- break;
- case "getOldestToDeviceBatch":
- prom = (_this$backend15 = this.backend) === null || _this$backend15 === void 0 ? void 0 : _this$backend15.getOldestToDeviceBatch();
- break;
- case "removeToDeviceBatch":
- prom = (_this$backend16 = this.backend) === null || _this$backend16 === void 0 ? void 0 : _this$backend16.removeToDeviceBatch(msg.args[0]);
- break;
- }
- if (prom === undefined) {
- this.postMessage({
- command: "cmd_fail",
- seq: msg.seq,
- // Can't be an Error because they're not structured cloneable
- error: "Unrecognised command"
- });
- return;
- }
- prom.then(ret => {
- this.postMessage.call(null, {
- command: "cmd_success",
- seq: msg.seq,
- result: ret
- });
- }, err => {
- _logger.logger.error("Error running command: " + msg.command, err);
- this.postMessage.call(null, {
- command: "cmd_fail",
- seq: msg.seq,
- // Just send a string because Error objects aren't cloneable
- error: {
- message: err.message,
- name: err.name
- }
- });
- });
- });
- }
-}
-exports.IndexedDBStoreWorker = IndexedDBStoreWorker;
-//# sourceMappingURL=indexeddb-store-worker.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map
deleted file mode 100644
index 3eca38f..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb-store-worker.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb-store-worker.js","names":["_indexeddbLocalBackend","require","_logger","IndexedDBStoreWorker","constructor","postMessage","_defineProperty2","default","call","command","ev","_this$backend","_this$backend2","_this$backend3","_this$backend4","_this$backend5","_this$backend6","_this$backend7","_this$backend8","_this$backend9","_this$backend10","_this$backend11","_this$backend12","_this$backend13","_this$backend14","_this$backend15","_this$backend16","msg","data","prom","backend","LocalIndexedDBStoreBackend","indexedDB","args","Promise","resolve","connect","onClose","isNewlyCreated","clearDatabase","getSavedSync","setSyncData","syncToDatabase","getUserPresenceEvents","getNextBatchToken","getOutOfBandMembers","clearOutOfBandMembers","setOutOfBandMembers","getClientOptions","storeClientOptions","saveToDeviceBatches","getOldestToDeviceBatch","removeToDeviceBatch","undefined","seq","error","then","ret","result","err","logger","message","name","exports"],"sources":["../../src/store/indexeddb-store-worker.ts"],"sourcesContent":["/*\nCopyright 2017 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { LocalIndexedDBStoreBackend } from \"./indexeddb-local-backend\";\nimport { logger } from \"../logger\";\n\ninterface ICmd {\n command: string;\n seq: number;\n args: any[];\n}\n\n/**\n * This class lives in the webworker and drives a LocalIndexedDBStoreBackend\n * controlled by messages from the main process.\n *\n * @example\n * It should be instantiated by a web worker script provided by the application\n * in a script, for example:\n * ```\n * import {IndexedDBStoreWorker} from 'matrix-js-sdk/lib/indexeddb-worker.js';\n * const remoteWorker = new IndexedDBStoreWorker(postMessage);\n * onmessage = remoteWorker.onMessage;\n * ```\n *\n * Note that it is advisable to import this class by referencing the file directly to\n * avoid a dependency on the whole js-sdk.\n *\n */\nexport class IndexedDBStoreWorker {\n private backend?: LocalIndexedDBStoreBackend;\n\n /**\n * @param postMessage - The web worker postMessage function that\n * should be used to communicate back to the main script.\n */\n public constructor(private readonly postMessage: InstanceType<typeof Worker>[\"postMessage\"]) {}\n\n private onClose = (): void => {\n this.postMessage.call(null, {\n command: \"closed\",\n });\n };\n\n /**\n * Passes a message event from the main script into the class. This method\n * can be directly assigned to the web worker `onmessage` variable.\n *\n * @param ev - The message event\n */\n public onMessage = (ev: MessageEvent): void => {\n const msg: ICmd = ev.data;\n let prom: Promise<any> | undefined;\n\n switch (msg.command) {\n case \"setupWorker\":\n // this is the 'indexedDB' global (where global != window\n // because it's a web worker and there is no window).\n this.backend = new LocalIndexedDBStoreBackend(indexedDB, msg.args[0]);\n prom = Promise.resolve();\n break;\n case \"connect\":\n prom = this.backend?.connect(this.onClose);\n break;\n case \"isNewlyCreated\":\n prom = this.backend?.isNewlyCreated();\n break;\n case \"clearDatabase\":\n prom = this.backend?.clearDatabase();\n break;\n case \"getSavedSync\":\n prom = this.backend?.getSavedSync(false);\n break;\n case \"setSyncData\":\n prom = this.backend?.setSyncData(msg.args[0]);\n break;\n case \"syncToDatabase\":\n prom = this.backend?.syncToDatabase(msg.args[0]);\n break;\n case \"getUserPresenceEvents\":\n prom = this.backend?.getUserPresenceEvents();\n break;\n case \"getNextBatchToken\":\n prom = this.backend?.getNextBatchToken();\n break;\n case \"getOutOfBandMembers\":\n prom = this.backend?.getOutOfBandMembers(msg.args[0]);\n break;\n case \"clearOutOfBandMembers\":\n prom = this.backend?.clearOutOfBandMembers(msg.args[0]);\n break;\n case \"setOutOfBandMembers\":\n prom = this.backend?.setOutOfBandMembers(msg.args[0], msg.args[1]);\n break;\n case \"getClientOptions\":\n prom = this.backend?.getClientOptions();\n break;\n case \"storeClientOptions\":\n prom = this.backend?.storeClientOptions(msg.args[0]);\n break;\n case \"saveToDeviceBatches\":\n prom = this.backend?.saveToDeviceBatches(msg.args[0]);\n break;\n case \"getOldestToDeviceBatch\":\n prom = this.backend?.getOldestToDeviceBatch();\n break;\n case \"removeToDeviceBatch\":\n prom = this.backend?.removeToDeviceBatch(msg.args[0]);\n break;\n }\n\n if (prom === undefined) {\n this.postMessage({\n command: \"cmd_fail\",\n seq: msg.seq,\n // Can't be an Error because they're not structured cloneable\n error: \"Unrecognised command\",\n });\n return;\n }\n\n prom.then(\n (ret) => {\n this.postMessage.call(null, {\n command: \"cmd_success\",\n seq: msg.seq,\n result: ret,\n });\n },\n (err) => {\n logger.error(\"Error running command: \" + msg.command, err);\n this.postMessage.call(null, {\n command: \"cmd_fail\",\n seq: msg.seq,\n // Just send a string because Error objects aren't cloneable\n error: {\n message: err.message,\n name: err.name,\n },\n });\n },\n );\n };\n}\n"],"mappings":";;;;;;;;AAgBA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,oBAAoB,CAAC;EAG9B;AACJ;AACA;AACA;EACWC,WAAWA,CAAkBC,WAAuD,EAAE;IAAA,KAAz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K,CAAC,yBAAyB,GAAG5B,GAAG,CAAClB,OAAO,EAAEkD,GAAG,CAAC;QAC1D,IAAI,CAACtD,WAAW,CAACG,IAAI,CAAC,IAAI,EAAE;UACxBC,OAAO,EAAE,UAAU;UACnB6C,GAAG,EAAE3B,GAAG,CAAC2B,GAAG;UACZ;UACAC,KAAK,EAAE;YACHM,OAAO,EAAEF,GAAG,CAACE,OAAO;YACpBC,IAAI,EAAEH,GAAG,CAACG;UACd;QACJ,CAAC,CAAC;MACN,CAAC,CACJ;IACL,CAAC;EA1G6F;AA2GlG;AAACC,OAAA,CAAA5D,oBAAA,GAAAA,oBAAA"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts
deleted file mode 100644
index 5a52787..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { MemoryStore, IOpts as IBaseOpts } from "./memory";
-import { IEvent } from "../models/event";
-import { ISavedSync } from "./index";
-import { IIndexedDBBackend } from "./indexeddb-backend";
-import { ISyncResponse } from "../sync-accumulator";
-import { TypedEventEmitter } from "../models/typed-event-emitter";
-import { IStateEventWithRoomId } from "../@types/search";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-import { IStoredClientOpts } from "../client";
-interface IOpts extends IBaseOpts {
- /** The Indexed DB interface e.g. `window.indexedDB` */
- indexedDB: IDBFactory;
- /** Optional database name. The same name must be used to open the same database. */
- dbName?: string;
- /** Optional factory to spin up a Worker to execute the IDB transactions within. */
- workerFactory?: () => Worker;
-}
-type EventHandlerMap = {
- degraded: (e: Error) => void;
- closed: () => void;
-};
-export declare class IndexedDBStore extends MemoryStore {
- static exists(indexedDB: IDBFactory, dbName: string): Promise<boolean>;
- /**
- * The backend instance.
- * Call through to this API if you need to perform specific indexeddb actions like deleting the database.
- */
- readonly backend: IIndexedDBBackend;
- private startedUp;
- private syncTs;
- private userModifiedMap;
- private emitter;
- /**
- * Construct a new Indexed Database store, which extends MemoryStore.
- *
- * This store functions like a MemoryStore except it periodically persists
- * the contents of the store to an IndexedDB backend.
- *
- * All data is still kept in-memory but can be loaded from disk by calling
- * `startup()`. This can make startup times quicker as a complete
- * sync from the server is not required. This does not reduce memory usage as all
- * the data is eagerly fetched when `startup()` is called.
- * ```
- * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };
- * let store = new IndexedDBStore(opts);
- * await store.startup(); // load from indexed db
- * let client = sdk.createClient({
- * store: store,
- * });
- * client.startClient();
- * client.on("sync", function(state, prevState, data) {
- * if (state === "PREPARED") {
- * console.log("Started up, now with go faster stripes!");
- * }
- * });
- * ```
- *
- * @param opts - Options object.
- */
- constructor(opts: IOpts);
- on: <T extends import("../models/typed-event-emitter").EventEmitterEvents | keyof EventHandlerMap>(event: T, listener: import("../models/typed-event-emitter").Listener<keyof EventHandlerMap, EventHandlerMap, T>) => TypedEventEmitter<keyof EventHandlerMap, EventHandlerMap, EventHandlerMap>;
- /**
- * @returns Resolved when loaded from indexed db.
- */
- startup(): Promise<void>;
- private onClose;
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync: DegradableFn<[], ISavedSync | null>;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated: DegradableFn<[], boolean>;
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken: DegradableFn<[], string | null>;
- /**
- * Delete all data from this store.
- * @returns Promise which resolves if the data was deleted from the database.
- */
- deleteAllData: DegradableFn<[], void>;
- /**
- * Whether this store would like to save its data
- * Note that obviously whether the store wants to save or
- * not could change between calling this function and calling
- * save().
- *
- * @returns True if calling save() will actually save
- * (at the time this function is called).
- */
- wantsSave(): boolean;
- /**
- * Possibly write data to the database.
- *
- * @param force - True to force a save to happen
- * @returns Promise resolves after the write completes
- * (or immediately if no write is performed)
- */
- save(force?: boolean): Promise<void>;
- private reallySave;
- setSyncData: DegradableFn<[syncData: ISyncResponse], void>;
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers: DegradableFn<[roomId: string], IStateEventWithRoomId[] | null>;
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers: DegradableFn<[roomId: string, membershipEvents: IStateEventWithRoomId[]], void>;
- clearOutOfBandMembers: DegradableFn<[roomId: string], void>;
- getClientOptions: DegradableFn<[], IStoredClientOpts | undefined>;
- storeClientOptions: DegradableFn<[options: IStoredClientOpts], void>;
- /**
- * All member functions of `IndexedDBStore` that access the backend use this wrapper to
- * watch for failures after initial store startup, including `QuotaExceededError` as
- * free disk space changes, etc.
- *
- * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`
- * in place so that the current operation and all future ones are in-memory only.
- *
- * @param func - The degradable work to do.
- * @param fallback - The method name for fallback.
- * @returns A wrapped member function.
- */
- private degradable;
- getPendingEvents(roomId: string): Promise<Partial<IEvent>[]>;
- setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void>;
- saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
-}
-type DegradableFn<A extends Array<any>, T> = (...args: A) => Promise<T>;
-export {};
-//# sourceMappingURL=indexeddb.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map
deleted file mode 100644
index 3806a04..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb.d.ts","sourceRoot":"","sources":["../../src/store/indexeddb.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAI3D,OAAO,EAAE,MAAM,EAAe,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAa9C,UAAU,KAAM,SAAQ,SAAS;IAC7B,uDAAuD;IACvD,SAAS,EAAE,UAAU,CAAC;IACtB,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CAChC;AAED,KAAK,eAAe,GAAG;IAGnB,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAG7B,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,qBAAa,cAAe,SAAQ,WAAW;WAC7B,MAAM,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7E;;;OAGG;IACH,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAE3C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO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,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js
deleted file mode 100644
index e799e17..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js
+++ /dev/null
@@ -1,295 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.IndexedDBStore = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-var _memory = require("./memory");
-var _indexeddbLocalBackend = require("./indexeddb-local-backend");
-var _indexeddbRemoteBackend = require("./indexeddb-remote-backend");
-var _user = require("../models/user");
-var _event = require("../models/event");
-var _logger = require("../logger");
-var _typedEventEmitter = require("../models/typed-event-emitter");
-/*
-Copyright 2017 - 2021 Vector Creations Ltd
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-/* eslint-disable @babel/no-invalid-this */
-
-/**
- * This is an internal module. See {@link IndexedDBStore} for the public class.
- */
-
-// If this value is too small we'll be writing very often which will cause
-// noticeable stop-the-world pauses. If this value is too big we'll be writing
-// so infrequently that the /sync size gets bigger on reload. Writing more
-// often does not affect the length of the pause since the entire /sync
-// response is persisted each time.
-const WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes
-
-class IndexedDBStore extends _memory.MemoryStore {
- static exists(indexedDB, dbName) {
- return _indexeddbLocalBackend.LocalIndexedDBStoreBackend.exists(indexedDB, dbName);
- }
-
- /**
- * The backend instance.
- * Call through to this API if you need to perform specific indexeddb actions like deleting the database.
- */
-
- /**
- * Construct a new Indexed Database store, which extends MemoryStore.
- *
- * This store functions like a MemoryStore except it periodically persists
- * the contents of the store to an IndexedDB backend.
- *
- * All data is still kept in-memory but can be loaded from disk by calling
- * `startup()`. This can make startup times quicker as a complete
- * sync from the server is not required. This does not reduce memory usage as all
- * the data is eagerly fetched when `startup()` is called.
- * ```
- * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };
- * let store = new IndexedDBStore(opts);
- * await store.startup(); // load from indexed db
- * let client = sdk.createClient({
- * store: store,
- * });
- * client.startClient();
- * client.on("sync", function(state, prevState, data) {
- * if (state === "PREPARED") {
- * console.log("Started up, now with go faster stripes!");
- * }
- * });
- * ```
- *
- * @param opts - Options object.
- */
- constructor(opts) {
- super(opts);
- (0, _defineProperty2.default)(this, "backend", void 0);
- (0, _defineProperty2.default)(this, "startedUp", false);
- (0, _defineProperty2.default)(this, "syncTs", 0);
- (0, _defineProperty2.default)(this, "userModifiedMap", {});
- (0, _defineProperty2.default)(this, "emitter", new _typedEventEmitter.TypedEventEmitter());
- (0, _defineProperty2.default)(this, "on", this.emitter.on.bind(this.emitter));
- (0, _defineProperty2.default)(this, "onClose", () => {
- this.emitter.emit("closed");
- });
- (0, _defineProperty2.default)(this, "getSavedSync", this.degradable(() => {
- return this.backend.getSavedSync();
- }, "getSavedSync"));
- (0, _defineProperty2.default)(this, "isNewlyCreated", this.degradable(() => {
- return this.backend.isNewlyCreated();
- }, "isNewlyCreated"));
- (0, _defineProperty2.default)(this, "getSavedSyncToken", this.degradable(() => {
- return this.backend.getNextBatchToken();
- }, "getSavedSyncToken"));
- (0, _defineProperty2.default)(this, "deleteAllData", this.degradable(() => {
- super.deleteAllData();
- return this.backend.clearDatabase().then(() => {
- _logger.logger.log("Deleted indexeddb data.");
- }, err => {
- _logger.logger.error(`Failed to delete indexeddb data: ${err}`);
- throw err;
- });
- }));
- (0, _defineProperty2.default)(this, "reallySave", this.degradable(() => {
- this.syncTs = Date.now(); // set now to guard against multi-writes
-
- // work out changed users (this doesn't handle deletions but you
- // can't 'delete' users as they are just presence events).
- const userTuples = [];
- for (const u of this.getUsers()) {
- if (this.userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;
- if (!u.events.presence) continue;
- userTuples.push([u.userId, u.events.presence.event]);
-
- // note that we've saved this version of the user
- this.userModifiedMap[u.userId] = u.getLastModifiedTime();
- }
- return this.backend.syncToDatabase(userTuples);
- }));
- (0, _defineProperty2.default)(this, "setSyncData", this.degradable(syncData => {
- return this.backend.setSyncData(syncData);
- }, "setSyncData"));
- (0, _defineProperty2.default)(this, "getOutOfBandMembers", this.degradable(roomId => {
- return this.backend.getOutOfBandMembers(roomId);
- }, "getOutOfBandMembers"));
- (0, _defineProperty2.default)(this, "setOutOfBandMembers", this.degradable((roomId, membershipEvents) => {
- super.setOutOfBandMembers(roomId, membershipEvents);
- return this.backend.setOutOfBandMembers(roomId, membershipEvents);
- }, "setOutOfBandMembers"));
- (0, _defineProperty2.default)(this, "clearOutOfBandMembers", this.degradable(roomId => {
- super.clearOutOfBandMembers(roomId);
- return this.backend.clearOutOfBandMembers(roomId);
- }, "clearOutOfBandMembers"));
- (0, _defineProperty2.default)(this, "getClientOptions", this.degradable(() => {
- return this.backend.getClientOptions();
- }, "getClientOptions"));
- (0, _defineProperty2.default)(this, "storeClientOptions", this.degradable(options => {
- super.storeClientOptions(options);
- return this.backend.storeClientOptions(options);
- }, "storeClientOptions"));
- if (!opts.indexedDB) {
- throw new Error("Missing required option: indexedDB");
- }
- if (opts.workerFactory) {
- this.backend = new _indexeddbRemoteBackend.RemoteIndexedDBStoreBackend(opts.workerFactory, opts.dbName);
- } else {
- this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);
- }
- }
- /**
- * @returns Resolved when loaded from indexed db.
- */
- startup() {
- if (this.startedUp) {
- _logger.logger.log(`IndexedDBStore.startup: already started`);
- return Promise.resolve();
- }
- _logger.logger.log(`IndexedDBStore.startup: connecting to backend`);
- return this.backend.connect(this.onClose).then(() => {
- _logger.logger.log(`IndexedDBStore.startup: loading presence events`);
- return this.backend.getUserPresenceEvents();
- }).then(userPresenceEvents => {
- _logger.logger.log(`IndexedDBStore.startup: processing presence events`);
- userPresenceEvents.forEach(([userId, rawEvent]) => {
- const u = new _user.User(userId);
- if (rawEvent) {
- u.setPresenceEvent(new _event.MatrixEvent(rawEvent));
- }
- this.userModifiedMap[u.userId] = u.getLastModifiedTime();
- this.storeUser(u);
- });
- this.startedUp = true;
- });
- }
- /**
- * Whether this store would like to save its data
- * Note that obviously whether the store wants to save or
- * not could change between calling this function and calling
- * save().
- *
- * @returns True if calling save() will actually save
- * (at the time this function is called).
- */
- wantsSave() {
- const now = Date.now();
- return now - this.syncTs > WRITE_DELAY_MS;
- }
-
- /**
- * Possibly write data to the database.
- *
- * @param force - True to force a save to happen
- * @returns Promise resolves after the write completes
- * (or immediately if no write is performed)
- */
- save(force = false) {
- if (force || this.wantsSave()) {
- return this.reallySave();
- }
- return Promise.resolve();
- }
- /**
- * All member functions of `IndexedDBStore` that access the backend use this wrapper to
- * watch for failures after initial store startup, including `QuotaExceededError` as
- * free disk space changes, etc.
- *
- * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`
- * in place so that the current operation and all future ones are in-memory only.
- *
- * @param func - The degradable work to do.
- * @param fallback - The method name for fallback.
- * @returns A wrapped member function.
- */
- degradable(func, fallback) {
- const fallbackFn = fallback ? super[fallback] : null;
- return async (...args) => {
- try {
- return await func.call(this, ...args);
- } catch (e) {
- _logger.logger.error("IndexedDBStore failure, degrading to MemoryStore", e);
- this.emitter.emit("degraded", e);
- try {
- // We try to delete IndexedDB after degrading since this store is only a
- // cache (the app will still function correctly without the data).
- // It's possible that deleting repair IndexedDB for the next app load,
- // potentially by making a little more space available.
- _logger.logger.log("IndexedDBStore trying to delete degraded data");
- await this.backend.clearDatabase();
- _logger.logger.log("IndexedDBStore delete after degrading succeeded");
- } catch (e) {
- _logger.logger.warn("IndexedDBStore delete after degrading failed", e);
- }
- // Degrade the store from being an instance of `IndexedDBStore` to instead be
- // an instance of `MemoryStore` so that future API calls use the memory path
- // directly and skip IndexedDB entirely. This should be safe as
- // `IndexedDBStore` already extends from `MemoryStore`, so we are making the
- // store become its parent type in a way. The mutator methods of
- // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are
- // not overridden at all).
- if (fallbackFn) {
- return fallbackFn.call(this, ...args);
- }
- }
- };
- }
-
- // XXX: ideally these would be stored in indexeddb as part of the room but,
- // we don't store rooms as such and instead accumulate entire sync responses atm.
- async getPendingEvents(roomId) {
- if (!this.localStorage) return super.getPendingEvents(roomId);
- const serialized = this.localStorage.getItem(pendingEventsKey(roomId));
- if (serialized) {
- try {
- return JSON.parse(serialized);
- } catch (e) {
- _logger.logger.error("Could not parse persisted pending events", e);
- }
- }
- return [];
- }
- async setPendingEvents(roomId, events) {
- if (!this.localStorage) return super.setPendingEvents(roomId, events);
- if (events.length > 0) {
- this.localStorage.setItem(pendingEventsKey(roomId), JSON.stringify(events));
- } else {
- this.localStorage.removeItem(pendingEventsKey(roomId));
- }
- }
- saveToDeviceBatches(batches) {
- return this.backend.saveToDeviceBatches(batches);
- }
- getOldestToDeviceBatch() {
- return this.backend.getOldestToDeviceBatch();
- }
- removeToDeviceBatch(id) {
- return this.backend.removeToDeviceBatch(id);
- }
-}
-
-/**
- * @param roomId - ID of the current room
- * @returns Storage key to retrieve pending events
- */
-exports.IndexedDBStore = IndexedDBStore;
-function pendingEventsKey(roomId) {
- return `mx_pending_events_${roomId}`;
-}
-//# sourceMappingURL=indexeddb.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map
deleted file mode 100644
index fc38f3a..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/indexeddb.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"indexeddb.js","names":["_memory","require","_indexeddbLocalBackend","_indexeddbRemoteBackend","_user","_event","_logger","_typedEventEmitter","WRITE_DELAY_MS","IndexedDBStore","MemoryStore","exists","indexedDB","dbName","LocalIndexedDBStoreBackend","constructor","opts","_defineProperty2","default","TypedEventEmitter","emitter","on","bind","emit","degradable","backend","getSavedSync","isNewlyCreated","getNextBatchToken","deleteAllData","clearDatabase","then","logger","log","err","error","syncTs","Date","now","userTuples","u","getUsers","userModifiedMap","userId","getLastModifiedTime","events","presence","push","event","syncToDatabase","syncData","setSyncData","roomId","getOutOfBandMembers","membershipEvents","setOutOfBandMembers","clearOutOfBandMembers","getClientOptions","options","storeClientOptions","Error","workerFactory","RemoteIndexedDBStoreBackend","startup","startedUp","Promise","resolve","connect","onClose","getUserPresenceEvents","userPresenceEvents","forEach","rawEvent","User","setPresenceEvent","MatrixEvent","storeUser","wantsSave","save","force","reallySave","func","fallback","fallbackFn","args","call","e","warn","getPendingEvents","localStorage","serialized","getItem","pendingEventsKey","JSON","parse","setPendingEvents","length","setItem","stringify","removeItem","saveToDeviceBatches","batches","getOldestToDeviceBatch","removeToDeviceBatch","id","exports"],"sources":["../../src/store/indexeddb.ts"],"sourcesContent":["/*\nCopyright 2017 - 2021 Vector Creations Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/* eslint-disable @babel/no-invalid-this */\n\nimport { MemoryStore, IOpts as IBaseOpts } from \"./memory\";\nimport { LocalIndexedDBStoreBackend } from \"./indexeddb-local-backend\";\nimport { RemoteIndexedDBStoreBackend } from \"./indexeddb-remote-backend\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { logger } from \"../logger\";\nimport { ISavedSync } from \"./index\";\nimport { IIndexedDBBackend } from \"./indexeddb-backend\";\nimport { ISyncResponse } from \"../sync-accumulator\";\nimport { TypedEventEmitter } from \"../models/typed-event-emitter\";\nimport { IStateEventWithRoomId } from \"../@types/search\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\nimport { IStoredClientOpts } from \"../client\";\n\n/**\n * This is an internal module. See {@link IndexedDBStore} for the public class.\n */\n\n// If this value is too small we'll be writing very often which will cause\n// noticeable stop-the-world pauses. If this value is too big we'll be writing\n// so infrequently that the /sync size gets bigger on reload. Writing more\n// often does not affect the length of the pause since the entire /sync\n// response is persisted each time.\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\n\ninterface IOpts extends IBaseOpts {\n /** The Indexed DB interface e.g. `window.indexedDB` */\n indexedDB: IDBFactory;\n /** Optional database name. The same name must be used to open the same database. */\n dbName?: string;\n /** Optional factory to spin up a Worker to execute the IDB transactions within. */\n workerFactory?: () => Worker;\n}\n\ntype EventHandlerMap = {\n // Fired when an IDB command fails on a degradable path, and the store falls back to MemoryStore\n // This signals the potential for data volatility.\n degraded: (e: Error) => void;\n // Fired when the IndexedDB gets closed unexpectedly, for example, if the underlying storage is removed or\n // if the user clears the database in the browser's history preferences.\n closed: () => void;\n};\n\nexport class IndexedDBStore extends MemoryStore {\n public static exists(indexedDB: IDBFactory, dbName: string): Promise<boolean> {\n return LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\n }\n\n /**\n * The backend instance.\n * Call through to this API if you need to perform specific indexeddb actions like deleting the database.\n */\n public readonly backend: IIndexedDBBackend;\n\n private startedUp = false;\n private syncTs = 0;\n // Records the last-modified-time of each user at the last point we saved\n // the database, such that we can derive the set if users that have been\n // modified since we last saved.\n private userModifiedMap: Record<string, number> = {}; // user_id : timestamp\n private emitter = new TypedEventEmitter<keyof EventHandlerMap, EventHandlerMap>();\n\n /**\n * Construct a new Indexed Database store, which extends MemoryStore.\n *\n * This store functions like a MemoryStore except it periodically persists\n * the contents of the store to an IndexedDB backend.\n *\n * All data is still kept in-memory but can be loaded from disk by calling\n * `startup()`. This can make startup times quicker as a complete\n * sync from the server is not required. This does not reduce memory usage as all\n * the data is eagerly fetched when `startup()` is called.\n * ```\n * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\n * let store = new IndexedDBStore(opts);\n * await store.startup(); // load from indexed db\n * let client = sdk.createClient({\n * store: store,\n * });\n * client.startClient();\n * client.on(\"sync\", function(state, prevState, data) {\n * if (state === \"PREPARED\") {\n * console.log(\"Started up, now with go faster stripes!\");\n * }\n * });\n * ```\n *\n * @param opts - Options object.\n */\n public constructor(opts: IOpts) {\n super(opts);\n\n if (!opts.indexedDB) {\n throw new Error(\"Missing required option: indexedDB\");\n }\n\n if (opts.workerFactory) {\n this.backend = new RemoteIndexedDBStoreBackend(opts.workerFactory, opts.dbName);\n } else {\n this.backend = new LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\n }\n }\n\n public on = this.emitter.on.bind(this.emitter);\n\n /**\n * @returns Resolved when loaded from indexed db.\n */\n public startup(): Promise<void> {\n if (this.startedUp) {\n logger.log(`IndexedDBStore.startup: already started`);\n return Promise.resolve();\n }\n\n logger.log(`IndexedDBStore.startup: connecting to backend`);\n return this.backend\n .connect(this.onClose)\n .then(() => {\n logger.log(`IndexedDBStore.startup: loading presence events`);\n return this.backend.getUserPresenceEvents();\n })\n .then((userPresenceEvents) => {\n logger.log(`IndexedDBStore.startup: processing presence events`);\n userPresenceEvents.forEach(([userId, rawEvent]) => {\n const u = new User(userId);\n if (rawEvent) {\n u.setPresenceEvent(new MatrixEvent(rawEvent));\n }\n this.userModifiedMap[u.userId] = u.getLastModifiedTime();\n this.storeUser(u);\n });\n this.startedUp = true;\n });\n }\n\n private onClose = (): void => {\n this.emitter.emit(\"closed\");\n };\n\n /**\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync = this.degradable((): Promise<ISavedSync | null> => {\n return this.backend.getSavedSync();\n }, \"getSavedSync\");\n\n /** @returns whether or not the database was newly created in this session. */\n public isNewlyCreated = this.degradable((): Promise<boolean> => {\n return this.backend.isNewlyCreated();\n }, \"isNewlyCreated\");\n\n /**\n * @returns If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken = this.degradable((): Promise<string | null> => {\n return this.backend.getNextBatchToken();\n }, \"getSavedSyncToken\");\n\n /**\n * Delete all data from this store.\n * @returns Promise which resolves if the data was deleted from the database.\n */\n public deleteAllData = this.degradable((): Promise<void> => {\n super.deleteAllData();\n return this.backend.clearDatabase().then(\n () => {\n logger.log(\"Deleted indexeddb data.\");\n },\n (err) => {\n logger.error(`Failed to delete indexeddb data: ${err}`);\n throw err;\n },\n );\n });\n\n /**\n * Whether this store would like to save its data\n * Note that obviously whether the store wants to save or\n * not could change between calling this function and calling\n * save().\n *\n * @returns True if calling save() will actually save\n * (at the time this function is called).\n */\n public wantsSave(): boolean {\n const now = Date.now();\n return now - this.syncTs > WRITE_DELAY_MS;\n }\n\n /**\n * Possibly write data to the database.\n *\n * @param force - True to force a save to happen\n * @returns Promise resolves after the write completes\n * (or immediately if no write is performed)\n */\n public save(force = false): Promise<void> {\n if (force || this.wantsSave()) {\n return this.reallySave();\n }\n return Promise.resolve();\n }\n\n private reallySave = this.degradable((): Promise<void> => {\n this.syncTs = Date.now(); // set now to guard against multi-writes\n\n // work out changed users (this doesn't handle deletions but you\n // can't 'delete' users as they are just presence events).\n const userTuples: [userId: string, presenceEvent: Partial<IEvent>][] = [];\n for (const u of this.getUsers()) {\n if (this.userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\n if (!u.events.presence) continue;\n\n userTuples.push([u.userId, u.events.presence.event]);\n\n // note that we've saved this version of the user\n this.userModifiedMap[u.userId] = u.getLastModifiedTime();\n }\n\n return this.backend.syncToDatabase(userTuples);\n });\n\n public setSyncData = this.degradable((syncData: ISyncResponse): Promise<void> => {\n return this.backend.setSyncData(syncData);\n }, \"setSyncData\");\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @returns the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers = this.degradable((roomId: string): Promise<IStateEventWithRoomId[] | null> => {\n return this.backend.getOutOfBandMembers(roomId);\n }, \"getOutOfBandMembers\");\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param membershipEvents - the membership events to store\n * @returns when all members have been stored\n */\n public setOutOfBandMembers = this.degradable(\n (roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void> => {\n super.setOutOfBandMembers(roomId, membershipEvents);\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\n },\n \"setOutOfBandMembers\",\n );\n\n public clearOutOfBandMembers = this.degradable((roomId: string) => {\n super.clearOutOfBandMembers(roomId);\n return this.backend.clearOutOfBandMembers(roomId);\n }, \"clearOutOfBandMembers\");\n\n public getClientOptions = this.degradable((): Promise<IStoredClientOpts | undefined> => {\n return this.backend.getClientOptions();\n }, \"getClientOptions\");\n\n public storeClientOptions = this.degradable((options: IStoredClientOpts): Promise<void> => {\n super.storeClientOptions(options);\n return this.backend.storeClientOptions(options);\n }, \"storeClientOptions\");\n\n /**\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\n * watch for failures after initial store startup, including `QuotaExceededError` as\n * free disk space changes, etc.\n *\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\n * in place so that the current operation and all future ones are in-memory only.\n *\n * @param func - The degradable work to do.\n * @param fallback - The method name for fallback.\n * @returns A wrapped member function.\n */\n private degradable<A extends Array<any>, R = void>(\n func: DegradableFn<A, R>,\n fallback?: keyof MemoryStore,\n ): DegradableFn<A, R> {\n const fallbackFn = fallback ? (super[fallback] as Function) : null;\n\n return async (...args) => {\n try {\n return await func.call(this, ...args);\n } catch (e) {\n logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\n this.emitter.emit(\"degraded\", e as Error);\n try {\n // We try to delete IndexedDB after degrading since this store is only a\n // cache (the app will still function correctly without the data).\n // It's possible that deleting repair IndexedDB for the next app load,\n // potentially by making a little more space available.\n logger.log(\"IndexedDBStore trying to delete degraded data\");\n await this.backend.clearDatabase();\n logger.log(\"IndexedDBStore delete after degrading succeeded\");\n } catch (e) {\n logger.warn(\"IndexedDBStore delete after degrading failed\", e);\n }\n // Degrade the store from being an instance of `IndexedDBStore` to instead be\n // an instance of `MemoryStore` so that future API calls use the memory path\n // directly and skip IndexedDB entirely. This should be safe as\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\n // store become its parent type in a way. The mutator methods of\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\n // not overridden at all).\n if (fallbackFn) {\n return fallbackFn.call(this, ...args);\n }\n }\n };\n }\n\n // XXX: ideally these would be stored in indexeddb as part of the room but,\n // we don't store rooms as such and instead accumulate entire sync responses atm.\n public async getPendingEvents(roomId: string): Promise<Partial<IEvent>[]> {\n if (!this.localStorage) return super.getPendingEvents(roomId);\n\n const serialized = this.localStorage.getItem(pendingEventsKey(roomId));\n if (serialized) {\n try {\n return JSON.parse(serialized);\n } catch (e) {\n logger.error(\"Could not parse persisted pending events\", e);\n }\n }\n return [];\n }\n\n public async setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void> {\n if (!this.localStorage) return super.setPendingEvents(roomId, events);\n\n if (events.length > 0) {\n this.localStorage.setItem(pendingEventsKey(roomId), JSON.stringify(events));\n } else {\n this.localStorage.removeItem(pendingEventsKey(roomId));\n }\n }\n\n public saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void> {\n return this.backend.saveToDeviceBatches(batches);\n }\n\n public getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null> {\n return this.backend.getOldestToDeviceBatch();\n }\n\n public removeToDeviceBatch(id: number): Promise<void> {\n return this.backend.removeToDeviceBatch(id);\n }\n}\n\n/**\n * @param roomId - ID of the current room\n * @returns Storage key to retrieve pending events\n */\nfunction pendingEventsKey(roomId: string): string {\n return `mx_pending_events_${roomId}`;\n}\n\ntype DegradableFn<A extends Array<any>, T> = (...args: A) => Promise<T>;\n"],"mappings":";;;;;;;;AAkBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,kBAAA,GAAAN,OAAA;AA3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAgBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMO,cAAc,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;AAoB/B,MAAMC,cAAc,SAASC,mBAAW,CAAC;EAC5C,OAAcC,MAAMA,CAACC,SAAqB,EAAEC,MAAc,EAAoB;IAC1E,OAAOC,iDAA0B,CAACH,MAAM,CAACC,SAAS,EAAEC,MAAM,CAAC;EAC/D;;EAEA;AACJ;AACA;AACA;;EAWI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACWE,WAAWA,CAACC,IAAW,EAAE;IAC5B,KAAK,CAACA,IAAI,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBA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sC,UAAU,EAAE;MACZ,IAAI;QACA,OAAOG,IAAI,CAACC,KAAK,CAACJ,UAAU,CAAC;MACjC,CAAC,CAAC,OAAOJ,CAAC,EAAE;QACRtD,cAAM,CAACG,KAAK,CAAC,0CAA0C,EAAEmD,CAAC,CAAC;MAC/D;IACJ;IACA,OAAO,EAAE;EACb;EAEA,MAAaS,gBAAgBA,CAAC3C,MAAc,EAAEP,MAAyB,EAAiB;IACpF,IAAI,CAAC,IAAI,CAAC4C,YAAY,EAAE,OAAO,KAAK,CAACM,gBAAgB,CAAC3C,MAAM,EAAEP,MAAM,CAAC;IAErE,IAAIA,MAAM,CAACmD,MAAM,GAAG,CAAC,EAAE;MACnB,IAAI,CAACP,YAAY,CAACQ,OAAO,CAACL,gBAAgB,CAACxC,MAAM,CAAC,EAAEyC,IAAI,CAACK,SAAS,CAACrD,MAAM,CAAC,CAAC;IAC/E,CAAC,MAAM;MACH,IAAI,CAAC4C,YAAY,CAACU,UAAU,CAACP,gBAAgB,CAACxC,MAAM,CAAC,CAAC;IAC1D;EACJ;EAEOgD,mBAAmBA,CAACC,OAAiC,EAAiB;IACzE,OAAO,IAAI,CAAC5E,OAAO,CAAC2E,mBAAmB,CAACC,OAAO,CAAC;EACpD;EAEOC,sBAAsBA,CAAA,EAAyC;IAClE,OAAO,IAAI,CAAC7E,OAAO,CAAC6E,sBAAsB,EAAE;EAChD;EAEOC,mBAAmBA,CAACC,EAAU,EAAiB;IAClD,OAAO,IAAI,CAAC/E,OAAO,CAAC8E,mBAAmB,CAACC,EAAE,CAAC;EAC/C;AACJ;;AAEA;AACA;AACA;AACA;AAHAC,OAAA,CAAAhG,cAAA,GAAAA,cAAA;AAIA,SAASmF,gBAAgBA,CAACxC,MAAc,EAAU;EAC9C,OAAQ,qBAAoBA,MAAO,EAAC;AACxC"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts
deleted file mode 100644
index 99a61e2..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { TypedEventEmitter } from "../models/typed-event-emitter";
-export declare enum LocalStorageErrors {
- Global = "Global",
- SetItemError = "setItem",
- GetItemError = "getItem",
- RemoveItemError = "removeItem",
- ClearError = "clear",
- QuotaExceededError = "QuotaExceededError"
-}
-type EventHandlerMap = {
- [LocalStorageErrors.Global]: (error: Error) => void;
- [LocalStorageErrors.SetItemError]: (error: Error) => void;
- [LocalStorageErrors.GetItemError]: (error: Error) => void;
- [LocalStorageErrors.RemoveItemError]: (error: Error) => void;
- [LocalStorageErrors.ClearError]: (error: Error) => void;
- [LocalStorageErrors.QuotaExceededError]: (error: Error) => void;
-};
-/**
- * Used in element-web as a temporary hack to handle all the localStorage errors on the highest level possible
- * As of 15.11.2021 (DD/MM/YYYY) we're not properly handling local storage exceptions anywhere.
- * This store, as an event emitter, is used to re-emit local storage exceptions so that we can handle them
- * and show some kind of a "It's dead Jim" modal to the users, telling them that hey,
- * maybe you should check out your disk, as it's probably dying and your session may die with it.
- * See: https://github.com/vector-im/element-web/issues/18423
- */
-declare class LocalStorageErrorsEventsEmitter extends TypedEventEmitter<LocalStorageErrors, EventHandlerMap> {
-}
-export declare const localStorageErrorsEventsEmitter: LocalStorageErrorsEventsEmitter;
-export {};
-//# sourceMappingURL=local-storage-events-emitter.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts.map
deleted file mode 100644
index ddf2602..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"local-storage-events-emitter.d.ts","sourceRoot":"","sources":["../../src/store/local-storage-events-emitter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,oBAAY,kBAAkB;IAC1B,MAAM,WAAW;IACjB,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,eAAe,eAAe;IAC9B,UAAU,UAAU;IACpB,kBAAkB,uBAAuB;CAC5C;AAED,KAAK,eAAe,GAAG;IACnB,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACpD,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1D,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1D,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7D,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxD,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF;;;;;;;GAOG;AACH,cAAM,+BAAgC,SAAQ,iBAAiB,CAAC,kBAAkB,EAAE,eAAe,CAAC;CAAG;AACvG,eAAO,MAAM,+BAA+B,iCAAwC,CAAC"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js
deleted file mode 100644
index 8a474ac..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js
+++ /dev/null
@@ -1,44 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.localStorageErrorsEventsEmitter = exports.LocalStorageErrors = void 0;
-var _typedEventEmitter = require("../models/typed-event-emitter");
-/*
-Copyright 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-let LocalStorageErrors;
-exports.LocalStorageErrors = LocalStorageErrors;
-(function (LocalStorageErrors) {
- LocalStorageErrors["Global"] = "Global";
- LocalStorageErrors["SetItemError"] = "setItem";
- LocalStorageErrors["GetItemError"] = "getItem";
- LocalStorageErrors["RemoveItemError"] = "removeItem";
- LocalStorageErrors["ClearError"] = "clear";
- LocalStorageErrors["QuotaExceededError"] = "QuotaExceededError";
-})(LocalStorageErrors || (exports.LocalStorageErrors = LocalStorageErrors = {}));
-/**
- * Used in element-web as a temporary hack to handle all the localStorage errors on the highest level possible
- * As of 15.11.2021 (DD/MM/YYYY) we're not properly handling local storage exceptions anywhere.
- * This store, as an event emitter, is used to re-emit local storage exceptions so that we can handle them
- * and show some kind of a "It's dead Jim" modal to the users, telling them that hey,
- * maybe you should check out your disk, as it's probably dying and your session may die with it.
- * See: https://github.com/vector-im/element-web/issues/18423
- */
-class LocalStorageErrorsEventsEmitter extends _typedEventEmitter.TypedEventEmitter {}
-const localStorageErrorsEventsEmitter = new LocalStorageErrorsEventsEmitter();
-exports.localStorageErrorsEventsEmitter = localStorageErrorsEventsEmitter;
-//# sourceMappingURL=local-storage-events-emitter.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map
deleted file mode 100644
index d128195..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/local-storage-events-emitter.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"local-storage-events-emitter.js","names":["_typedEventEmitter","require","LocalStorageErrors","exports","LocalStorageErrorsEventsEmitter","TypedEventEmitter","localStorageErrorsEventsEmitter"],"sources":["../../src/store/local-storage-events-emitter.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { TypedEventEmitter } from \"../models/typed-event-emitter\";\n\nexport enum LocalStorageErrors {\n Global = \"Global\",\n SetItemError = \"setItem\",\n GetItemError = \"getItem\",\n RemoveItemError = \"removeItem\",\n ClearError = \"clear\",\n QuotaExceededError = \"QuotaExceededError\",\n}\n\ntype EventHandlerMap = {\n [LocalStorageErrors.Global]: (error: Error) => void;\n [LocalStorageErrors.SetItemError]: (error: Error) => void;\n [LocalStorageErrors.GetItemError]: (error: Error) => void;\n [LocalStorageErrors.RemoveItemError]: (error: Error) => void;\n [LocalStorageErrors.ClearError]: (error: Error) => void;\n [LocalStorageErrors.QuotaExceededError]: (error: Error) => void;\n};\n\n/**\n * Used in element-web as a temporary hack to handle all the localStorage errors on the highest level possible\n * As of 15.11.2021 (DD/MM/YYYY) we're not properly handling local storage exceptions anywhere.\n * This store, as an event emitter, is used to re-emit local storage exceptions so that we can handle them\n * and show some kind of a \"It's dead Jim\" modal to the users, telling them that hey,\n * maybe you should check out your disk, as it's probably dying and your session may die with it.\n * See: https://github.com/vector-im/element-web/issues/18423\n */\nclass LocalStorageErrorsEventsEmitter extends TypedEventEmitter<LocalStorageErrors, EventHandlerMap> {}\nexport const localStorageErrorsEventsEmitter = new LocalStorageErrorsEventsEmitter();\n"],"mappings":";;;;;;AAgBA,IAAAA,kBAAA,GAAAC,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IAkBYC,kBAAkB;AAAAC,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAAA,WAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,KAAAC,OAAA,CAAAD,kBAAA,GAAlBA,kBAAkB;AAkB9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,+BAA+B,SAASC,oCAAiB,CAAsC;AAC9F,MAAMC,+BAA+B,GAAG,IAAIF,+BAA+B,EAAE;AAACD,OAAA,CAAAG,+BAAA,GAAAA,+BAAA"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts
deleted file mode 100644
index 1daaada..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts
+++ /dev/null
@@ -1,206 +0,0 @@
-/**
- * This is an internal module. See {@link MemoryStore} for the public class.
- */
-import { EventType } from "../@types/event";
-import { Room } from "../models/room";
-import { User } from "../models/user";
-import { IEvent, MatrixEvent } from "../models/event";
-import { Filter } from "../filter";
-import { ISavedSync, IStore } from "./index";
-import { RoomSummary } from "../models/room-summary";
-import { ISyncResponse } from "../sync-accumulator";
-import { IStateEventWithRoomId } from "../@types/search";
-import { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from "../models/ToDeviceMessage";
-import { IStoredClientOpts } from "../client";
-export interface IOpts {
- /** The local storage instance to persist some forms of data such as tokens. Rooms will NOT be stored. */
- localStorage?: Storage;
-}
-export declare class MemoryStore implements IStore {
- private rooms;
- private users;
- private syncToken;
- private filters;
- accountData: Map<string, MatrixEvent>;
- protected readonly localStorage?: Storage;
- private oobMembers;
- private pendingEvents;
- private clientOptions?;
- private pendingToDeviceBatches;
- private nextToDeviceBatchId;
- /**
- * Construct a new in-memory data store for the Matrix Client.
- * @param opts - Config options
- */
- constructor(opts?: IOpts);
- /**
- * Retrieve the token to stream from.
- * @returns The token or null.
- */
- getSyncToken(): string | null;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated(): Promise<boolean>;
- /**
- * Set the token to stream from.
- * @param token - The token to stream from.
- */
- setSyncToken(token: string): void;
- /**
- * Store the given room.
- * @param room - The room to be stored. All properties must be stored.
- */
- storeRoom(room: Room): void;
- /**
- * Called when a room member in a room being tracked by this store has been
- * updated.
- */
- private onRoomMember;
- /**
- * Retrieve a room by its' room ID.
- * @param roomId - The room ID.
- * @returns The room or null.
- */
- getRoom(roomId: string): Room | null;
- /**
- * Retrieve all known rooms.
- * @returns A list of rooms, which may be empty.
- */
- getRooms(): Room[];
- /**
- * Permanently delete a room.
- */
- removeRoom(roomId: string): void;
- /**
- * Retrieve a summary of all the rooms.
- * @returns A summary of each room.
- */
- getRoomSummaries(): RoomSummary[];
- /**
- * Store a User.
- * @param user - The user to store.
- */
- storeUser(user: User): void;
- /**
- * Retrieve a User by its' user ID.
- * @param userId - The user ID.
- * @returns The user or null.
- */
- getUser(userId: string): User | null;
- /**
- * Retrieve all known users.
- * @returns A list of users, which may be empty.
- */
- getUsers(): User[];
- /**
- * Retrieve scrollback for this room.
- * @param room - The matrix room
- * @param limit - The max number of old events to retrieve.
- * @returns An array of objects which will be at most 'limit'
- * length and at least 0. The objects are the raw event JSON.
- */
- scrollback(room: Room, limit: number): MatrixEvent[];
- /**
- * Store events for a room. The events have already been added to the timeline
- * @param room - The room to store events for.
- * @param events - The events to store.
- * @param token - The token associated with these events.
- * @param toStart - True if these are paginated results.
- */
- storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void;
- /**
- * Store a filter.
- */
- storeFilter(filter: Filter): void;
- /**
- * Retrieve a filter.
- * @returns A filter or null.
- */
- getFilter(userId: string, filterId: string): Filter | null;
- /**
- * Retrieve a filter ID with the given name.
- * @param filterName - The filter name.
- * @returns The filter ID or null.
- */
- getFilterIdByName(filterName: string): string | null;
- /**
- * Set a filter name to ID mapping.
- */
- setFilterIdByName(filterName: string, filterId?: string): void;
- /**
- * Store user-scoped account data events.
- * N.B. that account data only allows a single event per type, so multiple
- * events with the same type will replace each other.
- * @param events - The events to store.
- */
- storeAccountDataEvents(events: MatrixEvent[]): void;
- /**
- * Get account data event by event type
- * @param eventType - The event type being queried
- * @returns the user account_data event of given type, if any
- */
- getAccountData(eventType: EventType | string): MatrixEvent | undefined;
- /**
- * setSyncData does nothing as there is no backing data store.
- *
- * @param syncData - The sync data
- * @returns An immediately resolved promise.
- */
- setSyncData(syncData: ISyncResponse): Promise<void>;
- /**
- * We never want to save becase we have nothing to save to.
- *
- * @returns If the store wants to save
- */
- wantsSave(): boolean;
- /**
- * Save does nothing as there is no backing data store.
- * @param force - True to force a save (but the memory
- * store still can't save anything)
- */
- save(force: boolean): void;
- /**
- * Startup does nothing as this store doesn't require starting up.
- * @returns An immediately resolved promise.
- */
- startup(): Promise<void>;
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(): Promise<ISavedSync | null>;
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken(): Promise<string | null>;
- /**
- * Delete all data from this store.
- * @returns An immediately resolved promise.
- */
- deleteAllData(): Promise<void>;
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null>;
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(roomId: string): Promise<void>;
- getClientOptions(): Promise<IStoredClientOpts | undefined>;
- storeClientOptions(options: IStoredClientOpts): Promise<void>;
- getPendingEvents(roomId: string): Promise<Partial<IEvent>[]>;
- setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void>;
- saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
-}
-//# sourceMappingURL=memory.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map
deleted file mode 100644
index 03a6d73..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/store/memory.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE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AAG,IAAI,CAAC;IAIjD;;;OAGG;IACI,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIlD;;;OAGG;IACI,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAarC;;;;;OAKG;IACI,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC;IAInF;;;;;;OAMG;IACI,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7F,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAI1D,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAI5D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhF,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/D,sBAAsB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAKpE,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIxD"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js
deleted file mode 100644
index 452897e..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js
+++ /dev/null
@@ -1,425 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.MemoryStore = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-var _user = require("../models/user");
-var _roomState = require("../models/room-state");
-var _utils = require("../utils");
-/*
-Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-/**
- * This is an internal module. See {@link MemoryStore} for the public class.
- */
-
-function isValidFilterId(filterId) {
- const isValidStr = typeof filterId === "string" && !!filterId && filterId !== "undefined" &&
- // exclude these as we've serialized undefined in localStorage before
- filterId !== "null";
- return isValidStr || typeof filterId === "number";
-}
-class MemoryStore {
- // roomId: Room
- // userId: User
-
- // userId: {
- // filterId: Filter
- // }
-
- // type: content
-
- // roomId: [member events]
-
- /**
- * Construct a new in-memory data store for the Matrix Client.
- * @param opts - Config options
- */
- constructor(opts = {}) {
- (0, _defineProperty2.default)(this, "rooms", {});
- (0, _defineProperty2.default)(this, "users", {});
- (0, _defineProperty2.default)(this, "syncToken", null);
- (0, _defineProperty2.default)(this, "filters", new _utils.MapWithDefault(() => new Map()));
- (0, _defineProperty2.default)(this, "accountData", new Map());
- (0, _defineProperty2.default)(this, "localStorage", void 0);
- (0, _defineProperty2.default)(this, "oobMembers", new Map());
- (0, _defineProperty2.default)(this, "pendingEvents", {});
- (0, _defineProperty2.default)(this, "clientOptions", void 0);
- (0, _defineProperty2.default)(this, "pendingToDeviceBatches", []);
- (0, _defineProperty2.default)(this, "nextToDeviceBatchId", 0);
- (0, _defineProperty2.default)(this, "onRoomMember", (event, state, member) => {
- 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 (!)
- return;
- }
- const user = this.users[member.userId] || new _user.User(member.userId);
- if (member.name) {
- user.setDisplayName(member.name);
- if (member.events.member) {
- user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);
- }
- }
- if (member.events.member && member.events.member.getContent().avatar_url) {
- user.setAvatarUrl(member.events.member.getContent().avatar_url);
- }
- this.users[user.userId] = user;
- });
- this.localStorage = opts.localStorage;
- }
-
- /**
- * Retrieve the token to stream from.
- * @returns The token or null.
- */
- getSyncToken() {
- return this.syncToken;
- }
-
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated() {
- return Promise.resolve(true);
- }
-
- /**
- * Set the token to stream from.
- * @param token - The token to stream from.
- */
- setSyncToken(token) {
- this.syncToken = token;
- }
-
- /**
- * Store the given room.
- * @param room - The room to be stored. All properties must be stored.
- */
- storeRoom(room) {
- this.rooms[room.roomId] = room;
- // add listeners for room member changes so we can keep the room member
- // map up-to-date.
- room.currentState.on(_roomState.RoomStateEvent.Members, this.onRoomMember);
- // add existing members
- room.currentState.getMembers().forEach(m => {
- this.onRoomMember(null, room.currentState, m);
- });
- }
-
- /**
- * Called when a room member in a room being tracked by this store has been
- * updated.
- */
-
- /**
- * Retrieve a room by its' room ID.
- * @param roomId - The room ID.
- * @returns The room or null.
- */
- getRoom(roomId) {
- return this.rooms[roomId] || null;
- }
-
- /**
- * Retrieve all known rooms.
- * @returns A list of rooms, which may be empty.
- */
- getRooms() {
- return Object.values(this.rooms);
- }
-
- /**
- * Permanently delete a room.
- */
- removeRoom(roomId) {
- if (this.rooms[roomId]) {
- this.rooms[roomId].currentState.removeListener(_roomState.RoomStateEvent.Members, this.onRoomMember);
- }
- delete this.rooms[roomId];
- }
-
- /**
- * Retrieve a summary of all the rooms.
- * @returns A summary of each room.
- */
- getRoomSummaries() {
- return Object.values(this.rooms).map(function (room) {
- return room.summary;
- });
- }
-
- /**
- * Store a User.
- * @param user - The user to store.
- */
- storeUser(user) {
- this.users[user.userId] = user;
- }
-
- /**
- * Retrieve a User by its' user ID.
- * @param userId - The user ID.
- * @returns The user or null.
- */
- getUser(userId) {
- return this.users[userId] || null;
- }
-
- /**
- * Retrieve all known users.
- * @returns A list of users, which may be empty.
- */
- getUsers() {
- return Object.values(this.users);
- }
-
- /**
- * Retrieve scrollback for this room.
- * @param room - The matrix room
- * @param limit - The max number of old events to retrieve.
- * @returns An array of objects which will be at most 'limit'
- * length and at least 0. The objects are the raw event JSON.
- */
- scrollback(room, limit) {
- return [];
- }
-
- /**
- * Store events for a room. The events have already been added to the timeline
- * @param room - The room to store events for.
- * @param events - The events to store.
- * @param token - The token associated with these events.
- * @param toStart - True if these are paginated results.
- */
- storeEvents(room, events, token, toStart) {
- // no-op because they've already been added to the room instance.
- }
-
- /**
- * Store a filter.
- */
- storeFilter(filter) {
- if (!(filter !== null && filter !== void 0 && filter.userId) || !(filter !== null && filter !== void 0 && filter.filterId)) return;
- this.filters.getOrCreate(filter.userId).set(filter.filterId, filter);
- }
-
- /**
- * Retrieve a filter.
- * @returns A filter or null.
- */
- getFilter(userId, filterId) {
- var _this$filters$get;
- return ((_this$filters$get = this.filters.get(userId)) === null || _this$filters$get === void 0 ? void 0 : _this$filters$get.get(filterId)) || null;
- }
-
- /**
- * Retrieve a filter ID with the given name.
- * @param filterName - The filter name.
- * @returns The filter ID or null.
- */
- getFilterIdByName(filterName) {
- if (!this.localStorage) {
- return null;
- }
- const key = "mxjssdk_memory_filter_" + filterName;
- // XXX Storage.getItem doesn't throw ...
- // or are we using something different
- // than window.localStorage in some cases
- // that does throw?
- // that would be very naughty
- try {
- const value = this.localStorage.getItem(key);
- if (isValidFilterId(value)) {
- return value;
- }
- } catch (e) {}
- return null;
- }
-
- /**
- * Set a filter name to ID mapping.
- */
- setFilterIdByName(filterName, filterId) {
- if (!this.localStorage) {
- return;
- }
- const key = "mxjssdk_memory_filter_" + filterName;
- try {
- if (isValidFilterId(filterId)) {
- this.localStorage.setItem(key, filterId);
- } else {
- this.localStorage.removeItem(key);
- }
- } catch (e) {}
- }
-
- /**
- * Store user-scoped account data events.
- * N.B. that account data only allows a single event per type, so multiple
- * events with the same type will replace each other.
- * @param events - The events to store.
- */
- storeAccountDataEvents(events) {
- events.forEach(event => {
- // MSC3391: an event with content of {} should be interpreted as deleted
- const isDeleted = !Object.keys(event.getContent()).length;
- if (isDeleted) {
- this.accountData.delete(event.getType());
- } else {
- this.accountData.set(event.getType(), event);
- }
- });
- }
-
- /**
- * Get account data event by event type
- * @param eventType - The event type being queried
- * @returns the user account_data event of given type, if any
- */
- getAccountData(eventType) {
- return this.accountData.get(eventType);
- }
-
- /**
- * setSyncData does nothing as there is no backing data store.
- *
- * @param syncData - The sync data
- * @returns An immediately resolved promise.
- */
- setSyncData(syncData) {
- return Promise.resolve();
- }
-
- /**
- * We never want to save becase we have nothing to save to.
- *
- * @returns If the store wants to save
- */
- wantsSave() {
- return false;
- }
-
- /**
- * Save does nothing as there is no backing data store.
- * @param force - True to force a save (but the memory
- * store still can't save anything)
- */
- save(force) {}
-
- /**
- * Startup does nothing as this store doesn't require starting up.
- * @returns An immediately resolved promise.
- */
- startup() {
- return Promise.resolve();
- }
-
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync() {
- return Promise.resolve(null);
- }
-
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken() {
- return Promise.resolve(null);
- }
-
- /**
- * Delete all data from this store.
- * @returns An immediately resolved promise.
- */
- deleteAllData() {
- this.rooms = {
- // roomId: Room
- };
- this.users = {
- // userId: User
- };
- this.syncToken = null;
- this.filters = new _utils.MapWithDefault(() => new Map());
- this.accountData = new Map(); // type : content
- return Promise.resolve();
- }
-
- /**
- * Returns the out-of-band membership events for this room that
- * were previously loaded.
- * @returns the events, potentially an empty array if OOB loading didn't yield any new members
- * @returns in case the members for this room haven't been stored yet
- */
- getOutOfBandMembers(roomId) {
- return Promise.resolve(this.oobMembers.get(roomId) || null);
- }
-
- /**
- * Stores the out-of-band membership events for this room. Note that
- * it still makes sense to store an empty array as the OOB status for the room is
- * marked as fetched, and getOutOfBandMembers will return an empty array instead of null
- * @param membershipEvents - the membership events to store
- * @returns when all members have been stored
- */
- setOutOfBandMembers(roomId, membershipEvents) {
- this.oobMembers.set(roomId, membershipEvents);
- return Promise.resolve();
- }
- clearOutOfBandMembers(roomId) {
- this.oobMembers.delete(roomId);
- return Promise.resolve();
- }
- getClientOptions() {
- return Promise.resolve(this.clientOptions);
- }
- storeClientOptions(options) {
- this.clientOptions = Object.assign({}, options);
- return Promise.resolve();
- }
- async getPendingEvents(roomId) {
- var _this$pendingEvents$r;
- return (_this$pendingEvents$r = this.pendingEvents[roomId]) !== null && _this$pendingEvents$r !== void 0 ? _this$pendingEvents$r : [];
- }
- async setPendingEvents(roomId, events) {
- this.pendingEvents[roomId] = events;
- }
- saveToDeviceBatches(batches) {
- for (const batch of batches) {
- this.pendingToDeviceBatches.push({
- id: this.nextToDeviceBatchId++,
- eventType: batch.eventType,
- txnId: batch.txnId,
- batch: batch.batch
- });
- }
- return Promise.resolve();
- }
- async getOldestToDeviceBatch() {
- if (this.pendingToDeviceBatches.length === 0) return null;
- return this.pendingToDeviceBatches[0];
- }
- removeToDeviceBatch(id) {
- this.pendingToDeviceBatches = this.pendingToDeviceBatches.filter(batch => batch.id !== id);
- return Promise.resolve();
- }
-}
-exports.MemoryStore = MemoryStore;
-//# sourceMappingURL=memory.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js.map
deleted file mode 100644
index becc757..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/memory.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"memory.js","names":["_user","require","_roomState","_utils","isValidFilterId","filterId","isValidStr","MemoryStore","constructor","opts","_defineProperty2","default","MapWithDefault","Map","event","state","member","membership","user","users","userId","User","name","setDisplayName","events","setRawDisplayName","getDirectionalContent","displayname","getContent","avatar_url","setAvatarUrl","localStorage","getSyncToken","syncToken","isNewlyCreated","Promise","resolve","setSyncToken","token","storeRoom","room","rooms","roomId","currentState","on","RoomStateEvent","Members","onRoomMember","getMembers","forEach","m","getRoom","getRooms","Object","values","removeRoom","removeListener","getRoomSummaries","map","summary","storeUser","getUser","getUsers","scrollback","limit","storeEvents","toStart","storeFilter","filter","filters","getOrCreate","set","getFilter","_this$filters$get","get","getFilterIdByName","filterName","key","value","getItem","e","setFilterIdByName","setItem","removeItem","storeAccountDataEvents","isDeleted","keys","length","accountData","delete","getType","getAccountData","eventType","setSyncData","syncData","wantsSave","save","force","startup","getSavedSync","getSavedSyncToken","deleteAllData","getOutOfBandMembers","oobMembers","setOutOfBandMembers","membershipEvents","clearOutOfBandMembers","getClientOptions","clientOptions","storeClientOptions","options","assign","getPendingEvents","_this$pendingEvents$r","pendingEvents","setPendingEvents","saveToDeviceBatches","batches","batch","pendingToDeviceBatches","push","id","nextToDeviceBatchId","txnId","getOldestToDeviceBatch","removeToDeviceBatch","exports"],"sources":["../../src/store/memory.ts"],"sourcesContent":["/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module. See {@link MemoryStore} for the public class.\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { RoomState, RoomStateEvent } from \"../models/room-state\";\nimport { RoomMember } from \"../models/room-member\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\nimport { IStateEventWithRoomId } from \"../@types/search\";\nimport { IndexedToDeviceBatch, ToDeviceBatchWithTxnId } from \"../models/ToDeviceMessage\";\nimport { IStoredClientOpts } from \"../client\";\nimport { MapWithDefault } from \"../utils\";\n\nfunction isValidFilterId(filterId?: string | number | null): boolean {\n const isValidStr =\n typeof filterId === \"string\" &&\n !!filterId &&\n filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\n filterId !== \"null\";\n\n return isValidStr || typeof filterId === \"number\";\n}\n\nexport interface IOpts {\n /** The local storage instance to persist some forms of data such as tokens. Rooms will NOT be stored. */\n localStorage?: Storage;\n}\n\nexport class MemoryStore implements IStore {\n private rooms: Record<string, Room> = {}; // roomId: Room\n private users: Record<string, User> = {}; // userId: User\n private syncToken: string | null = null;\n // userId: {\n // filterId: Filter\n // }\n private filters: MapWithDefault<string, Map<string, Filter>> = new MapWithDefault(() => new Map());\n public accountData: Map<string, MatrixEvent> = new Map(); // type: content\n protected readonly localStorage?: Storage;\n private oobMembers: Map<string, IStateEventWithRoomId[]> = new Map(); // roomId: [member events]\n private pendingEvents: { [roomId: string]: Partial<IEvent>[] } = {};\n private clientOptions?: IStoredClientOpts;\n private pendingToDeviceBatches: IndexedToDeviceBatch[] = [];\n private nextToDeviceBatchId = 0;\n\n /**\n * Construct a new in-memory data store for the Matrix Client.\n * @param opts - Config options\n */\n public constructor(opts: IOpts = {}) {\n this.localStorage = opts.localStorage;\n }\n\n /**\n * Retrieve the token to stream from.\n * @returns The token or null.\n */\n public getSyncToken(): string | null {\n return this.syncToken;\n }\n\n /** @returns whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise<boolean> {\n return Promise.resolve(true);\n }\n\n /**\n * Set the token to stream from.\n * @param token - The token to stream from.\n */\n public setSyncToken(token: string): void {\n this.syncToken = token;\n }\n\n /**\n * Store the given room.\n * @param room - The room to be stored. All properties must be stored.\n */\n public storeRoom(room: Room): void {\n this.rooms[room.roomId] = room;\n // add listeners for room member changes so we can keep the room member\n // map up-to-date.\n room.currentState.on(RoomStateEvent.Members, this.onRoomMember);\n // add existing members\n room.currentState.getMembers().forEach((m) => {\n this.onRoomMember(null, room.currentState, m);\n });\n }\n\n /**\n * Called when a room member in a room being tracked by this store has been\n * updated.\n */\n private onRoomMember = (event: MatrixEvent | null, state: RoomState, member: RoomMember): void => {\n if (member.membership === \"invite\") {\n // We do NOT add invited members because people love to typo user IDs\n // which would then show up in these lists (!)\n return;\n }\n\n const user = this.users[member.userId] || new User(member.userId);\n if (member.name) {\n user.setDisplayName(member.name);\n if (member.events.member) {\n user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);\n }\n }\n if (member.events.member && member.events.member.getContent().avatar_url) {\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\n }\n this.users[user.userId] = user;\n };\n\n /**\n * Retrieve a room by its' room ID.\n * @param roomId - The room ID.\n * @returns The room or null.\n */\n public getRoom(roomId: string): Room | null {\n return this.rooms[roomId] || null;\n }\n\n /**\n * Retrieve all known rooms.\n * @returns A list of rooms, which may be empty.\n */\n public getRooms(): Room[] {\n return Object.values(this.rooms);\n }\n\n /**\n * Permanently delete a room.\n */\n public removeRoom(roomId: string): void {\n if (this.rooms[roomId]) {\n this.rooms[roomId].currentState.removeListener(RoomStateEvent.Members, this.onRoomMember);\n }\n delete this.rooms[roomId];\n }\n\n /**\n * Retrieve a summary of all the rooms.\n * @returns A summary of each room.\n */\n public getRoomSummaries(): RoomSummary[] {\n return Object.values(this.rooms).map(function (room) {\n return room.summary!;\n });\n }\n\n /**\n * Store a User.\n * @param user - The user to store.\n */\n public storeUser(user: User): void {\n this.users[user.userId] = user;\n }\n\n /**\n * Retrieve a User by its' user ID.\n * @param userId - The user ID.\n * @returns The user or null.\n */\n public getUser(userId: string): User | null {\n return this.users[userId] || null;\n }\n\n /**\n * Retrieve all known users.\n * @returns A list of users, which may be empty.\n */\n public getUsers(): User[] {\n return Object.values(this.users);\n }\n\n /**\n * Retrieve scrollback for this room.\n * @param room - The matrix room\n * @param limit - The max number of old events to retrieve.\n * @returns An array of objects which will be at most 'limit'\n * length and at least 0. The objects are the raw event JSON.\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room. The events have already been added to the timeline\n * @param room - The room to store events for.\n * @param events - The events to store.\n * @param token - The token associated with these events.\n * @param toStart - True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void {\n // no-op because they've already been added to the room instance.\n }\n\n /**\n * Store a filter.\n */\n public storeFilter(filter: Filter): void {\n if (!filter?.userId || !filter?.filterId) return;\n this.filters.getOrCreate(filter.userId).set(filter.filterId, filter);\n }\n\n /**\n * Retrieve a filter.\n * @returns A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n return this.filters.get(userId)?.get(filterId) || null;\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param filterName - The filter name.\n * @returns The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n if (!this.localStorage) {\n return null;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n // XXX Storage.getItem doesn't throw ...\n // or are we using something different\n // than window.localStorage in some cases\n // that does throw?\n // that would be very naughty\n try {\n const value = this.localStorage.getItem(key);\n if (isValidFilterId(value)) {\n return value;\n }\n } catch (e) {}\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n */\n public setFilterIdByName(filterName: string, filterId?: string): void {\n if (!this.localStorage) {\n return;\n }\n const key = \"mxjssdk_memory_filter_\" + filterName;\n try {\n if (isValidFilterId(filterId)) {\n this.localStorage.setItem(key, filterId!);\n } else {\n this.localStorage.removeItem(key);\n }\n } catch (e) {}\n }\n\n /**\n * Store user-scoped account data events.\n * N.B. that account data only allows a single event per type, so multiple\n * events with the same type will replace each other.\n * @param events - The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]): void {\n events.forEach((event) => {\n // MSC3391: an event with content of {} should be interpreted as deleted\n const isDeleted = !Object.keys(event.getContent()).length;\n if (isDeleted) {\n this.accountData.delete(event.getType());\n } else {\n this.accountData.set(event.getType(), event);\n }\n });\n }\n\n /**\n * Get account data event by event type\n * @param eventType - The event type being queried\n * @returns the user account_data event of given type, if any\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return this.accountData.get(eventType);\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param syncData - The sync data\n * @returns An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise<void> {\n return Promise.resolve();\n }\n\n /**\n * We never want to save becase we have nothing to save to.\n *\n * @returns If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n * @param force - True to force a save (but the memory\n * store still can't save anything)\n */\n public save(force: boolean): void {}\n\n /**\n * Startup does nothing as this store doesn't require starting up.\n * @returns An immediately resolved promise.\n */\n public startup(): Promise<void> {\n return Promise.resolve();\n }\n\n /**\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise<ISavedSync | null> {\n return Promise.resolve(null);\n }\n\n /**\n * @returns If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise<string | null> {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store.\n * @returns An immediately resolved promise.\n */\n public deleteAllData(): Promise<void> {\n this.rooms = {\n // roomId: Room\n };\n this.users = {\n // userId: User\n };\n this.syncToken = null;\n this.filters = new MapWithDefault(() => new Map());\n this.accountData = new Map(); // type : content\n return Promise.resolve();\n }\n\n /**\n * Returns the out-of-band membership events for this room that\n * were previously loaded.\n * @returns the events, potentially an empty array if OOB loading didn't yield any new members\n * @returns in case the members for this room haven't been stored yet\n */\n public getOutOfBandMembers(roomId: string): Promise<IStateEventWithRoomId[] | null> {\n return Promise.resolve(this.oobMembers.get(roomId) || null);\n }\n\n /**\n * Stores the out-of-band membership events for this room. Note that\n * it still makes sense to store an empty array as the OOB status for the room is\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\n * @param membershipEvents - the membership events to store\n * @returns when all members have been stored\n */\n public setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void> {\n this.oobMembers.set(roomId, membershipEvents);\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(roomId: string): Promise<void> {\n this.oobMembers.delete(roomId);\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise<IStoredClientOpts | undefined> {\n return Promise.resolve(this.clientOptions);\n }\n\n public storeClientOptions(options: IStoredClientOpts): Promise<void> {\n this.clientOptions = Object.assign({}, options);\n return Promise.resolve();\n }\n\n public async getPendingEvents(roomId: string): Promise<Partial<IEvent>[]> {\n return this.pendingEvents[roomId] ?? [];\n }\n\n public async setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void> {\n this.pendingEvents[roomId] = events;\n }\n\n public saveToDeviceBatches(batches: ToDeviceBatchWithTxnId[]): Promise<void> {\n for (const batch of batches) {\n this.pendingToDeviceBatches.push({\n id: this.nextToDeviceBatchId++,\n eventType: batch.eventType,\n txnId: batch.txnId,\n batch: batch.batch,\n });\n }\n return Promise.resolve();\n }\n\n public async getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null> {\n if (this.pendingToDeviceBatches.length === 0) return null;\n return this.pendingToDeviceBatches[0];\n }\n\n public removeToDeviceBatch(id: number): Promise<void> {\n this.pendingToDeviceBatches = this.pendingToDeviceBatches.filter((batch) => batch.id !== id);\n return Promise.resolve();\n }\n}\n"],"mappings":";;;;;;;;AAsBA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AAjCA;AACA;AACA;A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CAAC,CAAC;EACzC;EAEOM,mBAAmBA,CAACJ,EAAU,EAAiB;IAClD,IAAI,CAACF,sBAAsB,GAAG,IAAI,CAACA,sBAAsB,CAACnD,MAAM,CAAEkD,KAAK,IAAKA,KAAK,CAACG,EAAE,KAAKA,EAAE,CAAC;IAC5F,OAAOtF,OAAO,CAACC,OAAO,EAAE;EAC5B;AACJ;AAAC0F,OAAA,CAAAvH,WAAA,GAAAA,WAAA"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts
deleted file mode 100644
index 8ba1498..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * This is an internal module.
- */
-import { EventType } from "../@types/event";
-import { Room } from "../models/room";
-import { User } from "../models/user";
-import { IEvent, MatrixEvent } from "../models/event";
-import { Filter } from "../filter";
-import { ISavedSync, IStore } from "./index";
-import { RoomSummary } from "../models/room-summary";
-import { ISyncResponse } from "../sync-accumulator";
-import { IStateEventWithRoomId } from "../@types/search";
-import { IndexedToDeviceBatch, ToDeviceBatch } from "../models/ToDeviceMessage";
-import { IStoredClientOpts } from "../client";
-/**
- * Construct a stub store. This does no-ops on most store methods.
- */
-export declare class StubStore implements IStore {
- readonly accountData: Map<any, any>;
- private fromToken;
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated(): Promise<boolean>;
- /**
- * Get the sync token.
- */
- getSyncToken(): string | null;
- /**
- * Set the sync token.
- */
- setSyncToken(token: string): void;
- /**
- * No-op.
- */
- storeRoom(room: Room): void;
- /**
- * No-op.
- */
- getRoom(roomId: string): Room | null;
- /**
- * No-op.
- * @returns An empty array.
- */
- getRooms(): Room[];
- /**
- * Permanently delete a room.
- */
- removeRoom(roomId: string): void;
- /**
- * No-op.
- * @returns An empty array.
- */
- getRoomSummaries(): RoomSummary[];
- /**
- * No-op.
- */
- storeUser(user: User): void;
- /**
- * No-op.
- */
- getUser(userId: string): User | null;
- /**
- * No-op.
- */
- getUsers(): User[];
- /**
- * No-op.
- */
- scrollback(room: Room, limit: number): MatrixEvent[];
- /**
- * Store events for a room.
- * @param room - The room to store events for.
- * @param events - The events to store.
- * @param token - The token associated with these events.
- * @param toStart - True if these are paginated results.
- */
- storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void;
- /**
- * Store a filter.
- */
- storeFilter(filter: Filter): void;
- /**
- * Retrieve a filter.
- * @returns A filter or null.
- */
- getFilter(userId: string, filterId: string): Filter | null;
- /**
- * Retrieve a filter ID with the given name.
- * @param filterName - The filter name.
- * @returns The filter ID or null.
- */
- getFilterIdByName(filterName: string): string | null;
- /**
- * Set a filter name to ID mapping.
- */
- setFilterIdByName(filterName: string, filterId?: string): void;
- /**
- * Store user-scoped account data events
- * @param events - The events to store.
- */
- storeAccountDataEvents(events: MatrixEvent[]): void;
- /**
- * Get account data event by event type
- * @param eventType - The event type being queried
- */
- getAccountData(eventType: EventType | string): MatrixEvent | undefined;
- /**
- * setSyncData does nothing as there is no backing data store.
- *
- * @param syncData - The sync data
- * @returns An immediately resolved promise.
- */
- setSyncData(syncData: ISyncResponse): Promise<void>;
- /**
- * We never want to save because we have nothing to save to.
- *
- * @returns If the store wants to save
- */
- wantsSave(): boolean;
- /**
- * Save does nothing as there is no backing data store.
- */
- save(): void;
- /**
- * Startup does nothing.
- * @returns An immediately resolved promise.
- */
- startup(): Promise<void>;
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync(): Promise<ISavedSync | null>;
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken(): Promise<string | null>;
- /**
- * Delete all data from this store. Does nothing since this store
- * doesn't store anything.
- * @returns An immediately resolved promise.
- */
- deleteAllData(): Promise<void>;
- getOutOfBandMembers(): Promise<IStateEventWithRoomId[] | null>;
- setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void>;
- clearOutOfBandMembers(): Promise<void>;
- getClientOptions(): Promise<IStoredClientOpts | undefined>;
- storeClientOptions(options: IStoredClientOpts): Promise<void>;
- getPendingEvents(roomId: string): Promise<Partial<IEvent>[]>;
- setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void>;
- saveToDeviceBatches(batch: ToDeviceBatch[]): Promise<void>;
- getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null>;
- removeToDeviceBatch(id: number): Promise<void>;
-}
-//# sourceMappingURL=stub.d.ts.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map
deleted file mode 100644
index c5c9ad8..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/store/stub.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAA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,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,sBAAsB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAIxD,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG9D"} \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js
deleted file mode 100644
index fc3624f..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js
+++ /dev/null
@@ -1,256 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.StubStore = void 0;
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-/*
-Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-/**
- * This is an internal module.
- */
-
-/**
- * Construct a stub store. This does no-ops on most store methods.
- */
-class StubStore {
- constructor() {
- (0, _defineProperty2.default)(this, "accountData", new Map());
- (0, _defineProperty2.default)(this, "fromToken", null);
- }
- /** @returns whether or not the database was newly created in this session. */
- isNewlyCreated() {
- return Promise.resolve(true);
- }
-
- /**
- * Get the sync token.
- */
- getSyncToken() {
- return this.fromToken;
- }
-
- /**
- * Set the sync token.
- */
- setSyncToken(token) {
- this.fromToken = token;
- }
-
- /**
- * No-op.
- */
- storeRoom(room) {}
-
- /**
- * No-op.
- */
- getRoom(roomId) {
- return null;
- }
-
- /**
- * No-op.
- * @returns An empty array.
- */
- getRooms() {
- return [];
- }
-
- /**
- * Permanently delete a room.
- */
- removeRoom(roomId) {
- return;
- }
-
- /**
- * No-op.
- * @returns An empty array.
- */
- getRoomSummaries() {
- return [];
- }
-
- /**
- * No-op.
- */
- storeUser(user) {}
-
- /**
- * No-op.
- */
- getUser(userId) {
- return null;
- }
-
- /**
- * No-op.
- */
- getUsers() {
- return [];
- }
-
- /**
- * No-op.
- */
- scrollback(room, limit) {
- return [];
- }
-
- /**
- * Store events for a room.
- * @param room - The room to store events for.
- * @param events - The events to store.
- * @param token - The token associated with these events.
- * @param toStart - True if these are paginated results.
- */
- storeEvents(room, events, token, toStart) {}
-
- /**
- * Store a filter.
- */
- storeFilter(filter) {}
-
- /**
- * Retrieve a filter.
- * @returns A filter or null.
- */
- getFilter(userId, filterId) {
- return null;
- }
-
- /**
- * Retrieve a filter ID with the given name.
- * @param filterName - The filter name.
- * @returns The filter ID or null.
- */
- getFilterIdByName(filterName) {
- return null;
- }
-
- /**
- * Set a filter name to ID mapping.
- */
- setFilterIdByName(filterName, filterId) {}
-
- /**
- * Store user-scoped account data events
- * @param events - The events to store.
- */
- storeAccountDataEvents(events) {}
-
- /**
- * Get account data event by event type
- * @param eventType - The event type being queried
- */
- getAccountData(eventType) {
- return undefined;
- }
-
- /**
- * setSyncData does nothing as there is no backing data store.
- *
- * @param syncData - The sync data
- * @returns An immediately resolved promise.
- */
- setSyncData(syncData) {
- return Promise.resolve();
- }
-
- /**
- * We never want to save because we have nothing to save to.
- *
- * @returns If the store wants to save
- */
- wantsSave() {
- return false;
- }
-
- /**
- * Save does nothing as there is no backing data store.
- */
- save() {}
-
- /**
- * Startup does nothing.
- * @returns An immediately resolved promise.
- */
- startup() {
- return Promise.resolve();
- }
-
- /**
- * @returns Promise which resolves with a sync response to restore the
- * client state to where it was at the last save, or null if there
- * is no saved sync data.
- */
- getSavedSync() {
- return Promise.resolve(null);
- }
-
- /**
- * @returns If there is a saved sync, the nextBatch token
- * for this sync, otherwise null.
- */
- getSavedSyncToken() {
- return Promise.resolve(null);
- }
-
- /**
- * Delete all data from this store. Does nothing since this store
- * doesn't store anything.
- * @returns An immediately resolved promise.
- */
- deleteAllData() {
- return Promise.resolve();
- }
- getOutOfBandMembers() {
- return Promise.resolve(null);
- }
- setOutOfBandMembers(roomId, membershipEvents) {
- return Promise.resolve();
- }
- clearOutOfBandMembers() {
- return Promise.resolve();
- }
- getClientOptions() {
- return Promise.resolve(undefined);
- }
- storeClientOptions(options) {
- return Promise.resolve();
- }
- async getPendingEvents(roomId) {
- return [];
- }
- setPendingEvents(roomId, events) {
- return Promise.resolve();
- }
- async saveToDeviceBatches(batch) {
- return Promise.resolve();
- }
- getOldestToDeviceBatch() {
- return Promise.resolve(null);
- }
- async removeToDeviceBatch(id) {
- return Promise.resolve();
- }
-}
-exports.StubStore = StubStore;
-//# sourceMappingURL=stub.js.map \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js.map
deleted file mode 100644
index 066de64..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/store/stub.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"stub.js","names":["StubStore","constructor","_defineProperty2","default","Map","isNewlyCreated","Promise","resolve","getSyncToken","fromToken","setSyncToken","token","storeRoom","room","getRoom","roomId","getRooms","removeRoom","getRoomSummaries","storeUser","user","getUser","userId","getUsers","scrollback","limit","storeEvents","events","toStart","storeFilter","filter","getFilter","filterId","getFilterIdByName","filterName","setFilterIdByName","storeAccountDataEvents","getAccountData","eventType","undefined","setSyncData","syncData","wantsSave","save","startup","getSavedSync","getSavedSyncToken","deleteAllData","getOutOfBandMembers","setOutOfBandMembers","membershipEvents","clearOutOfBandMembers","getClientOptions","storeClientOptions","options","getPendingEvents","setPendingEvents","saveToDeviceBatches","batch","getOldestToDeviceBatch","removeToDeviceBatch","id","exports"],"sources":["../../src/store/stub.ts"],"sourcesContent":["/*\nCopyright 2015 - 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * This is an internal module.\n */\n\nimport { EventType } from \"../@types/event\";\nimport { Room } from \"../models/room\";\nimport { User } from \"../models/user\";\nimport { IEvent, MatrixEvent } from \"../models/event\";\nimport { Filter } from \"../filter\";\nimport { ISavedSync, IStore } from \"./index\";\nimport { RoomSummary } from \"../models/room-summary\";\nimport { ISyncResponse } from \"../sync-accumulator\";\nimport { IStateEventWithRoomId } from \"../@types/search\";\nimport { IndexedToDeviceBatch, ToDeviceBatch } from \"../models/ToDeviceMessage\";\nimport { IStoredClientOpts } from \"../client\";\n\n/**\n * Construct a stub store. This does no-ops on most store methods.\n */\nexport class StubStore implements IStore {\n public readonly accountData = new Map(); // stub\n private fromToken: string | null = null;\n\n /** @returns whether or not the database was newly created in this session. */\n public isNewlyCreated(): Promise<boolean> {\n return Promise.resolve(true);\n }\n\n /**\n * Get the sync token.\n */\n public getSyncToken(): string | null {\n return this.fromToken;\n }\n\n /**\n * Set the sync token.\n */\n public setSyncToken(token: string): void {\n this.fromToken = token;\n }\n\n /**\n * No-op.\n */\n public storeRoom(room: Room): void {}\n\n /**\n * No-op.\n */\n public getRoom(roomId: string): Room | null {\n return null;\n }\n\n /**\n * No-op.\n * @returns An empty array.\n */\n public getRooms(): Room[] {\n return [];\n }\n\n /**\n * Permanently delete a room.\n */\n public removeRoom(roomId: string): void {\n return;\n }\n\n /**\n * No-op.\n * @returns An empty array.\n */\n public getRoomSummaries(): RoomSummary[] {\n return [];\n }\n\n /**\n * No-op.\n */\n public storeUser(user: User): void {}\n\n /**\n * No-op.\n */\n public getUser(userId: string): User | null {\n return null;\n }\n\n /**\n * No-op.\n */\n public getUsers(): User[] {\n return [];\n }\n\n /**\n * No-op.\n */\n public scrollback(room: Room, limit: number): MatrixEvent[] {\n return [];\n }\n\n /**\n * Store events for a room.\n * @param room - The room to store events for.\n * @param events - The events to store.\n * @param token - The token associated with these events.\n * @param toStart - True if these are paginated results.\n */\n public storeEvents(room: Room, events: MatrixEvent[], token: string | null, toStart: boolean): void {}\n\n /**\n * Store a filter.\n */\n public storeFilter(filter: Filter): void {}\n\n /**\n * Retrieve a filter.\n * @returns A filter or null.\n */\n public getFilter(userId: string, filterId: string): Filter | null {\n return null;\n }\n\n /**\n * Retrieve a filter ID with the given name.\n * @param filterName - The filter name.\n * @returns The filter ID or null.\n */\n public getFilterIdByName(filterName: string): string | null {\n return null;\n }\n\n /**\n * Set a filter name to ID mapping.\n */\n public setFilterIdByName(filterName: string, filterId?: string): void {}\n\n /**\n * Store user-scoped account data events\n * @param events - The events to store.\n */\n public storeAccountDataEvents(events: MatrixEvent[]): void {}\n\n /**\n * Get account data event by event type\n * @param eventType - The event type being queried\n */\n public getAccountData(eventType: EventType | string): MatrixEvent | undefined {\n return undefined;\n }\n\n /**\n * setSyncData does nothing as there is no backing data store.\n *\n * @param syncData - The sync data\n * @returns An immediately resolved promise.\n */\n public setSyncData(syncData: ISyncResponse): Promise<void> {\n return Promise.resolve();\n }\n\n /**\n * We never want to save because we have nothing to save to.\n *\n * @returns If the store wants to save\n */\n public wantsSave(): boolean {\n return false;\n }\n\n /**\n * Save does nothing as there is no backing data store.\n */\n public save(): void {}\n\n /**\n * Startup does nothing.\n * @returns An immediately resolved promise.\n */\n public startup(): Promise<void> {\n return Promise.resolve();\n }\n\n /**\n * @returns Promise which resolves with a sync response to restore the\n * client state to where it was at the last save, or null if there\n * is no saved sync data.\n */\n public getSavedSync(): Promise<ISavedSync | null> {\n return Promise.resolve(null);\n }\n\n /**\n * @returns If there is a saved sync, the nextBatch token\n * for this sync, otherwise null.\n */\n public getSavedSyncToken(): Promise<string | null> {\n return Promise.resolve(null);\n }\n\n /**\n * Delete all data from this store. Does nothing since this store\n * doesn't store anything.\n * @returns An immediately resolved promise.\n */\n public deleteAllData(): Promise<void> {\n return Promise.resolve();\n }\n\n public getOutOfBandMembers(): Promise<IStateEventWithRoomId[] | null> {\n return Promise.resolve(null);\n }\n\n public setOutOfBandMembers(roomId: string, membershipEvents: IStateEventWithRoomId[]): Promise<void> {\n return Promise.resolve();\n }\n\n public clearOutOfBandMembers(): Promise<void> {\n return Promise.resolve();\n }\n\n public getClientOptions(): Promise<IStoredClientOpts | undefined> {\n return Promise.resolve(undefined);\n }\n\n public storeClientOptions(options: IStoredClientOpts): Promise<void> {\n return Promise.resolve();\n }\n\n public async getPendingEvents(roomId: string): Promise<Partial<IEvent>[]> {\n return [];\n }\n\n public setPendingEvents(roomId: string, events: Partial<IEvent>[]): Promise<void> {\n return Promise.resolve();\n }\n\n public async saveToDeviceBatches(batch: ToDeviceBatch[]): Promise<void> {\n return Promise.resolve();\n }\n\n public getOldestToDeviceBatch(): Promise<IndexedToDeviceBatch | null> {\n return Promise.resolve(null);\n }\n\n public async removeToDeviceBatch(id: number): Promise<void> {\n return Promise.resolve();\n }\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAcA;AACA;AACA;AACO,MAAMA,SAAS,CAAmB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACP,IAAIC,GAAG,EAAE;IAAA,IAAAF,gBAAA,CAAAC,OAAA,qBACJ,IAAI;EAAA;EAEvC;EACOE,cAAcA,CAAA,EAAqB;IACtC,OAAOC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC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