@kohanajs/mixin-orm
Advanced tools
Comparing version 1.0.45 to 1.1.0
@@ -1,3 +0,2 @@ | ||
const {KohanaJS, ControllerMixin, ORM, dereference:$} = require('kohanajs'); | ||
const HelperCrypto = KohanaJS.require('helper/Crypto'); | ||
const {ControllerMixin, ORM, dereference:$} = require('kohanajs'); | ||
@@ -197,22 +196,4 @@ class ControllerMixinORMWrite extends ControllerMixin{ | ||
} | ||
async action_delete(){ | ||
if(!this.id) throw new Error(`Delete ${model.name} require object id`); | ||
const deleteKey = KohanaJS.config.database.deleteKey; | ||
const value = this.model.tableName + this.id; | ||
this.deleteSign = (deleteKey) ? await HelperCrypto.sign(deleteKey, value) : "true"; | ||
const confirm = this.request.query['confirm']; | ||
if(!confirm)return; | ||
const verify = (deleteKey) ? await HelperCrypto.verify(KohanaJS.config.database.deleteKey, confirm, value) : true; | ||
if(!verify)throw new Error('Invalid delete signature.') | ||
const m = await ORM.factory(this.model, this.id, {database: this.database}); | ||
this.instance = m; | ||
await m.delete(); | ||
} | ||
} | ||
module.exports = ControllerMixinORMWrite; |
@@ -7,3 +7,3 @@ require('kohanajs').addNodeModule(__dirname); | ||
ControllerMixinORMWrite : require('./classes/controller-mixin/ORMWrite'), | ||
ControllerMixinDatabase : require('./classes/controller-mixin/Database'), | ||
ControllerMixinORMDelete: require('./classes/controller-mixin/ORMDelete'), | ||
} |
{ | ||
"name": "@kohanajs/mixin-orm", | ||
"version": "1.0.45", | ||
"version": "1.1.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest --coverage" | ||
}, | ||
@@ -20,10 +20,8 @@ "repository": { | ||
"dependencies": { | ||
"better-sqlite3": "^7.1.1", | ||
"kohanajs": "^1.0.59", | ||
"uuid": "^8.3.1" | ||
"kohanajs": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"jest": "^26.6.1", | ||
"jest": "^26.6.3", | ||
"qs": "^6.9.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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1
0
15033
351
+ Addedkohanajs@2.0.2(transitive)
- Removedbetter-sqlite3@^7.1.1
- Removeduuid@^8.3.1
- Removedbase64-js@1.5.1(transitive)
- Removedbetter-sqlite3@7.6.2(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedchownr@1.1.4(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddetect-libc@2.0.3(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedini@1.3.8(transitive)
- Removedkohanajs@1.1.0(transitive)
- Removedmimic-response@3.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removednapi-build-utils@1.0.2(transitive)
- Removednode-abi@3.71.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedprebuild-install@7.1.2(transitive)
- Removedpump@3.0.2(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@7.6.3(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@4.0.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtar-fs@2.1.1(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedkohanajs@^2.0.0