Constructor
new LinoClient(baseUrl, optionsopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
baseUrl |
string | Base URL of the service |
|||||||||||||||||||||
options |
object |
<optional> |
Client options Properties
|
Classes
Methods
delete(path, optionsopt) → {Promise.<object>}
DELETE a resource.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
(async) describe() → {Promise.<object>}
Fetch the service description of specification ยง9.
Returns:
Description document
- Type
- Promise.<object>
get(path, optionsopt) → {Promise.<object>}
GET a resource.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
head(path, optionsopt) → {Promise.<object>}
HEAD a resource.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
(async) list(path, queryopt, optionsopt) → {Promise.<{items: Array.<object>, page: object}>}
List a collection, returning the decoded envelope.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Collection path |
|
query |
object |
<optional> |
Collection query parameters |
options |
object |
<optional> |
Request options |
Returns:
Collection envelope
- Type
- Promise.<{items: Array.<object>, page: object}>
(async) options(path, optionsopt) → {Promise.<Array.<string>>}
OPTIONS a path, returning the advertised methods.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
options |
object |
<optional> |
Request options |
Returns:
Methods listed in Allow
- Type
- Promise.<Array.<string>>
patch(path, body, optionsopt) → {Promise.<object>}
PATCH a representation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
body |
* | Value to send |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
post(path, body, optionsopt) → {Promise.<object>}
POST to a collection.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
body |
* | Value to send |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
put(path, body, optionsopt) → {Promise.<object>}
PUT a representation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | Path |
|
body |
* | Value to send |
|
options |
object |
<optional> |
Request options |
Returns:
Decoded response
- Type
- Promise.<object>
(async) request(method, path, optionsopt) → {Promise.<{status: number, headers: Headers, data: *, etag: (string|null), location: (string|null), response: Response}>}
Perform a request and decode the response.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
string | HTTP method |
|||||||||||||||||||||||||||||||||
path |
string | Path, appended to the base URL |
|||||||||||||||||||||||||||||||||
options |
object |
<optional> |
Request options Properties
|
Throws:
-
For any
4xxor5xxresponse - Type
- LinoClientError
Returns:
Decoded response
- Type
- Promise.<{status: number, headers: Headers, data: *, etag: (string|null), location: (string|null), response: Response}>