Skip to content

Commit

Permalink
Merge pull request #305 from holidayextras/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
pmcnr-hx authored Jul 14, 2017
2 parents 72ef518 + 1c0e0d0 commit 368ad6b
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- 2017-07-14 - v3.0.1
- 2017-07-14 - Update dependencies.
- 2017-06-01 - v3.0.0
- 2017-06-01 - Use `Buffer.from` instead of deprecated `new Buffer` which only supports Node.js >= 4.5.0 requiring a major version upgrade for SemVer compliance
- 2017-06-01 - Fix GraphQL updates
Expand Down
4 changes: 2 additions & 2 deletions lib/MemoryHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MemoryStore.prototype.find = (request, callback) => {

// If the resource doesn't exist, error
if (!theResource) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'ENOTFOUND',
title: 'Requested resource does not exist',
Expand All @@ -66,7 +66,7 @@ MemoryStore.prototype.create = (request, newResource, callback) => {
// Check to see if the ID already exists
const index = MemoryStore._indexOf(resources[request.params.type], newResource)
if (index !== -1) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Requested resource already exists',
Expand Down
4 changes: 2 additions & 2 deletions lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ filter._parseScalarFilterElement = (attributeConfig, scalarElement) => {
const error = filter._stringOnlyOperator(splitElement.operator, attributeConfig)
if (error) return { error }

if (attributeConfig._settings) { // relationship attribute: no further validation
if (attributeConfig._settings) { // relationship attribute: no further validation
return { result: splitElement }
}

Expand Down Expand Up @@ -117,7 +117,7 @@ filter.parseAndValidate = request => {

if (typeof filterElement === 'string') request.params.filter[key] = filterElement = filterElement.split(FILTER_SEPERATOR)

if (!Array.isArray(filterElement) && filterElement instanceof Object) continue // skip deep filters
if (!Array.isArray(filterElement) && filterElement instanceof Object) continue // skip deep filters

error = filter._resourceDoesNotHaveProperty(resourceConfig, key)
if (error) return error
Expand Down
4 changes: 2 additions & 2 deletions lib/postProcessing/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fields.action = (request, response, callback) => {

for (const resource in resourceList) {
if (!jsonApi._resources[resource]) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid field resource',
Expand All @@ -23,7 +23,7 @@ fields.action = (request, response, callback) => {

for (const j of field) {
if (!jsonApi._resources[resource].attributes[j]) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid field selection',
Expand Down
2 changes: 1 addition & 1 deletion lib/postProcessing/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sort.action = (request, response, callback) => {
}

if (!request.resourceConfig.attributes[attribute]) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid sort',
Expand Down
2 changes: 1 addition & 1 deletion lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ router.applyMiddleware = () => {
// 406 Not Acceptable
let matchingTypes = req.headers.accept.split(/, ?/)
matchingTypes = matchingTypes.filter(mediaType => // Accept application/*, */vnd.api+json, */* and the correct JSON:API type.
mediaType.match(/^(\*|application)\/(\*|json|vnd\.api\+json)$/) || mediaType.match(/\*\/\*/))
mediaType.match(/^(\*|application)\/(\*|json|vnd\.api\+json)$/) || mediaType.match(/\*\/\*/))

if (matchingTypes.length === 0) {
return res.status(406).end()
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/_foreignKeySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ foreignKeySearchRoute.register = () => {
callback => {
const foreignKeySchema = resourceConfig.attributes[foreignKey]
if (!foreignKeySchema || !foreignKeySchema._settings) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid foreign key lookup',
detail: `Relation [${foreignKey}] does not exist within ${request.params.type}`
})
}
if (!(foreignKeySchema._settings.__one || foreignKeySchema._settings.__many)) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid foreign key lookup',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ findRoute.register = () => {
},
(sanitisedData, callback) => {
if (!sanitisedData) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'EVERSION',
title: 'Resource is not valid',
Expand Down
6 changes: 3 additions & 3 deletions lib/routes/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ helper.validate = (someObject, someDefinition, callback) => {
debug.validationInput(JSON.stringify(someObject))
Joi.validate(someObject, someDefinition, { abortEarly: false }, (err, sanitisedObject) => {
if (err) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Param validation failed',
Expand All @@ -27,7 +27,7 @@ helper.validate = (someObject, someDefinition, callback) => {

helper.checkForBody = (request, callback) => {
if (!request.params.data) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Request validation failed',
Expand All @@ -36,7 +36,7 @@ helper.checkForBody = (request, callback) => {
}
// data can be {} or [] both of which are typeof === 'object'
if (typeof request.params.data !== 'object') {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Request validation failed',
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/related.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ relatedRoute.register = () => {
callback => {
relation = resourceConfig.attributes[request.params.relation]
if (!relation || !relation._settings || !(relation._settings.__one || relation._settings.__many)) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'ENOTFOUND',
title: 'Resource not found',
detail: 'The requested relation does not exist within the requested type'
})
}
if (relation._settings.__as) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'EFOREIGN',
title: 'Relation is Foreign',
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/relationships.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ relationshipsRoute.register = () => {
callback => {
const relation = resourceConfig.attributes[request.params.relation]
if (!relation || !(relation._settings.__one || relation._settings.__many)) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'ENOTFOUND',
title: 'Resource not found',
Expand All @@ -43,7 +43,7 @@ relationshipsRoute.register = () => {
},
(sanitisedData, callback) => {
if (!sanitisedData) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '404',
code: 'EVERSION',
title: 'Resource is not valid',
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/removeRelation.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ removeRelationRoute.register = () => {

for (let i = 0; i < theirs.length; i++) {
if (relationType.indexOf(theirs[i].type) === -1) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid Request',
Expand All @@ -54,7 +54,7 @@ removeRelationRoute.register = () => {
const someId = theirs[i].id
const indexOfTheirs = keys.indexOf(someId)
if (indexOfTheirs === -1) {
return callback({ // eslint-disable-line standard/no-callback-literal
return callback({ // eslint-disable-line standard/no-callback-literal
status: '403',
code: 'EFORBIDDEN',
title: 'Invalid Request',
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonapi-server",
"version": "3.0.0",
"version": "3.0.1",
"description": "A config driven NodeJS framework implementing json:api",
"keywords": [
"jsonapi",
Expand All @@ -19,30 +19,30 @@
"node": ">=4.5"
},
"dependencies": {
"async": "2.4.1",
"async": "2.5.0",
"body-parser": "1.17.2",
"cookie-parser": "1.4.3",
"debug": "2.6.8",
"express": "4.15.3",
"express-graphql": "0.5.4",
"graphql": "0.7.2",
"joi": "10.5.2",
"joi": "10.6.0",
"lodash.assign": "4.2.0",
"lodash.isequal": "4.5.0",
"lodash.omit": "4.5.0",
"lodash.pick": "4.4.0",
"lodash.uniq": "4.5.0",
"lodash.uniqby": "4.7.0",
"qs": "6.4.0",
"qs": "6.5.0",
"request": "2.81.0",
"use-strict": "1.0.1",
"uuid": "3.0.1"
"uuid": "3.1.0"
},
"devDependencies": {
"eslint": "^3.6.1",
"eslint": "4.2.0",
"eslint-config-standard": "10.2.1",
"eslint-plugin-import": "2.3.0",
"eslint-plugin-node": "4.2.2",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-node": "5.1.0",
"eslint-plugin-promise": "^3.3.0",
"eslint-plugin-standard": "3.0.1",
"istanbul": "0.4.5",
Expand Down

0 comments on commit 368ad6b

Please sign in to comment.