mongoose-field-encryption
Advanced tools
Comparing version 6.0.0 to 6.1.0
@@ -67,3 +67,5 @@ "use strict"; | ||
// @ts-ignore | ||
const iv = new Buffer.from(encryptedArray[0], "hex"); | ||
// @ts-ignore | ||
const encrypted = new Buffer.from(encryptedArray[1], "hex"); | ||
@@ -253,2 +255,16 @@ const decipher = crypto.createDecipheriv(algorithm, secret, iv); | ||
schema.pre("insertMany", function (_next, docs) { | ||
const next = getCompatitibleNextFunc(_next); | ||
try { | ||
for (let doc of docs) { | ||
encryptFields(doc, fieldsToEncrypt, secret()); | ||
} | ||
next(); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}); | ||
schema.pre("findOneAndUpdate", updateHook); | ||
@@ -255,0 +271,0 @@ |
{ | ||
"name": "mongoose-field-encryption", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "A simple symmetric encryption plugin for individual fields. Dependency free, only mongoose peer dependency.", | ||
@@ -56,5 +56,5 @@ "main": "lib/mongoose-field-encryption.js", | ||
"nyc": "15.1.0", | ||
"release-it": "15.6.0", | ||
"sinon": "15.0.1", | ||
"typescript": "4.9.4" | ||
"release-it": "15.10.3", | ||
"sinon": "15.0.4", | ||
"typescript": "5.0.4" | ||
}, | ||
@@ -61,0 +61,0 @@ "release-it": { |
@@ -21,4 +21,4 @@ # mongoose-field-encryption | ||
- Node `>=6` (Use `2.3.4` for Node `>=4.4.7 && <=6.x.x`) | ||
- MongoDB `>=2.6.10` | ||
- Node `>=12` (Use `2.3.4` for Node `>=4.4.7 && <6.x.x`, `5.0.3` for Node `>=6.x.x && <=10.x.x`) | ||
- MongoDB `>=4.4` | ||
- Mongoose `>=4.0.0` | ||
@@ -253,2 +253,7 @@ | ||
### 6.1.0 | ||
- Add support for `insertMany`. | ||
- Update dev dependencies. | ||
### 6.0.0 | ||
@@ -255,0 +260,0 @@ |
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
28792
238
359