Compare commits

..

10 Commits

Author SHA1 Message Date
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
7 changed files with 73 additions and 21 deletions

View File

@ -10,15 +10,18 @@ stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
@ -28,7 +31,11 @@ snyk:
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
@ -38,6 +45,7 @@ testLEGACY:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS:
@ -49,6 +57,7 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
@ -59,34 +68,60 @@ testSTABLE:
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
tags:
- docker
- notpriv
only:
- tags
artifacts:

View File

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

View File

@ -1,13 +1,13 @@
{
"name": "@pushrocks/smartuniverse",
"version": "1.0.10",
"version": "1.0.15",
"description": "messaging service for your micro services",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "ts-node test/test.ts",
"test": "(ts-node -O '{\"lib\": [ \"es2015\" ]}' test/test.ts)",
"build": "(npmts)",
"format": "(gitzone format)"
},

View File

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

View File

@ -10,6 +10,14 @@ export class UniverseChannel {
* stores the channels that are available within the universe
*/
public static channelStore = new Objectmap();
/**
* the credentials for the channel
*/
private credentials: {
user: string;
password: string;
};
/**
* creates new channels
@ -18,11 +26,6 @@ export class UniverseChannel {
*/
public static createChannel = (channelArg: string, secretArg: string) => {
}
credentials: {
user: string;
password: string;
};
/**

View File

@ -14,9 +14,21 @@ export class UniverseMessage {
* avoids duplications though
*/
public id: number;
/**
* the universe store the message is attached to
*/
public universeStore: UniverseStore;
public timestamp: TimeStamp; // when has this message been created
public topic: string; // enables unprotected grouping of messages for efficiency purposes.
/**
* time of creation
*/
public timestamp: TimeStamp;
/**
* enables unprotected grouping of messages for efficiency purposes.
*/
public universeChannel: string;
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
@ -24,9 +36,9 @@ export class UniverseMessage {
/**
* the constructor to create a universe message
* @param parentUniverseStore
* @param messageArg
* @param attachedPayloadArg
* @param selfdestructAfterArg
* @param messageArg
* @param attachedPayloadArg
* @param selfdestructAfterArg
*/
constructor(
parentUniverseStore: UniverseStore,

View File

@ -7,6 +7,9 @@ import { Objectmap } from 'lik';
import { Observable } from 'rxjs';
import { rxjs } from 'smartrx';
/**
* universe store handles the creation, storage and retrieval of messages.
*/
export class UniverseStore {
public standardMessageExpiry: number;
public destructionTime: number = 60000;