Compare commits

..

66 Commits

Author SHA1 Message Date
241182ed2e 1.0.40 2019-04-22 22:04:53 +02:00
3d82038ec3 fix(core): update 2019-04-22 22:04:52 +02:00
300d62ed12 1.0.39 2019-04-22 13:06:02 +02:00
a5e849aa17 fix(core): update 2019-04-22 13:06:01 +02:00
83807d7c5c 1.0.38 2019-04-22 09:58:36 +02:00
39d3a0f2f8 fix(core): update 2019-04-22 09:58:36 +02:00
904a48d414 1.0.37 2019-04-12 20:50:44 +02:00
e2acb28756 1.0.36 2019-04-11 18:59:46 +02:00
92e4379bd2 fix(core): update 2019-04-11 18:59:45 +02:00
e0ce732ee1 1.0.35 2019-04-11 18:57:24 +02:00
98be0f036c fix(core): update 2019-04-11 18:57:23 +02:00
54fca17142 1.0.34 2019-04-11 18:50:43 +02:00
1a7634e8db fix(core): update 2019-04-11 18:50:43 +02:00
8830b825ac 1.0.33 2019-04-11 18:32:36 +02:00
123324bf43 fix(core): update 2019-04-11 18:32:36 +02:00
4761ff31cf 1.0.32 2019-04-11 18:31:21 +02:00
430c3ea13a fix(core): update 2019-04-11 18:31:21 +02:00
6dd3782b0d 1.0.31 2019-04-11 18:16:14 +02:00
06aa721247 1.0.30 2019-04-11 17:52:02 +02:00
f728c56016 fix(core): update 2019-04-11 17:52:01 +02:00
f512acdfaa 1.0.29 2019-04-11 16:53:28 +02:00
331a098851 fix(core): update 2019-04-11 16:53:28 +02:00
a8053a6e20 1.0.28 2019-04-11 11:36:57 +02:00
a62f3eb750 fix(core): update 2019-04-11 11:36:57 +02:00
4b53044e8f 1.0.27 2019-04-11 11:15:09 +02:00
2db2c80130 fix(core): update 2019-04-11 11:15:09 +02:00
8b23eaf194 1.0.26 2019-04-11 11:11:46 +02:00
a03c54001f fix(core): update 2019-04-11 11:11:45 +02:00
7bc404ba21 1.0.25 2019-01-31 02:52:18 +01:00
ac2a1559b0 fix(core): update 2019-01-31 02:52:18 +01:00
57b37cb327 1.0.24 2019-01-30 11:01:49 +01:00
8b17e814cc fix(dependencies): update 2019-01-30 11:01:48 +01:00
f4b8cde347 fix(dependencies): update 2019-01-30 10:56:31 +01:00
3189d4d274 1.0.23 2018-05-30 16:34:07 +02:00
c2d134a6ea fix(websocket): switch to all websocket infrastructure 2018-05-30 16:34:06 +02:00
7552dc1e9f 1.0.22 2018-05-28 12:07:26 +02:00
fe91459510 fix(core): update to transparent universe 2018-05-28 12:07:25 +02:00
0e0ffb7634 1.0.21 2018-05-26 13:44:32 +02:00
37bb052774 fix(UniverseMessage / UniverseChannel): better authentication for of messages for channels 2018-05-26 13:44:32 +02:00
3c7683d40e 1.0.20 2018-05-24 17:08:29 +02:00
c19f27e873 fix(dependencies): update 2018-05-24 17:08:28 +02:00
c1a03fec0f 1.0.19 2018-05-24 16:55:25 +02:00
8b650c5ea7 fix(UniverseChannel): improve channel handling 2018-05-24 16:55:24 +02:00
4fc6e327ec 1.0.18 2018-05-24 00:14:57 +02:00
7991baf2bf fix(core): improve channel handling 2018-05-24 00:14:57 +02:00
d033780015 1.0.17 2018-05-23 23:50:46 +02:00
eae46e6461 fix(structure): format TypeScript 2018-05-23 23:50:45 +02:00
785acfaba4 1.0.16 2018-05-20 00:41:59 +02:00
5a4dceb75d fix(core): prepare for release 2018-05-20 00:41:59 +02:00
a17834a8f0 1.0.15 2018-05-07 18:50:07 +02:00
01765fa50f feat(message): refactor 2018-05-07 18:50:07 +02:00
547c159dc4 1.0.14 2018-04-29 17:30:03 +02:00
046d7d646d update to latest standards 2018-04-29 17:30:00 +02:00
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
46 changed files with 3795 additions and 2394 deletions

1
.gitignore vendored
View File

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

View File

@ -3,93 +3,123 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci command yarn global add snyk
- npmci command yarn install --ignore-scripts
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release:
stage: release
script:
- npmci npm prepare
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npmpage
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1 +0,0 @@
FROM hosttoday/ht-docker-node

3
dist/index.d.ts vendored
View File

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

9
dist/index.js vendored
View File

@ -1,9 +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"));
__export(require("./smartuniverse.classes.universemessage"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHNEQUFpRDtBQUNqRCw0REFBdUQ7QUFDdkQsNkRBQXdEIn0=

View File

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

View File

@ -1,17 +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 });
class UniverseManager {
registerMember() {
return __awaiter(this, void 0, void 0, function* () { });
}
}
exports.UniverseManager = UniverseManager;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLm1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsYXNzZXMubWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBSUE7SUFDZSxjQUFjOzhEQUFJLENBQUM7S0FBQTtDQUNqQztBQUZELDBDQUVDIn0=

View File

@ -1,27 +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;
private smartsocket;
constructor(optionsArg: ISmartUniverseConstructorOptions);
/**
* initiates a server
*/
initServer(portArg: number | string): Promise<void>;
stopServer(): Promise<void>;
}

View File

@ -1,75 +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
});
this.smartsocket = new plugins.smartsocket.Smartsocket({
port: 12345 // fix this within smartsocket
});
this.smartsocket.setExternalServer('express', this.smartexpressServer); // should work with express as well
this.smartsocket.start();
// route handling
// adds messages
const addMessageHandler = new smartexpress_1.Handler('PUT', request => {
const requestBody = request.body;
this.universeStore.addMessage(requestBody.message, requestBody.payload);
console.log(requestBody);
return true;
});
// gets messages
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.smartsocket.stop();
yield this.smartexpressServer.stop();
});
}
}
exports.Universe = Universe;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxtREFBbUQ7QUFFbkQsK0NBQXNEO0FBRXRELG1GQUFrRTtBQUVsRSwrRkFBc0U7QUFDdEUsK0NBQStDO0FBZS9DO0lBVUUsSUFBWSxlQUFlO1FBQ3pCLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDLENBQUM7WUFDOUIsTUFBTSxDQUFDLElBQUksQ0FBQyxvQkFBb0IsQ0FBQztRQUNuQyxDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDTixNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxZQUFZLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1lBQ3pFLElBQUksQ0FBQyxvQkFBb0IsR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDO1lBQ2hELE1BQU0sQ0FBQyxJQUFJLENBQUMsb0JBQW9CLENBQUM7UUFDbkMsQ0FBQztJQUNILENBQUM7SUFLRCxZQUFZLFVBQTRDO1FBQ3RELElBQUksQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDO1FBQzFCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxtREFBYSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsMkJBQTJCLENBQUMsQ0FBQztRQUNqRixJQUFJLENBQUMsZUFBZSxHQUFHLElBQUksK0NBQWUsRUFBRSxDQUFDO0lBQy9DLENBQUM7SUFFRDs7T0FFRztJQUNVLFVBQVUsQ0FBQyxPQUF3Qjs7WUFDOUMsSUFBSSxDQUFDLGtCQUFrQixHQUFHLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxNQUFNLENBQUM7Z0JBQ3hELElBQUksRUFBRSxJQUFJO2dCQUNWLGFBQWEsRUFBRSx3QkFBd0IsSUFBSSxDQUFDLGVBQWUsRUFBRTtnQkFDN0QsUUFBUSxFQUFFLEtBQUs7Z0JBQ2YsSUFBSSxFQUFFLE9BQU87YUFDZCxDQUFDLENBQUM7WUFFSCxJQUFJLENBQUMsV0FBVyxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxXQUFXLENBQUM7Z0JBQ3JELElBQUksRUFBRSxLQUFLLENBQUMsOEJBQThCO2FBQzNDLENBQUMsQ0FBQztZQUVILElBQUksQ0FBQyxXQUFXLENBQUMsaUJBQWlCLENBQ2hDLFNBQVMsRUFDVCxJQUFJLENBQUMsa0JBQXlCLENBQUMsQ0FBQyxDQUFDLG1DQUFtQztZQUN0RSxJQUFJLENBQUMsV0FBVyxDQUFDLEtBQUssRUFBRSxDQUFDO1lBRXpCLGlCQUFpQjtZQUNqQixnQkFBZ0I7WUFDaEIsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLHNCQUFPLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxFQUFFO2dCQUNyRCxNQUFNLFdBQVcsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO2dCQUNqQyxJQUFJLENBQUMsYUFBYSxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsT0FBTyxFQUFFLFdBQVcsQ0FBQyxPQUFPLENBQUMsQ0FBQztnQkFDeEUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQztnQkFDekIsTUFBTSxDQUFDLElBQUksQ0FBQztZQUNkLENBQUMsQ0FBQyxDQUFDO1lBRUgsZ0JBQWdCO1lBQ2hCLE1BQU0sa0JBQWtCLEdBQUcsSUFBSSxzQkFBTyxDQUFDLEtBQUssRUFBRSxPQUFPLENBQUMsRUFBRTtnQkFDdEQsTUFBTSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztnQkFDakMsSUFBSSxDQUFDLGFBQWEsQ0FBQyx1QkFBdUIsQ0FBQyxXQUFXLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDaEUsQ0FBQyxDQUFDLENBQUM7WUFFSCxNQUFNLFlBQVksR0FBRyxJQUFJLG9CQUFLLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFLFNBQVMsQ0FBQyxDQUFDO1lBQ25FLFlBQVksQ0FBQyxVQUFVLENBQUMsaUJBQWlCLENBQUMsQ0FBQztZQUMzQyxZQUFZLENBQUMsVUFBVSxDQUFDLGtCQUFrQixDQUFDLENBQUM7WUFFNUMsTUFBTSxJQUFJLENBQUMsa0JBQWtCLENBQUMsS0FBSyxFQUFFLENBQUM7UUFDeEMsQ0FBQztLQUFBO0lBRVksVUFBVTs7WUFDckIsTUFBTSxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksRUFBRSxDQUFDO1lBQzlCLE1BQU0sSUFBSSxDQUFDLGtCQUFrQixDQUFDLElBQUksRUFBRSxDQUFDO1FBQ3ZDLENBQUM7S0FBQTtDQUNGO0FBM0VELDRCQTJFQyJ9

View File

@ -1,14 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
export interface IClientOptions {
serverAddress: string;
}
export declare class UniverseClient {
options: any;
private socketClient;
private observableIntake;
constructor(optionsArg: IClientOptions);
sendMessage(messageArg: any, payloadArg: any): Promise<void>;
getMessageObservable(): plugins.smartrx.rxjs.Observable<UniverseMessage>;
close(): void;
}

View File

@ -1,49 +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 smartsocket_1 = require("smartsocket");
const url = require("url");
class UniverseClient {
constructor(optionsArg) {
this.options = optionsArg;
}
sendMessage(messageArg, payloadArg) {
return __awaiter(this, void 0, void 0, function* () {
const requestBody = {
message: messageArg,
payload: payloadArg
};
yield plugins.smartrequest.post(this.options.serverAddress, {
requestBody
});
});
}
getMessageObservable() {
if (!this.socketClient && !this.observableIntake) {
const parsedURL = url.parse(this.options.serverAddress);
this.socketClient = new smartsocket_1.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;
}
close() {
this.socketClient.disconnect();
}
}
exports.UniverseClient = UniverseClient;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlY2xpZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxtREFBbUQ7QUFJbkQsNkNBQTZEO0FBQzdELDJCQUEyQjtBQVkzQjtJQUtFLFlBQVksVUFBMEI7UUFDcEMsSUFBSSxDQUFDLE9BQU8sR0FBRyxVQUFVLENBQUM7SUFDNUIsQ0FBQztJQUVZLFdBQVcsQ0FBQyxVQUFVLEVBQUUsVUFBVTs7WUFDN0MsTUFBTSxXQUFXLEdBQUc7Z0JBQ2xCLE9BQU8sRUFBRSxVQUFVO2dCQUNuQixPQUFPLEVBQUUsVUFBVTthQUNwQixDQUFDO1lBQ0YsTUFBTSxPQUFPLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGFBQWEsRUFBRTtnQkFDMUQsV0FBVzthQUNaLENBQUMsQ0FBQztRQUNMLENBQUM7S0FBQTtJQUVNLG9CQUFvQjtRQUN6QixFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxZQUFZLElBQUksQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO1lBQ2pELE1BQU0sU0FBUyxHQUFHLEdBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQztZQUN4RCxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksK0JBQWlCLENBQUM7Z0JBQ3hDLEtBQUssRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLFlBQVksSUFBSSxZQUFZO2dCQUMvQyxRQUFRLEVBQUUsZ0JBQWdCO2dCQUMxQixJQUFJLEVBQUUsUUFBUSxDQUFDLFNBQVMsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDO2dCQUNsQyxJQUFJLEVBQUUsZ0JBQWdCO2dCQUN0QixHQUFHLEVBQUUsU0FBUyxDQUFDLFFBQVE7YUFDeEIsQ0FBQyxDQUFDO1lBQ0gsSUFBSSxDQUFDLGdCQUFnQixHQUFHLElBQUksT0FBTyxDQUFDLE9BQU8sQ0FBQyxnQkFBZ0IsRUFBRSxDQUFDO1lBQy9ELElBQUksQ0FBQyxZQUFZLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDOUIsQ0FBQztRQUNELE1BQU0sQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxDQUFDO0lBQzFDLENBQUM7SUFFTSxLQUFLO1FBQ1YsSUFBSSxDQUFDLFlBQVksQ0FBQyxVQUFVLEVBQUUsQ0FBQztJQUNqQyxDQUFDO0NBQ0Y7QUF0Q0Qsd0NBc0NDIn0=

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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlbWVzc2FnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0dW5pdmVyc2UuY2xhc3Nlcy51bml2ZXJzZW1lc3NhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUVBLHlDQUE2QztBQUc3QztJQWNFLFlBQ0UsbUJBQWtDLEVBQ2xDLFVBQWtCLEVBQ2xCLGtCQUF1QixFQUN2QixvQkFBNEI7UUFFNUIsSUFBSSxDQUFDLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQztRQUN6QyxJQUFJLENBQUMsU0FBUyxHQUFHLElBQUkscUJBQVMsRUFBRSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDO1FBQzFCLElBQUksQ0FBQyxlQUFlLEdBQUcsa0JBQWtCLENBQUM7UUFDMUMsSUFBSSxDQUFDLGdCQUFnQixHQUFHLElBQUksaUJBQUssQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO1FBQ3hELElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUU5Qix3RUFBd0U7UUFDeEUsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsR0FBUyxFQUFFO1lBQzlDLElBQUksQ0FBQyxhQUFhLENBQUMsWUFBWSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUMvQyxDQUFDLENBQUEsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztDQUNGO0FBaENELDBDQWdDQyJ9

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,32 +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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGFzc2VzLnVuaXZlcnNlc3RvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsYXNzZXMudW5pdmVyc2VzdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLG1HQUEwRTtBQUUxRSw2QkFBZ0M7QUFHaEMscUNBQStCO0FBRS9CO0lBTUUsWUFBWSx3QkFBZ0M7UUFKckMsb0JBQWUsR0FBVyxLQUFLLENBQUM7UUFDaEMsaUJBQVksR0FBRyxJQUFJLGVBQVMsRUFBbUIsQ0FBQztRQUMvQyxXQUFNLEdBQVcsQ0FBQyxDQUFDLENBQUMscUJBQXFCO1FBRy9DLElBQUksQ0FBQyxxQkFBcUIsR0FBRyx3QkFBd0IsQ0FBQztJQUN4RCxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNJLFVBQVUsQ0FBQyxVQUFVLEVBQUUsa0JBQWtCO1FBQzlDLElBQUksQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUNuQixJQUFJLHVEQUFlLENBQUMsSUFBSSxFQUFFLFVBQVUsRUFBRSxrQkFBa0IsRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDLENBQ2hGLENBQUM7SUFDSixDQUFDO0lBRUQ7O09BRUc7SUFDSSx1QkFBdUIsQ0FBQyxXQUFvQjtRQUNqRCxNQUFNLGlCQUFpQixHQUFHLGNBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQ2pGLFVBQVUsQ0FBQyxFQUFFO1lBQ1gsTUFBTSxDQUFDLFVBQVUsQ0FBQyxTQUFTLENBQUMseUJBQXlCLENBQUMsSUFBSSxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQzlFLENBQUMsQ0FDRixDQUFDO1FBQ0YsTUFBTSxDQUFDLGlCQUFpQixDQUFDO0lBQzNCLENBQUM7Q0FDRjtBQWhDRCxzQ0FnQ0MifQ==

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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHVuaXZlcnNlLmNsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsbURBQW1EO0FBRW5ELG1DQUFtQztBQUVuQyxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUM7QUFFekIsTUFBTSxXQUFXLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBRXBELFdBQVcsQ0FBQyxZQUFZLEVBQUUsQ0FBQyxJQUFJLENBQUMsQ0FBTSxPQUFPLEVBQUMsRUFBRTtJQUM5QyxNQUFNLGdCQUFnQixHQUFHLElBQUksZ0JBQVEsQ0FBQztRQUNwQywyQkFBMkIsRUFBRSxLQUFLO0tBQ25DLENBQUMsQ0FBQztJQUNILE1BQU0sZ0JBQWdCLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzFDLENBQUMsQ0FBQSxDQUFDLENBQUMifQ==

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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnR1bml2ZXJzZS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnR1bml2ZXJzZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMkJBQTJCO0FBV3pCLGtCQUFHO0FBVkwsNkJBQTZCO0FBVzNCLG9CQUFJO0FBVk4scUNBQXFDO0FBV25DLDRCQUFRO0FBVlYsNkNBQTZDO0FBVzNDLG9DQUFZO0FBVmQsdUNBQXVDO0FBV3JDLDhCQUFTO0FBVlgsNkNBQTZDO0FBWTNDLG9DQUFZO0FBWGQsbUNBQW1DO0FBVWpDLDBCQUFPO0FBVFQsMkNBQTJDO0FBV3pDLGtDQUFXO0FBVmIsdUNBQXVDO0FBV3JDLDhCQUFTIn0=

19
license Normal file
View File

@ -0,0 +1,19 @@
Copyright (c) 2018 Lossless GmbH (hello@lossless.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,7 +1,17 @@
{
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartuniverse",
"shortDescription": "messaging service for micro services",
"npmPackagename": "@pushrocks/smartuniverse",
"license": "MIT",
"projectDomain": "push.rocks"
}
},
"npmci": {
"npmGlobalTools": [
"npmts"
]
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}
}

3046
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,39 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.7",
"version": "1.0.40",
"private": false,
"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": "(tstest test/)",
"build": "(tsbuild)",
"format": "(gitzone format)"
},
"devDependencies": {
"@types/node": "^9.6.0",
"tapbundle": "^2.0.0"
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tstest": "^1.0.20",
"@pushrocks/tapbundle": "^3.0.9",
"@types/node": "^11.13.4",
"tslint": "^5.15.0",
"tslint-config-prettier": "^1.18.0"
},
"peerDependencies": {
"rxjs": "*"
},
"dependencies": {
"lik": "^2.0.5",
"rxjs": "^5.5.8",
"smartcli": "^2.0.12",
"smartexpress": "^1.0.21",
"smartfile": "^4.2.28",
"smartrequest": "^1.0.8",
"smartrx": "^1.0.5",
"smartsocket": "^1.1.19",
"smarttime": "^2.0.0"
"@pushrocks/lik": "^3.0.5",
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartexpress": "^3.0.18",
"@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smarthash": "^2.0.4",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrequest": "^1.1.14",
"@pushrocks/smartrx": "^2.0.3",
"@pushrocks/smartsocket": "^1.1.27",
"@pushrocks/smarttime": "^3.0.7",
"@pushrocks/smartunique": "^3.0.1"
}
}

View File

@ -1,29 +1,56 @@
# smartuniverse
messaging service for your micro services
# @pushrocks/smartuniverse
## 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/)
messaging service for micro services
## Availabililty and Links
- [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
- [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
- [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
- [docs (typedoc)](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/@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/@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/)
[![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)
[![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->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
### What is smartuniverse all about?
> licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
Think WhatsApp, but for your microservices architecture. It allows your services to securely talk to each other in **private, shielded channels** without having to expose anything to the outside world. This allows the use of **reactive programming across your entire stack**.
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
### Server side
every universe has a server that manages messages.
Think Kafka, but without Kafka.
```typescript
import * as smartuniverse from '@pushrocks/smartuniverse';
const myUniverse = new smartuniverse.Universe({
messageExpiryInMilliseconds: 60000 // the standard time in milliseconds until a message expires
});
// create as many channels as you like
myUniverse.addChannel('awesomeChannel', 'awesomeChannelPass');
myUniverse.addChannel('awesomeChannel2', 'jhkjhfsdf87eerkjslkfja9');
myUniverse.start(8765); // start the server and provide the port on which to listen on
```
### Client side
All your microservices represents clients in the universe that may talk to each other using the universe server.
For further information read the linked docs at the top of this readme.
> MIT 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://maintainedby.lossless.com)

View File

@ -1,12 +1,17 @@
// tslint:disable-next-line:no-implicit-dependencies
import { expect, tap } from 'tapbundle';
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartuniverse from '../ts/index';
import { Observable } from 'rxjs';
let testUniverse: smartuniverse.Universe;
let testUniverseClient: smartuniverse.UniverseClient;
let testMessageObservable: Observable<smartuniverse.UniverseMessage>;
let testUniverseClient: smartuniverse.ClientUniverse;
let testClientChannel: smartuniverse.ClientUniverseChannel;
const testChannelData = {
channelName: 'awesomeTestChannel',
channelPass: 'awesomeChannelPAss'
};
tap.test('first test', async () => {
testUniverse = new smartuniverse.Universe({
@ -15,35 +20,40 @@ tap.test('first test', async () => {
});
tap.test('add a message to the SmartUniverse', async () => {
await testUniverse.initServer(8765);
await testUniverse.start(8765);
});
// testing message handling
tap.test('create smartuniverse client', async () => {
testUniverseClient = new smartuniverse.UniverseClient({
testUniverseClient = new smartuniverse.ClientUniverse({
serverAddress: 'http://localhost:8765'
});
expect(testUniverseClient).to.be.instanceof(smartuniverse.UniverseClient);
expect(testUniverseClient).to.be.instanceof(smartuniverse.ClientUniverse);
});
tap.test('should send a message correctly', async () => {
await testUniverseClient.sendMessage('greeting', {
anyBool: true
});
tap.test('should add a channel to the universe', async () => {
await testUniverse.addChannel('testChannel', 'testPassword');
});
tap.test('should get a observable correctly', async () => {
testMessageObservable = testUniverseClient.getMessageObservable();
testClientChannel = await testUniverseClient.getChannel(testChannelData.channelName, testChannelData.channelPass);
expect(testClientChannel).to.be.instanceof(smartuniverse.ClientUniverseChannel);
});
tap.test('should receive a message correctly', async () => {
tap.test('should send a message correctly', async () => {
await testUniverseClient.sendMessage({
messageText: 'hello',
targetChannelName: 'channel1'
});
});
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) => {
tap.test('should end the server correctly', async tools => {
await testUniverse.stopServer();
});

View File

@ -1,3 +1,11 @@
// Client classes
export * from './smartuniverse.classes.clientuniverse';
export * from './smartuniverse.classes.clientuniversechannel';
// Server classes
export * from './smartuniverse.classes.universe';
export * from './smartuniverse.classes.universeclient';
export * from './smartuniverse.classes.universecache';
export * from './smartuniverse.classes.universechannel';
export * from './smartuniverse.classes.universemessage';
export * from './interfaces';

View File

@ -0,0 +1,15 @@
export interface IServerGetMessagesRequestBody {
channel: string;
topic?: string;
youngerThan: number;
}
/**
* the interface for a standard request
*/
export interface IServerPutMessageRequestBody {
channel: string;
passphrase: string;
message: string;
payload: any;
}

3
ts/interfaces/index.ts Normal file
View File

@ -0,0 +1,3 @@
export * from './http.interfaces';
export * from './universechannel.interfaces';
export * from './universemessage.interfaces';

View File

@ -0,0 +1 @@
export interface IUniverseChannel {}

View File

@ -0,0 +1,15 @@
export interface IMessageCreator {
messageText: string;
payload?: string | number | any;
payloadStringType?: 'Buffer' | 'string' | 'object';
targetChannelName: string;
}
export interface IUniverseMessage extends IMessageCreator {
id: string;
/**
* time of creation
*/
timestamp: number;
passphrase: string;
}

View File

@ -0,0 +1,103 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from '@pushrocks/lik';
import { Observable } from 'rxjs';
import { Smartsocket, SmartsocketClient } from '@pushrocks/smartsocket';
import * as url from 'url';
import * as interfaces from './interfaces';
import {
ClientUniverseChannel,
UniverseMessage
} from './';
export interface IClientOptions {
serverAddress: string;
}
/**
* this class is for client side only!!!
* allows connecting to a universe server
*/
export class ClientUniverse {
public options;
public socketClient: plugins.smartsocket.SmartsocketClient;
public observableIntake: plugins.smartrx.ObservableIntake<UniverseMessage>;
public channelCache = new Objectmap<ClientUniverseChannel>();
constructor(optionsArg: IClientOptions) {
this.options = optionsArg;
}
/**
* adds a channel to the channelcache
* TODO: verify channel before adding it to the channel cache
*/
public async addChannel (channelNameArg: string, passphraseArg: string) {
const existingChannel = this.getChannel(channelNameArg);
if (existingChannel) {
throw new Error('channel exists');
}
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
this,
channelNameArg,
passphraseArg
);
this.channelCache.add(clientUniverseChannel);
}
/**
* gets a channel from the channelcache
* @param channelName
* @param passphraseArg
*/
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
await this.checkConnection();
const clientUniverseChannel = this.channelCache.find(channel => {
return channel.name === channelName;
})
return clientUniverseChannel;
}
public async sendMessage(messageArg: interfaces.IMessageCreator) {
const requestBody: interfaces.IUniverseMessage = {
id: plugins.smartunique.shortId(),
timestamp: Date.now(),
passphrase: (await this.getChannel(messageArg.targetChannelName)).passphrase,
...messageArg,
};
const requestBodyString = JSON.stringify(requestBody);
// TODO: User websocket connection if available
const response = await plugins.smartrequest.postJson(`${this.options.serverAddress}/sendmessage` , {
requestBody: requestBodyString
});
}
public close() {
this.socketClient.disconnect();
}
/**
* checks the connection towards a universe server
* since password validation is done through other means, a connection should always be possible
*/
private async checkConnection(): Promise<void> {
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();
}
}
}

View File

@ -0,0 +1,44 @@
import * as plugins from './smartuniverse.plugins';
import * as interfaces from './interfaces';
import { ClientUniverse } from './';
export class ClientUniverseChannel implements interfaces.IUniverseChannel {
// ======
// STATIC
// ======
public static async createClientUniverseChannel(
clientUniverseArg: ClientUniverse,
channelName: string,
passphraseArg: string
): Promise<ClientUniverseChannel> {
const clientChannel = new ClientUniverseChannel(clientUniverseArg, passphraseArg);
await clientChannel.subscribe();
return clientChannel;
}
// ========
// INSTANCE
// ========
// properties
public name: string;
public passphrase: string;
// refs
public clientUniverse: ClientUniverse;
constructor(clientUniverseArg: ClientUniverse, nameArg: string, passphraseArg: string) {
this.clientUniverse = clientUniverseArg;
this.name = nameArg;
this.passphrase = passphraseArg;
}
/**
* subscribes to a channel
* tells the universe about this instances interest into a channel
*/
public async subscribe() {
this.clientUniverse.socketClient;
}
}

View File

@ -0,0 +1,32 @@
import * as plugins from './smartuniverse.plugins';
import * as interfaces from './interfaces';
export class ClientUniverseMessage implements interfaces.IUniverseMessage {
// ======
// STATIC
// ======
public static createMessageFromPayload(messageDescriptor: interfaces.IUniverseMessage) {
};
// ========
// INSTANCE
// ========
public id: string;
public timestamp: number;
public smartTimestamp: plugins.smarttime.TimeStamp;
public messageText: string;
public passphrase: string;
public payload: any;
public payloadStringType;
public targetChannelName: string;
constructor(messageArg, payloadArg) {}
getAsJsonForPayload () {
}
}

View File

@ -1,7 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik';
export class UniverseManager {
public async registerMember() {}
}

View File

@ -1,36 +1,38 @@
import * as plugins from './smartuniverse.plugins';
import { Handler, Route, Server } from 'smartexpress';
import { Handler, Route, Server } from '@pushrocks/smartexpress';
import { UniverseCache, UniverseChannel, UniverseMessage } from './';
import { UniverseManager } from './smartuniverse.classes.manager';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { UniverseStore } from './smartuniverse.classes.universestore';
import * as paths from './smartuniverse.paths';
import * as interfaces from './interfaces';
export interface ISmartUniverseConstructorOptions {
messageExpiryInMilliseconds: number;
}
export interface IServerGetMessagesRequestBody {
youngerThan: number;
}
export interface IServerPutMessageRequestBody {
message: string;
payload: any;
}
/**
* main class that setsup a Universe
*/
export class Universe {
// subinstances
public universeStore: UniverseStore;
public universeManager: UniverseManager;
public universeCache: UniverseCache;
// options
private options: ISmartUniverseConstructorOptions;
// Store version handling
/**
* stores the version of the universe server running
* this is done since the version is exposed through the api and multiple fs actions are avoided this way.
*/
private universeVersionStore: string;
private get universeVersion() {
/**
* get the currently running version of smartuniverse
*/
public get universeVersion() {
if (this.universeVersionStore) {
return this.universeVersionStore;
} else {
@ -40,57 +42,83 @@ export class Universe {
}
}
/**
* the smartexpress server used
*/
private smartexpressServer: plugins.smartexpress.Server;
/**
* the smartsocket used
*/
private smartsocket: plugins.smartsocket.Smartsocket;
constructor(optionsArg: ISmartUniverseConstructorOptions) {
this.options = optionsArg;
this.universeStore = new UniverseStore(this.options.messageExpiryInMilliseconds);
this.universeManager = new UniverseManager();
this.universeCache = new UniverseCache(this.options.messageExpiryInMilliseconds);
}
/**
* adds a channel to the Universe
*/
public async addChannel(nameArg: string, passphraseArg: string) {
const newChannel = UniverseChannel.createChannel(this.universeCache, nameArg, passphraseArg);
}
/**
* initiates a server
*/
public async initServer(portArg: number | string) {
public async start(portArg: number | string) {
// lets create the base smartexpress server
this.smartexpressServer = new plugins.smartexpress.Server({
cors: true,
defaultAnswer: `smartuniverse server ${this.universeVersion}`,
defaultAnswer: async () => {
return `smartuniverse server ${this.universeVersion}`;
},
forceSsl: false,
port: portArg
});
// lets create the http request route
this.smartexpressServer.addRoute('/sendmessage', new Handler('POST', async (req, res) => {
const universeMessageInstance = new UniverseMessage(req.body);
this.universeCache.addMessage(universeMessageInstance);
}));
// 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
// add a role for the clients
const ClientRole = new plugins.smartsocket.SocketRole({
name: 'clientuniverse',
passwordHash: 'clientuniverse' // authentication happens on another level
});
// add the role to smartsocket
this.smartsocket.addSocketRoles([ClientRole]);
const SubscriptionSocketFunction = new plugins.smartsocket.SocketFunction({
allowedRoles: [ClientRole],
funcName: 'channelSubscription',
funcDef: () => {
console.log('a client connected');
} // TODO: implement an action upon connection of clients
});
// add smartsocket to the running smartexpress app
this.smartsocket.setExternalServer('express', this.smartexpressServer as any);
// start the socket
this.smartsocket.start();
// route 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;
});
// gets messages
const readMessageHandler = new Handler('GET', request => {
const requestBody = request.body;
this.universeStore.readMessagesYoungerThan(requestBody.since);
});
const messageRoute = new Route(this.smartexpressServer, 'message');
messageRoute.addHandler(addMessageHandler);
messageRoute.addHandler(readMessageHandler);
// start the smartexpress instance
await this.smartexpressServer.start();
}
/**
* stop everything
*/
public async stopServer() {
await this.smartsocket.stop();
await this.smartexpressServer.stop();

View File

@ -0,0 +1,63 @@
import * as plugins from './smartuniverse.plugins';
import { UniverseChannel } from './smartuniverse.classes.universechannel';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { Objectmap } from '@pushrocks/lik';
import { Observable, from } from 'rxjs';
import { filter } from 'rxjs/operators';
import { rxjs } from '@pushrocks/smartrx';
/**
* universe store handles the creation, storage and retrieval of messages.
*/
export class UniverseCache {
// ========
// INSTANCE
// ========
public standardMessageExpiry: number;
public destructionTime: number = 60000;
/**
* stores messages for this instance
*/
public messageMap = new Objectmap<UniverseMessage>();
/**
* stores the channels that are available within the universe
*/
public channelMap = new Objectmap<UniverseChannel>();
/**
* allows messages to be processed in a blacklist mode for further analysis
*/
public blackListChannel = new UniverseChannel(this, 'blacklist', 'nada');
constructor(standardMessageExpiryArg: number) {
this.standardMessageExpiry = standardMessageExpiryArg;
}
/**
* add a message to the UniverseCache
* @param messageArg
* @param attachedPayloadArg
*/
public async addMessage(messageArg: UniverseMessage) {
messageArg.setUniverseCache(this);
UniverseChannel.authorizeAMessageForAChannel(this, messageArg);
this.messageMap.add(messageArg);
}
/**
* Read a message from the UniverseCache
*/
public readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage> {
const messageObservable = from(this.messageMap.getArray()).pipe(
filter(messageArg => {
return messageArg.smartTimestamp.isYoungerThanMilliSeconds(this.destructionTime);
})
);
return messageObservable;
}
}

View File

@ -0,0 +1,92 @@
import * as plugins from './smartuniverse.plugins';
import { Objectmap } from '@pushrocks/lik';
import { UniverseCache } from './smartuniverse.classes.universecache';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
/**
* enables messages to stay within a certain scope.
*/
export class UniverseChannel {
// ======
// STATIC
// ======
/**
* creates new channels
* @param channelArg the name of the topic
* @param passphraseArg the secret thats used for a certain topic.
*/
public static createChannel(
universeCacheArg: UniverseCache,
channelNameArg: string,
passphraseArg: string
) {
const newChannel = new UniverseChannel(universeCacheArg, channelNameArg, passphraseArg);
universeCacheArg.channelMap.add(newChannel);
return newChannel;
}
/**
* returns boolean wether certain channel exists
*/
public static async doesChannelExists(universeCacheArg: UniverseCache, channelNameArg: string) {
const channel = universeCacheArg.channelMap.find(channelArg => {
return channelArg.name === channelNameArg;
});
if (channel) {
return true;
} else {
return false;
}
}
public static authorizeAMessageForAChannel(
universeCacheArg: UniverseCache,
universeMessageArg: UniverseMessage
) {
const foundChannel = universeCacheArg.channelMap.find(universeChannel => {
const result = universeChannel.authenticate(universeMessageArg);
return result;
});
if (foundChannel) {
universeMessageArg.authenticated = true;
universeMessageArg.universeChannelList.add(foundChannel);
return foundChannel;
} else {
universeMessageArg.authenticated = false;
universeMessageArg.universeChannelList.add(universeCacheArg.blackListChannel);
}
}
// ========
// INSTANCE
// ========
/**
* the name of the channel
*/
public name: string;
public universeCacheInstance: UniverseCache;
/**
* the passphrase for the channel
*/
public passphrase: string;
constructor(universeCacheArg: UniverseCache, channelNameArg: string, passphraseArg: string) {
this.name = channelNameArg;
this.passphrase = passphraseArg;
}
/**
* authenticates a client on the server side
*/
public authenticate(universeMessageArg: UniverseMessage): boolean {
return (
this.name === universeMessageArg.requestedChannelName &&
this.passphrase === universeMessageArg.requestedChannelPassphrase
);
}
public pushToClients(messageArg: UniverseMessage) {}
}

View File

@ -1,56 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { Observable } from 'rxjs';
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;
}
export class UniverseClient {
public options;
private socketClient: plugins.smartsocket.SmartsocketClient;
private observableIntake: plugins.smartrx.ObservableIntake<UniverseMessage>;
constructor(optionsArg: IClientOptions) {
this.options = optionsArg;
}
public async sendMessage(messageArg, payloadArg) {
const requestBody = {
message: messageArg,
payload: payloadArg
};
await plugins.smartrequest.post(this.options.serverAddress, {
requestBody
});
}
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

@ -1,38 +1,99 @@
import * as plugins from './smartuniverse.plugins';
import * as interfaces from './interfaces';
import { Timer, TimeStamp } from 'smarttime';
import { UniverseStore } from './smartuniverse.classes.universestore';
import { Objectmap } from '@pushrocks/lik';
import { Timer, TimeStamp } from '@pushrocks/smarttime';
import { Universe } from './smartuniverse.classes.universe';
import { UniverseChannel } from './smartuniverse.classes.universechannel';
import { UniverseCache } from './smartuniverse.classes.universecache';
import { IUniverseMessage } from './interfaces';
/**
* represents a message within a universe
* acts as a container to save message states like authentication status
*/
export class UniverseMessage implements interfaces.IUniverseMessage {
public id: string;
public timestamp: number;
public smartTimestamp: TimeStamp;
public messageText: string;
public passphrase: string;
public payload: any;
public payloadStringType;
public targetChannelName: string;
export class UniverseMessage {
/**
* public and unique id
* numeric ascending
* adheres to time in milliseconds
* avoids duplications though
* the UniverseCache the message is attached to
*/
public id: number;
public universeStore: UniverseStore;
public timestamp: TimeStamp;
public message: string;
public attachedPayload: any;
public destructionTimer: Timer;
public universeCache: UniverseCache;
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();
/**
* enables unprotected grouping of messages for efficiency purposes.
*/
public universeChannelList = new Objectmap<UniverseChannel>();
// set up self destruction by removing this from the parent messageStore
this.destructionTimer.completed.then(async () => {
this.universeStore.messageStore.remove(this);
/**
* wether the message is authenticated
*/
public authenticated: boolean = null;
/**
* a destruction timer for this message
*/
public destructionTimer: Timer; // a timer to take care of message destruction
/**
* the constructor to create a universe message
* @param messageArg
* @param attachedPayloadArg
*/
constructor(messageDescriptor: IUniverseMessage) {
this.smartTimestamp = new TimeStamp(this.timestamp);
this.messageText = messageDescriptor.messageText;
this.targetChannelName = messageDescriptor.targetChannelName;
this.passphrase = messageDescriptor.passphrase;
this.payload = messageDescriptor.payload;
// prevent memory issues
this.fallBackDestruction();
}
public setUniverseCache(universeCacheArg: UniverseCache) {
this.universeCache = universeCacheArg;
}
public setDestructionTimer(selfdestructAfterArg: number) {
if (selfdestructAfterArg) {
this.destructionTimer = new Timer(selfdestructAfterArg);
this.destructionTimer.start();
// set up self destruction by removing this from the parent messageCache
this.destructionTimer.completed.then(async () => {
this.universeCache.messageMap.remove(this);
});
} else {
this.fallBackDestruction();
}
}
/**
* handles bad messages for further analysis
*/
public handleAsBadMessage() {
console.log('received a bad message');
}
/**
* prevents memory leaks if channels have no default
*/
private fallBackDestruction() {
plugins.smartdelay.delayFor(1000).then(() => {
if (!this.destructionTimer) {
this.setDestructionTimer(6000);
}
});
}
}

View File

@ -1,42 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { Objectmap } from 'lik';
import { Observable } from 'rxjs';
import { rxjs } from 'smartrx';
export class UniverseStore {
public standardMessageExpiry: number;
public destructionTime: number = 60000;
public messageStore = new Objectmap<UniverseMessage>();
private lastId: number = 0; // stores the last id
constructor(standardMessageExpiryArg: number) {
this.standardMessageExpiry = standardMessageExpiryArg;
}
/**
* add a message to the UniverseStore
* @param messageArg
* @param attachedPayloadArg
*/
public addMessage(messageArg, attachedPayloadArg) {
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 => {
return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime);
}
);
return messageObservable;
}
}

View File

@ -1,14 +0,0 @@
import * as plugins from './smartuniverse.plugins';
import { Universe } from './index';
process.env.CLI = 'true';
const universeCli = new plugins.smartcli.Smartcli();
universeCli.standardTask().then(async argvArg => {
const standardUniverse = new Universe({
messageExpiryInMilliseconds: 60000
});
await standardUniverse.initServer(8765);
});

View File

@ -1,21 +1,31 @@
import * as lik from 'lik';
// node native
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 { path };
// pushrocks scope
import * as lik from '@pushrocks/lik';
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 smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest';
import * as smartrx from '@pushrocks/smartrx';
import * as smartsocket from '@pushrocks/smartsocket';
import * as smarttime from '@pushrocks/smarttime';
import * as smartunique from '@pushrocks/smartunique';
export {
lik,
path,
smartcli,
smarthash,
smartdelay,
smartexpress,
smartfile,
smartpromise,
smartrx,
smartrequest,
smartsocket,
smarttime
smarttime,
smartunique
};

View File

@ -1,12 +1,17 @@
{
"extends": [
"tslint:latest",
"tslint-config-prettier"
],
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [
true,
"always"
]
}
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}

1761
yarn.lock

File diff suppressed because it is too large Load Diff