Methods
alerts() → {AlertsHelper}
Access alert-related helper functions.
- Source:
Returns:
A newly-constructed alert helper instance.
- Type
- AlertsHelper
conversations() → {ConversationsHelper}
Access conversation-related helper functions.
- Source:
Returns:
A newly-constructed conversation helper instance.
- Type
- ConversationsHelper
(async) health()
Schedule an empty request which we expect to always succeed under nominal conditions.
- Source:
http() → {Http}
Access the inner Http instance which can be used to make raw requests.
- Source:
Returns:
The current Http instance in use by this wrapper.
- Type
- Http
(async) init(token, health)
Initialise this wrapper with a provided API token.
By default, initialisation of this wrapper will execute a health check which we expect to always succeed under nominal conditions. If the request does fail, we expect subsequent requests to other endpoints to also fail. In this situation, we conclude that an initialisation failure has occured. We reject the returned Promise and pass back the error to the caller.
By default, initialisation of this wrapper will execute a health check which we expect to always succeed under nominal conditions. If the request does fail, we expect subsequent requests to other endpoints to also fail. In this situation, we conclude that an initialisation failure has occured. We reject the returned Promise and pass back the error to the caller.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
token |
Token | The constructed API token. | |
health |
boolean | true | Whether or not to execute a health check during initialisation. |
- Source:
members() → {MembersHelper}
Access member-related helper functions.
- Source:
Returns:
A newly-constructed member helper instance.
- Type
- MembersHelper
(async) ping() → {number}
Schedule an empty request and measure how long the API took to respond.
This duration may not be representative of the raw request latency due to the fact that requests may be stalled locally within this wrapper to ensure compliance with rate limiting rules. Whilst this is a trade-off, it can be argued that the returned duration will be more representative of the true latencies experienced.
This duration may not be representative of the raw request latency due to the fact that requests may be stalled locally within this wrapper to ensure compliance with rate limiting rules. Whilst this is a trade-off, it can be argued that the returned duration will be more representative of the true latencies experienced.
- Source:
Returns:
The response time in milliseconds.
- Type
- number
resources() → {ResourcesHelper}
Access resource-related helper functions.
- Source:
Returns:
A newly-constructed resource helper instance.
- Type
- ResourcesHelper
threads() → {ThreadsHelper}
Access thread-related helper functions.
- Source:
Returns:
A newly-constructed thread helper instance.
- Type
- ThreadsHelper