Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
e43ed3951c | |||
23df304535 | |||
9a142175aa | |||
09b593e192 | |||
c27fc147b5 | |||
ddde21925a | |||
bd849d347d | |||
f2a85d4719 | |||
4e7c28ac83 | |||
243f1a70e9 | |||
b5a6517756 | |||
e12b128619 | |||
03fbab5265 | |||
1d13bf5bcc | |||
c2052f16a8 | |||
ff7cdc908c | |||
f3d41b8719 | |||
f9f0fc45e2 | |||
da6b7724b8 | |||
be7ca29e4b | |||
f401d78c4b | |||
6ceec0201f | |||
16ce4e09a9 | |||
2868ab686d | |||
5dab36382f | |||
02a32eb8c7 | |||
b258979b5a | |||
166e29bbf6 | |||
870f37d403 | |||
64c4b91678 | |||
f3e13292d8 | |||
7e1c405cb1 | |||
d1b4672eff | |||
0dd9fee52b | |||
37e1ee7970 | |||
bd0bb3acf5 | |||
f60497474e | |||
1d84cefa84 | |||
6792acd533 | |||
9397d89cf5 | |||
37cf4a91f4 | |||
52db86c929 | |||
e8f09c1b7a | |||
79edea873f | |||
97666a623d | |||
ef61ea9ad7 | |||
9c1504ef02 | |||
e8f2e04d1c | |||
e12aa7e961 | |||
857b7cd010 |
@ -38,17 +38,17 @@ snyk:
|
|||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- priv
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
@ -100,7 +100,7 @@ trigger:
|
|||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
image: hosttoday/ht-docker-dbase:npmci
|
||||||
services:
|
services:
|
||||||
- docker:18-dind
|
- docker:stable-dind
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
296
package-lock.json
generated
296
package-lock.json
generated
@ -1,18 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.62",
|
"version": "1.0.87",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@airbnb/node-memwatch": {
|
"@apiglobal/typedrequest-interfaces": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/@airbnb%2fnode-memwatch/-/node-memwatch-1.0.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.7.tgz",
|
||||||
"integrity": "sha512-2R+MEEMSTUdKwQ6NFWkyA/UNoSjL1tMldZqJbZpgXSwNMBzlNlkUWEXKu9RqTTMkDqJRfGJ2VDs8gPlPK2APDQ==",
|
"integrity": "sha512-yPl0UcLFMwSQL7bK52wVjkgvadC+x2YS3+7T15V1A1dXNxa96yd4WX1fqcKqwnBrvYexq/8FaxWGi98tZ0oNwg=="
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"bindings": "^1.3.0",
|
|
||||||
"nan": "^2.9.2"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"@babel/code-frame": {
|
"@babel/code-frame": {
|
||||||
"version": "7.5.5",
|
"version": "7.5.5",
|
||||||
@ -35,9 +30,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tsbuild": {
|
"@gitzone/tsbuild": {
|
||||||
"version": "2.1.11",
|
"version": "2.1.17",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/@gitzone/tsbuild/-/tsbuild-2.1.17.tgz",
|
||||||
"integrity": "sha512-Sa90/S7rkfFaTa2yeASHVAWIl3hNh9DBqVcQbOCaNhqKUGdD+NzPw1MESuMOXqKG7oM5i4Cu6qfcJB0fmAjS8g==",
|
"integrity": "sha512-Mg2cu7cW3cC6L2tzatB8t6OMVgTGatobb8UkN+y3n7KAWRld4gXcVWmaehch/wSFrbmk6Oe8rPjdWPjhTSIF1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartcli": "^3.0.7",
|
"@pushrocks/smartcli": "^3.0.7",
|
||||||
@ -45,7 +40,15 @@
|
|||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartpath": "^4.0.1",
|
"@pushrocks/smartpath": "^4.0.1",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"typescript": "^3.4.5"
|
"typescript": "^3.5.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"typescript": {
|
||||||
|
"version": "3.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz",
|
||||||
|
"integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tsrun": {
|
"@gitzone/tsrun": {
|
||||||
@ -104,9 +107,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/lik": {
|
"@pushrocks/lik": {
|
||||||
"version": "3.0.10",
|
"version": "3.0.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/lik/-/lik-3.0.11.tgz",
|
||||||
"integrity": "sha512-iWG06QsrL6AAnjPRWMVz4bRaRE0jJt/HgEK0YeLqaSBLY8ju4ps1j4lEN8VrUlXGZyPB6UGQfcreesO24buYhQ==",
|
"integrity": "sha512-SDKRPj9+xBTqozlDPcA7O6BcccM1Tw/sXPVP+OnhNxCubDZ/L2kGNpPpqm43NJUoNxSSo5wdBw4N7MAFYCGdVg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
@ -175,9 +178,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartexpress": {
|
"@pushrocks/smartexpress": {
|
||||||
"version": "3.0.38",
|
"version": "3.0.40",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexpress/-/smartexpress-3.0.38.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartexpress/-/smartexpress-3.0.40.tgz",
|
||||||
"integrity": "sha512-di26orVJwgBRGKVpYcPrauc14CVo0piAzXTBWFZZNUCuIsndnXepd9oDzMO+KHVZpNz3W4DxbtRkppZjrh9ejw==",
|
"integrity": "sha512-biAquO44yvrZ/elC3psUbYYoeZn647HjZXyQ14WL5IcXMgnKBo5+qvkqNgDmcHSKJ9KuVnycuRWa8vg6z77GSg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/lik": "^3.0.10",
|
"@pushrocks/lik": "^3.0.10",
|
||||||
"@pushrocks/smartfile": "^7.0.4",
|
"@pushrocks/smartfile": "^7.0.4",
|
||||||
@ -292,9 +295,9 @@
|
|||||||
"integrity": "sha512-jmrJMUEmBCWChWK8CIcx4Vw3wv/8OgVNmkaxJrbs+WMaoRUfJtpWWJfrAwwHWt9ZXJbarJ+CwfwfYiiZXymndQ=="
|
"integrity": "sha512-jmrJMUEmBCWChWK8CIcx4Vw3wv/8OgVNmkaxJrbs+WMaoRUfJtpWWJfrAwwHWt9ZXJbarJ+CwfwfYiiZXymndQ=="
|
||||||
},
|
},
|
||||||
"@pushrocks/smartrequest": {
|
"@pushrocks/smartrequest": {
|
||||||
"version": "1.1.16",
|
"version": "1.1.27",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.16.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.27.tgz",
|
||||||
"integrity": "sha512-3LbtqoqnjfzWSQ10NryhJmgwPpvMlVoYyTzE676+yC4hM2rnGSzxozLZxMr6enV4VeZcloQ0CqHBivKoT/kdvA==",
|
"integrity": "sha512-GJO6duKBro2oILtXduVQwxA50AzjHZbKP0P32OoiM+B1ftoQFf4D8zSs/SCljNKXUqS8SZ9IMQVlKLfRC4nu+A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/form-data": "^2.2.1",
|
"@types/form-data": "^2.2.1",
|
||||||
@ -302,20 +305,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartrx": {
|
"@pushrocks/smartrx": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.5.tgz",
|
||||||
"integrity": "sha512-OWxagu+CBdPaq76AIg91hJyrNhDTlEpesj01ooWCeVIaLY3G7yvFkqHsEKNOwPUG1LzCWmjq1l1dHQx9p2vJ9A==",
|
"integrity": "sha512-BOlIJmnCO8pxqu9f18D9UV5rIsyrmKeK/mWNMiAe/NH2OTeRPNLpgmhZBkXSKNVD8tSsD8aazs4BcACgYOg1FQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/lik": "^3.0.2",
|
"@pushrocks/lik": "^3.0.11",
|
||||||
"@pushrocks/smartevent": "^2.0.3",
|
"@pushrocks/smartevent": "^2.0.3",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"rxjs": "^6.3.3"
|
"rxjs": "^6.5.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartpromise": {
|
"rxjs": {
|
||||||
"version": "2.0.5",
|
"version": "6.5.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.5.3.tgz",
|
||||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -333,22 +339,38 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartsocket": {
|
"@pushrocks/smartsocket": {
|
||||||
"version": "1.1.44",
|
"version": "1.1.49",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.44.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.49.tgz",
|
||||||
"integrity": "sha512-AxDEDQw96szewxiA7Vk+ak6l7tsf2MLIThAuoV53ycDkDNXMyJizqE8fnzks9+/OEukwwas9kYNT9MyqPIS1mw==",
|
"integrity": "sha512-jDcqVU9/cXTkLBY2N3epPUBKtRRkFINzK//CRxmBcuZx/k0s5oeNM1tOI7aiP5p5arrybU/YksSQil1QKz24Gg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/lik": "^3.0.10",
|
"@apiglobal/typedrequest-interfaces": "^1.0.7",
|
||||||
|
"@pushrocks/lik": "^3.0.11",
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"@pushrocks/smartexpress": "^3.0.38",
|
"@pushrocks/smartexpress": "^3.0.40",
|
||||||
"@pushrocks/smarthash": "^2.0.6",
|
"@pushrocks/smarthash": "^2.0.6",
|
||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/shortid": "0.0.29",
|
"@types/shortid": "0.0.29",
|
||||||
"@types/socket.io": "^2.1.2",
|
"@types/socket.io": "^2.1.2",
|
||||||
"@types/socket.io-client": "^1.4.32",
|
"@types/socket.io-client": "^1.4.32",
|
||||||
"shortid": "^2.2.14",
|
"shortid": "^2.2.15",
|
||||||
"socket.io": "^2.2.0",
|
"socket.io": "^2.2.0",
|
||||||
"socket.io-client": "^2.2.0"
|
"socket.io-client": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"nanoid": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-g5WwS+p6Cm+zQhO2YOpRbQThZVnNb7DDq74h8YDCLfAGynrEOrbx2E16dc8ciENiP1va5sqaAruqn2sN+xpkWg=="
|
||||||
|
},
|
||||||
|
"shortid": {
|
||||||
|
"version": "2.2.15",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/shortid/-/shortid-2.2.15.tgz",
|
||||||
|
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
|
||||||
|
"requires": {
|
||||||
|
"nanoid": "^2.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smarttime": {
|
"@pushrocks/smarttime": {
|
||||||
@ -375,46 +397,45 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/tapbundle": {
|
"@pushrocks/tapbundle": {
|
||||||
"version": "3.0.11",
|
"version": "3.0.13",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.13.tgz",
|
||||||
"integrity": "sha512-s7epZfJZX+LsBVmIYvoaY4WtgPvRLnHZMVTpQAPJGMBqxJAQxhQ2wvGJjmqMAGhhznAHI6t4g+m0KTp3vFIRVg==",
|
"integrity": "sha512-23O4UMBafCuD+RnUlXNvtT9DGbL1HMD+xZE1Zcr7Ll7WvgxUgRQQfk9kq6qbLLbjaRe1J2Ijsgh1HuZbBaucLQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"leakage": "^0.4.0",
|
|
||||||
"smartchai": "^2.0.1"
|
"smartchai": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/body-parser": {
|
"@types/body-parser": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fbody-parser/-/body-parser-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz",
|
||||||
"integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==",
|
"integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/connect": "*",
|
"@types/connect": "*",
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/chai": {
|
"@types/chai": {
|
||||||
"version": "4.1.7",
|
"version": "4.2.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.0.tgz",
|
||||||
"integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==",
|
"integrity": "sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/chai-as-promised": {
|
"@types/chai-as-promised": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai-as-promised/-/chai-as-promised-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.2.tgz",
|
||||||
"integrity": "sha512-MFiW54UOSt+f2bRw8J7LgQeIvE/9b4oGvwU7XW30S9QGAiHGnU/fmiOprsyMkdmH2rl8xSPc0/yrQw8juXU6bQ==",
|
"integrity": "sha512-PO2gcfR3Oxa+u0QvECLe1xKXOqYTzCmWf0FhLhjREoW3fPAVamjihL7v1MOVLJLsnAMdLcjkfrs01yvDMwVK4Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/chai": "*"
|
"@types/chai": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/chai-string": {
|
"@types/chai-string": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai-string/-/chai-string-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.2.tgz",
|
||||||
"integrity": "sha512-aRNMs6TKgjgPlCHwDfq/YNy5VtRR2hJ4AUWByddrT0TRVVD8eX4MiHW6/iHvmQHRlVuuPZcwnTUE7b4yFt7bEA==",
|
"integrity": "sha512-ld/1hV5qcPRGuwlPdvRfvM3Ka/iofOk2pH4VkasK4b1JJP1LjNmWWn0LsISf6RRzyhVOvs93rb9tM09e+UuF8Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/chai": "*"
|
"@types/chai": "*"
|
||||||
@ -438,9 +459,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/express": {
|
"@types/express": {
|
||||||
"version": "4.17.0",
|
"version": "4.17.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fexpress/-/express-4.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.1.tgz",
|
||||||
"integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==",
|
"integrity": "sha512-VfH/XCP0QbQk5B5puLqTLEeFgR8lfCJHZJKkInZ9mkYd+u8byX0kztXEQxEk4wZXJs8HI+7km2ALXjn4YKcX9w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/body-parser": "*",
|
"@types/body-parser": "*",
|
||||||
"@types/express-serve-static-core": "*",
|
"@types/express-serve-static-core": "*",
|
||||||
@ -448,9 +469,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/express-serve-static-core": {
|
"@types/express-serve-static-core": {
|
||||||
"version": "4.16.7",
|
"version": "4.16.9",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fexpress-serve-static-core/-/express-serve-static-core-4.16.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.9.tgz",
|
||||||
"integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==",
|
"integrity": "sha512-GqpaVWR0DM8FnRUJYKlWgyARoBUAVfRIeVDZQKOttLFp5SmhhF9YFIYeTPwMd/AXfxlP7xVO2dj1fGu0Q+krKQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"@types/range-parser": "*"
|
"@types/range-parser": "*"
|
||||||
@ -518,9 +539,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "12.7.1",
|
"version": "12.7.4",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.4.tgz",
|
||||||
"integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw=="
|
"integrity": "sha512-W0+n1Y+gK/8G2P/piTkBBN38Qc5Q1ZSO6B5H3QmPCUewaiXOo2GCAWZ4ElZCcNhjJuBSUSLGFUJnmlCn5+nxOQ=="
|
||||||
},
|
},
|
||||||
"@types/range-parser": {
|
"@types/range-parser": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
@ -528,9 +549,9 @@
|
|||||||
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
|
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
|
||||||
},
|
},
|
||||||
"@types/serve-static": {
|
"@types/serve-static": {
|
||||||
"version": "1.13.2",
|
"version": "1.13.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fserve-static/-/serve-static-1.13.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz",
|
||||||
"integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==",
|
"integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/express-serve-static-core": "*",
|
"@types/express-serve-static-core": "*",
|
||||||
"@types/mime": "*"
|
"@types/mime": "*"
|
||||||
@ -735,15 +756,6 @@
|
|||||||
"callsite": "1.0.0"
|
"callsite": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bindings": {
|
|
||||||
"version": "1.5.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/bindings/-/bindings-1.5.0.tgz",
|
|
||||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"file-uri-to-path": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"blob": {
|
"blob": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/blob/-/blob-0.0.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/blob/-/blob-0.0.5.tgz",
|
||||||
@ -766,6 +778,11 @@
|
|||||||
"type-is": "~1.6.17"
|
"type-is": "~1.6.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bowser": {
|
||||||
|
"version": "2.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/bowser/-/bowser-2.5.3.tgz",
|
||||||
|
"integrity": "sha512-aWCA+CKfKNL/WGzNgjmK+Whp57JMzboZMwJ5gy2jDj2bEIjbMCb3ImGX+V++5wsJftyFiDIbOjRXl60ycniVqg=="
|
||||||
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
@ -1208,12 +1225,6 @@
|
|||||||
"has-binary2": "~1.0.2"
|
"has-binary2": "~1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"es6-error": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/es6-error/-/es6-error-4.1.1.tgz",
|
|
||||||
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"escape-html": {
|
"escape-html": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/escape-html/-/escape-html-1.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
@ -1231,9 +1242,9 @@
|
|||||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||||
},
|
},
|
||||||
"esutils": {
|
"esutils": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"etag": {
|
"etag": {
|
||||||
@ -1340,12 +1351,6 @@
|
|||||||
"escape-string-regexp": "^1.0.5"
|
"escape-string-regexp": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"file-uri-to-path": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"finalhandler": {
|
"finalhandler": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/finalhandler/-/finalhandler-1.1.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/finalhandler/-/finalhandler-1.1.2.tgz",
|
||||||
@ -1383,9 +1388,9 @@
|
|||||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
||||||
},
|
},
|
||||||
"form-data": {
|
"form-data": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-2.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
|
||||||
"integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==",
|
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.6",
|
"combined-stream": "^1.0.6",
|
||||||
@ -1510,9 +1515,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"helmet": {
|
"helmet": {
|
||||||
"version": "3.20.0",
|
"version": "3.20.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/helmet/-/helmet-3.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.20.1.tgz",
|
||||||
"integrity": "sha512-Ob+TqmQFZ5f7WgP8kBbAzNPsbf6p1lOj5r+327/ymw/IILWih3wcx9u/u/S8Mwv5wbBkO7Li6x5s23t3COhUKw==",
|
"integrity": "sha512-em+X5Wz/f0yqoRsBnpnVy3wJHSiIeskX3FQn30szBh1tILaOeSRRLkShuUVFlk/o4qTYjWxdHg4FrRe45iBWHg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"depd": "2.0.0",
|
"depd": "2.0.0",
|
||||||
"dns-prefetch-control": "0.2.0",
|
"dns-prefetch-control": "0.2.0",
|
||||||
@ -1521,7 +1526,7 @@
|
|||||||
"feature-policy": "0.3.0",
|
"feature-policy": "0.3.0",
|
||||||
"frameguard": "3.1.0",
|
"frameguard": "3.1.0",
|
||||||
"helmet-crossdomain": "0.4.0",
|
"helmet-crossdomain": "0.4.0",
|
||||||
"helmet-csp": "2.8.0",
|
"helmet-csp": "2.9.0",
|
||||||
"hide-powered-by": "1.1.0",
|
"hide-powered-by": "1.1.0",
|
||||||
"hpkp": "2.0.0",
|
"hpkp": "2.0.0",
|
||||||
"hsts": "2.2.0",
|
"hsts": "2.2.0",
|
||||||
@ -1544,14 +1549,14 @@
|
|||||||
"integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
|
"integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
|
||||||
},
|
},
|
||||||
"helmet-csp": {
|
"helmet-csp": {
|
||||||
"version": "2.8.0",
|
"version": "2.9.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/helmet-csp/-/helmet-csp-2.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.9.0.tgz",
|
||||||
"integrity": "sha512-MlCPeM0Sm3pS9RACRihx70VeTHmkQwa7sum9EK1tfw1VZyvFU0dBWym9nHh3CRkTRNlyNm/WFCMvuh9zXkOjNw==",
|
"integrity": "sha512-DGGOQtOLM7ZQpjbf/uvUonq1yG/rFgsBuK10ZJt2AtxUJxqfkPvfmP9aLUmgH9IactiRiYoiFY72YYSPl1TLTQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"bowser": "2.5.3",
|
||||||
"camelize": "1.0.0",
|
"camelize": "1.0.0",
|
||||||
"content-security-policy-builder": "2.1.0",
|
"content-security-policy-builder": "2.1.0",
|
||||||
"dasherize": "2.0.0",
|
"dasherize": "2.0.0"
|
||||||
"platform": "1.3.5"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hide-powered-by": {
|
"hide-powered-by": {
|
||||||
@ -1751,25 +1756,6 @@
|
|||||||
"invert-kv": "^2.0.0"
|
"invert-kv": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"leakage": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/leakage/-/leakage-0.4.0.tgz",
|
|
||||||
"integrity": "sha512-x7gYK5n5dPkHDZWJ2Kh8Ag1hZNzUh+HtXn8Bv1aDdN6o6ONPCJ8sOfFq+kxcULJFp3lXaCjXb3iXOLmQRbBLwA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@airbnb/node-memwatch": "^1.0.2",
|
|
||||||
"es6-error": "^4.0.2",
|
|
||||||
"left-pad": "^1.1.3",
|
|
||||||
"minimist": "^1.2.0",
|
|
||||||
"pretty-bytes": "^4.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"left-pad": {
|
|
||||||
"version": "1.3.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/left-pad/-/left-pad-1.3.0.tgz",
|
|
||||||
"integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"locate-path": {
|
"locate-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-3.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-3.0.0.tgz",
|
||||||
@ -1962,9 +1948,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.0",
|
"version": "0.0.8",
|
||||||
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
@ -1974,14 +1960,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": {
|
|
||||||
"version": "0.0.8",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
|
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moment": {
|
"moment": {
|
||||||
@ -2002,12 +1980,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/ms/-/ms-2.0.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/ms/-/ms-2.0.0.tgz",
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
},
|
},
|
||||||
"nan": {
|
|
||||||
"version": "2.14.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.14.0.tgz",
|
|
||||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"nanoid": {
|
"nanoid": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.0.1.tgz",
|
||||||
@ -2153,9 +2125,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"p-limit": {
|
"p-limit": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/p-limit/-/p-limit-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
|
||||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
"integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"p-try": "^2.0.0"
|
"p-try": "^2.0.0"
|
||||||
@ -2241,17 +2213,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/pify/-/pify-2.3.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/pify/-/pify-2.3.0.tgz",
|
||||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||||
},
|
},
|
||||||
"platform": {
|
|
||||||
"version": "1.3.5",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/platform/-/platform-1.3.5.tgz",
|
|
||||||
"integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q=="
|
|
||||||
},
|
|
||||||
"pretty-bytes": {
|
|
||||||
"version": "4.0.2",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
|
|
||||||
"integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
@ -2402,9 +2363,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.11.1",
|
"version": "1.12.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
|
||||||
"integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
|
"integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"path-parse": "^1.0.6"
|
"path-parse": "^1.0.6"
|
||||||
@ -2424,6 +2385,7 @@
|
|||||||
"version": "6.4.0",
|
"version": "6.4.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz",
|
||||||
"integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==",
|
"integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
@ -2439,9 +2401,9 @@
|
|||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.7.0",
|
"version": "5.7.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/semver/-/semver-5.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"send": {
|
"send": {
|
||||||
@ -2811,16 +2773,16 @@
|
|||||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.18.0",
|
"version": "5.20.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.18.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.20.0.tgz",
|
||||||
"integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==",
|
"integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.0.0",
|
"@babel/code-frame": "^7.0.0",
|
||||||
"builtin-modules": "^1.1.1",
|
"builtin-modules": "^1.1.1",
|
||||||
"chalk": "^2.3.0",
|
"chalk": "^2.3.0",
|
||||||
"commander": "^2.12.1",
|
"commander": "^2.12.1",
|
||||||
"diff": "^3.2.0",
|
"diff": "^4.0.1",
|
||||||
"glob": "^7.1.1",
|
"glob": "^7.1.1",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"minimatch": "^3.0.4",
|
"minimatch": "^3.0.4",
|
||||||
@ -2829,14 +2791,6 @@
|
|||||||
"semver": "^5.3.0",
|
"semver": "^5.3.0",
|
||||||
"tslib": "^1.8.0",
|
"tslib": "^1.8.0",
|
||||||
"tsutils": "^2.29.0"
|
"tsutils": "^2.29.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"diff": {
|
|
||||||
"version": "3.5.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/diff/-/diff-3.5.0.tgz",
|
|
||||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tslint-config-prettier": {
|
"tslint-config-prettier": {
|
||||||
|
21
package.json
21
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.62",
|
"version": "1.0.87",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "messaging service for your micro services",
|
"description": "messaging service for your micro services",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -14,27 +14,28 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.11",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tstest": "^1.0.24",
|
"@gitzone/tstest": "^1.0.24",
|
||||||
"@pushrocks/tapbundle": "^3.0.11",
|
"@pushrocks/tapbundle": "^3.0.13",
|
||||||
"@types/node": "^12.7.1",
|
"@types/node": "^12.7.4",
|
||||||
"tslint": "^5.18.0",
|
"tslint": "^5.20.0",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"rxjs": "*"
|
"rxjs": "*"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^3.0.10",
|
"@apiglobal/typedrequest-interfaces": "^1.0.7",
|
||||||
|
"@pushrocks/lik": "^3.0.11",
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
"@pushrocks/smartexpress": "^3.0.38",
|
"@pushrocks/smartexpress": "^3.0.40",
|
||||||
"@pushrocks/smartfile": "^7.0.4",
|
"@pushrocks/smartfile": "^7.0.4",
|
||||||
"@pushrocks/smarthash": "^2.0.6",
|
"@pushrocks/smarthash": "^2.0.6",
|
||||||
"@pushrocks/smartlog": "^2.0.19",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smartrequest": "^1.1.16",
|
"@pushrocks/smartrequest": "^1.1.27",
|
||||||
"@pushrocks/smartrx": "^2.0.3",
|
"@pushrocks/smartrx": "^2.0.5",
|
||||||
"@pushrocks/smartsocket": "^1.1.44",
|
"@pushrocks/smartsocket": "^1.1.49",
|
||||||
"@pushrocks/smarttime": "^3.0.12",
|
"@pushrocks/smarttime": "^3.0.12",
|
||||||
"@pushrocks/smartunique": "^3.0.1"
|
"@pushrocks/smartunique": "^3.0.1"
|
||||||
},
|
},
|
||||||
|
@ -50,6 +50,6 @@ All your microservices represents clients in the universe that may talk to each
|
|||||||
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.
|
||||||
|
|
||||||
> MIT 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)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
67
test/test.ts
67
test/test.ts
@ -37,24 +37,24 @@ tap.test('create smartuniverse client', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should add a channel to the universe', async () => {
|
tap.test('should add a channel to the universe', async () => {
|
||||||
await testUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
testUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should add the same channel to the client universe in the same way', async () => {
|
tap.test('should add the same channel to the client universe in the same way', async () => {
|
||||||
await testClientUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
testClientUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should start the ClientUniverse', async () => {
|
tap.test('should start the ClientUniverse', async () => {
|
||||||
await testClientUniverse.start();
|
await testClientUniverse.start();
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.test('should get a observable correctly', async () => {
|
tap.test('should get a observable correctly', async () => {
|
||||||
testClientChannel = await testClientUniverse.getChannel(testChannelData.channelName);
|
testClientChannel = testClientUniverse.getChannel(testChannelData.channelName);
|
||||||
expect(testClientChannel).to.be.instanceof(smartuniverse.ClientUniverseChannel);
|
expect(testClientChannel).to.be.instanceof(smartuniverse.ClientUniverseChannel);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should send a message correctly', async () => {
|
tap.test('should send a message correctly', async () => {
|
||||||
await (await testClientUniverse.getChannel(testChannelData.channelName)).sendMessage({
|
await testClientUniverse.getChannel(testChannelData.channelName).sendMessage({
|
||||||
messageText: 'hello'
|
messageText: 'hello'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -69,15 +69,62 @@ tap.test('a second client should be able to subscibe', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testClientUniverse2.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
testClientUniverse2.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||||
|
await testClientUniverse2.start();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should receive a message correctly', async () => {});
|
tap.test('should receive a message correctly', async (tools) => {
|
||||||
|
const done = tools.defer();
|
||||||
tap.test('should disconnect the client correctly', async () => {
|
const testChannel = testClientUniverse.getChannel(testChannelData.channelName);
|
||||||
testClientUniverse.stop();
|
const testChannel2 = testClientUniverse2.getChannel(testChannelData.channelName);
|
||||||
|
const subscription = testChannel2.subscribe(messageArg => {
|
||||||
|
if (messageArg.messageText === 'hellothere') {
|
||||||
|
console.log('Yay##########');
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await testChannel.sendMessage({
|
||||||
|
messageText: 'hellothere'
|
||||||
|
});
|
||||||
|
await done.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should end the server correctly', async tools => {
|
interface IDemoReqRes {
|
||||||
|
method: 'demo',
|
||||||
|
request: {
|
||||||
|
wowso: string;
|
||||||
|
};
|
||||||
|
response: {
|
||||||
|
hereso: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
tap.test('ReactionRequest and ReactionResponse should work', async () => {
|
||||||
|
const reactionResponse = new smartuniverse.ReactionResponse<IDemoReqRes>({
|
||||||
|
channels: [testUniverse.getChannel(testChannelData.channelName)],
|
||||||
|
funcDef: async reqData => {
|
||||||
|
console.log(reqData);
|
||||||
|
return {
|
||||||
|
hereso: 'Hello there'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
method: 'demo'
|
||||||
|
});
|
||||||
|
const reactionRequest = new smartuniverse.ReactionRequest<IDemoReqRes>({
|
||||||
|
method: 'demo'
|
||||||
|
});
|
||||||
|
const reactionResult = await reactionRequest.fire([testClientUniverse2.getChannel(testChannelData.channelName)], {
|
||||||
|
wowso: 'wowza'
|
||||||
|
});
|
||||||
|
const result = await reactionResult.getFirstResult();
|
||||||
|
console.log(result);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should disconnect the client correctly', async (tools) => {
|
||||||
|
await testClientUniverse.stop();
|
||||||
|
await testClientUniverse2.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should end the server correctly', async (tools) => {
|
||||||
await testUniverse.stopServer();
|
await testUniverse.stopServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -9,4 +9,8 @@ export * from './smartuniverse.classes.universecache';
|
|||||||
export * from './smartuniverse.classes.universechannel';
|
export * from './smartuniverse.classes.universechannel';
|
||||||
export * from './smartuniverse.classes.universemessage';
|
export * from './smartuniverse.classes.universemessage';
|
||||||
|
|
||||||
|
// Reaction Response
|
||||||
|
export * from './smartuniverse.classes.reactionrequest';
|
||||||
|
export * from './smartuniverse.classes.reactionresponse';
|
||||||
|
|
||||||
export * from './interfaces';
|
export * from './interfaces';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export * from './http.interfaces';
|
export * from './http.interfaces';
|
||||||
|
export * from './socketfunctionrequests';
|
||||||
export * from './universechannel.interfaces';
|
export * from './universechannel.interfaces';
|
||||||
export * from './universemessage.interfaces';
|
export * from './universemessage.interfaces';
|
||||||
export * from './universeactions.interfaces';
|
export * from './universeactions.interfaces';
|
||||||
|
20
ts/interfaces/socketfunctionrequests.ts
Normal file
20
ts/interfaces/socketfunctionrequests.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import * as interfaces from './index';
|
||||||
|
|
||||||
|
export interface ISocketRequest_SubscribeChannel {
|
||||||
|
method: 'subscribeChannel';
|
||||||
|
request: {
|
||||||
|
name: string;
|
||||||
|
passphrase: string;
|
||||||
|
};
|
||||||
|
response: {
|
||||||
|
subscriptionStatus: 'subscribed' | 'unsubscribed';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISocketRequest_ProcessMessage {
|
||||||
|
method: 'processMessage';
|
||||||
|
request: interfaces.IUniverseMessage;
|
||||||
|
response: {
|
||||||
|
messageStatus: 'ok' | 'channel not found';
|
||||||
|
};
|
||||||
|
}
|
@ -1,17 +1,3 @@
|
|||||||
export type IServerCallActions =
|
|
||||||
| 'channelSubscription'
|
|
||||||
| 'processMessage'
|
|
||||||
| 'channelUnsubscribe'
|
|
||||||
| 'terminateConnection';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* the interface for a subscription
|
|
||||||
*/
|
|
||||||
export interface IServerCallSubscribeActionPayload {
|
|
||||||
name: string;
|
|
||||||
passphrase: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IServerUnsubscribeActionPayload {
|
export interface IServerUnsubscribeActionPayload {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
export interface IMessageCreator {
|
export interface IMessageCreator {
|
||||||
messageText: string;
|
messageText: string;
|
||||||
payload?: string | number | any;
|
payload?: string | number | any;
|
||||||
payloadStringType?: 'Buffer' | 'string' | 'object';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* A universe
|
||||||
*/
|
*/
|
||||||
export interface IUniverseMessage extends IMessageCreator {
|
export interface IUniverseMessage extends IMessageCreator {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -21,7 +21,7 @@ export interface IClientOptions {
|
|||||||
export class ClientUniverse {
|
export class ClientUniverse {
|
||||||
public options;
|
public options;
|
||||||
public smartsocketClient: plugins.smartsocket.SmartsocketClient;
|
public smartsocketClient: plugins.smartsocket.SmartsocketClient;
|
||||||
public observableIntake: plugins.smartrx.ObservableIntake<ClientUniverseMessage>;
|
public observableIntake: plugins.smartrx.ObservableIntake<ClientUniverseMessage<any>>;
|
||||||
public clientUniverseCache = new ClientUniverseCache();
|
public clientUniverseCache = new ClientUniverseCache();
|
||||||
|
|
||||||
constructor(optionsArg: IClientOptions) {
|
constructor(optionsArg: IClientOptions) {
|
||||||
@ -32,15 +32,20 @@ export class ClientUniverse {
|
|||||||
* adds a channel to the channelcache
|
* adds a channel to the channelcache
|
||||||
* TODO: verify channel before adding it to the channel cache
|
* TODO: verify channel before adding it to the channel cache
|
||||||
*/
|
*/
|
||||||
public async addChannel(channelNameArg: string, passphraseArg: string) {
|
public addChannel(channelNameArg: string, passphraseArg: string) {
|
||||||
const existingChannel = await this.getChannel(channelNameArg);
|
const existingChannel = this.getChannel(channelNameArg);
|
||||||
|
|
||||||
if (existingChannel) {
|
if (existingChannel) {
|
||||||
throw new Error('channel exists');
|
throw new Error('channel exists');
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets create the channel
|
// lets create the channel
|
||||||
await ClientUniverseChannel.createClientUniverseChannel(this, channelNameArg, passphraseArg);
|
const clientUniverseChannel = ClientUniverseChannel.createClientUniverseChannel(
|
||||||
|
this,
|
||||||
|
channelNameArg,
|
||||||
|
passphraseArg
|
||||||
|
);
|
||||||
|
return clientUniverseChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,7 +53,7 @@ export class ClientUniverse {
|
|||||||
* @param channelName
|
* @param channelName
|
||||||
* @param passphraseArg
|
* @param passphraseArg
|
||||||
*/
|
*/
|
||||||
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
|
public getChannel(channelName: string): ClientUniverseChannel {
|
||||||
const clientUniverseChannel = this.clientUniverseCache.channelMap.find(channel => {
|
const clientUniverseChannel = this.clientUniverseCache.channelMap.find(channel => {
|
||||||
return channel.name === channelName;
|
return channel.name === channelName;
|
||||||
});
|
});
|
||||||
@ -60,17 +65,19 @@ export class ClientUniverse {
|
|||||||
* @param messageArg
|
* @param messageArg
|
||||||
*/
|
*/
|
||||||
public removeChannel(channelNameArg, notifyServer = true) {
|
public removeChannel(channelNameArg, notifyServer = true) {
|
||||||
const clientUniverseChannel = this.clientUniverseCache.channelMap.findOneAndRemove(channelItemArg => {
|
const clientUniverseChannel = this.clientUniverseCache.channelMap.findOneAndRemove(
|
||||||
return channelItemArg.name === channelNameArg;
|
channelItemArg => {
|
||||||
});
|
return channelItemArg.name === channelNameArg;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async start() {
|
public async start() {
|
||||||
await this.checkConnection();
|
await this.checkConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public stop() {
|
public async stop() {
|
||||||
this.smartsocketClient.disconnect();
|
await this.smartsocketClient.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,7 +88,7 @@ export class ClientUniverse {
|
|||||||
if (!this.smartsocketClient && !this.observableIntake) {
|
if (!this.smartsocketClient && !this.observableIntake) {
|
||||||
const parsedURL = url.parse(this.options.serverAddress);
|
const parsedURL = url.parse(this.options.serverAddress);
|
||||||
const socketConfig: plugins.smartsocket.ISmartsocketClientOptions = {
|
const socketConfig: plugins.smartsocket.ISmartsocketClientOptions = {
|
||||||
alias: process.env.SOCKET_ALIAS || 'someclient',
|
alias: 'universeclient',
|
||||||
password: 'UniverseClient',
|
password: 'UniverseClient',
|
||||||
port: parseInt(parsedURL.port, 10),
|
port: parseInt(parsedURL.port, 10),
|
||||||
role: 'UniverseClient',
|
role: 'UniverseClient',
|
||||||
@ -106,12 +113,30 @@ export class ClientUniverse {
|
|||||||
/**
|
/**
|
||||||
* handles message reception
|
* handles message reception
|
||||||
*/
|
*/
|
||||||
const socketFunctionProcessMessage = new plugins.smartsocket.SocketFunction({
|
const socketFunctionProcessMessage = new plugins.smartsocket.SocketFunction<
|
||||||
|
interfaces.ISocketRequest_ProcessMessage
|
||||||
|
>({
|
||||||
funcName: 'processMessage',
|
funcName: 'processMessage',
|
||||||
allowedRoles: [],
|
allowedRoles: [],
|
||||||
funcDef: async (messageDescriptorArg: interfaces.IUniverseMessage) => {
|
funcDef: async messageDescriptorArg => {
|
||||||
plugins.smartlog.defaultLogger.log('info', 'Got message from server');
|
plugins.smartlog.defaultLogger.log('info', 'Got message from server');
|
||||||
this.observableIntake.push(ClientUniverseMessage.createMessageFromMessageDescriptor(messageDescriptorArg));
|
const clientUniverseMessage = ClientUniverseMessage.createMessageFromMessageDescriptor(
|
||||||
|
messageDescriptorArg
|
||||||
|
);
|
||||||
|
this.observableIntake.push(clientUniverseMessage);
|
||||||
|
|
||||||
|
// lets find the corresponding channel
|
||||||
|
const targetChannel = this.getChannel(clientUniverseMessage.targetChannelName);
|
||||||
|
if (targetChannel) {
|
||||||
|
await targetChannel.emitMessageLocally(clientUniverseMessage);
|
||||||
|
return {
|
||||||
|
messageStatus: 'ok'
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
messageStatus: 'channel not found'
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -122,7 +147,7 @@ export class ClientUniverse {
|
|||||||
await this.smartsocketClient.connect();
|
await this.smartsocketClient.connect();
|
||||||
plugins.smartlog.defaultLogger.log('info', 'universe client connected successfully');
|
plugins.smartlog.defaultLogger.log('info', 'universe client connected successfully');
|
||||||
await this.clientUniverseCache.channelMap.forEach(async clientUniverseChannelArg => {
|
await this.clientUniverseCache.channelMap.forEach(async clientUniverseChannelArg => {
|
||||||
await clientUniverseChannelArg.subscribe();
|
await clientUniverseChannelArg.populateSubscriptionToServer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,9 @@ import * as plugins from './smartuniverse.plugins';
|
|||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
import { ClientUniverse } from './';
|
import { ClientUniverse } from './';
|
||||||
|
import { ClientUniverseMessage } from './smartuniverse.classes.clientuniversemessage';
|
||||||
|
import { ReactionRequest } from './smartuniverse.classes.reactionrequest';
|
||||||
|
import { ReactionResponse } from './smartuniverse.classes.reactionresponse';
|
||||||
|
|
||||||
export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
||||||
// ======
|
// ======
|
||||||
@ -13,11 +16,11 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
* @param channelNameArg
|
* @param channelNameArg
|
||||||
* @param passphraseArg
|
* @param passphraseArg
|
||||||
*/
|
*/
|
||||||
public static async createClientUniverseChannel(
|
public static createClientUniverseChannel(
|
||||||
clientUniverseArg: ClientUniverse,
|
clientUniverseArg: ClientUniverse,
|
||||||
channelNameArg: string,
|
channelNameArg: string,
|
||||||
passphraseArg: string
|
passphraseArg: string
|
||||||
): Promise<ClientUniverseChannel> {
|
): ClientUniverseChannel {
|
||||||
const clientChannel = new ClientUniverseChannel(
|
const clientChannel = new ClientUniverseChannel(
|
||||||
clientUniverseArg,
|
clientUniverseArg,
|
||||||
channelNameArg,
|
channelNameArg,
|
||||||
@ -34,6 +37,8 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
// properties
|
// properties
|
||||||
public name: string;
|
public name: string;
|
||||||
public passphrase: string;
|
public passphrase: string;
|
||||||
|
public status: 'subscribed' | 'unsubscribed' = 'unsubscribed';
|
||||||
|
private subject = new plugins.smartrx.rxjs.Subject<ClientUniverseMessage<any>>();
|
||||||
|
|
||||||
// refs
|
// refs
|
||||||
public clientUniverseRef: ClientUniverse;
|
public clientUniverseRef: ClientUniverse;
|
||||||
@ -48,13 +53,31 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
* subscribes to a channel
|
* subscribes to a channel
|
||||||
* tells the universe about this instances interest into a channel
|
* tells the universe about this instances interest into a channel
|
||||||
*/
|
*/
|
||||||
public async subscribe() {
|
public subscribe(observingFunctionArg: (messageArg: ClientUniverseMessage<any>) => void) {
|
||||||
const serverCallActionName: interfaces.IServerCallActions = 'channelSubscription';
|
|
||||||
const serverCallActionPayload: interfaces.IServerCallSubscribeActionPayload = {
|
return this.subject.subscribe(
|
||||||
name: this.name,
|
messageArg => {
|
||||||
passphrase: this.passphrase
|
observingFunctionArg(messageArg);
|
||||||
};
|
},
|
||||||
await this.clientUniverseRef.smartsocketClient.serverCall(serverCallActionName, serverCallActionPayload);
|
error => console.log(error)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async populateSubscriptionToServer() {
|
||||||
|
// lets make sure the channel is connected
|
||||||
|
if (this.status === 'unsubscribed') {
|
||||||
|
const response = await this.clientUniverseRef.smartsocketClient.serverCall<
|
||||||
|
interfaces.ISocketRequest_SubscribeChannel
|
||||||
|
>('subscribeChannel', {
|
||||||
|
name: this.name,
|
||||||
|
passphrase: this.passphrase
|
||||||
|
});
|
||||||
|
this.status = response.subscriptionStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async emitMessageLocally(messageArg: ClientUniverseMessage<any>) {
|
||||||
|
this.subject.next(messageArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,9 +92,11 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
passphrase: this.passphrase,
|
passphrase: this.passphrase,
|
||||||
targetChannelName: this.name,
|
targetChannelName: this.name,
|
||||||
messageText: messageArg.messageText,
|
messageText: messageArg.messageText,
|
||||||
payload: messageArg.payload,
|
payload: messageArg.payload
|
||||||
payloadStringType: messageArg.payloadStringType
|
|
||||||
};
|
};
|
||||||
await this.clientUniverseRef.smartsocketClient.serverCall('processMessage', universeMessageToSend);
|
await this.clientUniverseRef.smartsocketClient.serverCall(
|
||||||
|
'processMessage',
|
||||||
|
universeMessageToSend
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import * as plugins from './smartuniverse.plugins';
|
|||||||
|
|
||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
export class ClientUniverseMessage implements interfaces.IUniverseMessage {
|
export class ClientUniverseMessage<T> implements interfaces.IUniverseMessage {
|
||||||
// ======
|
// ======
|
||||||
// STATIC
|
// STATIC
|
||||||
// ======
|
// ======
|
||||||
@ -22,8 +22,7 @@ export class ClientUniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
public smartTimestamp: plugins.smarttime.TimeStamp;
|
public smartTimestamp: plugins.smarttime.TimeStamp;
|
||||||
public messageText: string;
|
public messageText: string;
|
||||||
public passphrase: string;
|
public passphrase: string;
|
||||||
public payload: any;
|
public payload: T;
|
||||||
public payloadStringType;
|
|
||||||
public targetChannelName: string;
|
public targetChannelName: string;
|
||||||
|
|
||||||
constructor(messageArg: interfaces.IUniverseMessage) {
|
constructor(messageArg: interfaces.IUniverseMessage) {
|
||||||
|
66
ts/smartuniverse.classes.reactionrequest.ts
Normal file
66
ts/smartuniverse.classes.reactionrequest.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||||
|
import { ClientUniverseChannel } from './smartuniverse.classes.clientuniversechannel';
|
||||||
|
import { ReactionResult } from './smartuniverse.classes.reactionresult';
|
||||||
|
import { UniverseMessage } from './smartuniverse.classes.universemessage';
|
||||||
|
import { ClientUniverseMessage } from './smartuniverse.classes.clientuniversemessage';
|
||||||
|
|
||||||
|
export interface IReactionRequestConstructorOptions<T extends plugins.typedrequestInterfaces.ITypedRequest> {
|
||||||
|
method: T['method'];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ICombinatorPayload<T extends plugins.typedrequestInterfaces.ITypedRequest> {
|
||||||
|
/**
|
||||||
|
* needed for tying responses to requests
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
typedRequestPayload: {
|
||||||
|
method: T['method'],
|
||||||
|
request : T['request'],
|
||||||
|
response: T['response']
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ReactionRequest<T extends plugins.typedrequestInterfaces.ITypedRequest> {
|
||||||
|
public method: T['method'];
|
||||||
|
|
||||||
|
constructor(optionsArg: IReactionRequestConstructorOptions<T>) {
|
||||||
|
this.method = optionsArg.method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async fire(channelsArg: Array<UniverseChannel | ClientUniverseChannel>, requestDataArg: T['request'], timeoutMillisArg=5000) {
|
||||||
|
const subscriptionMap = new plugins.lik.Objectmap<plugins.smartrx.rxjs.Subscription>();
|
||||||
|
const reactionResult = new ReactionResult<T>();
|
||||||
|
const requestId = plugins.smartunique.shortId();
|
||||||
|
for (const channel of channelsArg) {
|
||||||
|
subscriptionMap.add(channel.subscribe((messageArg: UniverseMessage<ICombinatorPayload<T>> | ClientUniverseMessage<ICombinatorPayload<T>>) => {
|
||||||
|
if (messageArg.messageText === 'reactionResponse' && messageArg.payload.typedRequestPayload.method === this.method) {
|
||||||
|
const payload: ICombinatorPayload<T> = messageArg.payload;
|
||||||
|
if (payload.id !== requestId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reactionResult.pushReactionResponse(payload.typedRequestPayload.response);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const payload: ICombinatorPayload<T> = {
|
||||||
|
id: requestId,
|
||||||
|
typedRequestPayload: {
|
||||||
|
method: this.method,
|
||||||
|
request: requestDataArg,
|
||||||
|
response: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
channel.sendMessage({
|
||||||
|
messageText: 'reactionRequest',
|
||||||
|
payload
|
||||||
|
});
|
||||||
|
}
|
||||||
|
plugins.smartdelay.delayFor(timeoutMillisArg).then(async () => {
|
||||||
|
await subscriptionMap.forEach(subscriptionArg => {
|
||||||
|
subscriptionArg.unsubscribe();
|
||||||
|
});
|
||||||
|
reactionResult.complete();
|
||||||
|
});
|
||||||
|
return reactionResult;
|
||||||
|
}
|
||||||
|
}
|
59
ts/smartuniverse.classes.reactionresponse.ts
Normal file
59
ts/smartuniverse.classes.reactionresponse.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
|
||||||
|
import { ICombinatorPayload } from './smartuniverse.classes.reactionrequest';
|
||||||
|
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||||
|
import { ClientUniverseChannel } from './smartuniverse.classes.clientuniversechannel';
|
||||||
|
import { UniverseMessage } from './smartuniverse.classes.universemessage';
|
||||||
|
import { ClientUniverseMessage } from './smartuniverse.classes.clientuniversemessage';
|
||||||
|
|
||||||
|
export type TReactionResponseFuncDef<T extends plugins.typedrequestInterfaces.ITypedRequest> = (dataArg: T['request']) => Promise<T['response']>;
|
||||||
|
|
||||||
|
export interface IReactionResponseConstructorOptions<
|
||||||
|
T extends plugins.typedrequestInterfaces.ITypedRequest
|
||||||
|
> {
|
||||||
|
method: T['method'];
|
||||||
|
channels: Array<UniverseChannel | ClientUniverseChannel>;
|
||||||
|
funcDef: TReactionResponseFuncDef<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ReactionResponse<T extends plugins.typedrequestInterfaces.ITypedRequest> {
|
||||||
|
public method: T['method'];
|
||||||
|
public channels = new plugins.lik.Objectmap<UniverseChannel | ClientUniverseChannel>();
|
||||||
|
public funcDef: TReactionResponseFuncDef<T>;
|
||||||
|
|
||||||
|
constructor(optionsArg: IReactionResponseConstructorOptions<T>) {
|
||||||
|
this.method = optionsArg.method;
|
||||||
|
this.channels.addArray(optionsArg.channels);
|
||||||
|
this.funcDef = optionsArg.funcDef;
|
||||||
|
for (const channel of this.channels.getArray()) {
|
||||||
|
channel.subscribe(messageArg => {
|
||||||
|
this.processMessageForReaction(channel, messageArg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async processMessageForReaction(
|
||||||
|
channelArg: UniverseChannel | ClientUniverseChannel,
|
||||||
|
messageArg:
|
||||||
|
| UniverseMessage<ICombinatorPayload<T>>
|
||||||
|
| ClientUniverseMessage<ICombinatorPayload<T>>
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
messageArg.messageText === 'reactionRequest' &&
|
||||||
|
messageArg.payload.typedRequestPayload.method === this.method
|
||||||
|
) {
|
||||||
|
const response: T['response'] = await this.funcDef(messageArg.payload.typedRequestPayload.request);
|
||||||
|
const payload: ICombinatorPayload<T> = {
|
||||||
|
...messageArg.payload,
|
||||||
|
typedRequestPayload: {
|
||||||
|
...messageArg.payload.typedRequestPayload,
|
||||||
|
response
|
||||||
|
}
|
||||||
|
};
|
||||||
|
channelArg.sendMessage({
|
||||||
|
messageText: 'reactionResponse',
|
||||||
|
payload
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
52
ts/smartuniverse.classes.reactionresult.ts
Normal file
52
ts/smartuniverse.classes.reactionresult.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
import { ReactionResponse } from './smartuniverse.classes.reactionresponse';
|
||||||
|
|
||||||
|
export class ReactionResult<T extends plugins.typedrequestInterfaces.ITypedRequest> {
|
||||||
|
private resultReplaySubject = new plugins.smartrx.rxjs.ReplaySubject<T['response']>();
|
||||||
|
private endResult: Array<T['response']> = [];
|
||||||
|
private completeDeferred = plugins.smartpromise.defer<Array<T['response']>>();
|
||||||
|
|
||||||
|
constructor () {
|
||||||
|
this.resultSubscribe(responseArg => {
|
||||||
|
this.endResult.push(responseArg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public resultSubscribe(observerArg: (responseArg: T['response']) => void) {
|
||||||
|
return this.resultReplaySubject.subscribe(observerArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the end result as an array of all results
|
||||||
|
*/
|
||||||
|
public async getEndResult() {
|
||||||
|
const result = await this.completeDeferred.promise;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if there is a single respondant, or you are only interested in the first result
|
||||||
|
*/
|
||||||
|
public async getFirstResult() {
|
||||||
|
const done = plugins.smartpromise.defer<T['response']>();
|
||||||
|
const subscription = this.resultReplaySubject.subscribe(result => {
|
||||||
|
done.resolve(result);
|
||||||
|
subscription.unsubscribe();
|
||||||
|
});
|
||||||
|
return await done.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* push a reactionResponse
|
||||||
|
*/
|
||||||
|
public async pushReactionResponse(responseArg: T['response']) {
|
||||||
|
this.resultReplaySubject.next(responseArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* completes the ReactionResult
|
||||||
|
*/
|
||||||
|
public async complete() {
|
||||||
|
this.completeDeferred.resolve(this.endResult);
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ import { UniverseConnection } from './smartuniverse.classes.universeconnection';
|
|||||||
|
|
||||||
export interface ISmartUniverseConstructorOptions {
|
export interface ISmartUniverseConstructorOptions {
|
||||||
messageExpiryInMilliseconds: number;
|
messageExpiryInMilliseconds: number;
|
||||||
|
externalServer?: plugins.smartexpress.Server;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,8 +60,18 @@ export class Universe {
|
|||||||
/**
|
/**
|
||||||
* adds a channel to the Universe
|
* adds a channel to the Universe
|
||||||
*/
|
*/
|
||||||
public async addChannel(nameArg: string, passphraseArg: string) {
|
public addChannel(nameArg: string, passphraseArg: string) {
|
||||||
const newChannel = UniverseChannel.createChannel(this, nameArg, passphraseArg);
|
const newChannel = UniverseChannel.createChannel(this, nameArg, passphraseArg);
|
||||||
|
return newChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns a channel
|
||||||
|
*/
|
||||||
|
public getChannel(channelNameArg: string) {
|
||||||
|
return this.universeCache.channelMap.find(channelArg => {
|
||||||
|
return channelArg.name === channelNameArg;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,14 +79,19 @@ export class Universe {
|
|||||||
*/
|
*/
|
||||||
public async start(portArg: number) {
|
public async start(portArg: number) {
|
||||||
// lets create the base smartexpress server
|
// lets create the base smartexpress server
|
||||||
this.smartexpressServer = new plugins.smartexpress.Server({
|
if (!this.options.externalServer) {
|
||||||
cors: true,
|
this.smartexpressServer = new plugins.smartexpress.Server({
|
||||||
defaultAnswer: async () => {
|
cors: true,
|
||||||
return `smartuniverse server ${this.getUniverseVersion()}`;
|
defaultAnswer: async () => {
|
||||||
},
|
return `smartuniverse server ${this.getUniverseVersion()}`;
|
||||||
forceSsl: false,
|
},
|
||||||
port: portArg
|
forceSsl: false,
|
||||||
});
|
port: portArg
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('Universe is using externally supplied server');
|
||||||
|
this.smartexpressServer = this.options.externalServer;
|
||||||
|
}
|
||||||
|
|
||||||
// add websocket upgrade
|
// add websocket upgrade
|
||||||
this.smartsocket = new plugins.smartsocket.Smartsocket({});
|
this.smartsocket = new plugins.smartsocket.Smartsocket({});
|
||||||
@ -89,24 +105,20 @@ export class Universe {
|
|||||||
// add the role to smartsocket
|
// add the role to smartsocket
|
||||||
this.smartsocket.addSocketRoles([ClientRole]);
|
this.smartsocket.addSocketRoles([ClientRole]);
|
||||||
|
|
||||||
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction({
|
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction<
|
||||||
|
interfaces.ISocketRequest_SubscribeChannel
|
||||||
|
>({
|
||||||
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
||||||
funcName: 'channelSubscription',
|
funcName: 'subscribeChannel',
|
||||||
funcDef: async (
|
funcDef: async (dataArg, socketConnectionArg) => {
|
||||||
dataArg: interfaces.IServerCallSubscribeActionPayload,
|
const universeConnection = new UniverseConnection({
|
||||||
socketConnectionArg
|
socketConnection: socketConnectionArg,
|
||||||
) => {
|
authenticationRequests: [dataArg]
|
||||||
// run in "this context" of this class
|
});
|
||||||
await (async () => {
|
await UniverseConnection.addConnectionToCache(this, universeConnection);
|
||||||
const universeConnection = new UniverseConnection({
|
return {
|
||||||
socketConnection: socketConnectionArg,
|
subscriptionStatus: 'subscribed'
|
||||||
authenticationRequests: [dataArg]
|
};
|
||||||
});
|
|
||||||
await UniverseConnection.addConnectionToCache(this, universeConnection);
|
|
||||||
return {
|
|
||||||
'subscription status': 'success'
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -114,30 +126,36 @@ export class Universe {
|
|||||||
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
||||||
funcName: 'processMessage',
|
funcName: 'processMessage',
|
||||||
funcDef: async (dataArg: interfaces.IUniverseMessage, socketConnectionArg) => {
|
funcDef: async (dataArg: interfaces.IUniverseMessage, socketConnectionArg) => {
|
||||||
// run in "this" context of this class
|
const universeConnection = UniverseConnection.findUniverseConnectionBySocketConnection(
|
||||||
await (async () => {
|
this.universeCache,
|
||||||
const universeConnection = UniverseConnection.findUniverseConnectionBySocketConnection(
|
socketConnectionArg
|
||||||
this.universeCache,
|
);
|
||||||
socketConnectionArg
|
if (universeConnection) {
|
||||||
|
plugins.smartlog.defaultLogger.log(
|
||||||
|
'ok',
|
||||||
|
'found UniverseConnection for socket for incoming message'
|
||||||
);
|
);
|
||||||
if (universeConnection) {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log('ok', 'found UniverseConnection for socket for incoming message');
|
plugins.smartlog.defaultLogger.log(
|
||||||
} else {
|
'warn',
|
||||||
plugins.smartlog.defaultLogger.log('warn', 'found no Authorized channel for incoming message');
|
'found no Authorized channel for incoming message'
|
||||||
return {
|
|
||||||
error: 'You need to authenticate for a channel'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const unauthenticatedMessage = UniverseMessage.createMessageFromPayload(socketConnectionArg, dataArg);
|
|
||||||
const foundChannel = await UniverseChannel.authorizeAMessageForAChannel(
|
|
||||||
this.universeCache,
|
|
||||||
unauthenticatedMessage
|
|
||||||
);
|
);
|
||||||
if (foundChannel && unauthenticatedMessage.authenticated) {
|
return {
|
||||||
const authenticatedMessage = unauthenticatedMessage;
|
error: 'You need to authenticate for a channel'
|
||||||
await this.universeCache.addMessage(authenticatedMessage);
|
};
|
||||||
}
|
}
|
||||||
})();
|
const unauthenticatedMessage = UniverseMessage.createMessageFromPayload(
|
||||||
|
socketConnectionArg,
|
||||||
|
dataArg
|
||||||
|
);
|
||||||
|
const foundChannel = await UniverseChannel.authorizeAMessageForAChannel(
|
||||||
|
this.universeCache,
|
||||||
|
unauthenticatedMessage
|
||||||
|
);
|
||||||
|
if (foundChannel && unauthenticatedMessage.authenticated) {
|
||||||
|
const authenticatedMessage = unauthenticatedMessage;
|
||||||
|
await this.universeCache.addMessage(authenticatedMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,10 +163,13 @@ export class Universe {
|
|||||||
this.smartsocket.addSocketFunction(socketFunctionSubscription);
|
this.smartsocket.addSocketFunction(socketFunctionSubscription);
|
||||||
this.smartsocket.addSocketFunction(socketFunctionProcessMessage);
|
this.smartsocket.addSocketFunction(socketFunctionProcessMessage);
|
||||||
|
|
||||||
|
// start the server
|
||||||
|
if (!this.options.externalServer) {
|
||||||
|
await this.smartexpressServer.start();
|
||||||
|
}
|
||||||
|
|
||||||
// add smartsocket to the running smartexpress app
|
// add smartsocket to the running smartexpress app
|
||||||
this.smartsocket.setExternalServer('smartexpress', this.smartexpressServer as any);
|
await this.smartsocket.setExternalServer('smartexpress', this.smartexpressServer);
|
||||||
// start everything
|
|
||||||
await this.smartexpressServer.start();
|
|
||||||
await this.smartsocket.start();
|
await this.smartsocket.start();
|
||||||
plugins.smartlog.defaultLogger.log('success', 'started universe');
|
plugins.smartlog.defaultLogger.log('success', 'started universe');
|
||||||
}
|
}
|
||||||
@ -157,7 +178,10 @@ export class Universe {
|
|||||||
* stop everything
|
* stop everything
|
||||||
*/
|
*/
|
||||||
public async stopServer() {
|
public async stopServer() {
|
||||||
|
console.log('hi');
|
||||||
await this.smartsocket.stop();
|
await this.smartsocket.stop();
|
||||||
await this.smartexpressServer.stop();
|
if (!this.options.externalServer) {
|
||||||
|
await this.smartexpressServer.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@ export class UniverseCache {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
// ========
|
// ========
|
||||||
public standardMessageExpiry: number;
|
public standardMessageExpiry: number;
|
||||||
public destructionTime: number = 60000;
|
public destructionTime: number = 10000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores messages for this instance
|
* stores messages for this instance
|
||||||
*/
|
*/
|
||||||
public messageMap = new Objectmap<UniverseMessage>();
|
public messageMap = new Objectmap<UniverseMessage<any>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the channels that are available within the universe
|
* stores the channels that are available within the universe
|
||||||
@ -54,12 +54,12 @@ export class UniverseCache {
|
|||||||
* @param messageArg
|
* @param messageArg
|
||||||
* @param attachedPayloadArg
|
* @param attachedPayloadArg
|
||||||
*/
|
*/
|
||||||
public async addMessage(messageArg: UniverseMessage) {
|
public async addMessage(messageArg: UniverseMessage<any>) {
|
||||||
messageArg.setUniverseCache(this);
|
messageArg.setUniverseCache(this);
|
||||||
UniverseChannel.authorizeAMessageForAChannel(this, messageArg);
|
UniverseChannel.authorizeAMessageForAChannel(this, messageArg);
|
||||||
this.messageMap.add(messageArg);
|
this.messageMap.add(messageArg);
|
||||||
messageArg.universeChannelList.forEach(universeChannel => {
|
messageArg.universeChannelList.forEach(universeChannel => {
|
||||||
universeChannel.pushToClients(messageArg);
|
universeChannel.push(messageArg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ export class UniverseCache {
|
|||||||
public readMessagesYoungerThan(
|
public readMessagesYoungerThan(
|
||||||
unixTimeArg?: number,
|
unixTimeArg?: number,
|
||||||
channelName?: string
|
channelName?: string
|
||||||
): Observable<UniverseMessage> {
|
): Observable<UniverseMessage<any>> {
|
||||||
const messageObservable = from(this.messageMap.getArray()).pipe(
|
const messageObservable = from(this.messageMap.getArray()).pipe(
|
||||||
filter(messageArg => {
|
filter(messageArg => {
|
||||||
return messageArg.smartTimestamp.isYoungerThanMilliSeconds(this.destructionTime);
|
return messageArg.smartTimestamp.isYoungerThanMilliSeconds(this.destructionTime);
|
||||||
|
@ -52,7 +52,7 @@ export class UniverseChannel {
|
|||||||
*/
|
*/
|
||||||
public static authorizeAMessageForAChannel(
|
public static authorizeAMessageForAChannel(
|
||||||
universeCacheArg: UniverseCache,
|
universeCacheArg: UniverseCache,
|
||||||
universeMessageArg: UniverseMessage
|
universeMessageArg: UniverseMessage<any>
|
||||||
): UniverseChannel {
|
): UniverseChannel {
|
||||||
const foundChannel = universeCacheArg.channelMap.find(universeChannel => {
|
const foundChannel = universeCacheArg.channelMap.find(universeChannel => {
|
||||||
const result = universeChannel.authenticate(universeMessageArg);
|
const result = universeChannel.authenticate(universeMessageArg);
|
||||||
@ -85,6 +85,7 @@ export class UniverseChannel {
|
|||||||
*/
|
*/
|
||||||
public name: string;
|
public name: string;
|
||||||
public universeRef: Universe;
|
public universeRef: Universe;
|
||||||
|
private subject = new plugins.smartrx.rxjs.Subject<UniverseMessage<any>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the passphrase for the channel
|
* the passphrase for the channel
|
||||||
@ -102,7 +103,7 @@ export class UniverseChannel {
|
|||||||
* # the messages channelName against the unverseChannel's name
|
* # the messages channelName against the unverseChannel's name
|
||||||
* # the messages password against the universeChannel's password
|
* # the messages password against the universeChannel's password
|
||||||
*/
|
*/
|
||||||
public authenticate(universeMessageArg: UniverseMessage): boolean {
|
public authenticate(universeMessageArg: UniverseMessage<any>): boolean {
|
||||||
return (
|
return (
|
||||||
this.name === universeMessageArg.targetChannelName &&
|
this.name === universeMessageArg.targetChannelName &&
|
||||||
this.passphrase === universeMessageArg.passphrase
|
this.passphrase === universeMessageArg.passphrase
|
||||||
@ -113,25 +114,55 @@ export class UniverseChannel {
|
|||||||
* pushes a message to clients
|
* pushes a message to clients
|
||||||
* @param messageArg
|
* @param messageArg
|
||||||
*/
|
*/
|
||||||
public async pushToClients(messageArg: UniverseMessage) {
|
public async push(messageArg: UniverseMessage<any>) {
|
||||||
|
this.subject.next(messageArg);
|
||||||
const universeConnectionsWithChannelAccess: UniverseConnection[] = [];
|
const universeConnectionsWithChannelAccess: UniverseConnection[] = [];
|
||||||
this.universeRef.universeCache.connectionMap.forEach(async socketConnection => {
|
await this.universeRef.universeCache.connectionMap.forEach(async socketConnection => {
|
||||||
if (socketConnection.authenticatedChannels.includes(this)) {
|
if (socketConnection.authenticatedChannels.includes(this)) {
|
||||||
universeConnectionsWithChannelAccess.push(socketConnection);
|
universeConnectionsWithChannelAccess.push(socketConnection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for (const universeConnection of universeConnectionsWithChannelAccess) {
|
for (const universeConnection of universeConnectionsWithChannelAccess) {
|
||||||
const smartsocket = universeConnection.socketConnection.smartsocketRef as plugins.smartsocket.Smartsocket;
|
const smartsocket = universeConnection.socketConnection
|
||||||
|
.smartsocketRef as plugins.smartsocket.Smartsocket;
|
||||||
const universeMessageToSend: interfaces.IUniverseMessage = {
|
const universeMessageToSend: interfaces.IUniverseMessage = {
|
||||||
id: messageArg.id,
|
id: messageArg.id,
|
||||||
timestamp: messageArg.timestamp,
|
timestamp: messageArg.timestamp,
|
||||||
passphrase: messageArg.passphrase,
|
passphrase: messageArg.passphrase,
|
||||||
targetChannelName: this.name,
|
targetChannelName: this.name,
|
||||||
messageText: messageArg.messageText,
|
messageText: messageArg.messageText,
|
||||||
payload: messageArg.payload,
|
payload: messageArg.payload
|
||||||
payloadStringType: messageArg.payloadStringType
|
|
||||||
};
|
};
|
||||||
smartsocket.clientCall('processMessage', universeMessageToSend, universeConnection.socketConnection);
|
smartsocket.clientCall(
|
||||||
|
'processMessage',
|
||||||
|
universeMessageToSend,
|
||||||
|
universeConnection.socketConnection
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// functions to interact with a channel locally
|
||||||
|
public subscribe(observingFunctionArg: (messageArg: UniverseMessage<any>) => void) {
|
||||||
|
return this.subject.subscribe(
|
||||||
|
messageArg => {
|
||||||
|
observingFunctionArg(messageArg);
|
||||||
|
},
|
||||||
|
error => console.log(error)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sends a message to the channel
|
||||||
|
*/
|
||||||
|
public async sendMessage(messageDescriptor: interfaces.IMessageCreator) {
|
||||||
|
const messageToSend = new UniverseMessage({
|
||||||
|
id: plugins.smartunique.shortId(),
|
||||||
|
messageText: messageDescriptor.messageText,
|
||||||
|
payload: messageDescriptor.payload,
|
||||||
|
targetChannelName: this.name,
|
||||||
|
passphrase: this.passphrase,
|
||||||
|
timestamp: Date.now()
|
||||||
|
});
|
||||||
|
this.universeRef.universeCache.addMessage(messageToSend);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ export class UniverseConnection {
|
|||||||
universeConnection
|
universeConnection
|
||||||
);
|
);
|
||||||
universeRef.universeCache.connectionMap.add(universeConnection);
|
universeRef.universeCache.connectionMap.add(universeConnection);
|
||||||
|
console.log('hi')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,7 +59,10 @@ export class UniverseConnection {
|
|||||||
universeConnectionArg: UniverseConnection
|
universeConnectionArg: UniverseConnection
|
||||||
): Promise<UniverseConnection> {
|
): Promise<UniverseConnection> {
|
||||||
for (const authenticationRequest of universeConnectionArg.authenticationRequests) {
|
for (const authenticationRequest of universeConnectionArg.authenticationRequests) {
|
||||||
const universeChannelToAuthenticateAgainst = UniverseChannel.getUniverseChannelByName(universeRef, authenticationRequest.name);
|
const universeChannelToAuthenticateAgainst = UniverseChannel.getUniverseChannelByName(
|
||||||
|
universeRef,
|
||||||
|
authenticationRequest.name
|
||||||
|
);
|
||||||
if (universeChannelToAuthenticateAgainst.passphrase === authenticationRequest.passphrase) {
|
if (universeChannelToAuthenticateAgainst.passphrase === authenticationRequest.passphrase) {
|
||||||
universeConnectionArg.authenticatedChannels.push(universeChannelToAuthenticateAgainst);
|
universeConnectionArg.authenticatedChannels.push(universeChannelToAuthenticateAgainst);
|
||||||
}
|
}
|
||||||
@ -95,7 +99,7 @@ export class UniverseConnection {
|
|||||||
* the socketClient to ping
|
* the socketClient to ping
|
||||||
*/
|
*/
|
||||||
public socketConnection: plugins.smartsocket.SocketConnection;
|
public socketConnection: plugins.smartsocket.SocketConnection;
|
||||||
public authenticationRequests: interfaces.IServerCallSubscribeActionPayload[] = [];
|
public authenticationRequests: Array<interfaces.ISocketRequest_SubscribeChannel['request']> = [];
|
||||||
public subscribedChannels: UniverseChannel[] = [];
|
public subscribedChannels: UniverseChannel[] = [];
|
||||||
public authenticatedChannels: UniverseChannel[] = [];
|
public authenticatedChannels: UniverseChannel[] = [];
|
||||||
public failedToJoinChannels: UniverseChannel[] = [];
|
public failedToJoinChannels: UniverseChannel[] = [];
|
||||||
@ -110,7 +114,7 @@ export class UniverseConnection {
|
|||||||
|
|
||||||
constructor(optionsArg: {
|
constructor(optionsArg: {
|
||||||
socketConnection: plugins.smartsocket.SocketConnection;
|
socketConnection: plugins.smartsocket.SocketConnection;
|
||||||
authenticationRequests: interfaces.IServerCallSubscribeActionPayload[];
|
authenticationRequests: Array<interfaces.ISocketRequest_SubscribeChannel['request']>;
|
||||||
}) {
|
}) {
|
||||||
this.authenticationRequests = optionsArg.authenticationRequests;
|
this.authenticationRequests = optionsArg.authenticationRequests;
|
||||||
this.socketConnection = optionsArg.socketConnection;
|
this.socketConnection = optionsArg.socketConnection;
|
||||||
|
@ -13,8 +13,11 @@ import { SocketConnection } from '@pushrocks/smartsocket';
|
|||||||
* represents a message within a universe
|
* represents a message within a universe
|
||||||
* acts as a container to save message states like authentication status
|
* acts as a container to save message states like authentication status
|
||||||
*/
|
*/
|
||||||
export class UniverseMessage implements interfaces.IUniverseMessage {
|
export class UniverseMessage<T> implements interfaces.IUniverseMessage {
|
||||||
public static createMessageFromPayload(socketConnectionArg: SocketConnection, dataArg: interfaces.IUniverseMessage) {
|
public static createMessageFromPayload(
|
||||||
|
socketConnectionArg: SocketConnection,
|
||||||
|
dataArg: interfaces.IUniverseMessage
|
||||||
|
) {
|
||||||
const universeMessageInstance = new UniverseMessage(dataArg);
|
const universeMessageInstance = new UniverseMessage(dataArg);
|
||||||
universeMessageInstance.socketConnection = socketConnectionArg;
|
universeMessageInstance.socketConnection = socketConnectionArg;
|
||||||
return universeMessageInstance;
|
return universeMessageInstance;
|
||||||
@ -25,8 +28,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
public smartTimestamp: TimeStamp;
|
public smartTimestamp: TimeStamp;
|
||||||
public messageText: string;
|
public messageText: string;
|
||||||
public passphrase: string;
|
public passphrase: string;
|
||||||
public payload: any;
|
public payload: T;
|
||||||
public payloadStringType;
|
|
||||||
public targetChannelName: string;
|
public targetChannelName: string;
|
||||||
public socketConnection: SocketConnection;
|
public socketConnection: SocketConnection;
|
||||||
|
|
||||||
@ -62,28 +64,32 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
this.passphrase = messageDescriptor.passphrase;
|
this.passphrase = messageDescriptor.passphrase;
|
||||||
this.payload = messageDescriptor.payload;
|
this.payload = messageDescriptor.payload;
|
||||||
// prevent memory issues
|
// prevent memory issues
|
||||||
this.fallBackDestruction();
|
this.setDestructionTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public setUniverseCache(universeCacheArg: UniverseCache) {
|
public setUniverseCache(universeCacheArg: UniverseCache) {
|
||||||
this.universeCache = universeCacheArg;
|
this.universeCache = universeCacheArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setTargetChannel() {
|
public setTargetChannel() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public setDestructionTimer(selfdestructAfterArg: number) {
|
public setDestructionTimer(selfdestructAfterArg?: number) {
|
||||||
if (selfdestructAfterArg) {
|
if (selfdestructAfterArg) {
|
||||||
this.destructionTimer = new Timer(selfdestructAfterArg);
|
this.destructionTimer = new Timer(selfdestructAfterArg);
|
||||||
this.destructionTimer.start();
|
this.destructionTimer.start();
|
||||||
|
|
||||||
// set up self destruction by removing this from the parent messageCache
|
// set up self destruction by removing this from the parent messageCache
|
||||||
this.destructionTimer.completed.then(async () => {
|
this.destructionTimer.completed.then(async () => {
|
||||||
this.universeCache.messageMap.remove(this);
|
this.universeCache.messageMap.remove(this);
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
console.log(this);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.fallBackDestruction();
|
plugins.smartdelay.delayFor(1000).then(() => {
|
||||||
|
if (!this.destructionTimer) {
|
||||||
|
this.setDestructionTimer(6000);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,15 +99,4 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
public handleAsBadMessage() {
|
public handleAsBadMessage() {
|
||||||
plugins.smartlog.defaultLogger.log('warn', 'received a bad message');
|
plugins.smartlog.defaultLogger.log('warn', '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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,13 @@ import * as path from 'path';
|
|||||||
|
|
||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
|
// apiglobal scope
|
||||||
|
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||||
|
|
||||||
|
export {
|
||||||
|
typedrequestInterfaces
|
||||||
|
};
|
||||||
|
|
||||||
// pushrocks scope
|
// pushrocks scope
|
||||||
import * as lik from '@pushrocks/lik';
|
import * as lik from '@pushrocks/lik';
|
||||||
import * as smarthash from '@pushrocks/smarthash';
|
import * as smarthash from '@pushrocks/smarthash';
|
||||||
|
Reference in New Issue
Block a user