feathers-sequelize
Advanced tools
Comparing version 6.0.1 to 6.0.2
# Change Log | ||
## [v6.0.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.0.1) (2019-07-22) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v6.0.0...v6.0.1) | ||
**Closed issues:** | ||
- UPDATE forces raw false [\#311](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/311) | ||
- After hook in service not running when same endpoint called in quick succession [\#308](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/308) | ||
- upgrade sequelize to avoid SQL injection vuln [\#306](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/306) | ||
**Merged pull requests:** | ||
- Use correct raw setting on update [\#312](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/312) ([daffl](https://github.com/daffl)) | ||
- Update dtslint to the latest version 🚀 [\#307](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/307) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) | ||
## [v6.0.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.0.0) (2019-07-06) | ||
@@ -4,0 +18,0 @@ [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v5.1.3...v6.0.0) |
@@ -138,3 +138,3 @@ const errors = require('@feathersjs/errors'); | ||
let Model = this.applyScope(params); | ||
const Model = this.applyScope(params); | ||
@@ -178,3 +178,3 @@ // Until Sequelize fix all the findAndCount issues, a few 'hacks' are needed to get the total count correct | ||
let Model = this.applyScope(params); | ||
const Model = this.applyScope(params); | ||
@@ -234,3 +234,3 @@ // findById calls findAll under the hood. We use findAll so that | ||
const ids = id === null ? this._getOrFind(null, params) | ||
.then(mapIds) : Promise.resolve([ id ]); | ||
.then(mapIds) : Promise.resolve([id]); | ||
@@ -290,3 +290,3 @@ return ids.then(idList => { | ||
let Model = this.applyScope(params); | ||
const Model = this.applyScope(params); | ||
@@ -293,0 +293,0 @@ if (params.$returning !== false) { |
@@ -37,3 +37,3 @@ const errors = require('@feathersjs/errors'); | ||
exports.getOrder = (sort = {}) => Object.keys(sort).reduce((order, name) => { | ||
order.push([ name, parseInt(sort[name], 10) === 1 ? 'ASC' : 'DESC' ]); | ||
order.push([name, parseInt(sort[name], 10) === 1 ? 'ASC' : 'DESC']); | ||
@@ -40,0 +40,0 @@ return order; |
{ | ||
"name": "feathers-sequelize", | ||
"description": "A service adapter for Sequelize an SQL ORM", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"homepage": "https://github.com/feathersjs-ecosystem/feathers-sequelize", | ||
@@ -62,23 +62,23 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/adapter-commons": "^4.0.0-pre.4", | ||
"@feathersjs/commons": "^4.0.0", | ||
"@feathersjs/errors": "^4.0.0-pre.4" | ||
"@feathersjs/adapter-commons": "^4.3.3", | ||
"@feathersjs/commons": "^4.3.0", | ||
"@feathersjs/errors": "^4.3.3" | ||
}, | ||
"devDependencies": { | ||
"@feathersjs/adapter-tests": "^4.0.0-pre.4", | ||
"@feathersjs/express": "^4.0.0-pre.4", | ||
"@feathersjs/feathers": "^4.0.0-pre.4", | ||
"@feathersjs/adapter-tests": "^4.3.3", | ||
"@feathersjs/express": "^4.3.3", | ||
"@feathersjs/feathers": "^4.3.3", | ||
"body-parser": "^1.19.0", | ||
"chai": "^4.2.0", | ||
"dtslint": "^0.9.0", | ||
"dtslint": "^0.9.8", | ||
"feathers-service-tests": "^0.10.2", | ||
"istanbul": "^1.1.0-alpha.1", | ||
"mocha": "^6.1.4", | ||
"mysql2": "^1.6.5", | ||
"pg": "^7.11.0", | ||
"mocha": "^6.2.0", | ||
"mysql2": "^1.7.0", | ||
"pg": "^7.12.1", | ||
"pg-hstore": "^2.3.3", | ||
"semistandard": "^13.0.1", | ||
"sequelize": "^5.9.4", | ||
"sqlite3": "^4.0.9" | ||
"semistandard": "^14.2.0", | ||
"sequelize": "^5.19.1", | ||
"sqlite3": "^4.1.0" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # feathers-sequelize | ||
> __Very Important:__ Before using this adapter you have to be familiar with both, the [Feathers Basics](https://docs.feathersjs.com/guides/basics/readme.html) and general use of [Sequelize](http://docs.sequelizejs.com/). For associations and relations see the [associations](#associations) section. This adapter may not cover all use cases but they can still be implemented using Sequelize models directly in a [Custom Feathers service](https://docs.feathersjs.com/guides/basics/services.html). | ||
> __Very Important:__ Before using this adapter you have to be familiar with both, the [Feathers Basics](https://docs.feathersjs.com/guides/basics/setup.html) and general use of [Sequelize](http://docs.sequelizejs.com/). For associations and relations see the [associations](#associations) section. This adapter may not cover all use cases but they can still be implemented using Sequelize models directly in a [Custom Feathers service](https://docs.feathersjs.com/guides/basics/services.html). | ||
@@ -196,3 +196,5 @@ ```bash | ||
function (context) { | ||
if (context.params.query.include) { | ||
const { include, ...query }; | ||
if (include) { | ||
const AssociatedModel = context.app.services.fooservice.Model; | ||
@@ -202,8 +204,7 @@ context.params.sequelize = { | ||
}; | ||
// delete any special query params so they are not used | ||
// in the WHERE clause in the db query. | ||
delete context.params.query.include; | ||
// Update the query to not include `include` | ||
context.params.query = query; | ||
} | ||
return Promise.resolve(context); | ||
return context; | ||
} | ||
@@ -361,3 +362,3 @@ ``` | ||
const env = process.env.NODE_ENV || 'development'; | ||
const dialect = 'mysql'|'sqlite'|'postgres'|'mssql'; | ||
const dialect = 'postgres'; // Or your dialect name | ||
@@ -364,0 +365,0 @@ module.exports = { |
@@ -10,3 +10,3 @@ // TypeScript Version: 3.0 | ||
export class Service<T = any> extends AdapterService implements InternalServiceMethods<T> { | ||
export class Service<T = any> extends AdapterService<T> implements InternalServiceMethods<T> { | ||
Model: any; | ||
@@ -13,0 +13,0 @@ options: SequelizeServiceOptions; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90123
540