fix(core): update

This commit is contained in:
Philipp Kunz 2019-11-03 19:17:26 +01:00
parent 08c1618ea8
commit 3f073ab9b3
5 changed files with 30 additions and 8 deletions

21
package-lock.json generated
View File

@ -537,6 +537,17 @@
"luxon": "^1.16.0"
}
},
"@pushrocks/smartunique": {
"version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartunique/-/smartunique-3.0.1.tgz",
"integrity": "sha512-xBu9ZB4C0BA0S/pbFFZn2ItPfnodPKpzrYIq1yN5XDs6OaookwcDF/iBwfS9+EYMSPENC9wAsOxg2RGMm4Qicw==",
"requires": {
"@types/shortid": "^0.0.29",
"@types/uuid": "^3.0.0",
"shortid": "^2.2.8",
"uuid": "^3.1.0"
}
},
"@pushrocks/tapbundle": {
"version": "3.0.13",
"resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.13.tgz",
@ -734,6 +745,14 @@
"@types/node": "*"
}
},
"@types/uuid": {
"version": "3.4.6",
"resolved": "https://verdaccio.lossless.one/@types%2fuuid/-/uuid-3.4.6.tgz",
"integrity": "sha512-cCdlC/1kGEZdEglzOieLDYBxHsvEOIg7kp/2FYyVR9Pxakq+Qf/inL3RKQ+PA8gOlI/NnL+fXmQH12nwcGzsHw==",
"requires": {
"@types/node": "*"
}
},
"@types/vinyl": {
"version": "2.0.2",
"resolved": "https://verdaccio.lossless.one/@types%2fvinyl/-/vinyl-2.0.2.tgz",
@ -2212,7 +2231,7 @@
},
"minimist": {
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},

View File

@ -26,10 +26,9 @@
"@pushrocks/smarthash": "^2.0.6",
"@pushrocks/smartlog": "^2.0.21",
"@pushrocks/smartpromise": "^3.0.6",
"@types/shortid": "0.0.29",
"@pushrocks/smartunique": "^3.0.1",
"@types/socket.io": "^2.1.4",
"@types/socket.io-client": "^1.4.32",
"shortid": "^2.2.15",
"socket.io": "^2.3.0",
"socket.io-client": "^2.3.0"
},

View File

@ -16,6 +16,10 @@ export interface ISmartsocketConstructorOptions {
}
export class Smartsocket {
/**
* a unique id to detect server restarts
*/
public id = plugins.smartunique.shortId();
public options: ISmartsocketConstructorOptions;
public io: SocketIO.Server;
public socketConnections = new Objectmap<SocketConnection>();
@ -80,7 +84,7 @@ export class Smartsocket {
funcName: functionNameArg
},
originSocketConnection: targetSocketConnectionArg,
shortId: plugins.shortid.generate(),
shortId: plugins.smartunique.shortId(),
side: 'requesting'
});
const response: ISocketFunctionCallDataResponse<T> = await socketRequest.dispatch();

View File

@ -111,7 +111,7 @@ export class SmartsocketClient {
const socketRequest = new SocketRequest<T>(this, {
side: 'requesting',
originSocketConnection: this.socketConnection,
shortId: plugins.shortid.generate(),
shortId: plugins.smartunique.shortId(),
funcCallData: {
funcName: functionNameArg,
funcDataArg: dataArg

View File

@ -10,6 +10,7 @@ import * as smarthash from '@pushrocks/smarthash';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartexpress from '@pushrocks/smartexpress';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartunique from '@pushrocks/smartunique';
export {
@ -18,16 +19,15 @@ export {
smarthash,
smartdelay,
smartexpress,
smartpromise
smartpromise,
smartunique,
};
// third party scope
import * as shortid from 'shortid';
import socketIo from 'socket.io';
import socketIoClient from 'socket.io-client';
export {
shortid,
socketIo,
socketIoClient
};