et-mfr@1.0.0
This adaptor exports the following from common:
- as()
- assert()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- log()
- map()
- merge()
- parseCsv()
- scrubEmojis()
- sourceValue()
- util
Functions
get
get(path, options) ⇒ Operation
Make a GET request to Ethiopia MFR
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, etc |
| references | an array of all previous data objects used in the Job |
Example: Get all regions
get('/Location/Regions');
Example: Get a facility with id
get('Facility', {
query: {
id: '1071644',
},
});
Example: Get all facility details matching a name
get('Facility/All', {
query: {
name: '010 Kombolcha Health Post',
},
});
post
post(path, body, options) ⇒ Operation
Make a POST request to Ethiopia MFR
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| body | object | Object which will be attached to the POST body |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, etc |
| references | an array of all previous data objects used in the Job |
Example: Retrieve facilities with pagination
post('Facility/GetFacilities', {
pageNumber: 1,
showPerPage: 25,
});
Example: Retrieve facility details as CSV strings
post(
'Facility/ExportCSV',
{ name: '010 Kombolcha Health Post' },
{ parseAs: 'text' }
);
request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request to Ethiopia MFR
| Param | Type | Description |
|---|---|---|
| method | string | HTTP method to use |
| path | string | Path to resource |
| body | object | Object which will be attached to the POST body |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, etc |
| references | an array of all previous data objects used in the Job |
Example
request(
'POST',
'Facility/ExportCSV',
{ name: '010 Kombolcha Health Post' },
{ parseAs: 'text' }
);
Interfaces
HttpState
State object
Properties
| Name | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, etc |
| references | an array of all previous data objects used in the Job |
RequestOptions
Options provided to the HTTP request
Properties
| Name | Type | Description |
|---|---|---|
| body | object | body data to append to the request. |
| query | object | An object of query parameters to be encoded into the URL. |
| headers | object | An object of headers to append to the request. |
| parseAs | string | Parse the response body as json, text or stream. By default will use the response headers. |