Construct a store suitable for room bridging information. Data is stored as RoomBridgeStoreEntrys which have the following serialized format:
{
id: "unique_id", // customisable
matrix_id: "room_id",
remote_id: "remote_room_id",
matrix: { serialised matrix room info },
remote: { serialised remote room info },
data: { ... any additional info ... }
}
If a unique 'id' is not given, the store will generate one by concatenating
the matrix_id
and the remote_id
. The delimiter
used is a property on this store and can be modified.
The structure of Entry objects means that it is efficient to select based off the 'id', 'matrix_id' or 'remote_id'. Additional indexes can be added manually.
The connected NEDB database instance
Readonly
dbA batched version of getLinkedRemoteRooms
.
A mapping of room_id to RemoteRoom.
RoomBridgeStore#getLinkedRemoteRooms
Get a list of entries based on the link's data value.
The data values to retrieve based from.
store.linkRooms(matrixRoom, remoteRoom, { some_key: "some_val" });
store.getEntriesByLinkData({
some_key: "some_val"
});
Get a list of entries based on the matrix_id of each entry.
A batch version of getEntriesByMatrixId
.
Resolves to a map of room_id => Entry[]
Get a list of entries based on a MatrixRoom data value.
The data values to retrieve based from.
matrixRoom.set("some_key", "some_val");
// store matrixRoom and then:
store.getEntriesByMatrixRoomData({
some_key: "some_val"
});
Get a list of entries based on the remote_id of each entry.
Get a list of entries based on a RemoteRoom data value.
The data values to retrieve based from.
remoteRoom.set("some_key", "some_val");
// store remoteRoom and then:
store.getEntriesByRemoteRoomData({
some_key: "some_val"
});
Get an existing entry based on the provided entry ID.
The ID of the entry to retrieve.
Get all entries with the given remote_id which have a Matrix room within.
Get all entries with the given matrix_id which have a Remote room within.
Get an entry's Matrix room based on the provided room_id. The entry MUST have an 'id' of the room_id and there MUST be a Matrix room contained within the entry for this to return.
RoomBridgeStore#setMatrixRoom
Create a link between a matrix room and remote room. This will create an entry with:
The matrix room
The remote room
Information about this mapping.
Optional
linkId: stringThe id value to set. If not given, a unique ID will be created from the matrix_id and remote_id.
Create an entry with only a matrix room. Sets the 'id' of the entry to the Matrix room ID. If an entry already exists with this 'id', it will be replaced. This function is useful if you just want to store a room with some data and not worry about any mappings.
RoomBridgeStore#getMatrixRoom
Insert an entry, clobbering based on the ID of the entry.
Static
createGenerated using TypeDoc
Base class for bridge stores.