* Move to uuid vs node-uuid

* Use uuid-parse for to/from string
This commit is contained in:
Bryan Ashby 2017-01-31 00:17:19 -07:00
parent 541489acb0
commit 690d148ad5
6 changed files with 15 additions and 12 deletions

View File

@ -2,7 +2,7 @@
'use strict';
const _ = require('lodash');
const uuids = require('node-uuid');
const uuidV4 = require('uuid/v4');
module.exports = class FileBaseFilters {
constructor(client) {
@ -37,7 +37,7 @@ module.exports = class FileBaseFilters {
}
add(filterInfo) {
const filterUuid = uuids.v4();
const filterUuid = uuidV4();
filterInfo.tags = this.cleanTags(filterInfo.tags);
@ -110,7 +110,7 @@ module.exports = class FileBaseFilters {
static getDefaultFilters() {
const filters = {};
const uuid = uuids.v4();
const uuid = uuidV4();
filters[uuid] = {
name : 'Default',
areaTag : '', // all

View File

@ -8,7 +8,7 @@ let FNV1a = require('./fnv1a.js');
let _ = require('lodash');
let iconv = require('iconv-lite');
let moment = require('moment');
let uuid = require('node-uuid');
//let uuid = require('node-uuid');
let os = require('os');
let packageJson = require('../package.json');
@ -39,7 +39,7 @@ exports.getQuotePrefix = getQuotePrefix;
// Namespace for RFC-4122 name based UUIDs generated from
// FTN kludges MSGID + AREA
//
const ENIGMA_FTN_MSGID_NAMESPACE = uuid.parse('a5c7ae11-420c-4469-a116-0e9a6d8d2654');
//const ENIGMA_FTN_MSGID_NAMESPACE = uuid.parse('a5c7ae11-420c-4469-a116-0e9a6d8d2654');
// See list here: https://github.com/Mithgol/node-fidonet-jam

View File

@ -8,7 +8,7 @@ const createNamedUUID = require('./uuid_util.js').createNamedUUID;
const getISOTimestampString = require('./database.js').getISOTimestampString;
// deps
const uuid = require('node-uuid');
const uuidParse = require('uuid-parse');
const async = require('async');
const _ = require('lodash');
const assert = require('assert');
@ -17,7 +17,7 @@ const iconvEncode = require('iconv-lite').encode;
module.exports = Message;
const ENIGMA_MESSAGE_UUID_NAMESPACE = uuid.parse('154506df-1df8-46b9-98f8-ebb5815baaf8');
const ENIGMA_MESSAGE_UUID_NAMESPACE = uuidParse.parse('154506df-1df8-46b9-98f8-ebb5815baaf8');
function Message(options) {
options = options || {};
@ -135,7 +135,7 @@ Message.createMessageUUID = function(areaTag, modTimestamp, subject, body) {
subject = iconvEncode(subject.toUpperCase().trim(), 'CP437');
body = iconvEncode(body.replace(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g, '').trim(), 'CP437');
return uuid.unparse(createNamedUUID(ENIGMA_MESSAGE_UUID_NAMESPACE, Buffer.concat( [ areaTag, modTimestamp, subject, body ] )));
return uuidParse.unparse(createNamedUUID(ENIGMA_MESSAGE_UUID_NAMESPACE, Buffer.concat( [ areaTag, modTimestamp, subject, body ] )));
};
Message.getMessageIdByUuid = function(uuid, cb) {

View File

@ -23,7 +23,7 @@ const assert = require('assert');
const gaze = require('gaze');
const fse = require('fs-extra');
const iconv = require('iconv-lite');
const uuid = require('node-uuid');
const uuidV4 = require('uuid/v4');
exports.moduleInfo = {
name : 'FTN BSO',
@ -834,7 +834,7 @@ function FTNMessageScanTossModule() {
//
if(Config.messageNetworks.ftn.areas[localAreaTag].allowDupes) {
// just generate a UUID & therefor always allow for dupes
message.uuid = uuid.v1();
message.uuid = uuidV4();
}
callback(null);

View File

@ -49,7 +49,9 @@ class TelnetClientConnection extends EventEmitter {
// client may have bailed
if(_.has(this, 'client.term.output')) {
this.client.term.output.unpipe(this.bridgeConnection);
if(this.bridgeConnection) {
this.client.term.output.unpipe(this.bridgeConnection);
}
this.client.term.output.resume();
}
}

View File

@ -34,7 +34,8 @@
"mime-types": "^2.1.12",
"minimist": "1.2.x",
"moment": "^2.11.0",
"node-uuid": "^1.4.7",
"uuid": "^3.0.1",
"uuid-parse" : "^1.0.0",
"ptyw.js": "NuSkooler/ptyw.js",
"sqlite3": "^3.1.1",
"ssh2": "^0.5.1",