fix(core): update
This commit is contained in:
parent
57b37cb327
commit
ac2a1559b0
@ -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
|
||||||
@ -33,24 +34,39 @@ snyk:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
|
sast:
|
||||||
|
stage: security
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
||||||
|
variables:
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
allow_failure: true
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||||
|
- docker run
|
||||||
|
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
||||||
|
--volume "$PWD:/code"
|
||||||
|
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
sast: gl-sast-report.json
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# 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 +78,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 +134,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 +147,4 @@ pages:
|
|||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
@ -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",
|
||||||
|
1279
package-lock.json
generated
1279
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.24",
|
"version": "1.0.24",
|
||||||
"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",
|
||||||
@ -13,8 +13,12 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@gitzone/tsbuild": "^2.1.8",
|
||||||
|
"@gitzone/tstest": "^1.0.18",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.7",
|
||||||
"@types/node": "^10.12.19"
|
"@types/node": "^10.12.20",
|
||||||
|
"tslint": "^5.12.1",
|
||||||
|
"tslint-config-prettier": "^1.17.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"rxjs": "*"
|
"rxjs": "*"
|
||||||
@ -26,9 +30,9 @@
|
|||||||
"@pushrocks/smartfile": "^6.0.12",
|
"@pushrocks/smartfile": "^6.0.12",
|
||||||
"@pushrocks/smarthash": "^2.0.4",
|
"@pushrocks/smarthash": "^2.0.4",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
"@pushrocks/smartrequest": "^1.0.8",
|
"@pushrocks/smartrequest": "^1.1.14",
|
||||||
"@pushrocks/smartrx": "^2.0.3",
|
"@pushrocks/smartrx": "^2.0.3",
|
||||||
"@pushrocks/smartsocket": "^1.1.24",
|
"@pushrocks/smartsocket": "^1.1.27",
|
||||||
"@pushrocks/smarttime": "^3.0.5"
|
"@pushrocks/smarttime": "^3.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
35
readme.md
35
readme.md
@ -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-standard-brightgreen.svg)](http://standardjs.com/)
|
||||||
|
|
||||||
## 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)
|
||||||
|
@ -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';
|
||||||
|
@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
});
|
});
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -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';
|
||||||
|
@ -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,
|
||||||
|
13
tslint.json
13
tslint.json
@ -1,6 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
"rules": {
|
"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"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user