diff --git a/CHANGES.md b/CHANGES.md index 410954c..19c79a0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # ldbs-json changelog +## 1.2.1 (May 2020) +Minor updated - added CRSList to filterList processing to handle getting disruptionLists + ## 1.2.0 (May 2020) Replaced request with node-fetch and added some basic error trapping. Examples updated diff --git a/examples/getDisruptionList.js b/examples/getDisruptionList.js new file mode 100644 index 0000000..50de8c0 --- /dev/null +++ b/examples/getDisruptionList.js @@ -0,0 +1,21 @@ +/** + * Simple example code for running the staff version to access the DisruptionList + * NB: You will need a valid Token to access the SV version of the api + */ +const settings = require('../settings.json'); +const LiveDepartureBoardService = require('../index'); + +// Set up the options for the call (Not the CRS list should be CRSList NOT crsList as in OpenLDBSVWS docs) +const options ={ + CRSList: ["KGX", "LET"] +}; + +// create a staff version of the API +const api = new LiveDepartureBoardService(settings.tokens.staff, true); + +// make sure we set userRef to true +api.call("GetDisruptionList", options, false) + .then(list => { + console.log(list); + }) + .catch(error => console.error(error)); diff --git a/package.json b/package.json index 737c5a4..6b20072 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ldbs-json", - "version": "1.2.0", + "version": "1.2.1", "engines": { "node": ">=7.6" }, diff --git a/soap/index.js b/soap/index.js index 78a0321..0f94c9d 100644 --- a/soap/index.js +++ b/soap/index.js @@ -36,7 +36,7 @@ class DepartureBoardSoap { let body = ``; Object.keys(options).forEach(function(key){ let val=""; - if(key == "filterList"){ + if(key == "filterList" || key == "CRSList"){ options[key].forEach((crs) => { val += `${crs}`; });