ghana-bdr@0.1.2
This adaptor exports the following from common:
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
get
get(path, query) ⇒ Operation
Make a GET request
Param | Type | Description |
---|---|---|
path | string | Path to resource |
query | object | An object of query parameters to be encoded into the URL. |
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, body, etc |
references | an array of all previous data objects used in the Job |
Example
get("patient");
post
post(path, data) ⇒ Operation
Make a POST request
Param | Type | Description |
---|---|---|
path | string | Path to resource |
data | object | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
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, body, etc |
references | an array of all previous data objects used in the Job |
Example
post("patient", { "name":"Bukayo" });
sendBirthNotification
sendBirthNotification(data) ⇒ Operation
Generate a birth certificate
Param | Type | Description |
---|---|---|
data | object | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
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, body, etc |
references | an array of all previous data objects used in the Job |
Example
sendBirthNotification({
child: {},
mother: {},
father: {},
health_facility: {},
birth_informant: {}
})
Interfaces
HttpState
/** State object
Properties
Name | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |