ghana-nia@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" });
registerChild
registerChild(data) ⇒ Operation
Generate a national ID
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
registerChild({
babyData: {
dateOfBirth: "string",
fatherName: "string",
forenames: "string",
gender: "string",
lightwaveETrackerID: "string",
motherName: "string",
noSiblingsInDelivery: "string",
placeOfBirth: "string",
surname: "string",
timeOfbirth: "string",
weightAtBirth: "string",
babyPicture: "string"
},
personVouching: {
etrackerLightwaveID: "string",
ghanaCardPIN: "string",
relationToBaby: "string",
relativePhone: "string",
relativePicture: "string"
},
merchantKey: "XXXXXXXXXXXXXXXXXXXXXX"
})
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 |