update bson (#2425)
Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> (update of dependabot excluded packages)
This commit is contained in:
parent
fba4a0a0af
commit
6a3a370bb1
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@ -25,12 +25,8 @@ updates:
|
|||||||
# see issue #2214 for rationale for each of these
|
# see issue #2214 for rationale for each of these
|
||||||
- dependency-name: '@xmldom/xmldom'
|
- dependency-name: '@xmldom/xmldom'
|
||||||
versions: [ '>=0.9.0' ]
|
versions: [ '>=0.9.0' ]
|
||||||
- dependency-name: 'bcryptjs'
|
|
||||||
versions: [ '>=3.0.0' ]
|
|
||||||
- dependency-name: 'bootstrap'
|
- dependency-name: 'bootstrap'
|
||||||
versions: [ '>=5.0.0' ]
|
versions: [ '>=5.0.0' ]
|
||||||
- dependency-name: 'bson'
|
|
||||||
versions: [ '>=5.0.0' ]
|
|
||||||
- dependency-name: 'cbor'
|
- dependency-name: 'cbor'
|
||||||
versions: [ '>=10.0.0' ]
|
versions: [ '>=10.0.0' ]
|
||||||
- dependency-name: 'eslint'
|
- dependency-name: 'eslint'
|
||||||
|
|||||||
37
package-lock.json
generated
37
package-lock.json
generated
@ -27,7 +27,7 @@
|
|||||||
"bootstrap-colorpicker": "^3.4.0",
|
"bootstrap-colorpicker": "^3.4.0",
|
||||||
"bootstrap-material-design": "^4.1.3",
|
"bootstrap-material-design": "^4.1.3",
|
||||||
"browserify-zlib": "^0.2.0",
|
"browserify-zlib": "^0.2.0",
|
||||||
"bson": "^4.7.2",
|
"bson": "^7.2.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"cbor": "9.0.2",
|
"cbor": "9.0.2",
|
||||||
"chi-squared": "^1.1.0",
|
"chi-squared": "^1.1.0",
|
||||||
@ -6512,39 +6512,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bson": {
|
"node_modules/bson": {
|
||||||
"version": "4.7.2",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/bson/-/bson-7.2.0.tgz",
|
||||||
"integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==",
|
"integrity": "sha512-YCEo7KjMlbNlyHhz7zAZNDpIpQbd+wOEHJYezv0nMYTn4x31eIUM2yomNNubclAt63dObUzKHWsBLJ9QcZNSnQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
|
||||||
"buffer": "^5.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=20.19.0"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bson/node_modules/buffer": {
|
|
||||||
"version": "5.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
|
||||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/feross"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "patreon",
|
|
||||||
"url": "https://www.patreon.com/feross"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "consulting",
|
|
||||||
"url": "https://feross.org/support"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"base64-js": "^1.3.1",
|
|
||||||
"ieee754": "^1.1.13"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer": {
|
"node_modules/buffer": {
|
||||||
|
|||||||
@ -111,7 +111,7 @@
|
|||||||
"bootstrap-colorpicker": "^3.4.0",
|
"bootstrap-colorpicker": "^3.4.0",
|
||||||
"bootstrap-material-design": "^4.1.3",
|
"bootstrap-material-design": "^4.1.3",
|
||||||
"browserify-zlib": "^0.2.0",
|
"browserify-zlib": "^0.2.0",
|
||||||
"bson": "^4.7.2",
|
"bson": "^7.2.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"cbor": "9.0.2",
|
"cbor": "9.0.2",
|
||||||
"chi-squared": "^1.1.0",
|
"chi-squared": "^1.1.0",
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import bson from "bson";
|
import { deserialize } from "bson";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +37,7 @@ class BSONDeserialise extends Operation {
|
|||||||
if (!input.byteLength) return "";
|
if (!input.byteLength) return "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = bson.deserialize(new Buffer(input));
|
const data = deserialize(new Uint8Array(input));
|
||||||
return JSON.stringify(data, null, 2);
|
return JSON.stringify(data, null, 2);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err.toString());
|
throw new OperationError(err.toString());
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import bson from "bson";
|
import { serialize } from "bson";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +38,8 @@ class BSONSerialise extends Operation {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(input);
|
const data = JSON.parse(input);
|
||||||
return bson.serialize(data).buffer;
|
const result = serialize(data);
|
||||||
|
return result.buffer.slice(result.byteOffset, result.byteOffset + result.byteLength);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err.toString());
|
throw new OperationError(err.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
import BSON from "bson";
|
import { ObjectId } from "bson";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse ObjectID timestamp operation
|
* Parse ObjectID timestamp operation
|
||||||
@ -35,7 +35,7 @@ class ParseObjectIDTimestamp extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
try {
|
try {
|
||||||
const objectId = new BSON.ObjectID(input);
|
const objectId = new ObjectId(input);
|
||||||
return objectId.getTimestamp().toISOString();
|
return objectId.getTimestamp().toISOString();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err);
|
throw new OperationError(err);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user