- CLIENT_ACTION
Dispatched by action to initiate a Core API action request.
- CLIENT_ACTION_FAILURE :
string Dispatched when a Core API action request fails.
- CLIENT_ACTION_REQUEST :
string Dispatched immediately before a Core API action request is sent.
- CLIENT_ACTION_SUCCESS :
string Dispatched when a Core API action request succeeds.
- CLIENT_GET
Dispatched by get to initiate a Core API document request.
- CLIENT_GET_FAILURE :
string Dispatched when a Core API document request fails.
- CLIENT_GET_REQUEST :
string Dispatched immediately before a Core API document request is sent.
- CLIENT_GET_SUCCESS :
string Dispatched when a Core API document request succeeds.
- action(client, document, keys, [params]) ⇒
ClientAction Make a Core API action request.
- get(client) ⇒
ClientGet Make a Core API document request.
- coreapiMiddleware()
Redux middleware that processes Core API action and document requests.
For both Core API
actionandgetrequests made by calling the correspondingredux-coreapiaction and get functions, the behavior is as follows:- A ClientActionRequest or ClientGetRequest is dispatched with the data used to make the request.
- The supplied
coreapi.Clientis used to asynchronously make the request. - Upon completion, a Redux action for the result is dispatched:
- On success, a ClientActionSuccess or ClientGetSuccess is dispatched with the request and response data.
- On failure, a ClientActionFailure or ClientGetFailure is dispatched with the request and error data.
Any other action types will not be processed.
- ClientAction :
Object Contains the data for an action call.
- ClientActionFailure :
Object Contains the data for a failed Core API action request.
- ClientActionRequest :
Object Contains the data for a Core API action request.
- ClientActionSuccess :
Object Contains the response data for a successful Core API action request.
- ClientGet :
Object Contains the data for a get call.
- ClientGetFailure :
Object Contains the data for a failed Core API document request.
- ClientGetRequest :
Object Contains the data for a Core API document request.
- ClientGetSuccess :
Object Contains the response data for a successful Core API document request.
Dispatched by action to initiate a Core API action request.
Dispatched when a Core API action request fails.
Dispatched immediately before a Core API action request is sent.
Dispatched when a Core API action request succeeds.
Dispatched by get to initiate a Core API document request.
Dispatched when a Core API document request fails.
Dispatched immediately before a Core API document request is sent.
Dispatched when a Core API document request succeeds.
action(client, document, keys, [params]) ⇒ ClientAction
Make a Core API action request.
Kind: global function
Returns: ClientAction - - A Redux action for the Core API action request.
If an argument contains invalid data, a {@see ClientActionError} will be
returned instead.
| Param | Type | Description |
|---|---|---|
| client | coreapi.Client |
The Core API client instance with which the request will be made. |
| document | coreapi.Document |
The Core API document describing the API to which the request will be sent. |
| keys | Array.<string> |
An array of strings describing the action to request. For example, ["users", "list"] or ["widgets", 0, "update"]. |
| [params] | Object |
Optional data to include with the request. The structure of the object depends on the action being requested. |
get(client) ⇒ ClientGet
Make a Core API document request.
Kind: global function
Returns: ClientGet - - A Redux action for the Core API get request. If an
argument contains invalid data, a {@see ClientGetError} will be returned
instead.
| Param | Type | Description |
|---|---|---|
| client | coreapi.Client |
The Core API client instance with which the request will be made. |
Properties
| Name | Type | Description |
|---|---|---|
| url | string |
The URL of the document to request. |
Redux middleware that processes Core API action and document requests.
For both Core API action and get requests made by calling the
corresponding redux-coreapi action and get functions,
the behavior is as follows:
- A ClientActionRequest or ClientGetRequest is dispatched with the data used to make the request.
- The supplied
coreapi.Clientis used to asynchronously make the request. - Upon completion, a Redux action for the result is dispatched:
- On success, a ClientActionSuccess or ClientGetSuccess is dispatched with the request and response data.
- On failure, a ClientActionFailure or ClientGetFailure is dispatched with the request and error data.
Any other action types will not be processed.
Contains the data for an action call.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_ACTION}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.document | coreapi.Document |
The Core API schema document describing the API to which the request will be sent. |
| payload.keys | Array.<string> |
An array of strings describing the action to request. For example, ["users", "list"] or ["widgets", 0, "update"]. |
| payload.params | Object |
Optional data to include with the request. The structure of the object depends on the action being requested. |
Contains the data for a failed Core API action request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_ACTION_FAILURE}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request was be made. |
| payload.document | coreapi.Document |
The Core API schema document describing the API to which the request was sent. |
| payload.keys | Array.<string> |
An array of strings describing the action that was requested. For example, ["users", "list"] or ["widgets", 0, "update"]. |
| payload.params | Object |
Optional data included with the request. The structure of the object depends on the action requested. |
| payload.error | Error |
The error encountered by the action request. |
Contains the data for a Core API action request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_ACTION_REQUEST}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.document | coreapi.Document |
The Core API schema document describing the API to which the request will be sent. |
| payload.keys | Array.<string> |
An array of strings describing the action to request. For example, ["users", "list"] or ["widgets", 0, "update"]. |
| payload.params | Object |
Optional data to include with the request. The structure of the object depends on the action being requested. |
Contains the response data for a successful Core API action request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_ACTION_SUCCESS}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request was be made. |
| payload.document | coreapi.Document |
The Core API schema document describing the API to which the request was sent. |
| payload.keys | Array.<string> |
An array of strings describing the action that was requested. For example, ["users", "list"] or ["widgets", 0, "update"]. |
| payload.params | Object |
Optional data included with the request. The structure of the object depends on the action requested. |
| payload.result | Object |
The response data from the request. |
Contains the data for a get call.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_GET}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.url | string |
The URL of the document being requested. |
Contains the data for a failed Core API document request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_GET_FAILURE}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.url | string |
The URL of the document that was requested. |
| payload.error | Error |
The error encountered by the document request. |
Contains the data for a Core API document request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_GET_REQUEST}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.url | string |
The URL of the document being requested. |
Contains the response data for a successful Core API document request.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| type | string |
The type of the Redux action. Must always be set to {@see CLIENT_GET_SUCCESS}. |
| payload | Object |
An object containing the data for the request. |
| payload.client | coreapi.Client |
The Core API client instance with which the request will be made. |
| payload.url | string |
The URL of the document that was requested. |
| payload.document | coreapi.Document |
The Core API document. |