Constructor
# new RESTClient(options)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object | |||
apiVersion |
Number |
<optional> |
2 | version of the API |
token |
String | authentication token |
Examples
const client = new RESTClient({ token: 'myToken' })
const records = await client.getSomeRecords(resourceId)
const client = new RESTClient({ token: 'myToken', apiVersion: 1 })
Methods
# async getSomeRecords(mainKey) → {Promise.<Array.<RESTClient~Record>>}
This could be a function returning data from the REST API. It returns a newly created type: RESTClient~Record
Parameters:
Name | Type | Description |
---|---|---|
mainKey |
String | Example property which serves as a key in the records lookup process |
Promise.<Array.<RESTClient~Record>>
Type Definitions
Object
# Record
You can even define your own types in JSDoc
Properties:
Name | Type | Description |
---|---|---|
first |
String | Some example property |
another |
String | Another property |