update to latest standards

This commit is contained in:
Philipp Kunz 2018-04-29 14:17:26 +02:00
parent 95c5fb7e83
commit 1c8d6bf96e
5 changed files with 34 additions and 11 deletions

View File

@ -1,4 +0,0 @@
/**
* This file contains logic to bridge certain messages into another channel
*/
export class ChannelBridge {}

View File

@ -16,5 +16,7 @@ export class UniverseManager {
* @param channelName the name of the channel
* @param authSecret the secret against which to verify members of the channel
*/
public async registerChannel(channelName: string, authSecret: string) {}
public async registerChannel(channelName: string, authSecret: string) {
}
}

View File

@ -14,6 +14,8 @@ export interface ISmartUniverseConstructorOptions {
}
export interface IServerGetMessagesRequestBody {
channel: string;
topic?: string;
youngerThan: number;
}

View File

@ -1,10 +1,25 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik';
/**
* enables a set of apps to talk within their own limited borders.
* enables messages to stay within a certain scope.
*/
export class UniverseChannel {
topic: string;
/**
* stores the channels that are available within the universe
*/
public static channelStore = new Objectmap();
/**
* creates new channels
* @param channelArg the name of the topic
* @param secretArg the secret thats used for a certain topic.
*/
public static createChannel = (channelArg: string, secretArg: string) => {
}
credentials: {
user: string;
password: string;

View File

@ -15,11 +15,19 @@ export class UniverseMessage {
*/
public id: number;
public universeStore: UniverseStore;
public timestamp: TimeStamp;
public message: string;
public attachedPayload: any;
public destructionTimer: Timer;
public timestamp: TimeStamp; // when has this message been created
public topic: string; // enables unprotected grouping of messages for efficiency purposes.
public message: string; // the actual message
public attachedPayload: any; // any attached payloads. Can be of binary format.
public destructionTimer: Timer; // a timer to take care of message destruction
/**
* the constructor to create a universe message
* @param parentUniverseStore
* @param messageArg
* @param attachedPayloadArg
* @param selfdestructAfterArg
*/
constructor(
parentUniverseStore: UniverseStore,
messageArg: string,