Creates an instance of MatrixCrudRepository.
Use SimpleMatrixClient.login(user, pw) : Promise<SimpleMatrixClient>
to get a client instance which has been authenticated.
The MatrixType for this type of resource. Use matrix-style namespace
syntax, eg. com.example.foo.dto
.
Optional. The state key, defaults to ''.
Optional. If defined, this service account user will be joined to any created rooms and removed from them when resoure-room is destroyed.
Optional. The state event type to add to any resource which is
deleted. Defaults to MatrixType.FI_NOR_DELETED
.
NOTE! This only has partial support. Filtering for example does not support it yet.
Optional. The state key for deletedType, defaults to ''.
Optional. List of Matrix rooms who's members will be able to access any resources (eg. rooms) created in this repository without an invite.
Optional. List of allowed event IDs in the room.
Optional. Test function to check if the type really is T.
Optional. The name of the T type for debugging purposes. Defaults to "T".
Optional. Function to explain if isT fails
Private
Readonly
_allowedPrivate
Readonly
_allowedPrivate
Readonly
_clientPrivate
Readonly
_deletedPrivate
Readonly
_deletedPrivate
Readonly
_explainTPrivate
Readonly
_isTPrivate
Readonly
_servicePrivate
Readonly
_statePrivate
Readonly
_statePrivate
Readonly
_tPrivate
_getReturns all resources (eg. Matrix rooms) from the repository which are of this type.
Array of resources
Creates a resource in the repository for data
, eg. a room in Matrix for this resource.
The new resource
The data of the resource.
Optional
members: readonly string[]Any members which will be invited to this resource
Delete all
Removes a resource by id
from repository.
This will make the client leave & forget the Matrix room for this resource.
If the service account is defined, it will also make the service account to leave & forget the room.
Make the client and/or service account kick every other user out of the room also.
The resource with deleted
property as false
The ID of the resource to delete. This is a Matrix room ID.
Delete by item list
Search a resource from the repository with this ID.
Promise of the latest resource with this ID, if it's defined, otherwise
undefined
.
The ID of the resource. It's also a Matrix Room ID.
Optional
includeMembers: booleanInclude list of members who have access to this item.
Protected
findProtected
Find a record by an ID and update it.
Returns one resource (eg. Matrix room) which have this property defined in their state.
If no resource found, returns undefined
.
TypeError if multiple values found
This may also be a path to value inside the model,
eg. user.id
to match {user: {id: 123}}
.
The value to find
Returns all resources (eg. Matrix rooms) from the repository which are of this type.
Array of resources
Returns all resources (eg. Matrix rooms) which have this property defined in their state.
Array of resources
This may also be a path to value inside the model,
eg. user.id
to match {user: {id: 123}}
.
The value to find
Returns all resources (eg. Matrix rooms) from the repository which are of this type.
Array of resources
Private
isPrivate
Returns true if the list is in correct format.
Update the state of a resource located by this ID.
It will set the state of the Matrix room to jsonData
with a newer version number.
The ID of the resource. It's a Matrix Room ID.
New data
Update the state of a resource located by this ID.
It will set the state of the Matrix room to jsonData
with a newer version number.
New data
Wait for item to change
Optional
includeMembers: booleanOptional
timeout: numberStatic
setGenerated using TypeDoc
Saves JSON-able objects of type T as special Matrix.org rooms identified by
stateType
andstateKey
.See also MemoryRepository