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" "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": { "@pushrocks/tapbundle": {
"version": "3.0.13", "version": "3.0.13",
"resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.13.tgz", "resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.13.tgz",
@ -734,6 +745,14 @@
"@types/node": "*" "@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": { "@types/vinyl": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://verdaccio.lossless.one/@types%2fvinyl/-/vinyl-2.0.2.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fvinyl/-/vinyl-2.0.2.tgz",
@ -2212,7 +2231,7 @@
}, },
"minimist": { "minimist": {
"version": "0.0.8", "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=", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true "dev": true
}, },

View File

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

View File

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

View File

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

View File

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