Compare commits

...

23 Commits

Author SHA1 Message Date
f6985bd7b2 1.0.13 2018-04-29 17:00:18 +02:00
241e44e19d update 2018-04-29 17:00:13 +02:00
99561166e2 1.0.12 2018-04-29 16:38:28 +02:00
0e95774f30 update ci 2018-04-29 16:38:23 +02:00
011af15866 1.0.11 2018-04-29 14:34:47 +02:00
77a13786d1 update ci config 2018-04-29 14:34:33 +02:00
d0e4c1c44a 1.0.10 2018-04-29 14:17:33 +02:00
1c8d6bf96e update to latest standards 2018-04-29 14:17:26 +02:00
95c5fb7e83 move to typescript predominance 2018-04-13 15:45:48 +02:00
2165a8f677 1.0.9 2018-04-05 17:39:47 +02:00
aa52ceeeca add better readme 2018-04-05 17:39:39 +02:00
78e57394c9 1.0.8 2018-04-05 10:34:57 +02:00
5f9f670546 add access level for npm 2018-04-05 10:34:54 +02:00
4cac5c1b1c 1.0.7 2018-04-05 10:33:09 +02:00
8d6c8494c4 1.0.6 2018-04-04 17:39:54 +02:00
3fb7375a42 update to new pushrocks scope 2018-04-04 17:39:48 +02:00
c64a72ea9d 1.0.5 2018-03-28 00:38:37 +02:00
c8c481fda0 now opening and closing correclty on server and client side 2018-03-28 00:38:32 +02:00
bafa94c6ac update 2018-03-20 08:16:54 +01:00
a28c96356f 1.0.4 2018-03-17 16:52:32 +01:00
bc7069e72c fix rxjs incompatibility 2018-03-17 16:52:27 +01:00
5ba41150be update 2018-03-17 16:36:36 +01:00
317a9f2189 now sends messages correctly 2018-03-15 01:16:16 +01:00
34 changed files with 329 additions and 442 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.nogit/
node_modules/
dist/
coverage/
public/
pages/

2
dist/index.d.ts vendored
View File

@ -1,2 +0,0 @@
export * from './smartuniverse.classes.universe';
export * from './smartuniverse.classes.universeclient';

8
dist/index.js vendored
View File

@ -1,8 +0,0 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./smartuniverse.classes.universe"));
__export(require("./smartuniverse.classes.universeclient"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHNEQUFpRDtBQUNqRCw0REFBdUQifQ==

View File

@ -1,3 +0,0 @@
export declare class UniverseManager {
registerMember(): void;
}

View File

@ -1,8 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class UniverseManager {
registerMember() {
}
}
exports.UniverseManager = UniverseManager;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLm1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsYXNzZXMubWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUlBO0lBRUUsY0FBYztJQUVkLENBQUM7Q0FDRjtBQUxELDBDQUtDIn0=

View File

@ -1,26 +0,0 @@
import { UniverseManager } from './smartuniverse.classes.manager';
import { UniverseStore } from './smartuniverse.classes.universestore';
export interface ISmartUniverseConstructorOptions {
messageExpiryInMilliseconds: number;
}
export interface IServerGetMessagesRequestBody {
youngerThan: number;
}
export interface IServerPutMessageRequestBody {
message: string;
payload: any;
}
export declare class Universe {
universeStore: UniverseStore;
universeManager: UniverseManager;
private options;
private universeVersionStore;
private readonly universeVersion;
private smartexpressServer;
constructor(optionsArg: ISmartUniverseConstructorOptions);
/**
* initiates a server
*/
initServer(portArg: number | string): Promise<void>;
stopServer(): Promise<void>;
}

View File

@ -1,66 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartuniverse.plugins");
const smartexpress_1 = require("smartexpress");
const smartuniverse_classes_manager_1 = require("./smartuniverse.classes.manager");
const smartuniverse_classes_universestore_1 = require("./smartuniverse.classes.universestore");
const paths = require("./smartuniverse.paths");
class Universe {
get universeVersion() {
if (this.universeVersionStore) {
return this.universeVersionStore;
}
else {
const packageJson = plugins.smartfile.fs.toObjectSync(paths.packageJson);
this.universeVersionStore = packageJson.version;
return this.universeVersionStore;
}
}
constructor(optionsArg) {
this.options = optionsArg;
this.universeStore = new smartuniverse_classes_universestore_1.UniverseStore(this.options.messageExpiryInMilliseconds);
this.universeManager = new smartuniverse_classes_manager_1.UniverseManager();
}
/**
* initiates a server
*/
initServer(portArg) {
return __awaiter(this, void 0, void 0, function* () {
this.smartexpressServer = new plugins.smartexpress.Server({
cors: true,
defaultAnswer: `smartuniverse server ${this.universeVersion}`,
forceSsl: false,
port: portArg
});
// route handling
const addMessageHandler = new smartexpress_1.Handler('PUT', request => {
const requestBody = request.body;
this.universeStore.addMessage(requestBody.message, requestBody.payload);
return true;
});
const readMessageHandler = new smartexpress_1.Handler('GET', request => {
const requestBody = request.body;
this.universeStore.readMessagesYoungerThan(requestBody.since);
});
const messageRoute = new smartexpress_1.Route(this.smartexpressServer, 'message');
messageRoute.addHandler(addMessageHandler);
messageRoute.addHandler(readMessageHandler);
yield this.smartexpressServer.start();
});
}
stopServer() {
return __awaiter(this, void 0, void 0, function* () {
yield this.smartexpressServer.stop();
});
}
}
exports.Universe = Universe;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxtREFBbUQ7QUFFbkQsK0NBQXNEO0FBRXRELG1GQUFrRTtBQUVsRSwrRkFBc0U7QUFDdEUsK0NBQStDO0FBZS9DO0lBVUUsSUFBWSxlQUFlO1FBQ3pCLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDLENBQUM7WUFDOUIsTUFBTSxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQztRQUNuQyxDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDTixNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxZQUFZLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1lBQ3pFLElBQUksQ0FBQyxvQkFBb0IsR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDO1lBQ2hELE1BQU0sQ0FBQyxJQUFJLENBQUMsb0JBQW9CLENBQUM7UUFDbkMsQ0FBQztJQUNILENBQUM7SUFJRCxZQUFZLFVBQTRDO1FBQ3RELElBQUksQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDO1FBQzFCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxtREFBYSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsMkJBQTJCLENBQUMsQ0FBQztRQUNqRixJQUFJLENBQUMsZUFBZSxHQUFHLElBQUksK0NBQWUsRUFBRSxDQUFDO0lBRS9DLENBQUM7SUFFRDs7T0FFRztJQUNVLFVBQVUsQ0FBQyxPQUF3Qjs7WUFDOUMsSUFBSSxDQUFDLGtCQUFrQixHQUFHLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxNQUFNLENBQUM7Z0JBQ3hELElBQUksRUFBRSxJQUFJO2dCQUNWLGFBQWEsRUFBRSx3QkFBd0IsSUFBSSxDQUFDLGVBQWUsRUFBRTtnQkFDN0QsUUFBUSxFQUFFLEtBQUs7Z0JBQ2YsSUFBSSxFQUFFLE9BQU87YUFDZCxDQUFDLENBQUM7WUFFSCxpQkFBaUI7WUFDakIsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLHNCQUFPLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxFQUFFO2dCQUNyRCxNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO2dCQUNqQyxJQUFJLENBQUMsYUFBYSxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsT0FBTyxFQUFFLFdBQVcsQ0FBQyxPQUFPLENBQUMsQ0FBQztnQkFDeEUsTUFBTSxDQUFDLElBQUksQ0FBQztZQUNkLENBQUMsQ0FBQyxDQUFDO1lBQ0gsTUFBTSxrQkFBa0IsR0FBRyxJQUFJLHNCQUFPLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxFQUFFO2dCQUN0RCxNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO2dCQUNqQyxJQUFJLENBQUMsYUFBYSxDQUFDLHVCQUF1QixDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNoRSxDQUFDLENBQUMsQ0FBQTtZQUVGLE1BQU0sWUFBWSxHQUFHLElBQUksb0JBQUssQ0FBQyxJQUFJLENBQUMsa0JBQWtCLEVBQUUsU0FBUyxDQUFDLENBQUM7WUFDbkUsWUFBWSxDQUFDLFVBQVUsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO1lBQzNDLFlBQVksQ0FBQyxVQUFVLENBQUMsa0JBQWtCLENBQUMsQ0FBQztZQUU1QyxNQUFNLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUN4QyxDQUFDO0tBQUE7SUFFWSxVQUFVOztZQUNyQixNQUFNLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUN2QyxDQUFDO0tBQUE7Q0FDRjtBQTdERCw0QkE2REMifQ==

View File

@ -1,9 +0,0 @@
export interface IClientOptions {
serverAddress: string;
}
export declare class UniverseClient {
options: any;
constructor(optionsArg: IClientOptions);
sendMessage(message: any, messagePayload: any): void;
getMessageObservable(): void;
}

View File

@ -1,17 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartuniverse.plugins");
class UniverseClient {
constructor(optionsArg) {
this.options = optionsArg;
}
sendMessage(message, messagePayload) {
plugins.smartrequest.post(this.options.serverAddress, {
requestBody: messagePayload
});
}
getMessageObservable() {
}
}
exports.UniverseClient = UniverseClient;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlY2xpZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbURBQW1EO0FBU25EO0lBR0UsWUFBWSxVQUEwQjtRQUNwQyxJQUFJLENBQUMsT0FBTyxHQUFHLFVBQVUsQ0FBQztJQUM1QixDQUFDO0lBRU0sV0FBVyxDQUFDLE9BQU8sRUFBRSxjQUFjO1FBQ3hDLE9BQU8sQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxFQUFFO1lBQ3BELFdBQVcsRUFBRSxjQUFjO1NBQzVCLENBQUMsQ0FBQTtJQUNKLENBQUM7SUFFTSxvQkFBb0I7SUFFM0IsQ0FBQztDQUNGO0FBaEJELHdDQWdCQyJ9

View File

@ -1,17 +0,0 @@
import { Timer, TimeStamp } from 'smarttime';
import { UniverseStore } from './smartuniverse.classes.universestore';
export declare class UniverseMessage {
/**
* public and unique id
* numeric ascending
* adheres to time in milliseconds
* avoids duplications though
*/
id: number;
universeStore: UniverseStore;
timestamp: TimeStamp;
message: string;
attachedPayload: any;
destructionTimer: Timer;
constructor(parentUniverseStore: UniverseStore, messageArg: string, attachedPayloadArg: any, selfdestructAfterArg: number);
}

View File

@ -1,27 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const smarttime_1 = require("smarttime");
class UniverseMessage {
constructor(parentUniverseStore, messageArg, attachedPayloadArg, selfdestructAfterArg) {
this.universeStore = parentUniverseStore;
this.timestamp = new smarttime_1.TimeStamp();
this.message = messageArg;
this.attachedPayload = attachedPayloadArg;
this.destructionTimer = new smarttime_1.Timer(selfdestructAfterArg);
this.destructionTimer.start();
// set up self destruction by removing this from the parent messageStore
this.destructionTimer.completed.then(() => __awaiter(this, void 0, void 0, function* () {
this.universeStore.messageStore.remove(this);
}));
}
}
exports.UniverseMessage = UniverseMessage;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlbWVzc2FnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0dW5pdmVyc2UuY2xhc3Nlcy51bml2ZXJzZW1lc3NhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUVBLHlDQUE2QztBQUc3QztJQWNFLFlBQVksbUJBQWtDLEVBQUUsVUFBa0IsRUFBRSxrQkFBdUIsRUFBRSxvQkFBNEI7UUFDdkgsSUFBSSxDQUFDLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQztRQUN6QyxJQUFJLENBQUMsU0FBUyxHQUFHLElBQUkscUJBQVMsRUFBRSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDO1FBQzFCLElBQUksQ0FBQyxlQUFlLEdBQUcsa0JBQWtCLENBQUM7UUFDMUMsSUFBSSxDQUFDLGdCQUFnQixHQUFHLElBQUksaUJBQUssQ0FBQyxvQkFBb0IsQ0FBQyxDQUFBO1FBQ3ZELElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLEVBQUUsQ0FBQTtRQUU3Qix3RUFBd0U7UUFDeEUsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsR0FBUyxFQUFFO1lBQzlDLElBQUksQ0FBQyxhQUFhLENBQUMsWUFBWSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUMvQyxDQUFDLENBQUEsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBM0JELDBDQTJCQyJ9

View File

@ -1,20 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { Observable } from 'rxjs';
export declare class UniverseStore {
standardMessageExpiry: number;
destructionTime: number;
messageStore: plugins.lik.Objectmap<UniverseMessage>;
private lastId;
constructor(standardMessageExpiryArg: number);
/**
* add a message to the UniverseStore
* @param messageArg
* @param attachedPayloadArg
*/
addMessage(messageArg: any, attachedPayloadArg: any): void;
/**
* Read a message from the UniverseStore
*/
readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage>;
}

View File

@ -1,34 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartuniverse_classes_universemessage_1 = require("./smartuniverse.classes.universemessage");
const lik_1 = require("lik");
const smartrx_1 = require("smartrx");
class UniverseStore {
constructor(standardMessageExpiryArg) {
this.destructionTime = 60000;
this.messageStore = new lik_1.Objectmap();
this.lastId = 0; // stores the last id
this.standardMessageExpiry = standardMessageExpiryArg;
}
/**
* add a message to the UniverseStore
* @param messageArg
* @param attachedPayloadArg
*/
addMessage(messageArg, attachedPayloadArg) {
this.messageStore.add(new smartuniverse_classes_universemessage_1.UniverseMessage(this, messageArg, attachedPayloadArg, this.destructionTime));
}
/**
* Read a message from the UniverseStore
*/
readMessagesYoungerThan(unixTimeArg) {
const messageObservable = smartrx_1.rxjs.Observable
.from(this.messageStore.getArray())
.filter(messageArg => {
return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime);
});
return messageObservable;
}
}
exports.UniverseStore = UniverseStore;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlc3RvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsYXNzZXMudW5pdmVyc2VzdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLG1HQUEwRTtBQUUxRSw2QkFBK0I7QUFHL0IscUNBQThCO0FBRTlCO0lBTUUsWUFBWSx3QkFBZ0M7UUFKckMsb0JBQWUsR0FBVyxLQUFLLENBQUM7UUFDaEMsaUJBQVksR0FBRyxJQUFJLGVBQVMsRUFBbUIsQ0FBQztRQUMvQyxXQUFNLEdBQVcsQ0FBQyxDQUFDLENBQUMscUJBQXFCO1FBRy9DLElBQUksQ0FBQyxxQkFBcUIsR0FBRyx3QkFBd0IsQ0FBQztJQUN4RCxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNJLFVBQVUsQ0FBQyxVQUFVLEVBQUUsa0JBQWtCO1FBQzlDLElBQUksQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLElBQUksdURBQWUsQ0FBQyxJQUFJLEVBQUUsVUFBVSxFQUFFLGtCQUFrQixFQUFFLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDO0lBQ3pHLENBQUM7SUFFRDs7T0FFRztJQUNJLHVCQUF1QixDQUFDLFdBQW9CO1FBQ2pELE1BQU0saUJBQWlCLEdBQUcsY0FBSSxDQUFDLFVBQVU7YUFDdEMsSUFBSSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsUUFBUSxFQUFFLENBQUM7YUFDbEMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQ25CLE1BQU0sQ0FBQyxVQUFVLENBQUMsU0FBUyxDQUFDLHlCQUF5QixDQUFDLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQztRQUM5RSxDQUFDLENBQUMsQ0FBQztRQUNMLE1BQU0sQ0FBQyxpQkFBaUIsQ0FBQztJQUUzQixDQUFDO0NBQ0Y7QUEvQkQsc0NBK0JDIn0=

View File

@ -1 +0,0 @@
export {};

View File

@ -1,21 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartuniverse.plugins");
const index_1 = require("./index");
process.env.CLI = 'true';
const universeCli = new plugins.smartcli.Smartcli();
universeCli.standardTask().then((argvArg) => __awaiter(this, void 0, void 0, function* () {
const standardUniverse = new index_1.Universe({
messageExpiryInMilliseconds: 60000
});
yield standardUniverse.initServer(8765);
}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsbURBQW1EO0FBRW5ELG1DQUFtQztBQUVuQyxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUM7QUFFekIsTUFBTSxXQUFXLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBRXBELFdBQVcsQ0FBQyxZQUFZLEVBQUUsQ0FBQyxJQUFJLENBQUMsQ0FBTSxPQUFPLEVBQUMsRUFBRTtJQUM5QyxNQUFNLGdCQUFnQixHQUFHLElBQUksZ0JBQVEsQ0FBQztRQUNwQywyQkFBMkIsRUFBRSxLQUFLO0tBQ25DLENBQUMsQ0FBQztJQUNILE1BQU0sZ0JBQWdCLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBRTFDLENBQUMsQ0FBQSxDQUFDLENBQUMifQ==

View File

@ -1 +0,0 @@
export declare const packageJson: string;

View File

@ -1,5 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartuniverse.plugins");
exports.packageJson = plugins.path.join(__dirname, '../package.json');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0dW5pdmVyc2UucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtREFBbUQ7QUFFdEMsUUFBQSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLGlCQUFpQixDQUFDLENBQUMifQ==

View File

@ -1,10 +0,0 @@
import * as lik from 'lik';
import * as path from 'path';
import * as smartcli from 'smartcli';
import * as smartexpress from 'smartexpress';
import * as smartfile from 'smartfile';
import * as smartrequest from 'smartrequest';
import * as smartrx from 'smartrx';
import * as smartsocket from 'smartsocket';
import * as smarttime from 'smarttime';
export { lik, path, smartcli, smartexpress, smartfile, smartrx, smartrequest, smartsocket, smarttime };

View File

@ -1,21 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const lik = require("lik");
exports.lik = lik;
const path = require("path");
exports.path = path;
const smartcli = require("smartcli");
exports.smartcli = smartcli;
const smartexpress = require("smartexpress");
exports.smartexpress = smartexpress;
const smartfile = require("smartfile");
exports.smartfile = smartfile;
const smartrequest = require("smartrequest");
exports.smartrequest = smartrequest;
const smartrx = require("smartrx");
exports.smartrx = smartrx;
const smartsocket = require("smartsocket");
exports.smartsocket = smartsocket;
const smarttime = require("smarttime");
exports.smarttime = smarttime;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMkJBQTJCO0FBVWxCLGtCQUFHO0FBVFosNkJBQTZCO0FBU2Ysb0JBQUk7QUFSbEIscUNBQXFDO0FBUWpCLDRCQUFRO0FBUDVCLDZDQUE2QztBQU9mLG9DQUFZO0FBTjFDLHVDQUF1QztBQU1LLDhCQUFTO0FBTHJELDZDQUE2QztBQUttQixvQ0FBWTtBQUo1RSxtQ0FBbUM7QUFJb0IsMEJBQU87QUFIOUQsMkNBQTJDO0FBR21DLGtDQUFXO0FBRnpGLHVDQUF1QztBQUVvRCw4QkFBUyJ9

View File

@ -1,7 +1,9 @@
{
"npmci": {
"npmGlobalTools": [
"npmts"
]
"@gitzone/npmts",
"ts-node"
],
"npmAccessLevel": "public"
}
}

View File

@ -1,27 +1,30 @@
{
"name": "smartuniverse",
"version": "1.0.3",
"name": "@pushrocks/smartuniverse",
"version": "1.0.13",
"description": "messaging service for your micro services",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(npmts)",
"test": "ts-node test/test.ts",
"build": "(npmts)",
"format": "(gitzone format)"
},
"devDependencies": {
"@types/node": "^9.6.0",
"tapbundle": "^2.0.0"
},
"dependencies": {
"lik": "^2.0.5",
"rxjs": "^5.5.6",
"rxjs": "^5.5.8",
"smartcli": "^2.0.12",
"smartexpress": "^1.0.21",
"smartfile": "^4.2.28",
"smartq": "^1.1.8",
"smartrequest": "^1.0.8",
"smartrx": "^1.0.5",
"smartsocket": "^1.1.10",
"smartsocket": "^1.1.19",
"smarttime": "^2.0.0"
}
}

33
readme.md Normal file
View File

@ -0,0 +1,33 @@
# smartuniverse
messaging service for your micro services
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartuniverse)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartuniverse)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartuniverse/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartuniverse/badges/master/build.svg)](https://GitLab.com/pushrocks/smartuniverse/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartuniverse/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartuniverse/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartuniverse.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartuniverse/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartuniverse/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartuniverse/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartuniverse)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartuniverse/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartuniverse)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -2,29 +2,48 @@
import { expect, tap } from 'tapbundle';
import * as smartuniverse from '../ts/index';
import { Observable } from 'rxjs';
let testUniverse: smartuniverse.Universe;
let testUniverseClient: smartuniverse.UniverseClient
let testUniverseClient: smartuniverse.UniverseClient;
let testMessageObservable: Observable<smartuniverse.UniverseMessage>;
tap.test('first test', async () => {
testUniverse = new smartuniverse.Universe({
messageExpiryInMilliseconds: 5000
messageExpiryInMilliseconds: 1000
});
});
tap.test('add a message to the SmartUniverse', async () => {
await testUniverse.initServer(8765);
})
});
// testing message handling
tap.test('create smartuniverse client', async () => {
testUniverseClient = new smartuniverse.UniverseClient({
serverAddress: 'localhost:8765'
serverAddress: 'http://localhost:8765'
});
expect(testUniverseClient).to.be.instanceof(smartuniverse.UniverseClient)
})
expect(testUniverseClient).to.be.instanceof(smartuniverse.UniverseClient);
});
tap.test('should end the server correctly', async () => {
tap.test('should send a message correctly', async () => {
await testUniverseClient.sendMessage('greeting', {
anyBool: true
});
});
tap.test('should get a observable correctly', async () => {
testMessageObservable = testUniverseClient.getMessageObservable();
});
tap.test('should receive a message correctly', async () => {});
tap.test('should disconnect the client correctly', async () => {
testUniverseClient.close();
});
tap.test('should end the server correctly', async tools => {
await testUniverse.stopServer();
})
});
tap.start();

View File

@ -1,2 +1,3 @@
export * from './smartuniverse.classes.universe';
export * from './smartuniverse.classes.universeclient';
export * from './smartuniverse.classes.universemessage';

View File

@ -1,10 +1,22 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik';
import { UniverseChannel } from './smartuniverse.classes.universechannel';
export class UniverseManager {
registerMember () {
public channelStore = new Objectmap<UniverseChannel>();
/**
* register a new member
*/
public async registerMember() {}
/**
* register a new channel within the universe
* @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) {
}
}

View File

@ -3,8 +3,10 @@ import * as plugins from './smartuniverse.plugins';
import { Handler, Route, Server } from 'smartexpress';
import { UniverseManager } from './smartuniverse.classes.manager';
import { UniverseChannel } from './smartuniverse.classes.universechannel';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { UniverseStore } from './smartuniverse.classes.universestore';
import * as paths from './smartuniverse.paths';
export interface ISmartUniverseConstructorOptions {
@ -12,12 +14,14 @@ export interface ISmartUniverseConstructorOptions {
}
export interface IServerGetMessagesRequestBody {
channel: string;
topic?: string;
youngerThan: number;
}
export interface IServerPutMessageRequestBody {
message: string,
payload: any
message: string;
payload: any;
}
export class Universe {
@ -27,7 +31,7 @@ export class Universe {
// options
private options: ISmartUniverseConstructorOptions;
// Store version handling
private universeVersionStore: string;
private get universeVersion() {
@ -41,12 +45,12 @@ export class Universe {
}
private smartexpressServer: plugins.smartexpress.Server;
private smartsocket: plugins.smartsocket.Smartsocket;
constructor(optionsArg: ISmartUniverseConstructorOptions) {
this.options = optionsArg;
this.universeStore = new UniverseStore(this.options.messageExpiryInMilliseconds);
this.universeManager = new UniverseManager();
}
/**
@ -60,25 +64,47 @@ export class Universe {
port: portArg
});
// route handling
// message handling
// adds messages
const addMessageHandler = new Handler('PUT', request => {
const requestBody = request.body;
this.universeStore.addMessage(requestBody.message, requestBody.payload);
console.log(requestBody);
return true;
});
const readMessageHandler = new Handler('GET', request => {
const requestBody = request.body;
this.universeStore.readMessagesYoungerThan(requestBody.since);
})
// gets messages
const readMessageHandler = new Handler('GET', request => {
const done = plugins.smartq.defer<UniverseMessage[]>();
const requestBody = request.body;
const messageObservable = this.universeStore.readMessagesYoungerThan(requestBody.since);
messageObservable.toArray().subscribe(universeMessageArrayArg => {
done.resolve(universeMessageArrayArg);
});
return done.promise;
});
// create new Route for messages
const messageRoute = new Route(this.smartexpressServer, 'message');
messageRoute.addHandler(addMessageHandler);
messageRoute.addHandler(readMessageHandler);
const leaderElectionRoute = new Route(this.smartexpressServer, 'leadelection');
// TODO: implement Handlers for leader election
// add websocket upgrade
this.smartsocket = new plugins.smartsocket.Smartsocket({
port: 12345 // fix this within smartsocket
});
this.smartsocket.setExternalServer('express', this.smartexpressServer as any); // should work with express as well
this.smartsocket.start();
await this.smartexpressServer.start();
}
public async stopServer () {
public async stopServer() {
await this.smartsocket.stop();
await this.smartexpressServer.stop();
}
}

View File

@ -0,0 +1,32 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik';
/**
* enables messages to stay within a certain scope.
*/
export class UniverseChannel {
/**
* 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;
};
/**
* authenticates a client on the server side
*/
async authenticateClient() {}
}

View File

@ -1,26 +1,60 @@
import * as plugins from './smartuniverse.plugins';
import { Observable } from 'rxjs';
import { IServerGetMessagesRequestBody, IServerPutMessageRequestBody } from './smartuniverse.classes.universe'
import { Smartsocket, SmartsocketClient } from 'smartsocket';
import * as url from 'url';
import {
IServerGetMessagesRequestBody,
IServerPutMessageRequestBody
} from './smartuniverse.classes.universe';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
export interface IClientOptions {
serverAddress: string
serverAddress: string;
}
/**
* this class is for client side only!!!
* allows connecting to a universe server
*/
export class UniverseClient {
public options;
private socketClient: plugins.smartsocket.SmartsocketClient;
private observableIntake: plugins.smartrx.ObservableIntake<UniverseMessage>;
constructor(optionsArg: IClientOptions) {
this.options = optionsArg;
}
public sendMessage(message, messagePayload) {
plugins.smartrequest.post(this.options.serverAddress, {
requestBody: messagePayload
})
public async sendMessage(messageArg, payloadArg) {
const requestBody = {
message: messageArg,
payload: payloadArg
};
// TODO: User websocket connection if available
await plugins.smartrequest.post(this.options.serverAddress, {
requestBody
});
}
public getMessageObservable () {
public getMessageObservable() {
if (!this.socketClient && !this.observableIntake) {
const parsedURL = url.parse(this.options.serverAddress);
this.socketClient = new SmartsocketClient({
alias: process.env.SOCKET_ALIAS || 'someclient',
password: 'UniverseClient',
port: parseInt(parsedURL.port, 10),
role: 'UniverseClient',
url: parsedURL.hostname
});
this.observableIntake = new plugins.smartrx.ObservableIntake();
this.socketClient.connect();
}
return this.observableIntake.observable;
}
public close() {
this.socketClient.disconnect();
}
}

View File

@ -3,6 +3,9 @@ import * as plugins from './smartuniverse.plugins';
import { Timer, TimeStamp } from 'smarttime';
import { UniverseStore } from './smartuniverse.classes.universestore';
/**
* represents a message within a universe
*/
export class UniverseMessage {
/**
* public and unique id
@ -12,22 +15,35 @@ 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
constructor(parentUniverseStore: UniverseStore, messageArg: string, attachedPayloadArg: any, selfdestructAfterArg: number) {
/**
* the constructor to create a universe message
* @param parentUniverseStore
* @param messageArg
* @param attachedPayloadArg
* @param selfdestructAfterArg
*/
constructor(
parentUniverseStore: UniverseStore,
messageArg: string,
attachedPayloadArg: any,
selfdestructAfterArg: number
) {
this.universeStore = parentUniverseStore;
this.timestamp = new TimeStamp();
this.message = messageArg;
this.attachedPayload = attachedPayloadArg;
this.destructionTimer = new Timer(selfdestructAfterArg)
this.destructionTimer.start()
this.destructionTimer = new Timer(selfdestructAfterArg);
this.destructionTimer.start();
// set up self destruction by removing this from the parent messageStore
this.destructionTimer.completed.then(async () => {
this.universeStore.messageStore.remove(this);
})
});
}
}

View File

@ -2,11 +2,14 @@ import * as plugins from './smartuniverse.plugins';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { Objectmap } from 'lik'
import { Objectmap } from 'lik';
import { Observable } from 'rxjs';
import { rxjs } from 'smartrx'
import { rxjs } from 'smartrx';
/**
* universe store handles the creation, storage and retrieval of messages.
*/
export class UniverseStore {
public standardMessageExpiry: number;
public destructionTime: number = 60000;
@ -23,19 +26,20 @@ export class UniverseStore {
* @param attachedPayloadArg
*/
public addMessage(messageArg, attachedPayloadArg) {
this.messageStore.add(new UniverseMessage(this, messageArg, attachedPayloadArg, this.destructionTime));
this.messageStore.add(
new UniverseMessage(this, messageArg, attachedPayloadArg, this.destructionTime)
);
}
/**
* Read a message from the UniverseStore
*/
public readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage> {
const messageObservable = rxjs.Observable
.from(this.messageStore.getArray())
.filter(messageArg => {
const messageObservable = rxjs.Observable.from(this.messageStore.getArray()).filter(
messageArg => {
return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime);
});
}
);
return messageObservable;
}
}

View File

@ -11,5 +11,4 @@ universeCli.standardTask().then(async argvArg => {
messageExpiryInMilliseconds: 60000
});
await standardUniverse.initServer(8765);
});

View File

@ -3,9 +3,21 @@ import * as path from 'path';
import * as smartcli from 'smartcli';
import * as smartexpress from 'smartexpress';
import * as smartfile from 'smartfile';
import * as smartq from 'smartq';
import * as smartrequest from 'smartrequest';
import * as smartrx from 'smartrx';
import * as smartsocket from 'smartsocket';
import * as smarttime from 'smarttime';
export { lik, path, smartcli, smartexpress, smartfile, smartrx, smartrequest, smartsocket, smarttime };
export {
lik,
path,
smartcli,
smartexpress,
smartfile,
smartq,
smartrx,
smartrequest,
smartsocket,
smarttime
};

View File

@ -1,6 +1,12 @@
{
"extends": [
"tslint:latest",
"tslint-config-prettier"
"extends": [
"tslint:latest",
"tslint-config-prettier"
],
"rules": {
"semicolon": [
true,
"always"
]
}
}

159
yarn.lock
View File

@ -56,21 +56,21 @@
dependencies:
"@types/express" "*"
"@types/lodash@^4.14.55", "@types/lodash@^4.14.74", "@types/lodash@^4.14.97":
version "4.14.104"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80"
"@types/lodash@^4.14.55", "@types/lodash@^4.14.97":
version "4.14.106"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd"
"@types/mime@*":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.0.tgz#5a7306e367c539b9f6543499de8dd519fac37a8b"
"@types/minimatch@3.x.x", "@types/minimatch@^3.0.3":
"@types/minimatch@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
"@types/node@*":
version "9.4.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.7.tgz#57d81cd98719df2c9de118f2d5f3b1120dcd7275"
"@types/node@*", "@types/node@^9.6.0":
version "9.6.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.0.tgz#d3480ee666df9784b1001a1872a2f6ccefb6c2d7"
"@types/q@0.x.x":
version "0.0.37"
@ -87,13 +87,13 @@
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/shortid/-/shortid-0.0.29.tgz#8093ee0416a6e2bf2aa6338109114b3fbffa0e9b"
"@types/socket.io-client@^1.4.29":
"@types/socket.io-client@^1.4.32":
version "1.4.32"
resolved "https://registry.yarnpkg.com/@types/socket.io-client/-/socket.io-client-1.4.32.tgz#988a65a0386c274b1c22a55377fab6a30789ac14"
"@types/socket.io@^1.4.29":
version "1.4.31"
resolved "https://registry.yarnpkg.com/@types/socket.io/-/socket.io-1.4.31.tgz#7a928518a35516fccd90431f94538ed3fddaba19"
"@types/socket.io@^1.4.32":
version "1.4.32"
resolved "https://registry.yarnpkg.com/@types/socket.io/-/socket.io-1.4.32.tgz#bf7bc4ea6991327f31672c05e237a8a28d7bfc30"
dependencies:
"@types/node" "*"
@ -113,7 +113,7 @@
version "10.0.2"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-10.0.2.tgz#cc4ea921877874d1261e2c44b89807bc836e1b12"
accepts@~1.3.4:
accepts@~1.3.4, accepts@~1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2"
dependencies:
@ -312,12 +312,12 @@ clone-stats@^1.0.0:
resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680"
clone@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb"
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
cloneable-readable@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.1.tgz#c27a4f3a943ca37bed9b01c7d572ee61b1302b15"
version "1.1.2"
resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.2.tgz#d591dee4a8f8bc15da43ce97dceeba13d43e2a65"
dependencies:
inherits "^2.0.1"
process-nextick-args "^2.0.0"
@ -429,7 +429,7 @@ depd@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
depd@~1.1.1:
depd@~1.1.1, depd@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
@ -457,7 +457,7 @@ ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
encodeurl@~1.0.1:
encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
@ -501,8 +501,8 @@ engine.io@~3.1.0:
uws "~9.14.0"
es-abstract@^1.5.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
version "1.11.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.1"
@ -561,10 +561,10 @@ express-force-ssl@^0.3.2:
lodash.assign "^3.2.0"
express@^4.16.2:
version "4.16.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c"
version "4.16.3"
resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53"
dependencies:
accepts "~1.3.4"
accepts "~1.3.5"
array-flatten "1.1.1"
body-parser "1.18.2"
content-disposition "0.5.2"
@ -572,26 +572,26 @@ express@^4.16.2:
cookie "0.3.1"
cookie-signature "1.0.6"
debug "2.6.9"
depd "~1.1.1"
encodeurl "~1.0.1"
depd "~1.1.2"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
finalhandler "1.1.0"
finalhandler "1.1.1"
fresh "0.5.2"
merge-descriptors "1.0.1"
methods "~1.1.2"
on-finished "~2.3.0"
parseurl "~1.3.2"
path-to-regexp "0.1.7"
proxy-addr "~2.0.2"
proxy-addr "~2.0.3"
qs "6.5.1"
range-parser "~1.2.0"
safe-buffer "5.1.1"
send "0.16.1"
serve-static "1.13.1"
send "0.16.2"
serve-static "1.13.2"
setprototypeof "1.1.0"
statuses "~1.3.1"
type-is "~1.6.15"
statuses "~1.4.0"
type-is "~1.6.16"
utils-merge "1.0.1"
vary "~1.1.2"
@ -599,16 +599,16 @@ figlet@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
finalhandler@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5"
finalhandler@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105"
dependencies:
debug "2.6.9"
encodeurl "~1.0.1"
encodeurl "~1.0.2"
escape-html "~1.0.3"
on-finished "~2.3.0"
parseurl "~1.3.2"
statuses "~1.3.1"
statuses "~1.4.0"
unpipe "~1.0.0"
find-up@^2.1.0:
@ -872,18 +872,6 @@ left-pad@^1.1.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
lik@^1.0.38:
version "1.0.43"
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.43.tgz#e81709290fb85ff61dabfa008791ba9ffed0c666"
dependencies:
"@types/lodash" "^4.14.74"
"@types/minimatch" "3.x.x"
lodash "^4.17.4"
minimatch "^3.0.4"
rxjs "^5.4.3"
smartq "^1.1.6"
typings-global "^1.0.20"
lik@^2.0.1, lik@^2.0.2, lik@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/lik/-/lik-2.0.5.tgz#1338a3201828b557fa91a5b8a6013743ff720e10"
@ -1044,8 +1032,8 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
nan@^2.3.2:
version "2.9.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866"
version "2.10.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"
negotiator@0.6.1:
version "0.6.1"
@ -1205,7 +1193,7 @@ process-nextick-args@^2.0.0, process-nextick-args@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
proxy-addr@~2.0.2:
proxy-addr@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341"
dependencies:
@ -1280,9 +1268,9 @@ restore-cursor@^2.0.0:
onetime "^2.0.0"
signal-exit "^3.0.2"
rxjs@^5.4.3, rxjs@^5.5.2, rxjs@^5.5.6:
version "5.5.6"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02"
rxjs@^5.4.3, rxjs@^5.5.2, rxjs@^5.5.8:
version "5.5.8"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.8.tgz#b2b0809a57614ad6254c03d7446dea0d83ca3791"
dependencies:
symbol-observable "1.0.1"
@ -1290,14 +1278,14 @@ safe-buffer@5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
send@0.16.1:
version "0.16.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3"
send@0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
dependencies:
debug "2.6.9"
depd "~1.1.1"
depd "~1.1.2"
destroy "~1.0.4"
encodeurl "~1.0.1"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
fresh "0.5.2"
@ -1306,16 +1294,16 @@ send@0.16.1:
ms "2.0.0"
on-finished "~2.3.0"
range-parser "~1.2.0"
statuses "~1.3.1"
statuses "~1.4.0"
serve-static@1.13.1:
version "1.13.1"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.1.tgz#4c57d53404a761d8f2e7c1e8a18a47dbf278a719"
serve-static@1.13.2:
version "1.13.2"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1"
dependencies:
encodeurl "~1.0.1"
encodeurl "~1.0.2"
escape-html "~1.0.3"
parseurl "~1.3.2"
send "0.16.1"
send "0.16.2"
set-blocking@^2.0.0:
version "2.0.0"
@ -1439,11 +1427,10 @@ smartpath@^3.2.8:
home "^1.0.1"
typings-global "^1.0.14"
smartq@^1.1.1, smartq@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
smartq@^1.1.1, smartq@^1.1.6, smartq@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.8.tgz#7e2f3b9739eb5d6c9f45f2a86e339ec81e49e8d2"
dependencies:
typings-global "^1.0.19"
util.promisify "^1.0.0"
smartrequest@^1.0.8:
@ -1462,21 +1449,21 @@ smartrx@^1.0.5:
smartq "^1.1.6"
typings-global "^1.0.23"
smartsocket@^1.1.10:
version "1.1.10"
resolved "https://registry.yarnpkg.com/smartsocket/-/smartsocket-1.1.10.tgz#b41d945f22e5144d932f49a3c955b7512bdb7731"
smartsocket@^1.1.19:
version "1.1.19"
resolved "https://registry.yarnpkg.com/smartsocket/-/smartsocket-1.1.19.tgz#60d15ad1af4b2be03ca7a56ce075e52fa0e33e1f"
dependencies:
"@types/shortid" "0.0.29"
"@types/socket.io" "^1.4.29"
"@types/socket.io-client" "^1.4.29"
"@types/socket.io" "^1.4.32"
"@types/socket.io-client" "^1.4.32"
beautylog "^6.1.10"
lik "^1.0.38"
lik "^2.0.5"
nodehash "^1.0.4"
shortid "^2.2.8"
smartq "^1.1.6"
socket.io "^2.0.3"
socket.io-client "^2.0.3"
typings-global "^1.0.19"
smartdelay "^1.0.4"
smartq "^1.1.8"
socket.io "^2.0.4"
socket.io-client "^2.0.4"
smarttime@^2.0.0:
version "2.0.0"
@ -1490,7 +1477,7 @@ socket.io-adapter@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b"
socket.io-client@2.0.4, socket.io-client@^2.0.3:
socket.io-client@2.0.4, socket.io-client@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e"
dependencies:
@ -1517,7 +1504,7 @@ socket.io-parser@~3.1.1:
has-binary2 "~1.0.2"
isarray "2.0.1"
socket.io@^2.0.3:
socket.io@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014"
dependencies:
@ -1531,14 +1518,10 @@ sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
"statuses@>= 1.3.1 < 2":
"statuses@>= 1.3.1 < 2", statuses@~1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
statuses@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -1634,14 +1617,14 @@ type-detect@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
type-is@~1.6.15:
type-is@~1.6.15, type-is@~1.6.16:
version "1.6.16"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194"
dependencies:
media-typer "0.3.0"
mime-types "~2.1.18"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19, typings-global@^1.0.20, typings-global@^1.0.23, typings-global@^1.0.6:
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.20, typings-global@^1.0.23, typings-global@^1.0.6:
version "1.0.28"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.28.tgz#e28cc965476564cbc00e438739e0aa0735d323d4"