fix(core): update
This commit is contained in:
parent
ec2afbfd55
commit
3a7ebcdd80
@ -30,6 +30,7 @@
|
||||
"@pushrocks/smartexpress": "^3.0.38",
|
||||
"@pushrocks/smartfile": "^7.0.4",
|
||||
"@pushrocks/smarthash": "^2.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrequest": "^1.1.16",
|
||||
"@pushrocks/smartrx": "^2.0.3",
|
||||
|
@ -87,7 +87,6 @@ export class ClientUniverse {
|
||||
role: 'UniverseClient',
|
||||
url: parsedURL.protocol + '//' + parsedURL.hostname
|
||||
};
|
||||
console.log(socketConfig);
|
||||
this.smartsocketClient = new SmartsocketClient(socketConfig);
|
||||
this.observableIntake = new plugins.smartrx.ObservableIntake();
|
||||
|
||||
@ -111,7 +110,7 @@ export class ClientUniverse {
|
||||
funcName: 'processMessage',
|
||||
allowedRoles: [],
|
||||
funcDef: async (data: interfaces.IServerUnsubscribeActionPayload) => {
|
||||
console.log('Got message from server');
|
||||
plugins.smartlog.defaultLogger.log('info', 'Got message from server');
|
||||
}
|
||||
});
|
||||
|
||||
@ -120,7 +119,7 @@ export class ClientUniverse {
|
||||
this.smartsocketClient.addSocketFunction(socketFunctionProcessMessage);
|
||||
|
||||
await this.smartsocketClient.connect();
|
||||
console.log('universe client connected successfully');
|
||||
plugins.smartlog.defaultLogger.log('info', 'universe client connected successfully');
|
||||
await this.clientUniverseCache.channelMap.forEach(async clientUniverseChannelArg => {
|
||||
await clientUniverseChannelArg.subscribe();
|
||||
});
|
||||
|
@ -121,8 +121,9 @@ export class Universe {
|
||||
socketConnectionArg
|
||||
);
|
||||
if (universeConnection) {
|
||||
console.log('found UniverseConnection for socket');
|
||||
plugins.smartlog.defaultLogger.log('ok', 'found UniverseConnection for socket for incoming message');
|
||||
} else {
|
||||
plugins.smartlog.defaultLogger.log('warn', 'found no Authorized channel for incoming message');
|
||||
return {
|
||||
error: 'You need to authenticate for a channel'
|
||||
};
|
||||
@ -149,7 +150,7 @@ export class Universe {
|
||||
// start everything
|
||||
await this.smartexpressServer.start();
|
||||
await this.smartsocket.start();
|
||||
console.log('started universe');
|
||||
plugins.smartlog.defaultLogger.log('success', 'started universe');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,12 +61,12 @@ export class UniverseChannel {
|
||||
if (foundChannel) {
|
||||
universeMessageArg.authenticated = true;
|
||||
universeMessageArg.universeChannelList.add(foundChannel);
|
||||
console.log('message authorized');
|
||||
plugins.smartlog.defaultLogger.log('ok', 'message authorized');
|
||||
return foundChannel;
|
||||
} else {
|
||||
universeMessageArg.authenticated = false;
|
||||
universeMessageArg.universeChannelList.add(universeCacheArg.blackListChannel);
|
||||
console.log('message not valid');
|
||||
plugins.smartlog.defaultLogger.log('warn', 'message not valid');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,6 @@ export class UniverseConnection {
|
||||
universeConnectionArg: UniverseConnection
|
||||
): Promise<UniverseConnection> {
|
||||
for (const authenticationRequest of universeConnectionArg.authenticationRequests) {
|
||||
// TODO: authenticate channel subscriptions
|
||||
const universeChannelToAuthenticateAgainst = UniverseChannel.getUniverseChannelByName(universeRef, authenticationRequest.name);
|
||||
if (universeChannelToAuthenticateAgainst.passphrase === authenticationRequest.passphrase) {
|
||||
universeConnectionArg.authenticatedChannels.push(universeChannelToAuthenticateAgainst);
|
||||
@ -74,7 +73,6 @@ export class UniverseConnection {
|
||||
connectionArg1: UniverseConnection,
|
||||
connectionArg2: UniverseConnection
|
||||
) {
|
||||
// TODO: merge connections
|
||||
return connectionArg1;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
* handles bad messages for further analysis
|
||||
*/
|
||||
public handleAsBadMessage() {
|
||||
console.log('received a bad message');
|
||||
plugins.smartlog.defaultLogger.log('warn', 'received a bad message');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,6 +9,7 @@ import * as smarthash from '@pushrocks/smarthash';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartexpress from '@pushrocks/smartexpress';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
@ -22,6 +23,7 @@ export {
|
||||
smartdelay,
|
||||
smartexpress,
|
||||
smartfile,
|
||||
smartlog,
|
||||
smartpromise,
|
||||
smartrx,
|
||||
smartrequest,
|
||||
|
Loading…
Reference in New Issue
Block a user