feathers-sequelize
Advanced tools
Comparing version 6.3.6 to 6.4.0
@@ -5,10 +5,27 @@ # Changelog | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v6.3.4...HEAD) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v6.3.6...HEAD) | ||
**Merged pull requests:** | ||
- Do not allow raw attribute selects [\#393](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/393) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#392](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/392) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#391](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/391) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#399](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/399) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#398](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/398) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#395](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/395) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#394](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/394) ([daffl](https://github.com/daffl)) | ||
## [v6.3.6](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.3.6) (2022-10-26) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v6.3.5...v6.3.6) | ||
## [v6.3.5](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.3.5) (2022-10-26) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v7.0.0-pre.0...v6.3.5) | ||
## [v7.0.0-pre.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v7.0.0-pre.0) (2022-10-04) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v6.3.4...v7.0.0-pre.0) | ||
**Closed issues:** | ||
- how to set field to NULL on patch request? [\#397](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/397) | ||
## [v6.3.4](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.3.4) (2022-06-08) | ||
@@ -18,2 +35,8 @@ | ||
**Merged pull requests:** | ||
- Do not allow raw attribute selects [\#393](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/393) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#392](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/392) ([daffl](https://github.com/daffl)) | ||
- chore\(dependencies\): Update all dependencies [\#391](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/391) ([daffl](https://github.com/daffl)) | ||
## [v6.3.3](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.3.3) (2022-04-13) | ||
@@ -67,3 +90,3 @@ | ||
- Upgrade dependencies [\#359](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/359) ([silvestreh](https://github.com/silvestreh)) | ||
- Update README.md [\#353](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/353) ([eclecticlly](https://github.com/eclecticlly)) | ||
- Update README.md [\#353](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/353) ([eclecticlly-indie-game](https://github.com/eclecticlly-indie-game)) | ||
@@ -70,0 +93,0 @@ ## [v6.2.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v6.2.0) (2020-04-29) |
@@ -282,24 +282,41 @@ const errors = require('@feathersjs/errors'); | ||
_remove (id, params = {}) { | ||
const opts = Object.assign({ raw: this.raw }, params); | ||
const where = Object.assign({}, this.filterQuery(params).query); | ||
const Model = this.applyScope(params); | ||
if (id !== null) { | ||
where[this.Op.and] = { [this.id]: id }; | ||
if (params.$returning === false) { | ||
params = { | ||
...params, | ||
query: { | ||
...params.query, | ||
$select: [this.id] | ||
} | ||
}; | ||
} else if (params.query && params.query.$select) { | ||
params = { | ||
...params, | ||
query: { | ||
...params.query, | ||
$select: [...params.query.$select, this.id] | ||
} | ||
}; | ||
} | ||
const options = Object.assign({}, { where }, params.sequelize); | ||
return this._getOrFind(id, params).then(results => { | ||
const items = Array.isArray(results) ? results : [results]; | ||
const idList = items.map(item => item[this.id]); | ||
const Model = this.applyScope(params); | ||
const seqOptions = Object.assign( | ||
{ raw: this.raw }, | ||
params.sequelize, | ||
{ where: { [this.id]: { [this.Op.in]: idList } } } | ||
); | ||
if (params.$returning !== false) { | ||
return this._getOrFind(id, opts).then(data => { | ||
return Model.destroy(options).then(() => data); | ||
}) | ||
.then(select(params, this.id)) | ||
.catch(utils.errorHandler); | ||
} else { | ||
return Model.destroy(options).then(() => Promise.resolve([])) | ||
.then(select(params, this.id)) | ||
.catch(utils.errorHandler); | ||
} | ||
return Model.destroy(seqOptions) | ||
.then(() => { | ||
if (params.$returning === false) { | ||
return Promise.resolve([]); | ||
} else { | ||
return results; | ||
} | ||
}); | ||
}).then(select(params, this.id)).catch(utils.errorHandler); | ||
} | ||
@@ -306,0 +323,0 @@ } |
{ | ||
"name": "feathers-sequelize", | ||
"description": "A service adapter for Sequelize an SQL ORM", | ||
"version": "6.3.6", | ||
"version": "6.4.0", | ||
"homepage": "https://github.com/feathersjs-ecosystem/feathers-sequelize", | ||
@@ -77,8 +77,8 @@ "main": "lib/", | ||
"@feathersjs/feathers": "^4.5.15", | ||
"body-parser": "^1.20.0", | ||
"body-parser": "^1.20.1", | ||
"chai": "^4.3.6", | ||
"dtslint": "^4.2.1", | ||
"mocha": "^10.0.0", | ||
"mocha": "^10.1.0", | ||
"mysql2": "^2.3.3", | ||
"npm-check-updates": "^16.3.4", | ||
"npm-check-updates": "^16.3.16", | ||
"nyc": "^15.1.0", | ||
@@ -88,6 +88,6 @@ "pg": "^8.8.0", | ||
"semistandard": "^16.0.1", | ||
"sequelize": "^6.23.2", | ||
"sqlite3": "^5.1.1", | ||
"sequelize": "^6.25.3", | ||
"sqlite3": "^5.1.2", | ||
"typescript": "^4.8.4" | ||
} | ||
} |
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
106367
451