Methods
(async) delete(endpoint)
Schedules a DELETE request for a specific endpoint.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | The path of the endpoint (incl. any path parameters). |
(async) get(endpoint, sort) → {*}
Schedules a GET request for a specific endpoint.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | The path of the endpoint (incl. any path parameters). |
sort |
SortOptions | undefined | The optional set of sort options. |
Returns:
The response data on success.
- Type
- *
(async) listUntil(endpoint, shouldContinue, sort) → {Array.<object>}
A raw function returning a compiled list of objects from all available pages or until we decide to stop.
'shouldContinue' expects a function with a single parameter and should return a boolean representing if we should continue to add the current (and future) objects to the final list (and thus, if we should continue to make requests). This function is called for every single object as a parameter within each request's returned list.
This function continuously makes requests to a specific endpoint with a set of sort options, and increments the sort option page count after each request.
'shouldContinue' expects a function with a single parameter and should return a boolean representing if we should continue to add the current (and future) objects to the final list (and thus, if we should continue to make requests). This function is called for every single object as a parameter within each request's returned list.
This function continuously makes requests to a specific endpoint with a set of sort options, and increments the sort option page count after each request.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | The path of the endpoint (incl. any path parameters). |
shouldContinue |
function | A function which determines if further pages are requested. |
sort |
SortOptions | undefined | An optional set of sort options. |
Returns:
An array of raw objects.
- Type
- Array.<object>
(async) patch(endpoint, body)
Schedules a PATCH request for a specific endpoint.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | The path of the endpoint (incl. any path parameters). |
body |
object | The request body options. |
(async) post(endpoint, body) → {number}
Schedules a POST request for a specific endpoint.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | The path of the endpoint (incl. any path parameters). |
body |
object | The request body options. |
Returns:
The response data on success (ie. a content identifier).
- Type
- number