satusehat@2.0.1
- get(path, params, callback)
- patch(path, data, params, [callback])
- post(path, data, params, [callback])
- put(path, data, params, [callback])
This adaptor exports the following from common:
- alterState()
- arrayToString()
- combine()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- fnIf()
- http
- lastReferenceValue()
- merge()
- sourceValue()
Functions
get
get(path, params, callback) ⇒ Operation
Make a GET request to Satusehat
Param | Type | Description |
---|---|---|
path | string | Path to resource |
params | object | Optional request params such as name. |
callback | function | An optional callback to handle the response |
Example
get("Organization", {"name": "somename"})
patch
patch(path, data, params, [callback]) ⇒ Operation
Make a PATCH request to Satusehat
Param | Type | Description |
---|---|---|
path | string | Path to resource and exact item to be partially updated |
data | Array | An array of objects which defines data that will be used to partially update a given instance of resource |
params | Object | Optional request params. |
[callback] | function | Optional callback to handle the response |
Example
patch(
"Organization/123",
[{
"op": "replace", // Operation - `replace` is the only one used to change a specific property or element
"path": "/language", // Path - The name of property/element of resource to be replaced
"value": "id" // Value- The value to be replaced
}]
);
post
post(path, data, params, [callback]) ⇒ Operation
Make a POST request to Satusehat
Param | Type | Description |
---|---|---|
path | string | Path to resource |
data | object | Object or JSON which defines data that will be used to create a given instance of resource |
params | Object | Optional request params. |
[callback] | function | Optional callback to handle the response |
Example
post(
"Organization",
{ "resourceType": "Organization", "active": true,
}
);
put
put(path, data, params, [callback]) ⇒ Operation
Make a PUT request to Satusehat
Param | Type | Description |
---|---|---|
path | string | Path to resource and exact item to be updated |
data | object | Object or JSON which defines data that will be used to update a given instance of resource |
params | Object | Optional request params. |
[callback] | function | Optional callback to handle the response |
Example
put(
"Organization/123",
{ "resourceType": "Organization", "active": false,
}
);