Compare commits

..

7 Commits

Author SHA1 Message Date
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
13 changed files with 1988 additions and 1011 deletions

View File

@ -26,6 +26,7 @@ mirror:
snyk: snyk:
stage: security stage: security
script: script:
- npmci npm prepare
- npmci command npm install -g snyk - npmci command npm install -g snyk
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command snyk test - npmci command snyk test
@ -36,21 +37,11 @@ snyk:
# ==================== # ====================
# test stage # test stage
# ==================== # ====================
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS: testLTS:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install lts - npmci node install lts
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -62,6 +53,7 @@ testLTS:
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -117,8 +109,10 @@ pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: metadata stage: metadata
script: script:
- npmci command npm install -g npmpage - npmci command npm install -g typedoc typescript
- npmci command npmpage - npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags: tags:
- docker - docker
- notpriv - notpriv
@ -128,3 +122,4 @@ pages:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
allow_failure: true

View File

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

2806
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,38 @@
{ {
"name": "@pushrocks/smartuniverse", "name": "@pushrocks/smartuniverse",
"version": "1.0.23", "version": "1.0.26",
"private": true, "private": false,
"description": "messaging service for your micro services", "description": "messaging service for your micro services",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(ts-node -O '{\"lib\": [ \"es2015\" ]}' test/test.ts)", "test": "(tstest test/)",
"build": "(npmts)", "build": "(npmts)",
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^9.6.18", "@gitzone/tsbuild": "^2.1.8",
"tapbundle": "^2.0.0", "@gitzone/tstest": "^1.0.20",
"ts-node": "^6.0.5", "@pushrocks/tapbundle": "^3.0.9",
"typescript": "^2.8.3" "@types/node": "^11.13.4",
"tslint": "^5.15.0",
"tslint-config-prettier": "^1.18.0"
}, },
"peerDependencies": { "peerDependencies": {
"rxjs": "*" "rxjs": "*"
}, },
"dependencies": { "dependencies": {
"lik": "^2.0.5", "@pushrocks/lik": "^3.0.5",
"nodehash": "^1.0.4", "@pushrocks/smartdelay": "^2.0.3",
"smartdelay": "^1.0.4", "@pushrocks/smartexpress": "^3.0.18",
"smartexpress": "^1.0.21", "@pushrocks/smartfile": "^7.0.2",
"smartfile": "^4.2.28", "@pushrocks/smarthash": "^2.0.4",
"smartq": "^1.1.8", "@pushrocks/smartpromise": "^3.0.2",
"smartrequest": "^1.0.8", "@pushrocks/smartrequest": "^1.1.14",
"smartrx": "^1.0.5", "@pushrocks/smartrx": "^2.0.3",
"smartsocket": "^1.1.19", "@pushrocks/smartsocket": "^1.1.27",
"smarttime": "^2.0.0" "@pushrocks/smarttime": "^3.0.7"
} }
} }

View File

@ -1,33 +1,28 @@
# smartuniverse # @pushrocks/smartuniverse
messaging service for micro services
messaging service for your micro services ## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
## Availabililty * [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse) * [docs (typedoc)](https://pushrocks.gitlab.io/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 ## Status for master
[![build status](https://gitlab.com/pushrocks/smartuniverse/badges/master/build.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/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)
[![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) [![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) [![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/) [![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->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.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-standard-brightgreen.svg)](http://standardjs.com/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage ## Usage
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this readme.
> licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) | 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) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

View File

@ -1,5 +1,5 @@
// tslint:disable-next-line:no-implicit-dependencies // 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 * as smartuniverse from '../ts/index';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';

View File

@ -1,8 +1,8 @@
import * as plugins from './smartuniverse.plugins'; import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik'; import { Objectmap } from '@pushrocks/lik';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Smartsocket, SmartsocketClient } from 'smartsocket'; import { Smartsocket, SmartsocketClient } from '@pushrocks/smartsocket';
import * as url from 'url'; import * as url from 'url';
import { import {
@ -37,7 +37,7 @@ export class ClientUniverse {
payload: payloadArg payload: payloadArg
}; };
// TODO: User websocket connection if available // TODO: User websocket connection if available
await plugins.smartrequest.post(this.options.serverAddress, { await plugins.smartrequest.postJson(this.options.serverAddress, {
requestBody requestBody
}); });
} }

View File

@ -1,6 +1,6 @@
import * as plugins from './smartuniverse.plugins'; 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 { UniverseCache, UniverseChannel, UniverseMessage } from './';
import * as paths from './smartuniverse.paths'; import * as paths from './smartuniverse.paths';
@ -69,7 +69,9 @@ export class Universe {
public async initServer(portArg: number | string) { public async initServer(portArg: number | string) {
this.smartexpressServer = new plugins.smartexpress.Server({ this.smartexpressServer = new plugins.smartexpress.Server({
cors: true, cors: true,
defaultAnswer: `smartuniverse server ${this.universeVersion}`, defaultAnswer: async () => {
return `smartuniverse server ${this.universeVersion}`;
},
forceSsl: false, forceSsl: false,
port: portArg port: portArg
}); });

View File

@ -3,10 +3,11 @@ import * as plugins from './smartuniverse.plugins';
import { UniverseChannel } from './smartuniverse.classes.universechannel'; import { UniverseChannel } from './smartuniverse.classes.universechannel';
import { UniverseMessage } from './smartuniverse.classes.universemessage'; import { UniverseMessage } from './smartuniverse.classes.universemessage';
import { Objectmap } from 'lik'; import { Objectmap } from '@pushrocks/lik';
import { Observable } from 'rxjs'; import { Observable, from } from 'rxjs';
import { rxjs } from 'smartrx'; import { filter } from 'rxjs/operators';
import { rxjs } from '@pushrocks/smartrx';
/** /**
* universe store handles the creation, storage and retrieval of messages. * universe store handles the creation, storage and retrieval of messages.
@ -52,10 +53,10 @@ export class UniverseCache {
* Read a message from the UniverseStore * Read a message from the UniverseStore
*/ */
public readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage> { public readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage> {
const messageObservable = rxjs.Observable.from(this.messageMap.getArray()).filter( const messageObservable = from(this.messageMap.getArray()).pipe(
messageArg => { filter(messageArg => {
return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime); return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime);
} })
); );
return messageObservable; return messageObservable;
} }

View File

@ -1,6 +1,6 @@
import * as plugins from './smartuniverse.plugins'; import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik'; import { Objectmap } from '@pushrocks/lik';
import { UniverseCache } from './smartuniverse.classes.universecache'; import { UniverseCache } from './smartuniverse.classes.universecache';
import { UniverseMessage } from './smartuniverse.classes.universemessage'; import { UniverseMessage } from './smartuniverse.classes.universemessage';

View File

@ -1,8 +1,8 @@
import * as plugins from './smartuniverse.plugins'; import * as plugins from './smartuniverse.plugins';
import { Objectmap } from 'lik'; import { Objectmap } from '@pushrocks/lik';
import { Timer, TimeStamp } from 'smarttime'; import { Timer, TimeStamp } from '@pushrocks/smarttime';
import { Universe } from './smartuniverse.classes.universe'; import { Universe } from './smartuniverse.classes.universe';
import { UniverseChannel } from './smartuniverse.classes.universechannel'; import { UniverseChannel } from './smartuniverse.classes.universechannel';
import { UniverseCache } from './smartuniverse.classes.universecache'; import { UniverseCache } from './smartuniverse.classes.universecache';

View File

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

View File

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