remove uuid module
built into node.js now
This commit is contained in:
+3
-3
@@ -116,12 +116,12 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
crypto = require('crypto'),
|
||||
database = require('./database.js'),
|
||||
debug = require('debug')('box:eventlog'),
|
||||
mysql = require('mysql2'),
|
||||
notifications = require('./notifications.js'),
|
||||
safe = require('safetydance'),
|
||||
uuid = require('uuid');
|
||||
safe = require('safetydance');
|
||||
|
||||
const EVENTLOG_FIELDS = [ 'id', 'action', 'sourceJson', 'dataJson', 'creationTime' ].join(',');
|
||||
|
||||
@@ -141,7 +141,7 @@ async function add(action, source, data) {
|
||||
assert.strictEqual(typeof source, 'object'); // an AuditSource
|
||||
assert.strictEqual(typeof data, 'object');
|
||||
|
||||
const id = uuid.v4();
|
||||
const id = crypto.randomUUID();
|
||||
await database.query('INSERT INTO eventlog (id, action, sourceJson, dataJson) VALUES (?, ?, ?, ?)', [ id, action, JSON.stringify(source), JSON.stringify(data) ]);
|
||||
await notifications.onEvent(id, action, source, data);
|
||||
return id;
|
||||
|
||||
Reference in New Issue
Block a user