diff --git a/foci-api.md b/foci-api.md index 85f657f..5f0c5c6 100644 --- a/foci-api.md +++ b/foci-api.md @@ -3,7 +3,7 @@ # Get case custers -**URL** : `/v6/foci/cluster` +**URL** : `/v6/foci/case_clusters` **Status** : TODO @@ -71,7 +71,7 @@ The format can be url_encoded # Create a case cluster -**URL** : `/v6/foci/cluster` +**URL** : `/v6/foci/case_clusters` **Status** : TODO @@ -122,7 +122,7 @@ json-encoded data # Update a case cluster -**URL** : `/v6/foci/cluster` +**URL** : `/v6/foci/case_clusters` **Status** : TODO @@ -204,7 +204,7 @@ json-formated data example # Get cases -**URL** : `/v6/foci/case` +**URL** : `/v6/foci/case_locations` **Status** : TODO @@ -258,7 +258,7 @@ url-encoded data # Create a case cluster -**URL** : `/v6/foci/case` +**URL** : `/v6/foci/case_locations` **Status** : TODO @@ -313,7 +313,7 @@ json-encoded data example # Update a case -**URL** : `/v6/foci/case` +**URL** : `/v6/foci/case_locations` **Status** : TODO @@ -412,7 +412,7 @@ url-encoded data # Case count -**URL** : `/v6/foci/number_of_cases` +**URL** : `/v6/foci/number_of_case_clusters` **Status** : DONE diff --git a/package-lock.json b/package-lock.json index ac17fc4..a8017b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8161,38 +8161,38 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nyc": { - "version": "11.2.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.2.1.tgz", - "integrity": "sha1-rYUK/p261/SXByi0suR/7Rw4chw=", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.5.0.tgz", + "integrity": "sha512-xIYK189By0YiM5/T4TviHu3J7bV7lCj5WYJfyZK3z03QgAaQ60WcLaJuXf0zhKoI6PBnUR92ZpSwBICCrgSBGg==", "dev": true, "requires": { "archy": "1.0.0", "arrify": "1.0.1", "caching-transform": "1.0.1", - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "debug-log": "1.0.1", "default-require-extensions": "1.0.0", "find-cache-dir": "0.1.1", "find-up": "2.1.0", "foreground-child": "1.5.6", "glob": "7.1.2", - "istanbul-lib-coverage": "1.1.1", - "istanbul-lib-hook": "1.0.7", - "istanbul-lib-instrument": "1.8.0", - "istanbul-lib-report": "1.1.1", - "istanbul-lib-source-maps": "1.2.1", - "istanbul-reports": "1.1.2", + "istanbul-lib-coverage": "1.1.2", + "istanbul-lib-hook": "1.1.0", + "istanbul-lib-instrument": "1.9.2", + "istanbul-lib-report": "1.1.3", + "istanbul-lib-source-maps": "1.2.3", + "istanbul-reports": "1.1.4", "md5-hex": "1.3.0", - "merge-source-map": "1.0.4", + "merge-source-map": "1.1.0", "micromatch": "2.3.11", "mkdirp": "0.5.1", "resolve-from": "2.0.0", - "rimraf": "2.6.1", + "rimraf": "2.6.2", "signal-exit": "3.0.2", - "spawn-wrap": "1.3.8", - "test-exclude": "4.1.1", - "yargs": "8.0.2", - "yargs-parser": "5.0.0" + "spawn-wrap": "1.4.2", + "test-exclude": "4.2.0", + "yargs": "10.1.2", + "yargs-parser": "8.1.0" }, "dependencies": { "align-text": { @@ -8272,7 +8272,7 @@ } }, "babel-generator": { - "version": "6.26.0", + "version": "6.26.1", "bundled": true, "dev": true, "requires": { @@ -8281,7 +8281,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "source-map": "0.5.7", "trim-right": "1.0.1" } @@ -8299,8 +8299,8 @@ "bundled": true, "dev": true, "requires": { - "core-js": "2.5.1", - "regenerator-runtime": "0.11.0" + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" } }, "babel-template": { @@ -8312,7 +8312,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-traverse": { @@ -8325,10 +8325,10 @@ "babel-runtime": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "debug": "2.6.8", + "debug": "2.6.9", "globals": "9.18.0", "invariant": "2.2.2", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-types": { @@ -8338,7 +8338,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.5", "to-fast-properties": "1.0.3" } }, @@ -8353,7 +8353,7 @@ "dev": true }, "brace-expansion": { - "version": "1.1.8", + "version": "1.1.11", "bundled": true, "dev": true, "requires": { @@ -8449,12 +8449,12 @@ "dev": true }, "convert-source-map": { - "version": "1.5.0", + "version": "1.5.1", "bundled": true, "dev": true }, "core-js": { - "version": "2.5.1", + "version": "2.5.3", "bundled": true, "dev": true }, @@ -8468,7 +8468,7 @@ } }, "debug": { - "version": "2.6.8", + "version": "2.6.9", "bundled": true, "dev": true, "requires": { @@ -8682,7 +8682,7 @@ "dev": true }, "handlebars": { - "version": "4.0.10", + "version": "4.0.11", "bundled": true, "dev": true, "requires": { @@ -8758,7 +8758,7 @@ "dev": true }, "is-buffer": { - "version": "1.1.5", + "version": "1.1.6", "bundled": true, "dev": true }, @@ -8802,12 +8802,9 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } + "dev": true }, "is-glob": { "version": "2.0.1", @@ -8864,12 +8861,12 @@ } }, "istanbul-lib-coverage": { - "version": "1.1.1", + "version": "1.1.2", "bundled": true, "dev": true }, "istanbul-lib-hook": { - "version": "1.0.7", + "version": "1.1.0", "bundled": true, "dev": true, "requires": { @@ -8877,25 +8874,25 @@ } }, "istanbul-lib-instrument": { - "version": "1.8.0", + "version": "1.9.2", "bundled": true, "dev": true, "requires": { - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.1", - "semver": "5.4.1" + "istanbul-lib-coverage": "1.1.2", + "semver": "5.5.0" } }, "istanbul-lib-report": { - "version": "1.1.1", + "version": "1.1.3", "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-coverage": "1.1.2", "mkdirp": "0.5.1", "path-parse": "1.0.5", "supports-color": "3.2.3" @@ -8912,23 +8909,33 @@ } }, "istanbul-lib-source-maps": { - "version": "1.2.1", + "version": "1.2.3", "bundled": true, "dev": true, "requires": { - "debug": "2.6.8", - "istanbul-lib-coverage": "1.1.1", + "debug": "3.1.0", + "istanbul-lib-coverage": "1.1.2", "mkdirp": "0.5.1", - "rimraf": "2.6.1", + "rimraf": "2.6.2", "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "istanbul-reports": { - "version": "1.1.2", + "version": "1.1.4", "bundled": true, "dev": true, "requires": { - "handlebars": "4.0.10" + "handlebars": "4.0.11" } }, "js-tokens": { @@ -8946,7 +8953,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } }, "lazy-cache": { @@ -8992,7 +8999,7 @@ } }, "lodash": { - "version": "4.17.4", + "version": "4.17.5", "bundled": true, "dev": true }, @@ -9036,15 +9043,22 @@ "bundled": true, "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "merge-source-map": { - "version": "1.0.4", + "version": "1.1.0", "bundled": true, "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } } }, "micromatch": { @@ -9068,7 +9082,7 @@ } }, "mimic-fn": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, "dev": true }, @@ -9077,7 +9091,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -9105,7 +9119,7 @@ "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", - "semver": "5.4.1", + "semver": "5.5.0", "validate-npm-package-license": "3.0.1" } }, @@ -9182,18 +9196,26 @@ "dev": true }, "p-limit": { - "version": "1.1.0", + "version": "1.2.0", "bundled": true, - "dev": true + "dev": true, + "requires": { + "p-try": "1.0.0" + } }, "p-locate": { "version": "2.0.0", "bundled": true, "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "1.2.0" } }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "parse-glob": { "version": "3.0.4", "bundled": true, @@ -9315,7 +9337,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -9325,7 +9347,7 @@ "bundled": true, "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -9361,7 +9383,7 @@ } }, "regenerator-runtime": { - "version": "0.11.0", + "version": "0.11.1", "bundled": true, "dev": true }, @@ -9421,7 +9443,7 @@ } }, "rimraf": { - "version": "2.6.1", + "version": "2.6.2", "bundled": true, "dev": true, "requires": { @@ -9429,7 +9451,7 @@ } }, "semver": { - "version": "5.4.1", + "version": "5.5.0", "bundled": true, "dev": true }, @@ -9467,14 +9489,14 @@ "dev": true }, "spawn-wrap": { - "version": "1.3.8", + "version": "1.4.2", "bundled": true, "dev": true, "requires": { "foreground-child": "1.5.6", "mkdirp": "0.5.1", "os-homedir": "1.0.2", - "rimraf": "2.6.1", + "rimraf": "2.6.2", "signal-exit": "3.0.2", "which": "1.3.0" } @@ -9511,11 +9533,6 @@ "bundled": true, "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, "strip-ansi": { "version": "4.0.0", "bundled": true, @@ -9553,7 +9570,7 @@ "dev": true }, "test-exclude": { - "version": "4.1.1", + "version": "4.2.0", "bundled": true, "dev": true, "requires": { @@ -9647,6 +9664,14 @@ "strip-ansi": "3.0.1" }, "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, "string-width": { "version": "1.0.2", "bundled": true, @@ -9685,115 +9710,59 @@ "dev": true }, "yargs": { - "version": "8.0.2", + "version": "10.1.2", "bundled": true, "dev": true, "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", + "cliui": "4.0.0", "decamelize": "1.2.0", + "find-up": "2.1.0", "get-caller-file": "1.0.2", "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", "require-directory": "2.1.1", "require-main-filename": "1.0.1", "set-blocking": "2.0.0", "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", - "yargs-parser": "7.0.0" + "yargs-parser": "8.1.0" }, "dependencies": { - "camelcase": { - "version": "4.1.0", + "ansi-regex": { + "version": "3.0.0", "bundled": true, "dev": true }, "cliui": { - "version": "3.2.0", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "wrap-ansi": "2.1.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - } - } - }, - "load-json-file": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" } }, - "path-type": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "2.3.0" - } - }, - "read-pkg": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "yargs-parser": { - "version": "7.0.0", + "strip-ansi": { + "version": "4.0.0", "bundled": true, "dev": true, "requires": { - "camelcase": "4.1.0" + "ansi-regex": "3.0.0" } } } }, "yargs-parser": { - "version": "5.0.0", + "version": "8.1.0", "bundled": true, "dev": true, "requires": { - "camelcase": "3.0.0" + "camelcase": "4.1.0" }, "dependencies": { "camelcase": { - "version": "3.0.0", + "version": "4.1.0", "bundled": true, "dev": true } diff --git a/package.json b/package.json index fdd0e41..6c7abbf 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "babel-preset-stage-0": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "mockery": "^2.1.0", - "nyc": "^11.2.1", + "nyc": "^11.5.0", "sinon": "^4.0.0", "supertest": "^3.0.0" }, diff --git a/src/v6/index.js b/src/v6/index.js index 15e2cb7..db53240 100644 --- a/src/v6/index.js +++ b/src/v6/index.js @@ -82,7 +82,7 @@ module.exports = function (app, version) { app.post(v('/foci/case_locations/bulk'), case_location.create_bulk) app.get(v('/foci/case_locations'), case_location.get_all) app.put(v('/foci/case_locations'), case_location.update) - app.delete(v('/foci/case_locations'), case_location.delete_case_point) + app.delete(v('/foci/case_locations'), case_location.delete_case_location) //Foci Generation addPermission('post','/foci/model/run',['write:foci']) diff --git a/src/v6/routes/foci/case_locations.js b/src/v6/routes/foci/case_locations.js index ffda421..ff43395 100644 --- a/src/v6/routes/foci/case_locations.js +++ b/src/v6/routes/foci/case_locations.js @@ -81,7 +81,7 @@ async function update(req, res) { } -async function delete_case_point(req,res){ +async function delete_case_location(req,res){ //console.log('Delete case points') const cluster = req.db.collection('case_location') let query = req.body; diff --git a/test/v6/unit/auth/user_permissions.test.js b/test/v6/unit/auth/user_permissions.test.js index 5a1068a..525b656 100644 --- a/test/v6/unit/auth/user_permissions.test.js +++ b/test/v6/unit/auth/user_permissions.test.js @@ -41,26 +41,26 @@ test('GET /v6/plan/current with correct api token and sufficient permissions => t.is(res.status, 200) }) -test('GET /v6/foci/cluster with correct api token and sufficient permissions => 200', async t => { +test('GET /v6/foci/case_clusters with correct api token and sufficient permissions => 200', async t => { t.plan(1) - const res = await request(app).get('/v6/foci/cluster?country=swz').set('Api-Key', foci_key) + const res = await request(app).get('/v6/foci/case_clusters?country=swz').set('Api-Key', foci_key) console.log(res) t.is(res.status, 200) }) -test('GET /v6/foci/case with correct api token and sufficient permissions => 200', async t => { +test('GET /v6/foci/case_locations with correct api token and sufficient permissions => 200', async t => { t.plan(1) - const res = await request(app).get('/v6/foci/case?country=swz').set('Api-Key', foci_key) + const res = await request(app).get('/v6/foci/case_locations?country=swz').set('Api-Key', foci_key) t.is(res.status, 200) }) -test('GET /v6/foci/case with correct api token and sufficient permissions => 200', async t => { +test('GET /v6/foci/case_locations with correct api token and sufficient permissions => 200', async t => { t.plan(1) - const res = await request(app).get('/v6/foci/case?country=swz').set('Api-Key', foci_key) + const res = await request(app).get('/v6/foci/case_locations?country=swz').set('Api-Key', foci_key) t.is(res.status, 200) })