Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kohanajs/mixin-orm

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kohanajs/mixin-orm - npm Package Compare versions

Comparing version 1.0.45 to 1.1.0

classes/controller-mixin/ORMDelete.js

21

classes/controller-mixin/ORMWrite.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc