Compare commits

..

4 Commits

Author SHA1 Message Date
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
5 changed files with 60 additions and 24 deletions

52
package-lock.json generated
View File

@ -1,9 +1,33 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.18",
"version": "1.0.20",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@pushrocks/smartcli": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@pushrocks/smartcli/-/smartcli-3.0.1.tgz",
"integrity": "sha512-NeLzHOAf2nCdgZq5QUNmiDE4xVo/HQktqxXmNGAf4kt6FnXlHe3pHVMjAB6mU7DmuoN0uY4qnkQAQYgFJ0MZ4A==",
"requires": {
"@types/yargs": "^11.0.0",
"beautylog": "^6.1.10",
"lik": "^2.0.5",
"rxjs": "^6.0.0",
"smartparam": "1.0.2",
"smartq": "^1.1.8",
"yargs": "^11.0.0"
},
"dependencies": {
"rxjs": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.0.tgz",
"integrity": "sha512-qBzf5uu6eOKiCZuAE0SgZ0/Qp+l54oeVxFfC2t+mJ2SFI6IB8gmMdJHs5DUMu5kqifqcCtsKS2XHjhZu6RKvAw==",
"requires": {
"tslib": "^1.9.0"
}
}
}
},
"@types/body-parser": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz",
@ -204,9 +228,9 @@
}
},
"@types/yargs": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-10.0.2.tgz",
"integrity": "sha512-VbsIazac1gy20qTjEZVgDUhs8uuVmGbFkSGcdHpcMoXSC4+0vn/PRHz9YBqpgxKwUi8qoxf3eHff07w7aKNBOg=="
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-11.0.0.tgz",
"integrity": "sha512-vFql3tOxs6clgh+WVoLW3nOkNGCdeKsMU6mQZkOerJpV/CR9Xc1c1lZ+kYU+hNSobrQIOcNovWfPFDJIhcG5Pw=="
},
"accepts": {
"version": "1.3.5",
@ -1885,21 +1909,6 @@
"chai-string": "^1.4.0"
}
},
"smartcli": {
"version": "2.0.12",
"resolved": "https://registry.npmjs.org/smartcli/-/smartcli-2.0.12.tgz",
"integrity": "sha512-oeHfzFJ6RRz7yNQbwNIXfnXMq71XIzuD8pc0aURxA883ocsPLtyLSfYkhZk7DjzIFb8LpZRge0cFO3Dk7frGDw==",
"requires": {
"@types/yargs": "^10.0.1",
"beautylog": "^6.1.10",
"lik": "^2.0.2",
"rxjs": "^5.4.3",
"smartparam": "1.0.2",
"smartq": "^1.1.6",
"typings-global": "^1.0.20",
"yargs": "^11.0.0"
}
},
"smartdelay": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/smartdelay/-/smartdelay-1.0.4.tgz",
@ -2264,6 +2273,11 @@
"yn": "^2.0.0"
}
},
"tslib": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.1.tgz",
"integrity": "sha512-avfPS28HmGLLc2o4elcc2EIq2FcH++Yo5YxpBZi9Yw93BCTGFthI4HPE4Rpep6vSYQaK8e69PelM44tPj+RaQg=="
},
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",

View File

@ -1,7 +1,7 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.18",
"private": true,
"version": "1.0.20",
"private": false,
"description": "messaging service for your micro services",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -19,10 +19,10 @@
"typescript": "^2.8.3"
},
"dependencies": {
"@pushrocks/smartcli": "^3.0.1",
"lik": "^2.0.5",
"nodehash": "^1.0.4",
"rxjs": "^5.5.8",
"smartcli": "^2.0.12",
"smartdelay": "^1.0.4",
"smartexpress": "^1.0.21",
"smartfile": "^4.2.28",

View File

@ -6,6 +6,11 @@ import { Objectmap } from 'lik';
* enables messages to stay within a certain scope.
*/
export class UniverseChannel {
// ======
// STATIC
// ======
/**
* stores the channels that are available within the universe
*/
@ -26,6 +31,20 @@ export class UniverseChannel {
return newChannel;
};
/**
* returns boolean wether certain channel exists
*/
public static async doesChannelExists (channelNameArg: string) {
const channel = this.channelStore.find(channelArg => {
return channelArg.name === channelNameArg;
});
if(channel) {
return true;
} else {
return false;
}
}
public static authorizeForChannel (channelNameArg: string, passphraseArg: string) {
const foundChannel = this.channelStore.find(universeChannel => {
const result = universeChannel.authenticate(channelNameArg, passphraseArg);
@ -38,6 +57,9 @@ export class UniverseChannel {
}
};
// ========
// INSTANCE
// ========
/**
* the name of the channel
*/

View File

@ -6,7 +6,7 @@ process.env.CLI = 'true';
const universeCli = new plugins.smartcli.Smartcli();
universeCli.standardTask().then(async argvArg => {
universeCli.standardTask().subscribe(async argvArg => {
const standardUniverse = new Universe({
messageExpiryInMilliseconds: 60000
});

View File

@ -1,7 +1,7 @@
import * as smartcli from '@pushrocks/smartcli';
import * as lik from 'lik';
import * as nodehash from 'nodehash';
import * as path from 'path';
import * as smartcli from 'smartcli';
import * as smartdelay from 'smartdelay';
import * as smartexpress from 'smartexpress';
import * as smartfile from 'smartfile';