Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
9c1504ef02 | |||
e8f2e04d1c | |||
e12aa7e961 | |||
857b7cd010 | |||
e100dea160 | |||
e8e87fcdba | |||
0d18b11721 | |||
eaaefddbe3 | |||
8c6946ddb6 | |||
3a7ebcdd80 | |||
ec2afbfd55 | |||
89feeca735 | |||
c4261765ec | |||
33fe6bcd41 | |||
1baf1c318c | |||
051aba3299 | |||
7998d79b13 | |||
6838a8729a | |||
67f4e33ca0 | |||
8a8277ae9f | |||
ff9cb9132c | |||
f4ce784a59 | |||
b34be4dcba | |||
6cc69efe2d |
@ -1,5 +1,5 @@
|
||||
# gitzone ci_default
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
@ -49,14 +49,14 @@ testLTS:
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
@ -65,7 +65,7 @@ testSTABLE:
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci node install lts
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
@ -98,7 +98,9 @@ trigger:
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
image: hosttoday/ht-docker-dbase:npmci
|
||||
services:
|
||||
- docker:18-dind
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
|
444
package-lock.json
generated
444
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartuniverse",
|
||||
"version": "1.0.52",
|
||||
"version": "1.0.64",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -15,18 +15,18 @@
|
||||
}
|
||||
},
|
||||
"@babel/code-frame": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
|
||||
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.5.5.tgz",
|
||||
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/highlight": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"@babel/highlight": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
|
||||
"integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.5.0.tgz",
|
||||
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^2.0.0",
|
||||
@ -104,24 +104,17 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/lik": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.5.tgz",
|
||||
"integrity": "sha512-pc5Nq0WUysS34qPpyiZXiX254kL3vyRVbt3D36Q5QU+eHhxAThHofSzgOdyVHUZU2WFoaMlKowIVsyUFzIkfdw==",
|
||||
"version": "3.0.10",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.10.tgz",
|
||||
"integrity": "sha512-iWG06QsrL6AAnjPRWMVz4bRaRE0jJt/HgEK0YeLqaSBLY8ju4ps1j4lEN8VrUlXGZyPB6UGQfcreesO24buYhQ==",
|
||||
"requires": {
|
||||
"@pushrocks/smartdelay": "^2.0.2",
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrx": "^2.0.3",
|
||||
"@pushrocks/smarttime": "^3.0.5",
|
||||
"@pushrocks/smarttime": "^3.0.12",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"minimatch": "^3.0.4",
|
||||
"symbol-tree": "^3.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
||||
}
|
||||
"symbol-tree": "^3.2.4"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartcli": {
|
||||
@ -182,31 +175,32 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartexpress": {
|
||||
"version": "3.0.21",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexpress/-/smartexpress-3.0.21.tgz",
|
||||
"integrity": "sha512-b/TONmCWG/K2gt3AuHGn7nWDkP3LIU072nbXShKbkcXPqetQcbuyXWc5g52wkag4KQV8XWcaucMDBNCSMmPhgg==",
|
||||
"version": "3.0.38",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexpress/-/smartexpress-3.0.38.tgz",
|
||||
"integrity": "sha512-di26orVJwgBRGKVpYcPrauc14CVo0piAzXTBWFZZNUCuIsndnXepd9oDzMO+KHVZpNz3W4DxbtRkppZjrh9ejw==",
|
||||
"requires": {
|
||||
"@pushrocks/lik": "^3.0.5",
|
||||
"@pushrocks/smartfile": "^7.0.2",
|
||||
"@pushrocks/lik": "^3.0.10",
|
||||
"@pushrocks/smartfile": "^7.0.4",
|
||||
"@pushrocks/smartmanifest": "^1.0.6",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrequest": "^1.1.15",
|
||||
"@types/express": "^4.16.1",
|
||||
"@pushrocks/smartrequest": "^1.1.16",
|
||||
"@types/express": "^4.17.0",
|
||||
"@types/finalhandler": "^1.1.0",
|
||||
"@types/helmet": "0.0.43",
|
||||
"@types/serve-static": "^1.13.2",
|
||||
"body-parser": "^1.19.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.16.4",
|
||||
"express": "^4.17.1",
|
||||
"express-force-ssl": "^0.3.2",
|
||||
"helmet": "^3.16.0",
|
||||
"helmet": "^3.20.0",
|
||||
"rendertron-middleware": "^0.1.5",
|
||||
"sitemap": "^2.1.0"
|
||||
"sitemap": "^3.2.2"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartfile": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.2.tgz",
|
||||
"integrity": "sha512-38l9DRalp1McEBFG+qKzBqefVQZZLPNk+uo7Ff1guy8BDxA+tATlZ6O6FuXW7M3wjFDBi245VJs+KWVKcCxBRA==",
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.4.tgz",
|
||||
"integrity": "sha512-ym8eigWJAQhwgmuVLew3GLrk4WhV03ajapwuMWytxKSzfIW9ZqceJBX2QzOkmhFGA2bp+gc4Q2wOBy3Ffnlj+A==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpath": "^4.0.1",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
@ -220,20 +214,24 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smarthash": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.0.4.tgz",
|
||||
"integrity": "sha512-xT1BKrJEHZs+0K62ba5IHt7mkdMGMORDBRnw4QweC49ryNiJm2x4CT/he7HTVy5nPK1Q2OrPwrUoEQ1CiHcq8w==",
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.0.6.tgz",
|
||||
"integrity": "sha512-jHk9srgRLkszk/oPCUOkxTX2Fqu7qKwx13aEeSIBx8UCtFbXPLecJAqEaGEVk1mw9e4Oq0iC6O0jEnxKo5NQwA==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
"@pushrocks/smartjson": "^3.0.5",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@types/through2": "^2.0.34",
|
||||
"through2": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
||||
}
|
||||
"through2": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartjson": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-3.0.5.tgz",
|
||||
"integrity": "sha512-k5UvB2Q0Dm61vexxBs69E8F0vceSuuI5KcHTLofgZ30Csws9mawFhHCsGfvUl9XlCErcKnkfTFId8iEqWTQiKA==",
|
||||
"requires": {
|
||||
"@types/fast-json-stable-stringify": "^2.0.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartlog": {
|
||||
@ -259,6 +257,11 @@
|
||||
"ora": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartmanifest": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartmanifest/-/smartmanifest-1.0.6.tgz",
|
||||
"integrity": "sha512-2EalWj9P0jPvbQxAy9YH10AC+xCBfI25MRuWsIrNhhpAxfhZL7l0wrXiKENLXaS5Rh8BsC1cB6sufYfKvoE5gg=="
|
||||
},
|
||||
"@pushrocks/smartparam": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.0.4.tgz",
|
||||
@ -289,9 +292,9 @@
|
||||
"integrity": "sha512-jmrJMUEmBCWChWK8CIcx4Vw3wv/8OgVNmkaxJrbs+WMaoRUfJtpWWJfrAwwHWt9ZXJbarJ+CwfwfYiiZXymndQ=="
|
||||
},
|
||||
"@pushrocks/smartrequest": {
|
||||
"version": "1.1.15",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/smartrequest/-/smartrequest-1.1.15.tgz",
|
||||
"integrity": "sha512-MBOOTTdqWy+HvWS4Lt8jzITxF2hYyQ3/OjB28CpTAkPuKsDyLi9HEngvFufKu5EbKwBGwCVdeF7vQSpLRSoDtA==",
|
||||
"version": "1.1.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.16.tgz",
|
||||
"integrity": "sha512-3LbtqoqnjfzWSQ10NryhJmgwPpvMlVoYyTzE676+yC4hM2rnGSzxozLZxMr6enV4VeZcloQ0CqHBivKoT/kdvA==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@types/form-data": "^2.2.1",
|
||||
@ -330,14 +333,14 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartsocket": {
|
||||
"version": "1.1.38",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.38.tgz",
|
||||
"integrity": "sha512-mGWEuA53GqTFOCebwo4Ayu2l7xjui7I0tdUNgZShGhIr4yv+q3sP/66q6cT388xVawIN+swviJPlPoogaoZXdA==",
|
||||
"version": "1.1.44",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.44.tgz",
|
||||
"integrity": "sha512-AxDEDQw96szewxiA7Vk+ak6l7tsf2MLIThAuoV53ycDkDNXMyJizqE8fnzks9+/OEukwwas9kYNT9MyqPIS1mw==",
|
||||
"requires": {
|
||||
"@pushrocks/lik": "^3.0.5",
|
||||
"@pushrocks/lik": "^3.0.10",
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartexpress": "^3.0.21",
|
||||
"@pushrocks/smarthash": "^2.0.4",
|
||||
"@pushrocks/smartexpress": "^3.0.38",
|
||||
"@pushrocks/smarthash": "^2.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@types/shortid": "0.0.29",
|
||||
@ -349,15 +352,15 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smarttime": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.7.tgz",
|
||||
"integrity": "sha512-IL/+lgVQLvZvoMSbOpT3JSGjogGzpNbWdzfFZAjjxrTtwxAN1FNWGcCESCvq1BPlUGECPTBeyyaURXhhhLfihA==",
|
||||
"version": "3.0.12",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
|
||||
"integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@types/cron": "^1.7.0",
|
||||
"@types/luxon": "^1.12.0",
|
||||
"cron": "^1.7.0",
|
||||
"luxon": "^1.12.1"
|
||||
"@types/cron": "^1.7.1",
|
||||
"@types/luxon": "^1.15.1",
|
||||
"cron": "^1.7.1",
|
||||
"luxon": "^1.16.0"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartunique": {
|
||||
@ -372,9 +375,9 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/tapbundle": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.9.tgz",
|
||||
"integrity": "sha512-+EMdP3iykAtx192sebHBAWCE+2RGUU7q9kp8iHe62H16WSbDDaDpnRNd6VHv389qTaZlubQb0d/FR+uQJUVUDQ==",
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.11.tgz",
|
||||
"integrity": "sha512-s7epZfJZX+LsBVmIYvoaY4WtgPvRLnHZMVTpQAPJGMBqxJAQxhQ2wvGJjmqMAGhhznAHI6t4g+m0KTp3vFIRVg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/early": "^3.0.3",
|
||||
@ -426,9 +429,9 @@
|
||||
}
|
||||
},
|
||||
"@types/cron": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.0.tgz",
|
||||
"integrity": "sha512-LRu/XiiOExELholyEwEuSTPAEiO+sVR1nXmWEjezneGgYpDyMNVIsjiaHYBoCEUJo4F1hCOlAzQAh80iEUVbKw==",
|
||||
"version": "1.7.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.1.tgz",
|
||||
"integrity": "sha512-48brwgU18DqA0mQX1As5OcJEo1yNjaXMM6Mk4r8K1dOzLJRQ37FE/kCivKx7ClKEHfhX2FdcxKzJ1B744a+V3A==",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"moment": ">=2.14.0"
|
||||
@ -453,6 +456,11 @@
|
||||
"@types/range-parser": "*"
|
||||
}
|
||||
},
|
||||
"@types/fast-json-stable-stringify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2ffast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
||||
"integrity": "sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ=="
|
||||
},
|
||||
"@types/figures": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-3.0.1.tgz",
|
||||
@ -471,17 +479,17 @@
|
||||
}
|
||||
},
|
||||
"@types/form-data": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.2.1.tgz",
|
||||
"integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==",
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.5.0.tgz",
|
||||
"integrity": "sha512-23/wYiuckYYtFpL+4RPWiWmRQH2BjFuqCUi2+N3amB1a1Drv+i/byTrGvlLwRVLFNAZbwpbQ7JvTK+VCAPMbcg==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
"form-data": "*"
|
||||
}
|
||||
},
|
||||
"@types/fs-extra": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-5.0.5.tgz",
|
||||
"integrity": "sha512-w7iqhDH9mN8eLClQOYTkhdYUOSpp25eXxfc6VbFOGtzxW34JcvctH2bKjj4jD4++z4R5iO5D+pg48W2e03I65A==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-5.1.0.tgz",
|
||||
"integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
@ -495,9 +503,9 @@
|
||||
}
|
||||
},
|
||||
"@types/luxon": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.12.0.tgz",
|
||||
"integrity": "sha512-+UzPmwHSEEyv7aGlNkVpuFxp/BirXgl8NnPGCtmyx2KXIzAapoW3IqSVk87/Z3PUk8vEL8Pe1HXEMJbNBOQgtg=="
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.15.2.tgz",
|
||||
"integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw=="
|
||||
},
|
||||
"@types/mime": {
|
||||
"version": "2.0.1",
|
||||
@ -510,9 +518,9 @@
|
||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.0.7",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.0.7.tgz",
|
||||
"integrity": "sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A=="
|
||||
"version": "12.7.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.1.tgz",
|
||||
"integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw=="
|
||||
},
|
||||
"@types/range-parser": {
|
||||
"version": "1.2.3",
|
||||
@ -589,21 +597,6 @@
|
||||
"requires": {
|
||||
"mime-types": "~2.1.24",
|
||||
"negotiator": "0.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"mime-db": {
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"requires": {
|
||||
"mime-db": "1.40.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
@ -612,9 +605,9 @@
|
||||
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://verdaccio.lossless.one/ajv/-/ajv-6.10.0.tgz",
|
||||
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://verdaccio.lossless.one/ajv/-/ajv-6.10.2.tgz",
|
||||
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
@ -687,9 +680,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"async-limiter": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/async-limiter/-/async-limiter-1.0.0.tgz",
|
||||
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/async-limiter/-/async-limiter-1.0.1.tgz",
|
||||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
@ -908,9 +901,9 @@
|
||||
"integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA="
|
||||
},
|
||||
"cloneable-readable": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://verdaccio.lossless.one/cloneable-readable/-/cloneable-readable-1.1.2.tgz",
|
||||
"integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==",
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://verdaccio.lossless.one/cloneable-readable/-/cloneable-readable-1.1.3.tgz",
|
||||
"integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.1",
|
||||
"process-nextick-args": "^2.0.0",
|
||||
@ -939,9 +932,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://verdaccio.lossless.one/combined-stream/-/combined-stream-1.0.7.tgz",
|
||||
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://verdaccio.lossless.one/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
@ -981,9 +974,9 @@
|
||||
}
|
||||
},
|
||||
"content-security-policy-builder": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/content-security-policy-builder/-/content-security-policy-builder-2.0.0.tgz",
|
||||
"integrity": "sha512-j+Nhmj1yfZAikJLImCvPJFE29x/UuBi+/MWqggGGc515JKaZrjuei2RhULJmy0MsstW3E3htl002bwmBNMKr7w=="
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz",
|
||||
"integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ=="
|
||||
},
|
||||
"content-type": {
|
||||
"version": "1.0.4",
|
||||
@ -1015,9 +1008,9 @@
|
||||
}
|
||||
},
|
||||
"cron": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.0.tgz",
|
||||
"integrity": "sha512-I7S7ES2KZtKPfBTGJ5Brc6X23apE71fgYU/PC5ayh8R6VhECpqvTLe/LTkwAEN3ERFzNKXlWzh/PkwsGg3vkDQ==",
|
||||
"version": "1.7.1",
|
||||
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.1.tgz",
|
||||
"integrity": "sha512-gmMB/pJcqUVs/NklR1sCGlNYM7TizEw+1gebz20BMc/8bTm/r7QUp3ZPSPlG8Z5XRlvb7qhjEjq/+bdIfUCL2A==",
|
||||
"requires": {
|
||||
"moment-timezone": "^0.5.x"
|
||||
}
|
||||
@ -1110,14 +1103,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"dns-prefetch-control": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/dns-prefetch-control/-/dns-prefetch-control-0.1.0.tgz",
|
||||
"integrity": "sha1-YN20V3dOF48flBXwyrsOhbCzALI="
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/dns-prefetch-control/-/dns-prefetch-control-0.2.0.tgz",
|
||||
"integrity": "sha512-hvSnros73+qyZXhHFjx2CMLwoj3Fe7eR9EJsFsqmcI1bB2OBWL/+0YzaEaKssCHnj/6crawNnUyw74Gm2EKe+Q=="
|
||||
},
|
||||
"dont-sniff-mimetype": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/dont-sniff-mimetype/-/dont-sniff-mimetype-1.0.0.tgz",
|
||||
"integrity": "sha1-WTKJDcn04vGeXrAqIAJuXl78j1g="
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz",
|
||||
"integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug=="
|
||||
},
|
||||
"ecc-jsbn": {
|
||||
"version": "0.1.2",
|
||||
@ -1390,9 +1383,9 @@
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-2.3.3.tgz",
|
||||
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-2.5.0.tgz",
|
||||
"integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
@ -1472,9 +1465,9 @@
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.15",
|
||||
"resolved": "https://verdaccio.lossless.one/graceful-fs/-/graceful-fs-4.1.15.tgz",
|
||||
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/graceful-fs/-/graceful-fs-4.2.0.tgz",
|
||||
"integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg=="
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "2.0.0",
|
||||
@ -1517,25 +1510,25 @@
|
||||
"dev": true
|
||||
},
|
||||
"helmet": {
|
||||
"version": "3.18.0",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet/-/helmet-3.18.0.tgz",
|
||||
"integrity": "sha512-TsKlGE5UVkV0NiQ4PllV9EVfZklPjyzcMEMjWlyI/8S6epqgRT+4s4GHVgc25x0TixsKvp3L7c91HQQt5l0+QA==",
|
||||
"version": "3.20.0",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet/-/helmet-3.20.0.tgz",
|
||||
"integrity": "sha512-Ob+TqmQFZ5f7WgP8kBbAzNPsbf6p1lOj5r+327/ymw/IILWih3wcx9u/u/S8Mwv5wbBkO7Li6x5s23t3COhUKw==",
|
||||
"requires": {
|
||||
"depd": "2.0.0",
|
||||
"dns-prefetch-control": "0.1.0",
|
||||
"dont-sniff-mimetype": "1.0.0",
|
||||
"dns-prefetch-control": "0.2.0",
|
||||
"dont-sniff-mimetype": "1.1.0",
|
||||
"expect-ct": "0.2.0",
|
||||
"feature-policy": "0.3.0",
|
||||
"frameguard": "3.1.0",
|
||||
"helmet-crossdomain": "0.3.0",
|
||||
"helmet-csp": "2.7.1",
|
||||
"hide-powered-by": "1.0.0",
|
||||
"helmet-crossdomain": "0.4.0",
|
||||
"helmet-csp": "2.8.0",
|
||||
"hide-powered-by": "1.1.0",
|
||||
"hpkp": "2.0.0",
|
||||
"hsts": "2.2.0",
|
||||
"ienoopen": "1.1.0",
|
||||
"nocache": "2.1.0",
|
||||
"referrer-policy": "1.2.0",
|
||||
"x-xss-protection": "1.1.0"
|
||||
"x-xss-protection": "1.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"depd": {
|
||||
@ -1546,25 +1539,25 @@
|
||||
}
|
||||
},
|
||||
"helmet-crossdomain": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet-crossdomain/-/helmet-crossdomain-0.3.0.tgz",
|
||||
"integrity": "sha512-YiXhj0E35nC4Na5EPE4mTfoXMf9JTGpN4OtB4aLqShKuH9d2HNaJX5MQoglO6STVka0uMsHyG5lCut5Kzsy7Lg=="
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz",
|
||||
"integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
|
||||
},
|
||||
"helmet-csp": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet-csp/-/helmet-csp-2.7.1.tgz",
|
||||
"integrity": "sha512-sCHwywg4daQ2mY0YYwXSZRsgcCeerUwxMwNixGA7aMLkVmPTYBl7gJoZDHOZyXkqPrtuDT3s2B1A+RLI7WxSdQ==",
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://verdaccio.lossless.one/helmet-csp/-/helmet-csp-2.8.0.tgz",
|
||||
"integrity": "sha512-MlCPeM0Sm3pS9RACRihx70VeTHmkQwa7sum9EK1tfw1VZyvFU0dBWym9nHh3CRkTRNlyNm/WFCMvuh9zXkOjNw==",
|
||||
"requires": {
|
||||
"camelize": "1.0.0",
|
||||
"content-security-policy-builder": "2.0.0",
|
||||
"content-security-policy-builder": "2.1.0",
|
||||
"dasherize": "2.0.0",
|
||||
"platform": "1.3.5"
|
||||
}
|
||||
},
|
||||
"hide-powered-by": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/hide-powered-by/-/hide-powered-by-1.0.0.tgz",
|
||||
"integrity": "sha1-SoWtZYgfYoV/xwr3F0oRhNzM4ys="
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/hide-powered-by/-/hide-powered-by-1.1.0.tgz",
|
||||
"integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg=="
|
||||
},
|
||||
"hpkp": {
|
||||
"version": "2.0.0",
|
||||
@ -1697,7 +1690,7 @@
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
|
||||
"dev": true
|
||||
},
|
||||
@ -1787,11 +1780,6 @@
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
||||
},
|
||||
"lodash._baseassign": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
|
||||
@ -1841,6 +1829,16 @@
|
||||
"lodash.keys": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash.chunk": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.chunk/-/lodash.chunk-4.2.0.tgz",
|
||||
"integrity": "sha1-ZuXOH3btJ7QwPYxlEujRIW6BBrw="
|
||||
},
|
||||
"lodash.clonedeep": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
|
||||
},
|
||||
"lodash.isarguments": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
|
||||
@ -1861,11 +1859,21 @@
|
||||
"lodash.isarray": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash.padstart": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.padstart/-/lodash.padstart-4.6.1.tgz",
|
||||
"integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs="
|
||||
},
|
||||
"lodash.restparam": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
|
||||
"integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU="
|
||||
},
|
||||
"lodash.sortby": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://verdaccio.lossless.one/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
|
||||
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
|
||||
},
|
||||
"log-symbols": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/log-symbols/-/log-symbols-2.2.0.tgz",
|
||||
@ -1876,9 +1884,9 @@
|
||||
}
|
||||
},
|
||||
"luxon": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.12.1.tgz",
|
||||
"integrity": "sha512-Zv/qJb2X1ESTrlniAViWx2aqGwi2cVpeoZFTbPdPiCu4EsadKsmb/QCH8HQjMUpDZKKJIHKHsJxV5Rwpq47HKQ=="
|
||||
"version": "1.17.2",
|
||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.17.2.tgz",
|
||||
"integrity": "sha512-qELKtIj3HD41N+MvgoxArk8DZGUb4Gpiijs91oi+ZmKJzRlxY6CoyTwNoUwnogCVs4p8HuxVJDik9JbnYgrCng=="
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.5",
|
||||
@ -1927,16 +1935,16 @@
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.38.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.38.0.tgz",
|
||||
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg=="
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.22",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.22.tgz",
|
||||
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"requires": {
|
||||
"mime-db": "~1.38.0"
|
||||
"mime-db": "1.40.0"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
@ -1982,9 +1990,9 @@
|
||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||
},
|
||||
"moment-timezone": {
|
||||
"version": "0.5.23",
|
||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.23.tgz",
|
||||
"integrity": "sha512-WHFH85DkCfiNMDX5D3X7hpNH3/PUhjTGcD0U1SgfBGZxJ3qUmJh5FdvaFjcClxOvB3rzdfj4oRffbI38jEnC1w==",
|
||||
"version": "0.5.26",
|
||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.26.tgz",
|
||||
"integrity": "sha512-sFP4cgEKTCymBBKgoxZjYzlSovC20Y6J7y3nanDc5RoBIXKlZhoYwBoZGe3flwU6A372AcRwScH8KiwV6zjy1g==",
|
||||
"requires": {
|
||||
"moment": ">= 2.9.0"
|
||||
}
|
||||
@ -1995,9 +2003,9 @@
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.13.2",
|
||||
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.13.2.tgz",
|
||||
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
},
|
||||
"nanoid": {
|
||||
@ -2245,9 +2253,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"proxy-addr": {
|
||||
"version": "2.0.5",
|
||||
@ -2259,9 +2267,9 @@
|
||||
}
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.1.32",
|
||||
"resolved": "https://verdaccio.lossless.one/psl/-/psl-1.1.32.tgz",
|
||||
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g=="
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://verdaccio.lossless.one/psl/-/psl-1.3.0.tgz",
|
||||
"integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag=="
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
@ -2364,6 +2372,16 @@
|
||||
"uuid": "^3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"form-data": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-2.3.3.tgz",
|
||||
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://verdaccio.lossless.one/qs/-/qs-6.5.2.tgz",
|
||||
@ -2505,13 +2523,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"sitemap": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-2.2.0.tgz",
|
||||
"integrity": "sha512-9Zoi3UBhSIt5jWENDRUbzsqLMJ+Fha3P2aQ2PRghmh0FOivtHsC4FAJdkAEKHvATajd74BWp/57Yh7kz/UA53Q==",
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-3.2.2.tgz",
|
||||
"integrity": "sha512-TModL/WU4m2q/mQcrDgNANn0P4LwprM9MMvG4hu5zP4c6IIKs2YLTu6nXXnNr8ODW/WFtxKggiJ1EGn2W0GNmg==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.10",
|
||||
"url-join": "^4.0.0",
|
||||
"xmlbuilder": "^10.0.0"
|
||||
"lodash.chunk": "^4.2.0",
|
||||
"lodash.padstart": "^4.6.1",
|
||||
"whatwg-url": "^7.0.0",
|
||||
"xmlbuilder": "^13.0.0"
|
||||
}
|
||||
},
|
||||
"smartchai": {
|
||||
@ -2727,9 +2746,9 @@
|
||||
}
|
||||
},
|
||||
"symbol-tree": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.2.tgz",
|
||||
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.4.tgz",
|
||||
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
|
||||
},
|
||||
"through2": {
|
||||
"version": "3.0.1",
|
||||
@ -2765,6 +2784,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/tr46/-/tr46-1.0.1.tgz",
|
||||
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
|
||||
"requires": {
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.2.0.tgz",
|
||||
@ -2784,9 +2811,9 @@
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
},
|
||||
"tslint": {
|
||||
"version": "5.17.0",
|
||||
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.17.0.tgz",
|
||||
"integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==",
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.18.0.tgz",
|
||||
"integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
@ -2853,21 +2880,6 @@
|
||||
"requires": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.24"
|
||||
},
|
||||
"dependencies": {
|
||||
"mime-db": {
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"requires": {
|
||||
"mime-db": "1.40.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
@ -2894,11 +2906,6 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"url-join": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/url-join/-/url-join-4.0.0.tgz",
|
||||
"integrity": "sha1-TTNA6AfTdzvamZH4MFrNzCpmXSo="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@ -2963,6 +2970,21 @@
|
||||
"defaults": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/whatwg-url/-/whatwg-url-7.0.0.tgz",
|
||||
"integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==",
|
||||
"requires": {
|
||||
"lodash.sortby": "^4.7.0",
|
||||
"tr46": "^1.0.1",
|
||||
"webidl-conversions": "^4.0.2"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://verdaccio.lossless.one/which/-/which-1.3.1.tgz",
|
||||
@ -3039,14 +3061,14 @@
|
||||
}
|
||||
},
|
||||
"x-xss-protection": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/x-xss-protection/-/x-xss-protection-1.1.0.tgz",
|
||||
"integrity": "sha512-rx3GzJlgEeZ08MIcDsU2vY2B1QEriUKJTSiNHHUIem6eg9pzVOr2TL3Y4Pd6TMAM5D5azGjcxqI62piITBDHVg=="
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/x-xss-protection/-/x-xss-protection-1.2.0.tgz",
|
||||
"integrity": "sha512-xN0kV+8XfOQM2OPPBdEbGtbvJNNP1pvZR7sE6d44cjJFQG4OiGDdienPg5iOUGswBTiGbBvtYDURd30BMJwwqg=="
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "10.1.1",
|
||||
"resolved": "https://verdaccio.lossless.one/xmlbuilder/-/xmlbuilder-10.1.1.tgz",
|
||||
"integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg=="
|
||||
"version": "13.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
||||
"integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ=="
|
||||
},
|
||||
"xmlhttprequest-ssl": {
|
||||
"version": "1.5.5",
|
||||
|
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartuniverse",
|
||||
"version": "1.0.52",
|
||||
"version": "1.0.64",
|
||||
"private": false,
|
||||
"description": "messaging service for your micro services",
|
||||
"main": "dist/index.js",
|
||||
@ -16,25 +16,26 @@
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.11",
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.9",
|
||||
"@types/node": "^12.0.7",
|
||||
"tslint": "^5.17.0",
|
||||
"@pushrocks/tapbundle": "^3.0.11",
|
||||
"@types/node": "^12.7.1",
|
||||
"tslint": "^5.18.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rxjs": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/lik": "^3.0.5",
|
||||
"@pushrocks/lik": "^3.0.10",
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartexpress": "^3.0.21",
|
||||
"@pushrocks/smartfile": "^7.0.2",
|
||||
"@pushrocks/smarthash": "^2.0.4",
|
||||
"@pushrocks/smartexpress": "^3.0.38",
|
||||
"@pushrocks/smartfile": "^7.0.4",
|
||||
"@pushrocks/smarthash": "^2.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrequest": "^1.1.15",
|
||||
"@pushrocks/smartrequest": "^1.1.16",
|
||||
"@pushrocks/smartrx": "^2.0.3",
|
||||
"@pushrocks/smartsocket": "^1.1.38",
|
||||
"@pushrocks/smarttime": "^3.0.7",
|
||||
"@pushrocks/smartsocket": "^1.1.44",
|
||||
"@pushrocks/smarttime": "^3.0.12",
|
||||
"@pushrocks/smartunique": "^3.0.1"
|
||||
},
|
||||
"files": [
|
||||
@ -42,6 +43,7 @@
|
||||
"ts_web/*",
|
||||
"dist/*",
|
||||
"dist_web/*",
|
||||
"dist_ts_web/*",
|
||||
"assets/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
|
19
test/test.ts
19
test/test.ts
@ -15,7 +15,7 @@ const testServerData = {
|
||||
|
||||
const testChannelData = {
|
||||
channelName: 'awesomeTestChannel',
|
||||
channelPass: 'awesomeChannelPAss'
|
||||
channelPass: 'awesomeChannelPass'
|
||||
};
|
||||
|
||||
tap.test('first test', async () => {
|
||||
@ -37,22 +37,25 @@ tap.test('create smartuniverse client', 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 () => {
|
||||
await testClientUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||
testClientUniverse.addChannel(testChannelData.channelName, testChannelData.channelPass);
|
||||
});
|
||||
|
||||
tap.test('should start the ClientUniverse', async () => {
|
||||
await testClientUniverse.start();
|
||||
})
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
tap.test('should send a message correctly', async () => {
|
||||
await testClientUniverse.sendMessage({
|
||||
messageText: 'hello',
|
||||
targetChannelName: testChannelData.channelName
|
||||
await (testClientUniverse.getChannel(testChannelData.channelName)).sendMessage({
|
||||
messageText: 'hello'
|
||||
});
|
||||
});
|
||||
|
||||
@ -71,7 +74,7 @@ tap.test('a second client should be able to subscibe', async () => {
|
||||
tap.test('should receive a message correctly', async () => {});
|
||||
|
||||
tap.test('should disconnect the client correctly', async () => {
|
||||
testClientUniverse.close();
|
||||
testClientUniverse.stop();
|
||||
});
|
||||
|
||||
tap.test('should end the server correctly', async tools => {
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Client classes
|
||||
export * from './smartuniverse.classes.clientuniverse';
|
||||
export * from './smartuniverse.classes.clientuniversechannel';
|
||||
export * from './smartuniverse.classes.clientuniversemessage';
|
||||
|
||||
// Server classes
|
||||
export * from './smartuniverse.classes.universe';
|
||||
|
@ -1,4 +1,8 @@
|
||||
export type IServerCallActions = 'subscribe' | 'sendmessage' | 'unsubscribe';
|
||||
export type IServerCallActions =
|
||||
| 'channelSubscription'
|
||||
| 'processMessage'
|
||||
| 'channelUnsubscribe'
|
||||
| 'terminateConnection';
|
||||
|
||||
/**
|
||||
* the interface for a subscription
|
||||
|
@ -1,4 +0,0 @@
|
||||
export interface IAuthenticationRequest {
|
||||
channelName: string;
|
||||
password: string;
|
||||
}
|
@ -2,9 +2,11 @@ export interface IMessageCreator {
|
||||
messageText: string;
|
||||
payload?: string | number | any;
|
||||
payloadStringType?: 'Buffer' | 'string' | 'object';
|
||||
targetChannelName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface IUniverseMessage extends IMessageCreator {
|
||||
id: string;
|
||||
/**
|
||||
@ -12,4 +14,5 @@ export interface IUniverseMessage extends IMessageCreator {
|
||||
*/
|
||||
timestamp: number;
|
||||
passphrase: string;
|
||||
targetChannelName: string;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import * as url from 'url';
|
||||
|
||||
import * as interfaces from './interfaces';
|
||||
|
||||
import { ClientUniverseChannel, UniverseMessage } from './';
|
||||
import { ClientUniverseChannel, ClientUniverseMessage } from './';
|
||||
import { ClientUniverseCache } from './smartuniverse.classes.clientuniversecache';
|
||||
|
||||
export interface IClientOptions {
|
||||
@ -21,9 +21,7 @@ export interface IClientOptions {
|
||||
export class ClientUniverse {
|
||||
public options;
|
||||
public smartsocketClient: plugins.smartsocket.SmartsocketClient;
|
||||
public observableIntake: plugins.smartrx.ObservableIntake<UniverseMessage>;
|
||||
|
||||
public channelStore = new Objectmap<ClientUniverseChannel>();
|
||||
public observableIntake: plugins.smartrx.ObservableIntake<ClientUniverseMessage>;
|
||||
public clientUniverseCache = new ClientUniverseCache();
|
||||
|
||||
constructor(optionsArg: IClientOptions) {
|
||||
@ -34,15 +32,16 @@ export class ClientUniverse {
|
||||
* adds a channel to the channelcache
|
||||
* TODO: verify channel before adding it to the channel cache
|
||||
*/
|
||||
public async addChannel(channelNameArg: string, passphraseArg: string) {
|
||||
const existingChannel = await this.getChannel(channelNameArg);
|
||||
public addChannel(channelNameArg: string, passphraseArg: string) {
|
||||
const existingChannel = this.getChannel(channelNameArg);
|
||||
|
||||
if (existingChannel) {
|
||||
throw new Error('channel exists');
|
||||
}
|
||||
|
||||
// lets create the channel
|
||||
ClientUniverseChannel.createClientUniverseChannel(this, channelNameArg, passphraseArg);
|
||||
const clientUniverseChannel = ClientUniverseChannel.createClientUniverseChannel(this, channelNameArg, passphraseArg);
|
||||
return clientUniverseChannel;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,9 +49,8 @@ export class ClientUniverse {
|
||||
* @param channelName
|
||||
* @param passphraseArg
|
||||
*/
|
||||
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
|
||||
await this.checkConnection();
|
||||
const clientUniverseChannel = this.channelStore.find(channel => {
|
||||
public getChannel(channelName: string): ClientUniverseChannel {
|
||||
const clientUniverseChannel = this.clientUniverseCache.channelMap.find(channel => {
|
||||
return channel.name === channelName;
|
||||
});
|
||||
return clientUniverseChannel;
|
||||
@ -63,27 +61,16 @@ export class ClientUniverse {
|
||||
* @param messageArg
|
||||
*/
|
||||
public removeChannel(channelNameArg, notifyServer = true) {
|
||||
const clientUniverseChannel = this.channelStore.findOneAndRemove(channelItemArg => {
|
||||
const clientUniverseChannel = this.clientUniverseCache.channelMap.findOneAndRemove(channelItemArg => {
|
||||
return channelItemArg.name === channelNameArg;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* sends a message towards the server
|
||||
* @param messageArg
|
||||
*/
|
||||
public async sendMessage(messageArg: interfaces.IMessageCreator) {
|
||||
public async start() {
|
||||
await this.checkConnection();
|
||||
const requestBody: interfaces.IUniverseMessage = {
|
||||
id: plugins.smartunique.shortId(),
|
||||
timestamp: Date.now(),
|
||||
passphrase: (await this.getChannel(messageArg.targetChannelName)).passphrase,
|
||||
...messageArg
|
||||
};
|
||||
// TODO: User websocket connection if available
|
||||
}
|
||||
|
||||
public close() {
|
||||
public stop() {
|
||||
this.smartsocketClient.disconnect();
|
||||
}
|
||||
|
||||
@ -91,7 +78,7 @@ export class ClientUniverse {
|
||||
* checks the connection towards a universe server
|
||||
* since password validation is done through other means, a connection should always be possible
|
||||
*/
|
||||
private async checkConnection(): Promise<void> {
|
||||
public async checkConnection(): Promise<void> {
|
||||
if (!this.smartsocketClient && !this.observableIntake) {
|
||||
const parsedURL = url.parse(this.options.serverAddress);
|
||||
const socketConfig: plugins.smartsocket.ISmartsocketClientOptions = {
|
||||
@ -101,7 +88,6 @@ export class ClientUniverse {
|
||||
role: 'UniverseClient',
|
||||
url: parsedURL.protocol + '//' + parsedURL.hostname
|
||||
};
|
||||
console.log(socketConfig);
|
||||
this.smartsocketClient = new SmartsocketClient(socketConfig);
|
||||
this.observableIntake = new plugins.smartrx.ObservableIntake();
|
||||
|
||||
@ -110,18 +96,35 @@ export class ClientUniverse {
|
||||
/**
|
||||
* should handle a forced unsubscription by the server
|
||||
*/
|
||||
const unsubscribe = new plugins.smartsocket.SocketFunction({
|
||||
const socketFunctionUnsubscribe = new plugins.smartsocket.SocketFunction({
|
||||
funcName: 'unsubscribe',
|
||||
allowedRoles: [],
|
||||
funcDef: async (data: interfaces.IServerUnsubscribeActionPayload) => {}
|
||||
funcDef: async (data: interfaces.IServerUnsubscribeActionPayload) => {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* should handle a message reception
|
||||
* handles message reception
|
||||
*/
|
||||
const receiveMessage = async () => {};
|
||||
const socketFunctionProcessMessage = new plugins.smartsocket.SocketFunction({
|
||||
funcName: 'processMessage',
|
||||
allowedRoles: [],
|
||||
funcDef: async (messageDescriptorArg: interfaces.IUniverseMessage) => {
|
||||
plugins.smartlog.defaultLogger.log('info', 'Got message from server');
|
||||
this.observableIntake.push(ClientUniverseMessage.createMessageFromMessageDescriptor(messageDescriptorArg));
|
||||
}
|
||||
});
|
||||
|
||||
// add functions
|
||||
this.smartsocketClient.addSocketFunction(socketFunctionUnsubscribe);
|
||||
this.smartsocketClient.addSocketFunction(socketFunctionProcessMessage);
|
||||
|
||||
await this.smartsocketClient.connect();
|
||||
plugins.smartlog.defaultLogger.log('info', 'universe client connected successfully');
|
||||
await this.clientUniverseCache.channelMap.forEach(async clientUniverseChannelArg => {
|
||||
await clientUniverseChannelArg.subscribe();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
import * as plugins from './smartuniverse.plugins';
|
||||
import { ClientUniverseChannel } from './smartuniverse.classes.clientuniversechannel';
|
||||
|
||||
/**
|
||||
* a cache for clients
|
||||
* keeps track of which messages have already been received
|
||||
* good for deduplication in mesh environments
|
||||
*/
|
||||
export class ClientUniverseCache {}
|
||||
export class ClientUniverseCache {
|
||||
public channelMap = new plugins.lik.Objectmap<ClientUniverseChannel>();
|
||||
}
|
||||
|
@ -13,18 +13,17 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
||||
* @param channelNameArg
|
||||
* @param passphraseArg
|
||||
*/
|
||||
public static async createClientUniverseChannel(
|
||||
public static createClientUniverseChannel(
|
||||
clientUniverseArg: ClientUniverse,
|
||||
channelNameArg: string,
|
||||
passphraseArg: string
|
||||
): Promise<ClientUniverseChannel> {
|
||||
): ClientUniverseChannel {
|
||||
const clientChannel = new ClientUniverseChannel(
|
||||
clientUniverseArg,
|
||||
channelNameArg,
|
||||
passphraseArg
|
||||
);
|
||||
clientUniverseArg.channelStore.add(clientChannel);
|
||||
await clientChannel.subscribe();
|
||||
clientUniverseArg.clientUniverseCache.channelMap.add(clientChannel);
|
||||
return clientChannel;
|
||||
}
|
||||
|
||||
@ -37,10 +36,10 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
||||
public passphrase: string;
|
||||
|
||||
// refs
|
||||
public clientUniverse: ClientUniverse;
|
||||
public clientUniverseRef: ClientUniverse;
|
||||
|
||||
constructor(clientUniverseArg: ClientUniverse, nameArg: string, passphraseArg: string) {
|
||||
this.clientUniverse = clientUniverseArg;
|
||||
this.clientUniverseRef = clientUniverseArg;
|
||||
this.name = nameArg;
|
||||
this.passphrase = passphraseArg;
|
||||
}
|
||||
@ -50,11 +49,29 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
||||
* tells the universe about this instances interest into a channel
|
||||
*/
|
||||
public async subscribe() {
|
||||
const serverCallActionName: interfaces.IServerCallActions = 'subscribe';
|
||||
const serverCallActionName: interfaces.IServerCallActions = 'channelSubscription';
|
||||
const serverCallActionPayload: interfaces.IServerCallSubscribeActionPayload = {
|
||||
name: this.name,
|
||||
passphrase: this.passphrase
|
||||
};
|
||||
this.clientUniverse.smartsocketClient.serverCall(serverCallActionName, serverCallActionPayload);
|
||||
await this.clientUniverseRef.smartsocketClient.serverCall(serverCallActionName, serverCallActionPayload);
|
||||
}
|
||||
|
||||
/**
|
||||
* sends a message towards the server
|
||||
* @param messageArg
|
||||
*/
|
||||
public async sendMessage(messageArg: interfaces.IMessageCreator) {
|
||||
await this.clientUniverseRef.checkConnection();
|
||||
const universeMessageToSend: interfaces.IUniverseMessage = {
|
||||
id: plugins.smartunique.shortId(),
|
||||
timestamp: Date.now(),
|
||||
passphrase: this.passphrase,
|
||||
targetChannelName: this.name,
|
||||
messageText: messageArg.messageText,
|
||||
payload: messageArg.payload,
|
||||
payloadStringType: messageArg.payloadStringType
|
||||
};
|
||||
await this.clientUniverseRef.smartsocketClient.serverCall('processMessage', universeMessageToSend);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,15 @@
|
||||
import * as plugins from './smartuniverse.plugins';
|
||||
|
||||
import * as interfaces from './interfaces';
|
||||
import { IUniverseMessage } from './interfaces';
|
||||
|
||||
export class ClientUniverseMessage implements interfaces.IUniverseMessage {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
public static createMessageFromPayload(messageDescriptor: interfaces.IUniverseMessage) {}
|
||||
public static createMessageFromMessageDescriptor(messageDescriptor: interfaces.IUniverseMessage) {
|
||||
const clientuniverseMessage = new ClientUniverseMessage(messageDescriptor);
|
||||
return clientuniverseMessage;
|
||||
}
|
||||
|
||||
// ========
|
||||
// INSTANCE
|
||||
@ -24,11 +26,14 @@ export class ClientUniverseMessage implements interfaces.IUniverseMessage {
|
||||
public payloadStringType;
|
||||
public targetChannelName: string;
|
||||
|
||||
constructor(messageArg: IUniverseMessage, payloadArg) {
|
||||
constructor(messageArg: interfaces.IUniverseMessage) {
|
||||
for (const key of Object.keys(messageArg)) {
|
||||
this[key] = messageArg[key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gets json for payload
|
||||
*/
|
||||
getAsJsonForPayload() {}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import { UniverseCache, UniverseChannel, UniverseMessage } from './';
|
||||
import * as paths from './smartuniverse.paths';
|
||||
|
||||
import * as interfaces from './interfaces';
|
||||
import { UniverseConnectionManager } from './smartuniverse.classes.universeconnectionmanager';
|
||||
import { UniverseConnection } from './smartuniverse.classes.universeconnection';
|
||||
|
||||
export interface ISmartUniverseConstructorOptions {
|
||||
@ -14,12 +13,11 @@ export interface ISmartUniverseConstructorOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* main class that setsup a Universe
|
||||
* main class that setups a Universe
|
||||
*/
|
||||
export class Universe {
|
||||
// subinstances
|
||||
public universeCache: UniverseCache;
|
||||
public universeConnectionManager: UniverseConnectionManager;
|
||||
|
||||
// options
|
||||
private options: ISmartUniverseConstructorOptions;
|
||||
@ -36,8 +34,7 @@ export class Universe {
|
||||
|
||||
constructor(optionsArg: ISmartUniverseConstructorOptions) {
|
||||
this.options = optionsArg;
|
||||
this.universeCache = new UniverseCache(this.options.messageExpiryInMilliseconds);
|
||||
this.universeConnectionManager = new UniverseConnectionManager();
|
||||
this.universeCache = new UniverseCache(this, this.options.messageExpiryInMilliseconds);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,8 +59,8 @@ export class Universe {
|
||||
/**
|
||||
* adds a channel to the Universe
|
||||
*/
|
||||
public async addChannel(nameArg: string, passphraseArg: string) {
|
||||
const newChannel = UniverseChannel.createChannel(this.universeCache, nameArg, passphraseArg);
|
||||
public addChannel(nameArg: string, passphraseArg: string) {
|
||||
const newChannel = UniverseChannel.createChannel(this, nameArg, passphraseArg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,28 +89,68 @@ export class Universe {
|
||||
// add the role to smartsocket
|
||||
this.smartsocket.addSocketRoles([ClientRole]);
|
||||
|
||||
const SubscriptionSocketFunction = new plugins.smartsocket.SocketFunction({
|
||||
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction({
|
||||
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
||||
funcName: 'channelSubscription',
|
||||
funcDef: async (dataArg: interfaces.IServerCallSubscribeActionPayload, socketConnectionArg) => {
|
||||
funcDef: async (
|
||||
dataArg: interfaces.IServerCallSubscribeActionPayload,
|
||||
socketConnectionArg
|
||||
) => {
|
||||
// run in "this context" of this class
|
||||
(() => {
|
||||
// TODO: properly add the connection
|
||||
await (async () => {
|
||||
const universeConnection = new UniverseConnection({
|
||||
socketConnection: socketConnectionArg,
|
||||
authenticationRequests: []
|
||||
})
|
||||
this.universeConnectionManager.addConnection(universeConnection);
|
||||
authenticationRequests: [dataArg]
|
||||
});
|
||||
await UniverseConnection.addConnectionToCache(this, universeConnection);
|
||||
return {
|
||||
'subscription status': 'success'
|
||||
};
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
const socketFunctionProcessMessage = new plugins.smartsocket.SocketFunction({
|
||||
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
|
||||
funcName: 'processMessage',
|
||||
funcDef: async (dataArg: interfaces.IUniverseMessage, socketConnectionArg) => {
|
||||
// run in "this" context of this class
|
||||
await (async () => {
|
||||
const universeConnection = UniverseConnection.findUniverseConnectionBySocketConnection(
|
||||
this.universeCache,
|
||||
socketConnectionArg
|
||||
);
|
||||
if (universeConnection) {
|
||||
plugins.smartlog.defaultLogger.log('ok', 'found UniverseConnection for socket for incoming message');
|
||||
} else {
|
||||
plugins.smartlog.defaultLogger.log('warn', '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) {
|
||||
const authenticatedMessage = unauthenticatedMessage;
|
||||
await this.universeCache.addMessage(authenticatedMessage);
|
||||
}
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// add socket functions
|
||||
this.smartsocket.addSocketFunction(socketFunctionSubscription);
|
||||
this.smartsocket.addSocketFunction(socketFunctionProcessMessage);
|
||||
|
||||
// add smartsocket to the running smartexpress app
|
||||
this.smartsocket.setExternalServer('smartexpress', this.smartexpressServer as any);
|
||||
// start everything
|
||||
await this.smartexpressServer.start();
|
||||
await this.smartsocket.start();
|
||||
console.log('started universe');
|
||||
plugins.smartlog.defaultLogger.log('success', 'started universe');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,6 +8,8 @@ import { Objectmap } from '@pushrocks/lik';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { rxjs } from '@pushrocks/smartrx';
|
||||
import { UniverseConnection } from './smartuniverse.classes.universeconnection';
|
||||
import { Universe } from './smartuniverse.classes.universe';
|
||||
|
||||
/**
|
||||
* universe store handles the creation, storage and retrieval of messages.
|
||||
@ -29,13 +31,22 @@ export class UniverseCache {
|
||||
*/
|
||||
public channelMap = new Objectmap<UniverseChannel>();
|
||||
|
||||
/**
|
||||
* stores all connections
|
||||
*/
|
||||
public connectionMap = new plugins.lik.Objectmap<UniverseConnection>();
|
||||
|
||||
/**
|
||||
* allows messages to be processed in a blacklist mode for further analysis
|
||||
*/
|
||||
public blackListChannel = new UniverseChannel(this, 'blacklist', 'nada');
|
||||
public blackListChannel: UniverseChannel;
|
||||
|
||||
constructor(standardMessageExpiryArg: number) {
|
||||
public universeRef: Universe;
|
||||
|
||||
constructor(universeArg: Universe, standardMessageExpiryArg: number) {
|
||||
this.universeRef = universeArg;
|
||||
this.standardMessageExpiry = standardMessageExpiryArg;
|
||||
this.blackListChannel = new UniverseChannel(this.universeRef, 'blacklist', 'nada');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,6 +58,9 @@ export class UniverseCache {
|
||||
messageArg.setUniverseCache(this);
|
||||
UniverseChannel.authorizeAMessageForAChannel(this, messageArg);
|
||||
this.messageMap.add(messageArg);
|
||||
messageArg.universeChannelList.forEach(universeChannel => {
|
||||
universeChannel.pushToClients(messageArg);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,10 @@
|
||||
import * as plugins from './smartuniverse.plugins';
|
||||
import * as interfaces from './interfaces';
|
||||
|
||||
import { Objectmap } from '@pushrocks/lik';
|
||||
import { UniverseCache } from './smartuniverse.classes.universecache';
|
||||
import { UniverseMessage } from './smartuniverse.classes.universemessage';
|
||||
import { UniverseConnection } from './smartuniverse.classes.universeconnection';
|
||||
import { Universe } from './smartuniverse.classes.universe';
|
||||
|
||||
/**
|
||||
* enables messages to stay within a certain scope.
|
||||
@ -18,12 +20,12 @@ export class UniverseChannel {
|
||||
* @param passphraseArg the secret thats used for a certain topic.
|
||||
*/
|
||||
public static createChannel(
|
||||
universeCacheArg: UniverseCache,
|
||||
universeArg: Universe,
|
||||
channelNameArg: string,
|
||||
passphraseArg: string
|
||||
) {
|
||||
const newChannel = new UniverseChannel(universeCacheArg, channelNameArg, passphraseArg);
|
||||
universeCacheArg.channelMap.add(newChannel);
|
||||
const newChannel = new UniverseChannel(universeArg, channelNameArg, passphraseArg);
|
||||
universeArg.universeCache.channelMap.add(newChannel);
|
||||
return newChannel;
|
||||
}
|
||||
|
||||
@ -41,10 +43,17 @@ export class UniverseChannel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* a static message authorization function that takes the UniverseCache
|
||||
* (where messages and channels are stored and their lifetime is managed)
|
||||
* and the universemessage to find a fitting channel for the message
|
||||
* @param universeCacheArg
|
||||
* @param universeMessageArg
|
||||
*/
|
||||
public static authorizeAMessageForAChannel(
|
||||
universeCacheArg: UniverseCache,
|
||||
universeMessageArg: UniverseMessage
|
||||
) {
|
||||
): UniverseChannel {
|
||||
const foundChannel = universeCacheArg.channelMap.find(universeChannel => {
|
||||
const result = universeChannel.authenticate(universeMessageArg);
|
||||
return result;
|
||||
@ -52,13 +61,22 @@ export class UniverseChannel {
|
||||
if (foundChannel) {
|
||||
universeMessageArg.authenticated = true;
|
||||
universeMessageArg.universeChannelList.add(foundChannel);
|
||||
plugins.smartlog.defaultLogger.log('ok', 'message authorized');
|
||||
return foundChannel;
|
||||
} else {
|
||||
universeMessageArg.authenticated = false;
|
||||
universeMessageArg.universeChannelList.add(universeCacheArg.blackListChannel);
|
||||
plugins.smartlog.defaultLogger.log('warn', 'message not valid');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static getUniverseChannelByName(universeRef: Universe, universeChannelName: string) {
|
||||
return universeRef.universeCache.channelMap.find(channelArg => {
|
||||
return channelArg.name === universeChannelName;
|
||||
});
|
||||
}
|
||||
|
||||
// ========
|
||||
// INSTANCE
|
||||
// ========
|
||||
@ -66,20 +84,23 @@ export class UniverseChannel {
|
||||
* the name of the channel
|
||||
*/
|
||||
public name: string;
|
||||
public universeCacheInstance: UniverseCache;
|
||||
public universeRef: Universe;
|
||||
|
||||
/**
|
||||
* the passphrase for the channel
|
||||
*/
|
||||
public passphrase: string;
|
||||
|
||||
constructor(universeCacheArg: UniverseCache, channelNameArg: string, passphraseArg: string) {
|
||||
constructor(universeArg: Universe, channelNameArg: string, passphraseArg: string) {
|
||||
this.universeRef = universeArg;
|
||||
this.name = channelNameArg;
|
||||
this.passphrase = passphraseArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* authenticates a client on the server side
|
||||
* authenticates a client on the server side by matching
|
||||
* # the messages channelName against the unverseChannel's name
|
||||
* # the messages password against the universeChannel's password
|
||||
*/
|
||||
public authenticate(universeMessageArg: UniverseMessage): boolean {
|
||||
return (
|
||||
@ -88,5 +109,29 @@ export class UniverseChannel {
|
||||
);
|
||||
}
|
||||
|
||||
public pushToClients(messageArg: UniverseMessage) {}
|
||||
/**
|
||||
* pushes a message to clients
|
||||
* @param messageArg
|
||||
*/
|
||||
public async pushToClients(messageArg: UniverseMessage) {
|
||||
const universeConnectionsWithChannelAccess: UniverseConnection[] = [];
|
||||
this.universeRef.universeCache.connectionMap.forEach(async socketConnection => {
|
||||
if (socketConnection.authenticatedChannels.includes(this)) {
|
||||
universeConnectionsWithChannelAccess.push(socketConnection);
|
||||
}
|
||||
});
|
||||
for (const universeConnection of universeConnectionsWithChannelAccess) {
|
||||
const smartsocket = universeConnection.socketConnection.smartsocketRef as plugins.smartsocket.Smartsocket;
|
||||
const universeMessageToSend: interfaces.IUniverseMessage = {
|
||||
id: messageArg.id,
|
||||
timestamp: messageArg.timestamp,
|
||||
passphrase: messageArg.passphrase,
|
||||
targetChannelName: this.name,
|
||||
messageText: messageArg.messageText,
|
||||
payload: messageArg.payload,
|
||||
payloadStringType: messageArg.payloadStringType
|
||||
};
|
||||
smartsocket.clientCall('processMessage', universeMessageToSend, universeConnection.socketConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,101 @@
|
||||
import * as plugins from './smartuniverse.plugins';
|
||||
import * as interfaces from './interfaces';
|
||||
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||
import { UniverseCache } from './smartuniverse.classes.universecache';
|
||||
import { Universe } from './smartuniverse.classes.universe';
|
||||
|
||||
/**
|
||||
* represents a connection to the universe
|
||||
*/
|
||||
export class UniverseConnection {
|
||||
public terminatedDeferred = plugins.smartpromise.defer();
|
||||
/**
|
||||
*
|
||||
* @param universeConnectionArg
|
||||
*/
|
||||
public static async addConnectionToCache(
|
||||
universeRef: Universe,
|
||||
universeConnectionArg: UniverseConnection
|
||||
) {
|
||||
let universeConnection = universeConnectionArg;
|
||||
universeConnection = await UniverseConnection.deduplicateUniverseConnection(
|
||||
universeRef.universeCache,
|
||||
universeConnection
|
||||
);
|
||||
universeConnection = await UniverseConnection.authenticateAuthenticationRequests(
|
||||
universeRef,
|
||||
universeConnection
|
||||
);
|
||||
universeRef.universeCache.connectionMap.add(universeConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
* deduplicates UniverseConnections
|
||||
*/
|
||||
public static async deduplicateUniverseConnection(
|
||||
universeCache: UniverseCache,
|
||||
universeConnectionArg: UniverseConnection
|
||||
): Promise<UniverseConnection> {
|
||||
let connectionToReturn: UniverseConnection;
|
||||
universeCache.connectionMap.forEach(async existingConnection => {
|
||||
if (existingConnection.socketConnection === universeConnectionArg.socketConnection) {
|
||||
connectionToReturn = await this.mergeUniverseConnections(
|
||||
existingConnection,
|
||||
universeConnectionArg
|
||||
);
|
||||
}
|
||||
});
|
||||
if (!connectionToReturn) {
|
||||
connectionToReturn = universeConnectionArg;
|
||||
}
|
||||
return connectionToReturn;
|
||||
}
|
||||
|
||||
/**
|
||||
* authenticate AuthenticationRequests
|
||||
*/
|
||||
public static async authenticateAuthenticationRequests(
|
||||
universeRef: Universe,
|
||||
universeConnectionArg: UniverseConnection
|
||||
): Promise<UniverseConnection> {
|
||||
for (const authenticationRequest of universeConnectionArg.authenticationRequests) {
|
||||
const universeChannelToAuthenticateAgainst = UniverseChannel.getUniverseChannelByName(universeRef, authenticationRequest.name);
|
||||
if (universeChannelToAuthenticateAgainst.passphrase === authenticationRequest.passphrase) {
|
||||
universeConnectionArg.authenticatedChannels.push(universeChannelToAuthenticateAgainst);
|
||||
}
|
||||
}
|
||||
return universeConnectionArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* merges two UniverseConnections
|
||||
*/
|
||||
public static mergeUniverseConnections(
|
||||
connectionArg1: UniverseConnection,
|
||||
connectionArg2: UniverseConnection
|
||||
) {
|
||||
return connectionArg1;
|
||||
}
|
||||
|
||||
/**
|
||||
* finds a UniverseConnection by providing a socket connection
|
||||
*/
|
||||
public static findUniverseConnectionBySocketConnection(
|
||||
universeCache: UniverseCache,
|
||||
socketConnectionArg: plugins.smartsocket.SocketConnection
|
||||
): UniverseConnection {
|
||||
const universeConnection = universeCache.connectionMap.find(universeConnectionArg => {
|
||||
return universeConnectionArg.socketConnection === socketConnectionArg;
|
||||
});
|
||||
return universeConnection;
|
||||
}
|
||||
|
||||
public terminatedDeferred = plugins.smartpromise.defer();
|
||||
|
||||
/**
|
||||
* the socketClient to ping
|
||||
*/
|
||||
public socketConnection: plugins.smartsocket.SocketConnection;
|
||||
public authenticationRequests = [];
|
||||
public authenticationRequests: interfaces.IServerCallSubscribeActionPayload[] = [];
|
||||
public subscribedChannels: UniverseChannel[] = [];
|
||||
public authenticatedChannels: UniverseChannel[] = [];
|
||||
public failedToJoinChannels: UniverseChannel[] = [];
|
||||
@ -20,16 +103,16 @@ export class UniverseConnection {
|
||||
/**
|
||||
* terminates the connection
|
||||
*/
|
||||
public terminateConnection () {
|
||||
public terminateConnection() {
|
||||
this.socketConnection.socket.disconnect();
|
||||
this.terminatedDeferred.resolve();
|
||||
}
|
||||
|
||||
constructor(optionsArg: {
|
||||
socketConnection: plugins.smartsocket.SocketConnection;
|
||||
authenticationRequests
|
||||
authenticationRequests: interfaces.IServerCallSubscribeActionPayload[];
|
||||
}) {
|
||||
// TODO: check if this is correct
|
||||
this.socketConnection.socket.disconnect();
|
||||
this.authenticationRequests = optionsArg.authenticationRequests;
|
||||
this.socketConnection = optionsArg.socketConnection;
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +0,0 @@
|
||||
import * as plugins from './smartuniverse.plugins';
|
||||
import { UniverseConnection } from './smartuniverse.classes.universeconnection';
|
||||
|
||||
/**
|
||||
* manages connections to a universe
|
||||
*/
|
||||
export class UniverseConnectionManager {
|
||||
public connectionMap = new plugins.lik.Objectmap<UniverseConnection>();
|
||||
|
||||
public async addConnection(universeConnectionArg: UniverseConnection) {
|
||||
let universeConnection = universeConnectionArg;
|
||||
universeConnection = await this.deduplicateUniverseConnection(universeConnection);
|
||||
universeConnection = await this.authenticateAuthenticationRequests(universeConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
* deduplicates UniverseConnections
|
||||
*/
|
||||
public async deduplicateUniverseConnection (universeConnectionArg: UniverseConnection): Promise<UniverseConnection> {
|
||||
let connectionToReturn: UniverseConnection;
|
||||
this.connectionMap.forEach(async existingConnection => {
|
||||
if (existingConnection.socketConnection = universeConnectionArg.socketConnection) {
|
||||
connectionToReturn = await this.mergeUniverseConnections(existingConnection, universeConnectionArg);
|
||||
}
|
||||
});
|
||||
if (!connectionToReturn) {
|
||||
connectionToReturn = universeConnectionArg;
|
||||
}
|
||||
return connectionToReturn;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* authenticate AuthenticationRequests
|
||||
*/
|
||||
public authenticateAuthenticationRequests(universeConnectionArg): Promise<UniverseConnection> {
|
||||
// TODO: authenticate connections
|
||||
return universeConnectionArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* merges two UniverseConnections
|
||||
*/
|
||||
public mergeUniverseConnections (connectionArg1: UniverseConnection, connectionArg2: UniverseConnection) {
|
||||
// TODO: merge connections
|
||||
return connectionArg1;
|
||||
}
|
||||
}
|
@ -7,23 +7,28 @@ import { Timer, TimeStamp } from '@pushrocks/smarttime';
|
||||
import { Universe } from './smartuniverse.classes.universe';
|
||||
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||
import { UniverseCache } from './smartuniverse.classes.universecache';
|
||||
import { IUniverseMessage } from './interfaces';
|
||||
import { SocketConnection } from '@pushrocks/smartsocket';
|
||||
|
||||
/**
|
||||
* represents a message within a universe
|
||||
* acts as a container to save message states like authentication status
|
||||
*/
|
||||
export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
public id: string;
|
||||
public static createMessageFromPayload(socketConnectionArg: SocketConnection, dataArg: interfaces.IUniverseMessage) {
|
||||
const universeMessageInstance = new UniverseMessage(dataArg);
|
||||
universeMessageInstance.socketConnection = socketConnectionArg;
|
||||
return universeMessageInstance;
|
||||
}
|
||||
|
||||
public id: string;
|
||||
public timestamp: number;
|
||||
public smartTimestamp: TimeStamp;
|
||||
|
||||
public messageText: string;
|
||||
public passphrase: string;
|
||||
public payload: any;
|
||||
public payloadStringType;
|
||||
public targetChannelName: string;
|
||||
public socketConnection: SocketConnection;
|
||||
|
||||
/**
|
||||
* the UniverseCache the message is attached to
|
||||
@ -38,7 +43,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
/**
|
||||
* wether the message is authenticated
|
||||
*/
|
||||
public authenticated: boolean = null;
|
||||
public authenticated: boolean = false;
|
||||
|
||||
/**
|
||||
* a destruction timer for this message
|
||||
@ -50,7 +55,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
* @param messageArg
|
||||
* @param attachedPayloadArg
|
||||
*/
|
||||
constructor(messageDescriptor: IUniverseMessage) {
|
||||
constructor(messageDescriptor: interfaces.IUniverseMessage) {
|
||||
this.smartTimestamp = new TimeStamp(this.timestamp);
|
||||
this.messageText = messageDescriptor.messageText;
|
||||
this.targetChannelName = messageDescriptor.targetChannelName;
|
||||
@ -64,6 +69,10 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
this.universeCache = universeCacheArg;
|
||||
}
|
||||
|
||||
public setTargetChannel() {
|
||||
|
||||
}
|
||||
|
||||
public setDestructionTimer(selfdestructAfterArg: number) {
|
||||
if (selfdestructAfterArg) {
|
||||
this.destructionTimer = new Timer(selfdestructAfterArg);
|
||||
@ -82,7 +91,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
||||
* handles bad messages for further analysis
|
||||
*/
|
||||
public handleAsBadMessage() {
|
||||
console.log('received a bad message');
|
||||
plugins.smartlog.defaultLogger.log('warn', 'received a bad message');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,6 +9,7 @@ import * as smarthash from '@pushrocks/smarthash';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartexpress from '@pushrocks/smartexpress';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
@ -22,6 +23,7 @@ export {
|
||||
smartdelay,
|
||||
smartexpress,
|
||||
smartfile,
|
||||
smartlog,
|
||||
smartpromise,
|
||||
smartrx,
|
||||
smartrequest,
|
||||
|
Reference in New Issue
Block a user