Members
# EventKind
Represents the different kinds of events a bot/appservice might see.
# constant METRIC_IDENTITY_CLIENT_FAILED_FUNCTION_CALL
Counter metric for failed function calls on an IdentityClient. Uses an IdentityClientCallContext.
# constant METRIC_IDENTITY_CLIENT_FUNCTION_CALL
Time-series metric for how long a function call takes on an IdentityClient. Uses an IdentityClientCallContext.
# constant METRIC_IDENTITY_CLIENT_SUCCESSFUL_FUNCTION_CALL
Counter metric for successful function calls on an IdentityClient. Uses an IdentityClientCallContext.
# constant METRIC_INTENT_FAILED_FUNCTION_CALL
Counter metric for failed function calls on an Intent. Uses a IntentCallContext.
# constant METRIC_INTENT_FUNCTION_CALL
Time-series metric for how long a function call takes on an Intent. Uses a IntentCallContext.
# constant METRIC_INTENT_SUCCESSFUL_FUNCTION_CALL
Counter metric for successful function calls on an Intent. Uses a IntentCallContext.
# constant METRIC_MATRIX_CLIENT_FAILED_FUNCTION_CALL
Counter metric for failed function calls on a MatrixClient. Uses a MatrixClientCallContext.
# constant METRIC_MATRIX_CLIENT_FUNCTION_CALL
Time-series metric for how long a function call takes on MatrixClient. Uses a MatrixClientCallContext.
# constant METRIC_MATRIX_CLIENT_SUCCESSFUL_FUNCTION_CALL
Counter metric for successful function calls on a MatrixClient. Uses a MatrixClientCallContext.
# PowerLevelAction
Actions that can be guarded by power levels.
# RoomEncryptionAlgorithm
The kinds of room encryption algorithms allowed by the spec.
# constant SYNC_LOCK_NAME
# SynapseRoomProperty
Available properties on a Synapse room listing to order by.
Methods
# decodeBase64(s) → {Uint8Array}
Decodes Base64.
Parameters:
Name | Type | Description |
---|---|---|
s |
string
|
The Base64 string. |
The encoded data as a buffer.
Uint8Array
# decodeUnpaddedBase64(s) → {Uint8Array}
Decodes Unpadded Base64.
Parameters:
Name | Type | Description |
---|---|---|
s |
string
|
The Base64 string. |
The encoded data as a buffer.
Uint8Array
# decodeUnpaddedUrlSafeBase64(s) → {Uint8Array}
Decodes URL-Safe Unpadded Base64.
Parameters:
Name | Type | Description |
---|---|---|
s |
string
|
The Base64 string. |
The encoded data as a buffer.
Uint8Array
# doHttpRequest(baseUrl, method, endpoint, qs, body, headers, timeout, raw, contentType, noEncoding) → {Promise.<any>}
Performs a web request to a server.
Parameters:
Name | Type | Description |
---|---|---|
baseUrl |
string
|
The base URL to apply to the call. |
method |
"GET"
|
"POST"
|
"PUT"
|
"DELETE"
|
The HTTP method to use in the request |
endpoint |
string
|
The endpoint to call. For example: "/_matrix/client/v3/account/whoami" |
qs |
any
|
The query string to send. Optional. |
body |
any
|
The request body to send. Optional. Will be converted to JSON unless the type is a Buffer. |
headers |
any
|
Additional headers to send in the request. |
timeout |
number
|
The number of milliseconds to wait before timing out. |
raw |
boolean
|
If true, the raw response will be returned instead of the response body. |
contentType |
string
|
The content type to send. Only used if the `body` is a Buffer. |
noEncoding |
string
|
Set to true to disable encoding, and return a Buffer. Defaults to false |
Resolves to the response (body), rejected if a non-2xx status code was returned.
Promise.<any>
# encodeBase64(b) → {string}
Encodes Base64.
Parameters:
Name | Type | Description |
---|---|---|
b |
ArrayBuffer
|
Uint8Array
|
The buffer to encode. |
The Base64 string.
string
# encodeUnpaddedBase64(b) → {string}
Encodes Unpadded Base64.
Parameters:
Name | Type | Description |
---|---|---|
b |
ArrayBuffer
|
Uint8Array
|
The buffer to encode. |
The Base64 string.
string
# encodeUnpaddedUrlSafeBase64(b) → {string}
Encodes URL-Safe Unpadded Base64.
Parameters:
Name | Type | Description |
---|---|---|
b |
ArrayBuffer
|
Uint8Array
|
The buffer to encode. |
The Base64 string.
string
# extractRequestError(err) → {*}
Extracts the useful part of a request's error into something loggable.
Parameters:
Name | Type | Description |
---|---|---|
err |
Error
|
The error to parse. |
The extracted error, or the given error if unaltered.
*
# getRequestFn()
Gets the `request`-compatible function for performing HTTP requests.
The request function.
# requiresCrypto()
Flags a MatrixClient function as needing end-to-end encryption enabled.
# requiresReady()
Flags a CryptoClient function as needing the CryptoClient to be ready.
# setRequestFn(fn)
Sets the function to use for performing HTTP requests. Must be compatible with `request`.
Parameters:
Name | Type | Description |
---|---|---|
fn |
The new request function. |
# timedIdentityClientFunctionCall()
Times an IdentityClient function call for metrics.
# timedIntentFunctionCall()
Times an Intent function call for metrics.
# timedMatrixClientFunctionCall()
Times a MatrixClient function call for metrics.
# validateSpaceOrderString(order) → {boolean}
Validate the 'order' parameter of a child space entry. It must be a
string between the range of \x20 - \x7F and contain no more than 50
characters.
Parameters:
Name | Type | Description |
---|---|---|
order |
string
|
The 'order' parameter of a m.space.child |
If the string is not valid
Error
True if the string is valid
boolean
Type Definitions
"public"
|
"knock"
|
"invite"
|
"private"
# JoinRule
The types of join rules that are valid in Matrix.
"m.text"
|
"m.emote"
|
"m.notice"
|
"m.image"
|
"m.file"
|
"m.audio"
|
"m.location"
|
"m.video"
|
string
# MessageType
The types of messages that are valid in Matrix.
"online"
|
"offline"
|
"unavailable"
# PresenceState
The allowed states of presence in Matrix.
* `online`: The default state when the user is connected to an event stream.
* `unavailable`: The user is not reachable at this time e.g. they are idle.
* `offline`: The user is not connected to an event stream or is explicitly suppressing their profile information from being sent.
"private_chat"
|
"trusted_private_chat"
|
"public_chat"
# RoomPreset
"private_chat" sets:
- join_rules to `invite`
- history_visibility to `shared`
- guest_access to `can_join`
"trusted_private_chat" sets:
- join_rules to `invite`
- history_visibility to `shared`
- guest_access to `can_join`
- All invitees are given the same power level as the room creator.
"public_chat" sets:
- join_rules to `public`
- history_visibility to `shared`
- guest_access to `forbidden`
"public"
|
"private"
# RoomVisibility
"public" visibility indicates that the room will be shown in the published room list.
"private" visibility indicates that the room will not be included in published room list.
object
# ServerVersions
Representation of the server's supported specification versions and unstable feature flags.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
unstable_features |
Record.<string, boolean>
|
<optional> |
|
versions |
Array
|