new AppServiceRegistration(appServiceUrl)
Construct a new application service registration.
Parameters:
Name | Type | Description |
---|---|---|
appServiceUrl |
string | The base URL the AS can be reached via. |
- Source:
Methods
(static) generateToken() → {string}
Generate a random token.
- Source:
Returns:
A randomly generated token.
- Type
- string
addRegexPattern(type, regex, exclusive)
Add a regex pattern to be registered.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | : The type of regex pattern. Must be 'users', 'rooms', or 'aliases'. |
regex |
String | : The regex pattern. |
exclusive |
Boolean | : True to reserve the matched namespace. |
- Source:
Throws:
If given an invalid type or regex.
getAppServiceToken() → (nullable) {string}
Get the token the app service will use to communicate with the homeserver.
- Source:
Returns:
The token
- Type
- string
getHomeserverToken() → (nullable) {string}
Get the token the homeserver will use to communicate with the app service.
- Source:
Returns:
The token
- Type
- string
getSenderLocalpart() → (nullable) {string}
Get the desired user_id localpart for the app service itself.
- Source:
Returns:
The user_id localpart ("alice" in "@alice:domain")
- Type
- string
outputAsYaml(filename)
Output this registration to the given file name.
Parameters:
Name | Type | Description |
---|---|---|
filename |
String | The file name to write the yaml to. |
- Source:
Throws:
If required fields hs_token, as_token, url are missing.
setAppServiceToken(token)
Set the token the app service will use to communicate with the homeserver.
Parameters:
Name | Type | Description |
---|---|---|
token |
string | The token |
- Source:
setHomeserverToken(token)
Set the token the homeserver will use to communicate with the app service.
Parameters:
Name | Type | Description |
---|---|---|
token |
string | The token |
- Source:
setSenderLocalpart(localpart)
Set the desired user_id localpart for the app service itself.
Parameters:
Name | Type | Description |
---|---|---|
localpart |
string | The user_id localpart ("alice" in "@alice:domain") |
- Source: