new AtlasClient()
- Source:
Methods
(async, static) authenticateViaCode(userTag, code, optionsopt) → {AtlasClient}
- Source:
Authentication challenge response for SMS-code based users. You probably don't need to call
this method directly as it will be associated with
AuthenticationRequestChallenge.authenticate
in most cases.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userTag |
Tag | ||
code |
string | The 6 digit SMS code you received | |
options |
Object |
<optional> |
Constructor options for AtlasClient |
Returns:
- Type
- AtlasClient
(async, static) authenticateViaPassword(userTag, password, optionsopt) → {AtlasClient}
- Source:
Authentication challenge response for password based users. You probably don't need to call
this method directly as it will be associated with
AuthenticationRequestChallenge.authenticate
in most cases.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userTag |
Tag | ||
password |
string | ||
options |
Object |
<optional> |
Constructor options for AtlasClient |
Returns:
- Type
- AtlasClient
(async, static) authenticateViaPasswordOtp(userTag, password, otp, optionsopt) → {AtlasClient}
- Source:
Authentication challenge response for password+otp (two-factor auth) based users.
You probably don't need to call this method directly as it will be associated with
AuthenticationRequestChallenge.authenticate
in most cases.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userTag |
Tag | ||
password |
string | ||
otp |
string | 2FA code | |
options |
Object |
<optional> |
Constructor options for AtlasClient |
Returns:
- Type
- AtlasClient
(async, static) authenticateViaToken(userauthtoken, optionsopt) → {AtlasClient}
- Source:
Authentication challenge response for API token users. Typically used by bots.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userauthtoken |
string | The secret auth token for this user. | |
options |
Object |
<optional> |
Constructor options for AtlasClient |
Returns:
- Type
- AtlasClient
(async, static) factory() → {AtlasClient}
- Source:
Produce a default instance.
Returns:
- Type
- AtlasClient
(async, static) requestAuthentication(userTag, optionsopt) → {AuthenticationRequestChallenge}
- Source:
Begin authentication process with Atlas server.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userTag |
Tag | ||
options |
Object |
<optional> |
Options to be fed to {@link |
Returns:
(async) fetch(urn, optionsopt) → {Object}
- Source:
Perform an authenticated HTTP fetch to the Atlas service.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
urn |
string | The URN of the resource being requested. | |
options |
Object |
<optional> |
Standard fetch options. |
Returns:
- The response object (decoded JSON).
- Type
- Object
(async) getDevices() → {Array.<Object>}
- Source:
The current set of known devices for your account.
Returns:
Device info objects.
- Type
- Array.<Object>
(async) getUsers(userIds, onlyDiropt) → {Array.<Object>}
- Source:
Get user objects based on a list of user IDs.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userIds |
Array.<string> | Array of user UUIDs to lookup. | |
onlyDir |
boolean |
<optional> |
Only use the Forsta public directory. E.g. only return lightweight user objects. |
Returns:
User objects.
- Type
- Array.<Object>
(async) maintainJWT(forceRefresh, authenticator, onRefreshopt)
- Source:
A background task that will keep a sessions JWT fresh.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
forceRefresh |
boolean | Perform an immediate refresh. | |
authenticator |
function | Auth handler used for doing JWT refresh. | |
onRefresh |
function |
<optional> |
Callback fired when refresh takes place. |
(async) resolveTags(expression) → {ResolvedTagExpression}
- Source:
Take a tag expression (i.e "@foo + @bar - (@joe + @sarah)") and parse it into the
current user membership.
Parameters:
Name | Type | Description |
---|---|---|
expression |
TagExpression |
Returns:
(async) resolveTagsBatch(expression) → {Array.<ResolvedTagExpression>}
- Source:
Like
resolveTags
but performs a batched fetch with an array
of expressions. The results are in the same order as the input array
and invalid response will be set to undefined.
Parameters:
Name | Type | Description |
---|---|---|
expression |
Array.<TagExpression> |
Returns:
- Type
- Array.<ResolvedTagExpression>