From 0b0cfbe108fa1a600456a153fd7bbe457473154c Mon Sep 17 00:00:00 2001 From: Pedro Romano Date: Sat, 28 May 2016 18:39:02 +0100 Subject: [PATCH 1/3] Export module version. Export module version so data store modules can check for the minimum required server version. --- lib/jsonApi.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jsonApi.js b/lib/jsonApi.js index 8774064a..18312233 100644 --- a/lib/jsonApi.js +++ b/lib/jsonApi.js @@ -1,6 +1,7 @@ /* @flow weak */ "use strict"; var jsonApi = module.exports = { }; +jsonApi._version = require(require("path").join(__dirname, "../package.json")).version; jsonApi._resources = { }; jsonApi._apiConfig = { }; From 8445f42ba1e7d54ce729f22c2d4668512df204e2 Mon Sep 17 00:00:00 2001 From: Pedro Romano Date: Sat, 28 May 2016 22:27:45 +0100 Subject: [PATCH 2/3] Update to latest dependencies. --- lib/postProcessing/include.js | 9 +++++---- package.json | 37 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/postProcessing/include.js b/lib/postProcessing/include.js index d66204e1..2b6905c2 100644 --- a/lib/postProcessing/include.js +++ b/lib/postProcessing/include.js @@ -4,7 +4,8 @@ var includePP = module.exports = { }; var jsonApi = require("../jsonApi.js"); var _ = { - unique: require("lodash.uniq") + uniq: require("lodash.uniq"), + uniqBy: require("lodash.uniqby") }; var rerouter = require("../rerouter.js"); var async = require("async"); @@ -28,7 +29,7 @@ includePP.action = function(request, response, callback) { includeTree._dataItems = [ ]; response.included = includePP._getDataItemsFromTree(includeTree); - response.included = _.unique(response.included, false, function(someItem) { + response.included = _.uniqBy(response.included, function(someItem) { return someItem.type + "~~" + someItem.id; }); @@ -153,7 +154,7 @@ includePP._fillIncludeTree = function(includeTree, request, callback) { var resourcesToFetch = []; Object.keys(map.primary).forEach(function(relation) { - var ids = _.unique(map.primary[relation]); + var ids = _.uniq(map.primary[relation]); var parts = relation.split("~~"); var urlJoiner = "&filter[id]="; ids = urlJoiner + ids.join(urlJoiner); @@ -167,7 +168,7 @@ includePP._fillIncludeTree = function(includeTree, request, callback) { }); Object.keys(map.foreign).forEach(function(relation) { - var ids = _.unique(map.foreign[relation]); + var ids = _.uniq(map.foreign[relation]); var parts = relation.split("~~"); var urlJoiner = "&filter[" + parts[0] + "]="; ids = urlJoiner + ids.join(urlJoiner); diff --git a/package.json b/package.json index 01bdf0e3..881b53d1 100644 --- a/package.json +++ b/package.json @@ -20,33 +20,34 @@ }, "dependencies": { "async": "1.5.2", - "body-parser": "1.14.2", - "cookie-parser": "1.4.0", + "body-parser": "^1.15.1", + "cookie-parser": "^1.4.3", "debug": "2.2.0", - "express": "4.13.3", + "express": "^4.13.4", "joi": "6.10.1", - "lodash.assign": "3.2.0", - "lodash.isequal": "3.0.4", - "lodash.omit": "3.1.0", - "lodash.pick": "3.1.0", - "lodash.uniq": "3.2.2", + "lodash.assign": "^4.0.9", + "lodash.isequal": "^4.2.0", + "lodash.omit": "^4.3.0", + "lodash.pick": "^4.2.1", + "lodash.uniq": "^4.3.0", + "lodash.uniqby": "^4.5.0", "node-uuid": "1.4.7", "qs": "^6.2.0", - "request": "2.67.0" + "request": "^2.72.0" }, "devDependencies": { - "blanket": "1.1.7", - "coveralls": "2.11.2", - "eslint": "0.24.1", - "flow-bin": "^0.23.1", + "blanket": "1.1.9", + "coveralls": "^2.11.9", + "eslint": "^2.11.0", + "flow-bin": "^0.26.0", "jscpd": "^0.6.1", - "mocha": "2.2.5", - "mocha-lcov-reporter": "0.0.2", - "mocha-performance": "0.1.0", - "node-inspector": "0.12.5", + "mocha": "^2.5.3", + "mocha-lcov-reporter": "^1.2.0", + "mocha-performance": "^0.1.1", + "node-inspector": "^0.12.8", "plato": "1.5.0", "swagger-tools": "^0.10.1", - "v8-profiler": "5.5.0" + "v8-profiler": "^5.6.5" }, "scripts": { "test": "node ./node_modules/mocha/bin/mocha -S -R spec ./test/*.js", From c135933d72c2070999dec73217bf2f29bb9ab926 Mon Sep 17 00:00:00 2001 From: Pedro Romano Date: Sat, 28 May 2016 18:43:46 +0100 Subject: [PATCH 3/3] Update changelog and bump version. --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75dd99c9..3ca34769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- 2016-05-31 - v1.10.0 +- 2016-05-31 - Export module version so data stores can check for a minimum required version - 2016-05-27 - v1.9.0 - 2016-05-27 - Make parsed and validated filter available in request for handlers - 2016-05-24 - v1.8.0 diff --git a/package.json b/package.json index 881b53d1..7c8a07ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsonapi-server", - "version": "1.9.0", + "version": "1.10.0", "description": "A config driven NodeJS framework implementing json:api", "keywords": [ "jsonapi",