Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
4678e44d16 | |||
af9f590349 | |||
d43ad80784 | |||
b1017121ea | |||
a8a91b4db2 | |||
67c4b06c4d | |||
7693b52066 | |||
30a02ae48b | |||
241182ed2e | |||
3d82038ec3 | |||
300d62ed12 | |||
a5e849aa17 | |||
83807d7c5c | |||
39d3a0f2f8 | |||
904a48d414 | |||
e2acb28756 | |||
92e4379bd2 |
200
package-lock.json
generated
200
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.35",
|
"version": "1.0.44",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -14,6 +14,26 @@
|
|||||||
"nan": "^2.9.2"
|
"nan": "^2.9.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/code-frame": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
|
||||||
|
"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==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chalk": "^2.0.0",
|
||||||
|
"esutils": "^2.0.2",
|
||||||
|
"js-tokens": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@gitzone/tsbuild": {
|
"@gitzone/tsbuild": {
|
||||||
"version": "2.1.8",
|
"version": "2.1.8",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.8.tgz",
|
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.8.tgz",
|
||||||
@ -296,20 +316,13 @@
|
|||||||
"integrity": "sha512-jmrJMUEmBCWChWK8CIcx4Vw3wv/8OgVNmkaxJrbs+WMaoRUfJtpWWJfrAwwHWt9ZXJbarJ+CwfwfYiiZXymndQ=="
|
"integrity": "sha512-jmrJMUEmBCWChWK8CIcx4Vw3wv/8OgVNmkaxJrbs+WMaoRUfJtpWWJfrAwwHWt9ZXJbarJ+CwfwfYiiZXymndQ=="
|
||||||
},
|
},
|
||||||
"@pushrocks/smartrequest": {
|
"@pushrocks/smartrequest": {
|
||||||
"version": "1.1.14",
|
"version": "1.1.15",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.14.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartrequest/-/smartrequest-1.1.15.tgz",
|
||||||
"integrity": "sha512-+sDQB4Mxvpn8BIMPUQ7TPSCKUVMln3tHC4rp4pmfEHmBQK+g1XwtNr59aMA9kEoBDMt7li1hu+1cs+SNsWt6Gw==",
|
"integrity": "sha512-MBOOTTdqWy+HvWS4Lt8jzITxF2hYyQ3/OjB28CpTAkPuKsDyLi9HEngvFufKu5EbKwBGwCVdeF7vQSpLRSoDtA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/form-data": "^2.2.1",
|
"@types/form-data": "^2.2.1",
|
||||||
"form-data": "^2.3.2"
|
"form-data": "^2.3.3"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@pushrocks/smartpromise": {
|
|
||||||
"version": "2.0.5",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
|
||||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartrx": {
|
"@pushrocks/smartrx": {
|
||||||
@ -350,28 +363,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartsocket": {
|
"@pushrocks/smartsocket": {
|
||||||
"version": "1.1.27",
|
"version": "1.1.32",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.27.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.1.32.tgz",
|
||||||
"integrity": "sha512-rxHWOoGTbDyRi+LQRTFe1kgnlik8uPDjRpz60U49yQU7mexGbeK6HPevgaiQH6wsmorrN64KMWCnwCrPAFQDXA==",
|
"integrity": "sha512-wqc62xt7ollhGnE34076h5Y8ZwNHlK8p14WomXEDOiR6QFiPcF5L3hf2OzJTWPvMycNoa/iWGqkU0Ceo8coj+A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/lik": "^3.0.4",
|
"@pushrocks/lik": "^3.0.5",
|
||||||
"@pushrocks/smartdelay": "^2.0.2",
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
|
"@pushrocks/smartexpress": "^3.0.18",
|
||||||
"@pushrocks/smarthash": "^2.0.4",
|
"@pushrocks/smarthash": "^2.0.4",
|
||||||
"@pushrocks/smartlog": "^2.0.16",
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@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.14",
|
||||||
"socket.io": "^2.2.0",
|
"socket.io": "^2.2.0",
|
||||||
"socket.io-client": "^2.2.0"
|
"socket.io-client": "^2.2.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@pushrocks/smartpromise": {
|
|
||||||
"version": "2.0.5",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
|
||||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smarttime": {
|
"@pushrocks/smarttime": {
|
||||||
@ -386,6 +393,17 @@
|
|||||||
"luxon": "^1.12.1"
|
"luxon": "^1.12.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@pushrocks/smartunique": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartunique/-/smartunique-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-xBu9ZB4C0BA0S/pbFFZn2ItPfnodPKpzrYIq1yN5XDs6OaookwcDF/iBwfS9+EYMSPENC9wAsOxg2RGMm4Qicw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/shortid": "^0.0.29",
|
||||||
|
"@types/uuid": "^3.0.0",
|
||||||
|
"shortid": "^2.2.8",
|
||||||
|
"uuid": "^3.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@pushrocks/tapbundle": {
|
"@pushrocks/tapbundle": {
|
||||||
"version": "3.0.9",
|
"version": "3.0.9",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.9.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.9.tgz",
|
||||||
@ -522,9 +540,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "11.13.4",
|
"version": "11.13.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-11.13.4.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-11.13.7.tgz",
|
||||||
"integrity": "sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ=="
|
"integrity": "sha512-suFHr6hcA9mp8vFrZTgrmqW2ZU3mbWsryQtQlY/QvwTISCw7nw/j+bCQPPohqmskhmqa5wLNuMHTTsc+xf1MQg=="
|
||||||
},
|
},
|
||||||
"@types/range-parser": {
|
"@types/range-parser": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
@ -566,6 +584,14 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/uuid": {
|
||||||
|
"version": "3.4.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.4.tgz",
|
||||||
|
"integrity": "sha512-tPIgT0GUmdJQNSHxp0X2jnpQfBSTfGxUMc/2CXBU2mnyTFVYVa2ojpoQ74w0U2yn2vw3jnC640+77lkFFpdVDw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/vinyl": {
|
"@types/vinyl": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fvinyl/-/vinyl-2.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fvinyl/-/vinyl-2.0.3.tgz",
|
||||||
@ -624,10 +650,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
"version": "2.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://verdaccio.lossless.one/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"color-convert": "^1.9.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
@ -692,47 +721,6 @@
|
|||||||
"resolved": "https://verdaccio.lossless.one/aws4/-/aws4-1.8.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/aws4/-/aws4-1.8.0.tgz",
|
||||||
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
|
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
|
||||||
},
|
},
|
||||||
"babel-code-frame": {
|
|
||||||
"version": "6.26.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
|
|
||||||
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"chalk": "^1.1.3",
|
|
||||||
"esutils": "^2.0.2",
|
|
||||||
"js-tokens": "^3.0.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
|
||||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"chalk": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/chalk/-/chalk-1.1.3.tgz",
|
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-styles": "^2.2.1",
|
|
||||||
"escape-string-regexp": "^1.0.2",
|
|
||||||
"has-ansi": "^2.0.0",
|
|
||||||
"strip-ansi": "^3.0.0",
|
|
||||||
"supports-color": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"strip-ansi": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
|
||||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"backo2": {
|
"backo2": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://verdaccio.lossless.one/backo2/-/backo2-1.0.2.tgz",
|
"resolved": "https://verdaccio.lossless.one/backo2/-/backo2-1.0.2.tgz",
|
||||||
@ -885,26 +873,6 @@
|
|||||||
"ansi-styles": "^3.2.1",
|
"ansi-styles": "^3.2.1",
|
||||||
"escape-string-regexp": "^1.0.5",
|
"escape-string-regexp": "^1.0.5",
|
||||||
"supports-color": "^5.3.0"
|
"supports-color": "^5.3.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-styles": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"color-convert": "^1.9.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"supports-color": {
|
|
||||||
"version": "5.5.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-5.5.0.tgz",
|
|
||||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"has-flag": "^3.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"check-error": {
|
"check-error": {
|
||||||
@ -1511,23 +1479,6 @@
|
|||||||
"har-schema": "^2.0.0"
|
"har-schema": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"has-ansi": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/has-ansi/-/has-ansi-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
|
||||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"has-binary2": {
|
"has-binary2": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://verdaccio.lossless.one/has-binary2/-/has-binary2-1.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/has-binary2/-/has-binary2-1.0.3.tgz",
|
||||||
@ -1733,9 +1684,9 @@
|
|||||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
||||||
},
|
},
|
||||||
"js-tokens": {
|
"js-tokens": {
|
||||||
"version": "3.0.2",
|
"version": "4.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/js-tokens/-/js-tokens-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
|
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
@ -2681,10 +2632,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"supports-color": {
|
"supports-color": {
|
||||||
"version": "2.0.0",
|
"version": "5.5.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"has-flag": "^3.0.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"symbol-tree": {
|
"symbol-tree": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.2",
|
||||||
@ -2739,12 +2693,12 @@
|
|||||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.15.0",
|
"version": "5.16.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz",
|
||||||
"integrity": "sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==",
|
"integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"babel-code-frame": "^6.22.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",
|
||||||
|
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartuniverse",
|
"name": "@pushrocks/smartuniverse",
|
||||||
"version": "1.0.35",
|
"version": "1.0.44",
|
||||||
"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",
|
||||||
@ -9,6 +9,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
|
"testManual": "(tsrun test/test.ts)",
|
||||||
"build": "(tsbuild)",
|
"build": "(tsbuild)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
@ -16,8 +17,8 @@
|
|||||||
"@gitzone/tsbuild": "^2.1.8",
|
"@gitzone/tsbuild": "^2.1.8",
|
||||||
"@gitzone/tstest": "^1.0.20",
|
"@gitzone/tstest": "^1.0.20",
|
||||||
"@pushrocks/tapbundle": "^3.0.9",
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
"@types/node": "^11.13.4",
|
"@types/node": "^11.13.7",
|
||||||
"tslint": "^5.15.0",
|
"tslint": "^5.16.0",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@ -30,9 +31,10 @@
|
|||||||
"@pushrocks/smartfile": "^7.0.2",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"@pushrocks/smarthash": "^2.0.4",
|
"@pushrocks/smarthash": "^2.0.4",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smartrequest": "^1.1.14",
|
"@pushrocks/smartrequest": "^1.1.15",
|
||||||
"@pushrocks/smartrx": "^2.0.3",
|
"@pushrocks/smartrx": "^2.0.3",
|
||||||
"@pushrocks/smartsocket": "^1.1.27",
|
"@pushrocks/smartsocket": "^1.1.32",
|
||||||
"@pushrocks/smarttime": "^3.0.7"
|
"@pushrocks/smarttime": "^3.0.7",
|
||||||
|
"@pushrocks/smartunique": "^3.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
readme.md
22
readme.md
@ -1,16 +1,13 @@
|
|||||||
# @pushrocks/smartuniverse
|
# @pushrocks/smartuniverse
|
||||||
|
|
||||||
messaging service for micro services
|
messaging service for micro services
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
|
||||||
- [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
|
||||||
- [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
|
* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
|
||||||
- [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/)
|
||||||
- [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
|
||||||
[](https://gitlab.com/pushrocks/smartuniverse/commits/master)
|
[](https://gitlab.com/pushrocks/smartuniverse/commits/master)
|
||||||
[](https://gitlab.com/pushrocks/smartuniverse/commits/master)
|
[](https://gitlab.com/pushrocks/smartuniverse/commits/master)
|
||||||
[](https://www.npmjs.com/package/@pushrocks/smartuniverse)
|
[](https://www.npmjs.com/package/@pushrocks/smartuniverse)
|
||||||
@ -27,6 +24,11 @@ Use TypeScript for best in class instellisense.
|
|||||||
|
|
||||||
Think WhatsApp, but for your microservices architecture. It allows your services to securely talk to each other in **private, shielded channels** without having to expose anything to the outside world. This allows the use of **reactive programming across your entire stack**.
|
Think WhatsApp, but for your microservices architecture. It allows your services to securely talk to each other in **private, shielded channels** without having to expose anything to the outside world. This allows the use of **reactive programming across your entire stack**.
|
||||||
|
|
||||||
|
### Server side
|
||||||
|
|
||||||
|
every universe has a server that manages messages.
|
||||||
|
Think Kafka, but without Kafka.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import * as smartuniverse from '@pushrocks/smartuniverse';
|
import * as smartuniverse from '@pushrocks/smartuniverse';
|
||||||
|
|
||||||
@ -41,9 +43,13 @@ myUniverse.addChannel('awesomeChannel2', 'jhkjhfsdf87eerkjslkfja9');
|
|||||||
myUniverse.start(8765); // start the server and provide the port on which to listen on
|
myUniverse.start(8765); // start the server and provide the port on which to listen on
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Client side
|
||||||
|
|
||||||
|
All your microservices represents clients in the universe that may talk to each other using the universe server.
|
||||||
|
|
||||||
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.html)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
27
test/test.ts
27
test/test.ts
@ -5,13 +5,13 @@ import * as smartuniverse from '../ts/index';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
let testUniverse: smartuniverse.Universe;
|
let testUniverse: smartuniverse.Universe;
|
||||||
let testUniverseClient: smartuniverse.ClientUniverse;
|
let testClientUniverse: smartuniverse.ClientUniverse;
|
||||||
let testClientChannel: smartuniverse.ClientUniverseChannel;
|
let testClientChannel: smartuniverse.ClientUniverseChannel;
|
||||||
|
|
||||||
const testChannelData = {
|
const testChannelData = {
|
||||||
channelName: 'awesomeTestChannel',
|
channelName: 'awesomeTestChannel',
|
||||||
channelPass: 'awesomeChannelPAss'
|
channelPass: 'awesomeChannelPAss'
|
||||||
}
|
};
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
testUniverse = new smartuniverse.Universe({
|
testUniverse = new smartuniverse.Universe({
|
||||||
@ -25,31 +25,40 @@ tap.test('add a message to the SmartUniverse', async () => {
|
|||||||
|
|
||||||
// testing message handling
|
// testing message handling
|
||||||
tap.test('create smartuniverse client', async () => {
|
tap.test('create smartuniverse client', async () => {
|
||||||
testUniverseClient = new smartuniverse.ClientUniverse({
|
testClientUniverse = new smartuniverse.ClientUniverse({
|
||||||
serverAddress: 'http://localhost:8765'
|
serverAddress: 'http://localhost:8765'
|
||||||
});
|
});
|
||||||
expect(testUniverseClient).to.be.instanceof(smartuniverse.ClientUniverse);
|
expect(testClientUniverse).to.be.instanceof(smartuniverse.ClientUniverse);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should add a channel to the universe', async () => {
|
tap.test('should add a channel to the universe', async () => {
|
||||||
await testUniverse.addChannel('testChannel', 'testPassword');
|
await 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);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should get a observable correctly', async () => {
|
tap.test('should get a observable correctly', async () => {
|
||||||
testClientChannel = await testUniverseClient.getChannel(testChannelData.channelName, testChannelData.channelPass);
|
testClientChannel = await 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 testUniverseClient.sendMessage('greeting', {
|
await testClientUniverse.sendMessage({
|
||||||
anyBool: true
|
messageText: 'hello',
|
||||||
|
targetChannelName: testChannelData.channelName
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('universe should contain the sent message', async () => {
|
||||||
|
expect(testUniverse.universeCache.messageMap.getArray()[0].messageText).to.equal('hello');
|
||||||
|
});
|
||||||
|
|
||||||
tap.test('should receive a message correctly', async () => {});
|
tap.test('should receive a message correctly', async () => {});
|
||||||
|
|
||||||
tap.test('should disconnect the client correctly', async () => {
|
tap.test('should disconnect the client correctly', async () => {
|
||||||
testUniverseClient.close();
|
testClientUniverse.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should end the server correctly', async tools => {
|
tap.test('should end the server correctly', async tools => {
|
||||||
|
@ -12,4 +12,4 @@ export interface IServerPutMessageRequestBody {
|
|||||||
passphrase: string;
|
passphrase: string;
|
||||||
message: string;
|
message: string;
|
||||||
payload: any;
|
payload: any;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
export interface IUniverseMessage {
|
export interface IMessageCreator {
|
||||||
messageText: string;
|
messageText: string;
|
||||||
targetChannelName: string;
|
|
||||||
passphrase: string;
|
|
||||||
payload?: string | number | any;
|
payload?: string | number | any;
|
||||||
payloadStringType?: 'Buffer' | 'string' | 'object';
|
payloadStringType?: 'Buffer' | 'string' | 'object';
|
||||||
|
targetChannelName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IUniverseMessage extends IMessageCreator {
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* time of creation
|
||||||
|
*/
|
||||||
|
timestamp: number;
|
||||||
|
passphrase: string;
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,7 @@ import * as url from 'url';
|
|||||||
|
|
||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
import {
|
import { ClientUniverseChannel, UniverseMessage } from './';
|
||||||
ClientUniverseChannel,
|
|
||||||
UniverseMessage
|
|
||||||
} from './';
|
|
||||||
|
|
||||||
export interface IClientOptions {
|
export interface IClientOptions {
|
||||||
serverAddress: string;
|
serverAddress: string;
|
||||||
@ -31,41 +28,73 @@ export class ClientUniverse {
|
|||||||
this.options = optionsArg;
|
this.options = optionsArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendMessage(messageArg: interfaces.IUniverseMessage) {
|
/**
|
||||||
const requestBody: interfaces.IUniverseMessage = messageArg;
|
* adds a channel to the channelcache
|
||||||
const requestBodyString = JSON.stringify(requestBody);
|
* TODO: verify channel before adding it to the channel cache
|
||||||
// TODO: User websocket connection if available
|
*/
|
||||||
const response = await plugins.smartrequest.postJson(`${this.options.serverAddress}/sendmessage` , {
|
public async addChannel(channelNameArg: string, passphraseArg: string) {
|
||||||
requestBody: requestBodyString
|
const existingChannel = await this.getChannel(channelNameArg);
|
||||||
});
|
|
||||||
|
if (existingChannel) {
|
||||||
|
throw new Error('channel exists');
|
||||||
|
}
|
||||||
|
|
||||||
|
// lets create the channel
|
||||||
|
ClientUniverseChannel.createClientUniverseChannel(this, channelNameArg, passphraseArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getChannel(channelName: string, passphrase): Promise<ClientUniverseChannel> {
|
/**
|
||||||
|
* gets a channel from the channelcache
|
||||||
|
* @param channelName
|
||||||
|
* @param passphraseArg
|
||||||
|
*/
|
||||||
|
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
|
||||||
await this.checkConnection();
|
await this.checkConnection();
|
||||||
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
|
const clientUniverseChannel = this.channelCache.find(channel => {
|
||||||
this,
|
return channel.name === channelName;
|
||||||
channelName
|
});
|
||||||
);
|
|
||||||
this.channelCache.add(clientUniverseChannel);
|
|
||||||
return clientUniverseChannel;
|
return clientUniverseChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async sendMessage(messageArg: interfaces.IMessageCreator) {
|
||||||
|
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
|
||||||
|
const response = await plugins.smartrequest.postJson(
|
||||||
|
`${this.options.serverAddress}/sendmessage`,
|
||||||
|
{
|
||||||
|
requestBody
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public close() {
|
public close() {
|
||||||
this.socketClient.disconnect();
|
this.socketClient.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async checkConnection() {
|
/**
|
||||||
|
* 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> {
|
||||||
if (!this.socketClient && !this.observableIntake) {
|
if (!this.socketClient && !this.observableIntake) {
|
||||||
const parsedURL = url.parse(this.options.serverAddress);
|
const parsedURL = url.parse(this.options.serverAddress);
|
||||||
this.socketClient = new SmartsocketClient({
|
const socketConfig: plugins.smartsocket.ISmartsocketClientOptions = {
|
||||||
alias: process.env.SOCKET_ALIAS || 'someclient',
|
alias: process.env.SOCKET_ALIAS || 'someclient',
|
||||||
password: 'UniverseClient',
|
password: 'UniverseClient',
|
||||||
port: parseInt(parsedURL.port, 10),
|
port: parseInt(parsedURL.port, 10),
|
||||||
role: 'UniverseClient',
|
role: 'UniverseClient',
|
||||||
url: parsedURL.hostname
|
url: parsedURL.protocol + '//' + parsedURL.hostname
|
||||||
});
|
};
|
||||||
|
console.log(socketConfig);
|
||||||
|
this.socketClient = new SmartsocketClient(socketConfig);
|
||||||
this.observableIntake = new plugins.smartrx.ObservableIntake();
|
this.observableIntake = new plugins.smartrx.ObservableIntake();
|
||||||
this.socketClient.connect();
|
await this.socketClient.connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,24 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
// ======
|
// ======
|
||||||
// STATIC
|
// STATIC
|
||||||
// ======
|
// ======
|
||||||
|
/**
|
||||||
|
* creates a channel and adds it to the cache of clientUniverseArg
|
||||||
|
* @param clientUniverseArg
|
||||||
|
* @param channelNameArg
|
||||||
|
* @param passphraseArg
|
||||||
|
*/
|
||||||
public static async createClientUniverseChannel(
|
public static async createClientUniverseChannel(
|
||||||
clientUniverseArg: ClientUniverse,
|
clientUniverseArg: ClientUniverse,
|
||||||
channelName: string
|
channelNameArg: string,
|
||||||
|
passphraseArg: string
|
||||||
): Promise<ClientUniverseChannel> {
|
): Promise<ClientUniverseChannel> {
|
||||||
const clientChannel = new ClientUniverseChannel(clientUniverseArg);
|
const clientChannel = new ClientUniverseChannel(
|
||||||
await clientChannel.transmitSubscription();
|
clientUniverseArg,
|
||||||
|
channelNameArg,
|
||||||
|
passphraseArg
|
||||||
|
);
|
||||||
|
clientUniverseArg.channelCache.add(clientChannel);
|
||||||
|
await clientChannel.subscribe();
|
||||||
return clientChannel;
|
return clientChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,16 +32,24 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
// ========
|
// ========
|
||||||
|
|
||||||
|
// properties
|
||||||
|
public name: string;
|
||||||
|
public passphrase: string;
|
||||||
|
|
||||||
|
// refs
|
||||||
public clientUniverse: ClientUniverse;
|
public clientUniverse: ClientUniverse;
|
||||||
|
|
||||||
constructor(clientUniverseArg: ClientUniverse) {
|
constructor(clientUniverseArg: ClientUniverse, nameArg: string, passphraseArg: string) {
|
||||||
this.clientUniverse = clientUniverseArg;
|
this.clientUniverse = clientUniverseArg;
|
||||||
|
this.name = nameArg;
|
||||||
|
this.passphrase = passphraseArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 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 transmitSubscription() {
|
public async subscribe() {
|
||||||
this.clientUniverse.socketClient;
|
this.clientUniverse.socketClient;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,16 +6,23 @@ export class ClientUniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
// ======
|
// ======
|
||||||
// STATIC
|
// STATIC
|
||||||
// ======
|
// ======
|
||||||
public static createMessageFromPayload(messageArg: string, payloadArg: any) {
|
public static createMessageFromPayload(messageDescriptor: interfaces.IUniverseMessage) {}
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// ========
|
// ========
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
// ========
|
// ========
|
||||||
|
|
||||||
|
public id: string;
|
||||||
|
|
||||||
|
public timestamp: number;
|
||||||
|
public smartTimestamp: plugins.smarttime.TimeStamp;
|
||||||
|
|
||||||
|
public messageText: string;
|
||||||
|
public passphrase: string;
|
||||||
|
public payload: any;
|
||||||
|
public payloadStringType;
|
||||||
|
public targetChannelName: string;
|
||||||
constructor(messageArg, payloadArg) {}
|
constructor(messageArg, payloadArg) {}
|
||||||
|
|
||||||
getAsJsonForPayload () {
|
getAsJsonForPayload() {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,6 @@ export interface ISmartUniverseConstructorOptions {
|
|||||||
messageExpiryInMilliseconds: number;
|
messageExpiryInMilliseconds: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main class that setsup a Universe
|
* main class that setsup a Universe
|
||||||
*/
|
*/
|
||||||
@ -67,7 +65,7 @@ export class Universe {
|
|||||||
/**
|
/**
|
||||||
* initiates a server
|
* initiates a server
|
||||||
*/
|
*/
|
||||||
public async start(portArg: number | string) {
|
public async start(portArg: number) {
|
||||||
// lets create the base smartexpress server
|
// lets create the base smartexpress server
|
||||||
this.smartexpressServer = new plugins.smartexpress.Server({
|
this.smartexpressServer = new plugins.smartexpress.Server({
|
||||||
cors: true,
|
cors: true,
|
||||||
@ -79,19 +77,24 @@ export class Universe {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// lets create the http request route
|
// lets create the http request route
|
||||||
this.smartexpressServer.addRoute('/sendmessage', new Handler('POST', async (req, res) => {
|
this.smartexpressServer.addRoute(
|
||||||
this.universeCache.addMessage(req.body);
|
'/sendmessage',
|
||||||
}));
|
new Handler('POST', async (req, res) => {
|
||||||
|
const universeMessageInstance: UniverseMessage = new UniverseMessage(req.body);
|
||||||
|
this.universeCache.addMessage(universeMessageInstance);
|
||||||
|
|
||||||
|
res.status(200);
|
||||||
|
res.end();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// add websocket upgrade
|
// add websocket upgrade
|
||||||
this.smartsocket = new plugins.smartsocket.Smartsocket({
|
this.smartsocket = new plugins.smartsocket.Smartsocket({});
|
||||||
port: 12345 // fix this within smartsocket
|
|
||||||
});
|
|
||||||
|
|
||||||
// add a role for the clients
|
// add a role for the clients
|
||||||
const ClientRole = new plugins.smartsocket.SocketRole({
|
const ClientRole = new plugins.smartsocket.SocketRole({
|
||||||
name: 'clientuniverse',
|
name: 'UniverseClient',
|
||||||
passwordHash: 'clientuniverse' // authentication happens on another level
|
passwordHash: plugins.smarthash.sha256FromStringSync('UniverseClient') // authentication happens on another level
|
||||||
});
|
});
|
||||||
|
|
||||||
// add the role to smartsocket
|
// add the role to smartsocket
|
||||||
@ -100,17 +103,17 @@ export class Universe {
|
|||||||
const SubscriptionSocketFunction = new plugins.smartsocket.SocketFunction({
|
const SubscriptionSocketFunction = new plugins.smartsocket.SocketFunction({
|
||||||
allowedRoles: [ClientRole],
|
allowedRoles: [ClientRole],
|
||||||
funcName: 'channelSubscription',
|
funcName: 'channelSubscription',
|
||||||
funcDef: () => {} // TODO: implement an action upon connection of clients
|
funcDef: () => {
|
||||||
|
} // TODO: implement an action upon connection of clients
|
||||||
});
|
});
|
||||||
|
|
||||||
// add smartsocket to the running smartexpress app
|
// add smartsocket to the running smartexpress app
|
||||||
this.smartsocket.setExternalServer('express', this.smartexpressServer as any);
|
this.smartsocket.setExternalServer('smartexpress', this.smartexpressServer as any);
|
||||||
|
// start everything
|
||||||
// start the socket
|
|
||||||
this.smartsocket.start();
|
|
||||||
|
|
||||||
// start the smartexpress instance
|
|
||||||
await this.smartexpressServer.start();
|
await this.smartexpressServer.start();
|
||||||
|
await this.smartsocket.start();
|
||||||
|
console.log('started universe');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,10 +52,10 @@ export class UniverseCache {
|
|||||||
/**
|
/**
|
||||||
* Read a message from the UniverseCache
|
* Read a message from the UniverseCache
|
||||||
*/
|
*/
|
||||||
public readMessagesYoungerThan(unixTimeArg?: number): Observable<UniverseMessage> {
|
public readMessagesYoungerThan(unixTimeArg?: number, channelName?: string): Observable<UniverseMessage> {
|
||||||
const messageObservable = from(this.messageMap.getArray()).pipe(
|
const messageObservable = from(this.messageMap.getArray()).pipe(
|
||||||
filter(messageArg => {
|
filter(messageArg => {
|
||||||
return messageArg.timestamp.isYoungerThanMilliSeconds(this.destructionTime);
|
return messageArg.smartTimestamp.isYoungerThanMilliSeconds(this.destructionTime);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
return messageObservable;
|
return messageObservable;
|
||||||
|
@ -83,10 +83,12 @@ export class UniverseChannel {
|
|||||||
*/
|
*/
|
||||||
public authenticate(universeMessageArg: UniverseMessage): boolean {
|
public authenticate(universeMessageArg: UniverseMessage): boolean {
|
||||||
return (
|
return (
|
||||||
this.name === universeMessageArg.requestedChannelName &&
|
this.name === universeMessageArg.targetChannelName &&
|
||||||
this.passphrase === universeMessageArg.requestedChannelPassphrase
|
this.passphrase === universeMessageArg.passphrase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public pushToClients(messageArg: UniverseMessage) {}
|
public pushToClients(messageArg: UniverseMessage) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,34 +7,29 @@ import { Timer, TimeStamp } from '@pushrocks/smarttime';
|
|||||||
import { Universe } from './smartuniverse.classes.universe';
|
import { Universe } from './smartuniverse.classes.universe';
|
||||||
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||||
import { UniverseCache } from './smartuniverse.classes.universecache';
|
import { UniverseCache } from './smartuniverse.classes.universecache';
|
||||||
|
import { IUniverseMessage } from './interfaces';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 implements interfaces.IUniverseMessage {
|
||||||
/**
|
public id: string;
|
||||||
* public and unique id
|
|
||||||
* numeric ascending
|
public timestamp: number;
|
||||||
* adheres to time in milliseconds
|
public smartTimestamp: TimeStamp;
|
||||||
* -> meaning it describes the time of arrival
|
|
||||||
* -> two messages received at the same time will count up the second one
|
public messageText: string;
|
||||||
* -> avoids duplications of messages
|
public passphrase: string;
|
||||||
* -> may be changed to nanoseconds to ensure higher throughput
|
public payload: any;
|
||||||
*/
|
public payloadStringType;
|
||||||
public id: number;
|
public targetChannelName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the UniverseCache the message is attached to
|
* the UniverseCache the message is attached to
|
||||||
*/
|
*/
|
||||||
public universeCache: UniverseCache;
|
public universeCache: UniverseCache;
|
||||||
|
|
||||||
/**
|
|
||||||
* requestedChannelName
|
|
||||||
*/
|
|
||||||
public requestedChannelName: string;
|
|
||||||
public requestedChannelPassphrase: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enables unprotected grouping of messages for efficiency purposes.
|
* enables unprotected grouping of messages for efficiency purposes.
|
||||||
*/
|
*/
|
||||||
@ -46,19 +41,8 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
public authenticated: boolean = null;
|
public authenticated: boolean = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* time of creation
|
* a destruction timer for this message
|
||||||
*/
|
*/
|
||||||
public timestamp: TimeStamp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* the actual message
|
|
||||||
*/
|
|
||||||
public message: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* any attached payloads. Can be of binary format.
|
|
||||||
*/
|
|
||||||
public attachedPayload: any;
|
|
||||||
public destructionTimer: Timer; // a timer to take care of message destruction
|
public destructionTimer: Timer; // a timer to take care of message destruction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,17 +50,12 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
* @param messageArg
|
* @param messageArg
|
||||||
* @param attachedPayloadArg
|
* @param attachedPayloadArg
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(messageDescriptor: IUniverseMessage) {
|
||||||
messageArg: string,
|
this.smartTimestamp = new TimeStamp(this.timestamp);
|
||||||
requestedChannelNameArg: string,
|
this.messageText = messageDescriptor.messageText;
|
||||||
passphraseArg: string,
|
this.targetChannelName = messageDescriptor.targetChannelName;
|
||||||
attachedPayloadArg: any
|
this.passphrase = messageDescriptor.passphrase;
|
||||||
) {
|
this.payload = messageDescriptor.payload;
|
||||||
this.timestamp = new TimeStamp();
|
|
||||||
this.message = messageArg;
|
|
||||||
this.requestedChannelName = requestedChannelNameArg;
|
|
||||||
this.requestedChannelPassphrase = passphraseArg;
|
|
||||||
this.attachedPayload = attachedPayloadArg;
|
|
||||||
// prevent memory issues
|
// prevent memory issues
|
||||||
this.fallBackDestruction();
|
this.fallBackDestruction();
|
||||||
}
|
}
|
||||||
@ -102,7 +81,7 @@ export class UniverseMessage implements interfaces.IUniverseMessage {
|
|||||||
/**
|
/**
|
||||||
* handles bad messages for further analysis
|
* handles bad messages for further analysis
|
||||||
*/
|
*/
|
||||||
handleAsBadMessage() {
|
public handleAsBadMessage() {
|
||||||
console.log('received a bad message');
|
console.log('received a bad message');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
20
ts/smartuniverse.classes.universesubscription.ts
Normal file
20
ts/smartuniverse.classes.universesubscription.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import * as plugins from './smartuniverse.plugins';
|
||||||
|
import { UniverseChannel } from './smartuniverse.classes.universechannel';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* represents a subscription into a specific topic
|
||||||
|
*/
|
||||||
|
export class UniverseConnection {
|
||||||
|
/**
|
||||||
|
* the socketClient to ping
|
||||||
|
*/
|
||||||
|
socketclient: plugins.smartsocket.SmartsocketClient;
|
||||||
|
subscribedChannels: UniverseChannel[] = [];
|
||||||
|
authenticatedChannels: UniverseChannel[] = [];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -14,6 +14,7 @@ import * as smartrequest from '@pushrocks/smartrequest';
|
|||||||
import * as smartrx from '@pushrocks/smartrx';
|
import * as smartrx from '@pushrocks/smartrx';
|
||||||
import * as smartsocket from '@pushrocks/smartsocket';
|
import * as smartsocket from '@pushrocks/smartsocket';
|
||||||
import * as smarttime from '@pushrocks/smarttime';
|
import * as smarttime from '@pushrocks/smarttime';
|
||||||
|
import * as smartunique from '@pushrocks/smartunique';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
lik,
|
lik,
|
||||||
@ -25,5 +26,6 @@ export {
|
|||||||
smartrx,
|
smartrx,
|
||||||
smartrequest,
|
smartrequest,
|
||||||
smartsocket,
|
smartsocket,
|
||||||
smarttime
|
smarttime,
|
||||||
|
smartunique
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user