Skip to content

Latest commit

 

History

History
205 lines (90 loc) · 2.89 KB

DOCUMENTATION.md

File metadata and controls

205 lines (90 loc) · 2.89 KB

normalize(obj)

Normalize object to remove unused properties

Parameters
Name Type Description
obj object valid object to normalize.  
Examples
normalize(obj);
// => { ... }
Returns
  • object normalize object

parseAlert(alertXml)

Parse given alert from xml to json

Parameters
Name Type Description
alertXml string valid alert xml.  
Examples
parseAlert(alertXml)
  .then(alert => { ... }) // => { identifier: ..., info: { ... } }
  .catch(error => { ... });
Returns
  • Promise promise resolve with alert on success or error on failure.

parseFeed(source)

Parse given alert feed from xml to json

Parameters
Name Type Description
source object valid alert feed readable stream.  
Examples
parseFeed(readableStream)
  .then(feed => { ... }) // => { channel: ..., items: { ... } }
  .catch(error => { ... });
Returns
  • Promise promise resolve with alert feed on success or error on failure.

fetchAlert(optns)

Issue http get request to fetch specific alert.

Parameters
Name Type Description
optns object valid fetch options.  
optns.url string valid alert full url.  
Examples
const optns = { url: ... };
fetchAlert(optns)
  .then(alert => { ... })
  .catch(error => { ... });
Returns
  • Promise promise resolve with alert in CAP format on success or error on failure.

fetchFeed(optns)

Issue http get request to fetch alerts feed.

Parameters
Name Type Description
optns object valid fetch options.  
optns.url string valid alert feed full url.  
Examples
const optns = { url: ... };
fetchFeed(optns)
  .then(alert => { ... })
  .catch(error => { ... });
Returns
  • Promise promise resolve with alerts in feed format on success or error on failure.

fetchAlerts(optns)

Issue http get request to fetch alerts from feed.

Parameters
Name Type Description
optns object valid fetch options.  
optns.url string valid alert feed full url.  
Examples
const optns = { url: ... };
fetchAlerts(optns)
  .then(alert => { ... })
  .catch(error => { ... });
Returns
  • Promise promise resolve with alerts in CAP format on success or error on failure.

Documentation generated with doxdox.