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 channelName the name of the channel
* @param authSecret the secret against which to verify members 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 { export interface IServerGetMessagesRequestBody {
channel: string;
topic?: string;
youngerThan: number; youngerThan: number;
} }

View File

@ -1,10 +1,25 @@
import * as plugins from './smartuniverse.plugins'; 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 { 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: { credentials: {
user: string; user: string;
password: string; password: string;

View File

@ -15,11 +15,19 @@ export class UniverseMessage {
*/ */
public id: number; public id: number;
public universeStore: UniverseStore; public universeStore: UniverseStore;
public timestamp: TimeStamp; public timestamp: TimeStamp; // when has this message been created
public message: string; public topic: string; // enables unprotected grouping of messages for efficiency purposes.
public attachedPayload: any; public message: string; // the actual message
public destructionTimer: Timer; 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( constructor(
parentUniverseStore: UniverseStore, parentUniverseStore: UniverseStore,
messageArg: string, messageArg: string,