An optional set of headers that can be added to every request
Protected
sessionA session object from a successful authentication
Protected
authShorthand auth basic string for API calls
Protected
clientThe client id to use for the connection
Protected
baseThe base URL for API interactions
Protected
httpThe HTTP client to use for http calls
Protected
storageA storage object to use for storing credentials. This will usually be window.localStorage
or window.sessionStorage
on the front-end, but could be anything.
Protected
logA logger to use for logging errors and other info
Protected
storageAn optional key to use for the storage key.
The client id to use for the connection
The secret to use for the connection. May be null if this is a front-end connection.
The base URL for API interactions
The HTTP client to use for http calls
A storage object to use for storing credentials. This will usually be window.localStorage
or window.sessionStorage
on the front-end, but could be anything.
A logger to use for logging errors and other info
An optional key to use for the storage key.
Takes the user's email and password and attempts to obtain a session token with it. If there is already an active session, removes the session (live and stored) and replaces it with the new one.
Use a 32-character hex code (received from the login
method) and a TOTP obtained from the
user to execute the 2fa step of the login process. This should return an active session or
an error. The client will throw an error if some additional step is requested.
Additionally, it should be noted that the 2fa flow is not well defined at the time of this writing, because 2fa is not yet implemented in the standard auth gateway.
get an API result
Optional
params: CollectionParams<unknown>post data to the API
update data in the API
delete data in the API
This is just like the get
method, except it is meant to be used for paginated collection
responses, and it allows you to pass in the response in order to get the next page of results
for the same parameters.
Note that you can also use it to get an initial page of responses, just like the get
method.
Optional
params: CollectionParams<unknown>Optional
headers: { This is just like the get
method, except it is meant to be used for paginated collection
responses, and it allows you to pass in the response in order to get the previous page of
results for the same parameters.
Note that you can also use it to get an initial page of responses, just like the get
method.
Optional
params: CollectionParams<unknown>Optional
headers: { This method is a convenience method used to find data objects of a certain type and/or id within a collection response.
Protected
nextInternal method facilitating a call for the next or previous response
Protected
callUse the current session to make the given HTTP call to the API and return to the result. This method automatically tries to refresh the session if it receives a 401 for a given call. If the call still fails, the error is thrown.
Protected
refreshProtected
storeProtected
toProtected
generateProtected
checkProtected
inflateInflate and optionally dress an error from an error HTTP response
Protected
condenseCondense a complex array of parameters into a flat set of key-value pairs. E.g:
``` const params = this.condenseParams({ pg: { size: 5, cursor: "abcde==", } })
// params is equal to: { "pg[size]": 5, "pg[cursor]": "abcde==", }
Generated using TypeDoc
This is a typescript client for interacting with the Luminous Money APIs. It is a somewhat bare- bones client and only seeks to provide some additional support around user management, error handling, logging, and other such things to make development against the Luminous REST APIs more robust.