Compare commits

..

8 Commits

Author SHA1 Message Date
fb99848df1 1.1.41 2019-08-12 22:45:58 +02:00
1bd39d0755 fix(core): update 2019-08-12 22:45:58 +02:00
d24c5f628c 1.1.40 2019-08-12 22:31:41 +02:00
33fbabdd72 fix(core): update 2019-08-12 22:31:40 +02:00
9d26fff986 1.1.39 2019-08-12 18:16:26 +02:00
41151e5436 fix(core): update 2019-08-12 18:16:25 +02:00
109c5197f3 1.1.38 2019-06-07 08:40:24 +02:00
c3d47c1f50 fix(core): update 2019-06-07 08:40:24 +02:00
16 changed files with 515 additions and 484 deletions

20
.gitignore vendored
View File

@ -1,4 +1,22 @@
node_modules/ .nogit/
# artifacts
coverage/ coverage/
public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,5 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
@ -50,13 +50,13 @@ testLTS:
- docker - docker
- notpriv - notpriv
testSTABLE: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare - npmci npm prepare
- npmci node install stable - npmci node install lts
- npmci npm install - npmci npm install
- npmci npm test - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -65,7 +65,7 @@ testSTABLE:
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install lts
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
@ -78,19 +78,11 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g tslint typescript
- docker run - npmci npm install
--env SOURCE_CODE="$PWD" - npmci command "tslint -c tslint.json ./ts/**/*.ts"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- docker - docker
- priv - priv
@ -106,13 +98,15 @@ trigger:
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-dbase:npmci
services:
- docker:18-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command tsdoc
tags: tags:
- docker - docker
- notpriv - notpriv

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
}
]
}

View File

@ -106,6 +106,6 @@ mySmartsocketClient.serverCall('function', functionCallData).then(functionRespon
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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com) [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

479
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsocket", "name": "@pushrocks/smartsocket",
"version": "1.1.37", "version": "1.1.41",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -15,18 +15,18 @@
} }
}, },
"@babel/code-frame": { "@babel/code-frame": {
"version": "7.0.0", "version": "7.5.5",
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.0.0.tgz", "resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.5.5.tgz",
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/highlight": "^7.0.0" "@babel/highlight": "^7.0.0"
} }
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.0.0", "version": "7.5.0",
"resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.0.0.tgz", "resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.5.0.tgz",
"integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.0.0", "chalk": "^2.0.0",
@ -49,15 +49,39 @@
} }
}, },
"@gitzone/tsrun": { "@gitzone/tsrun": {
"version": "1.2.6", "version": "1.2.8",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.6.tgz", "resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.8.tgz",
"integrity": "sha512-MTgQ7OiKfMpRQRumJp8aGuLCNNyWGjZSxsF+GfZ7cmg2DUtJRyCL0Ybkai1sPdMWG/zE8RUo50WvBKEChdVyvA==", "integrity": "sha512-G65DNcjegxF6w/O9MYD2mlHh+QVUiLuZvgLD5eamOOuWLhzuiE1tDzv5praJ/woJQzzZinDs+IyRyZ5rWKp/fQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@gitzone/tsbuild": "^2.1.8", "@pushrocks/smartfile": "^7.0.4",
"@pushrocks/smartfile": "^7.0.2", "ts-node": "^8.3.0",
"ts-node": "^8.0.3", "typescript": "^3.5.3"
"typescript": "^3.4.2" },
"dependencies": {
"@pushrocks/smartfile": {
"version": "7.0.4",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.4.tgz",
"integrity": "sha512-ym8eigWJAQhwgmuVLew3GLrk4WhV03ajapwuMWytxKSzfIW9ZqceJBX2QzOkmhFGA2bp+gc4Q2wOBy3Ffnlj+A==",
"dev": true,
"requires": {
"@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrequest": "^1.1.14",
"@types/fs-extra": "^5.0.5",
"@types/vinyl": "^2.0.2",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
"js-yaml": "^3.13.1",
"vinyl-file": "^3.0.0"
}
},
"typescript": {
"version": "3.5.3",
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.5.3.tgz",
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
"dev": true
}
} }
}, },
"@gitzone/tstest": { "@gitzone/tstest": {
@ -104,24 +128,17 @@
} }
}, },
"@pushrocks/lik": { "@pushrocks/lik": {
"version": "3.0.5", "version": "3.0.10",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.5.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.10.tgz",
"integrity": "sha512-pc5Nq0WUysS34qPpyiZXiX254kL3vyRVbt3D36Q5QU+eHhxAThHofSzgOdyVHUZU2WFoaMlKowIVsyUFzIkfdw==", "integrity": "sha512-iWG06QsrL6AAnjPRWMVz4bRaRE0jJt/HgEK0YeLqaSBLY8ju4ps1j4lEN8VrUlXGZyPB6UGQfcreesO24buYhQ==",
"requires": { "requires": {
"@pushrocks/smartdelay": "^2.0.2", "@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrx": "^2.0.3", "@pushrocks/smartrx": "^2.0.3",
"@pushrocks/smarttime": "^3.0.5", "@pushrocks/smarttime": "^3.0.12",
"@types/minimatch": "^3.0.3", "@types/minimatch": "^3.0.3",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"symbol-tree": "^3.2.2" "symbol-tree": "^3.2.4"
},
"dependencies": {
"@pushrocks/smartpromise": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
}
} }
}, },
"@pushrocks/smartcli": { "@pushrocks/smartcli": {
@ -182,31 +199,32 @@
} }
}, },
"@pushrocks/smartexpress": { "@pushrocks/smartexpress": {
"version": "3.0.21", "version": "3.0.38",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexpress/-/smartexpress-3.0.21.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartexpress/-/smartexpress-3.0.38.tgz",
"integrity": "sha512-b/TONmCWG/K2gt3AuHGn7nWDkP3LIU072nbXShKbkcXPqetQcbuyXWc5g52wkag4KQV8XWcaucMDBNCSMmPhgg==", "integrity": "sha512-di26orVJwgBRGKVpYcPrauc14CVo0piAzXTBWFZZNUCuIsndnXepd9oDzMO+KHVZpNz3W4DxbtRkppZjrh9ejw==",
"requires": { "requires": {
"@pushrocks/lik": "^3.0.5", "@pushrocks/lik": "^3.0.10",
"@pushrocks/smartfile": "^7.0.2", "@pushrocks/smartfile": "^7.0.4",
"@pushrocks/smartmanifest": "^1.0.6",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrequest": "^1.1.15", "@pushrocks/smartrequest": "^1.1.16",
"@types/express": "^4.16.1", "@types/express": "^4.17.0",
"@types/finalhandler": "^1.1.0", "@types/finalhandler": "^1.1.0",
"@types/helmet": "0.0.43", "@types/helmet": "0.0.43",
"@types/serve-static": "^1.13.2", "@types/serve-static": "^1.13.2",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.16.4", "express": "^4.17.1",
"express-force-ssl": "^0.3.2", "express-force-ssl": "^0.3.2",
"helmet": "^3.16.0", "helmet": "^3.20.0",
"rendertron-middleware": "^0.1.5", "rendertron-middleware": "^0.1.5",
"sitemap": "^2.1.0" "sitemap": "^3.2.2"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartfile": { "@pushrocks/smartfile": {
"version": "7.0.2", "version": "7.0.4",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.2.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.4.tgz",
"integrity": "sha512-38l9DRalp1McEBFG+qKzBqefVQZZLPNk+uo7Ff1guy8BDxA+tATlZ6O6FuXW7M3wjFDBi245VJs+KWVKcCxBRA==", "integrity": "sha512-ym8eigWJAQhwgmuVLew3GLrk4WhV03ajapwuMWytxKSzfIW9ZqceJBX2QzOkmhFGA2bp+gc4Q2wOBy3Ffnlj+A==",
"requires": { "requires": {
"@pushrocks/smartpath": "^4.0.1", "@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
@ -220,31 +238,14 @@
} }
}, },
"@pushrocks/smartrequest": { "@pushrocks/smartrequest": {
"version": "1.1.15", "version": "1.1.16",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.15.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.16.tgz",
"integrity": "sha512-MBOOTTdqWy+HvWS4Lt8jzITxF2hYyQ3/OjB28CpTAkPuKsDyLi9HEngvFufKu5EbKwBGwCVdeF7vQSpLRSoDtA==", "integrity": "sha512-3LbtqoqnjfzWSQ10NryhJmgwPpvMlVoYyTzE676+yC4hM2rnGSzxozLZxMr6enV4VeZcloQ0CqHBivKoT/kdvA==",
"requires": { "requires": {
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@types/form-data": "^2.2.1", "@types/form-data": "^2.2.1",
"form-data": "^2.3.3" "form-data": "^2.3.3"
} }
},
"@types/fs-extra": {
"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": "*"
}
},
"js-yaml": {
"version": "3.13.1",
"resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.13.1.tgz",
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
}
} }
} }
}, },
@ -266,20 +267,24 @@
} }
}, },
"@pushrocks/smarthash": { "@pushrocks/smarthash": {
"version": "2.0.4", "version": "2.0.6",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.0.4.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.0.6.tgz",
"integrity": "sha512-xT1BKrJEHZs+0K62ba5IHt7mkdMGMORDBRnw4QweC49ryNiJm2x4CT/he7HTVy5nPK1Q2OrPwrUoEQ1CiHcq8w==", "integrity": "sha512-jHk9srgRLkszk/oPCUOkxTX2Fqu7qKwx13aEeSIBx8UCtFbXPLecJAqEaGEVk1mw9e4Oq0iC6O0jEnxKo5NQwA==",
"requires": { "requires": {
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartjson": "^3.0.5",
"@pushrocks/smartpromise": "^3.0.2",
"@types/through2": "^2.0.34", "@types/through2": "^2.0.34",
"through2": "^3.0.0" "through2": "^3.0.1"
}, }
"dependencies": { },
"@pushrocks/smartpromise": { "@pushrocks/smartjson": {
"version": "2.0.5", "version": "3.0.7",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-3.0.7.tgz",
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==" "integrity": "sha512-0jGsFbJGUWkRt1sQL0twuwuPLLnG0U89X8RE/7QGEY/aAAXkcFs0AolCXpQz87Z7GLSZJl2/s2xZRWKGmY0j7w==",
} "requires": {
"@types/fast-json-stable-stringify": "^2.0.0",
"fast-json-stable-stringify": "^2.0.0",
"lodash.clonedeep": "^4.5.0"
} }
}, },
"@pushrocks/smartlog": { "@pushrocks/smartlog": {
@ -305,6 +310,11 @@
"ora": "^3.4.0" "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": { "@pushrocks/smartparam": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.0.4.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.0.4.tgz",
@ -377,21 +387,21 @@
} }
}, },
"@pushrocks/smarttime": { "@pushrocks/smarttime": {
"version": "3.0.7", "version": "3.0.12",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.7.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
"integrity": "sha512-IL/+lgVQLvZvoMSbOpT3JSGjogGzpNbWdzfFZAjjxrTtwxAN1FNWGcCESCvq1BPlUGECPTBeyyaURXhhhLfihA==", "integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
"requires": { "requires": {
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@types/cron": "^1.7.0", "@types/cron": "^1.7.1",
"@types/luxon": "^1.12.0", "@types/luxon": "^1.15.1",
"cron": "^1.7.0", "cron": "^1.7.1",
"luxon": "^1.12.1" "luxon": "^1.16.0"
} }
}, },
"@pushrocks/tapbundle": { "@pushrocks/tapbundle": {
"version": "3.0.9", "version": "3.0.11",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.9.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.11.tgz",
"integrity": "sha512-+EMdP3iykAtx192sebHBAWCE+2RGUU7q9kp8iHe62H16WSbDDaDpnRNd6VHv389qTaZlubQb0d/FR+uQJUVUDQ==", "integrity": "sha512-s7epZfJZX+LsBVmIYvoaY4WtgPvRLnHZMVTpQAPJGMBqxJAQxhQ2wvGJjmqMAGhhznAHI6t4g+m0KTp3vFIRVg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@pushrocks/early": "^3.0.3", "@pushrocks/early": "^3.0.3",
@ -411,24 +421,24 @@
} }
}, },
"@types/chai": { "@types/chai": {
"version": "4.1.7", "version": "4.2.0",
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.1.7.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.0.tgz",
"integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", "integrity": "sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA==",
"dev": true "dev": true
}, },
"@types/chai-as-promised": { "@types/chai-as-promised": {
"version": "7.1.0", "version": "7.1.2",
"resolved": "https://verdaccio.lossless.one/@types%2fchai-as-promised/-/chai-as-promised-7.1.0.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fchai-as-promised/-/chai-as-promised-7.1.2.tgz",
"integrity": "sha512-MFiW54UOSt+f2bRw8J7LgQeIvE/9b4oGvwU7XW30S9QGAiHGnU/fmiOprsyMkdmH2rl8xSPc0/yrQw8juXU6bQ==", "integrity": "sha512-PO2gcfR3Oxa+u0QvECLe1xKXOqYTzCmWf0FhLhjREoW3fPAVamjihL7v1MOVLJLsnAMdLcjkfrs01yvDMwVK4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/chai": "*" "@types/chai": "*"
} }
}, },
"@types/chai-string": { "@types/chai-string": {
"version": "1.4.1", "version": "1.4.2",
"resolved": "https://verdaccio.lossless.one/@types%2fchai-string/-/chai-string-1.4.1.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fchai-string/-/chai-string-1.4.2.tgz",
"integrity": "sha512-aRNMs6TKgjgPlCHwDfq/YNy5VtRR2hJ4AUWByddrT0TRVVD8eX4MiHW6/iHvmQHRlVuuPZcwnTUE7b4yFt7bEA==", "integrity": "sha512-ld/1hV5qcPRGuwlPdvRfvM3Ka/iofOk2pH4VkasK4b1JJP1LjNmWWn0LsISf6RRzyhVOvs93rb9tM09e+UuF8Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/chai": "*" "@types/chai": "*"
@ -443,9 +453,9 @@
} }
}, },
"@types/cron": { "@types/cron": {
"version": "1.7.0", "version": "1.7.1",
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.0.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.1.tgz",
"integrity": "sha512-LRu/XiiOExELholyEwEuSTPAEiO+sVR1nXmWEjezneGgYpDyMNVIsjiaHYBoCEUJo4F1hCOlAzQAh80iEUVbKw==", "integrity": "sha512-48brwgU18DqA0mQX1As5OcJEo1yNjaXMM6Mk4r8K1dOzLJRQ37FE/kCivKx7ClKEHfhX2FdcxKzJ1B744a+V3A==",
"requires": { "requires": {
"@types/node": "*", "@types/node": "*",
"moment": ">=2.14.0" "moment": ">=2.14.0"
@ -470,6 +480,11 @@
"@types/range-parser": "*" "@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": { "@types/figures": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-3.0.1.tgz", "resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-3.0.1.tgz",
@ -499,7 +514,6 @@
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-5.1.0.tgz", "resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-5.1.0.tgz",
"integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==", "integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==",
"dev": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
@ -513,9 +527,9 @@
} }
}, },
"@types/luxon": { "@types/luxon": {
"version": "1.12.0", "version": "1.15.2",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.12.0.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.15.2.tgz",
"integrity": "sha512-+UzPmwHSEEyv7aGlNkVpuFxp/BirXgl8NnPGCtmyx2KXIzAapoW3IqSVk87/Z3PUk8vEL8Pe1HXEMJbNBOQgtg==" "integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw=="
}, },
"@types/mime": { "@types/mime": {
"version": "2.0.1", "version": "2.0.1",
@ -528,9 +542,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
}, },
"@types/node": { "@types/node": {
"version": "12.0.6", "version": "12.7.1",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.0.6.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.1.tgz",
"integrity": "sha512-3sV/MUw6uYxPaRIoooI/MjO0j1A06JNlbpkGc56F+zikO52qavehD/Qw85so47gWhO82tNzEFoF6adXqIfK+EA==" "integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw=="
}, },
"@types/range-parser": { "@types/range-parser": {
"version": "1.2.3", "version": "1.2.3",
@ -577,13 +591,6 @@
"integrity": "sha512-nhRG8+RuG/L+0fAZBQYaRflXKjTrHOKH8MFTChnf+dNVMxA3wHYYrfj0tztK0W51ABXjGfRCDc0vRkecCOrsow==", "integrity": "sha512-nhRG8+RuG/L+0fAZBQYaRflXKjTrHOKH8MFTChnf+dNVMxA3wHYYrfj0tztK0W51ABXjGfRCDc0vRkecCOrsow==",
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
},
"dependencies": {
"@types/node": {
"version": "10.12.19",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-10.12.19.tgz",
"integrity": "sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA=="
}
} }
}, },
"@types/vinyl": { "@types/vinyl": {
@ -621,9 +628,9 @@
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
}, },
"ajv": { "ajv": {
"version": "6.10.0", "version": "6.10.2",
"resolved": "https://verdaccio.lossless.one/ajv/-/ajv-6.10.0.tgz", "resolved": "https://verdaccio.lossless.one/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"requires": { "requires": {
"fast-deep-equal": "^2.0.1", "fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0", "fast-json-stable-stringify": "^2.0.0",
@ -653,9 +660,9 @@
} }
}, },
"arg": { "arg": {
"version": "4.1.0", "version": "4.1.1",
"resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.0.tgz", "resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.1.tgz",
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", "integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
"dev": true "dev": true
}, },
"argparse": { "argparse": {
@ -1034,9 +1041,9 @@
} }
}, },
"content-security-policy-builder": { "content-security-policy-builder": {
"version": "2.0.0", "version": "2.1.0",
"resolved": "https://verdaccio.lossless.one/content-security-policy-builder/-/content-security-policy-builder-2.0.0.tgz", "resolved": "https://verdaccio.lossless.one/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz",
"integrity": "sha512-j+Nhmj1yfZAikJLImCvPJFE29x/UuBi+/MWqggGGc515JKaZrjuei2RhULJmy0MsstW3E3htl002bwmBNMKr7w==" "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ=="
}, },
"content-type": { "content-type": {
"version": "1.0.4", "version": "1.0.4",
@ -1068,9 +1075,9 @@
} }
}, },
"cron": { "cron": {
"version": "1.7.0", "version": "1.7.1",
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.0.tgz", "resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.1.tgz",
"integrity": "sha512-I7S7ES2KZtKPfBTGJ5Brc6X23apE71fgYU/PC5ayh8R6VhECpqvTLe/LTkwAEN3ERFzNKXlWzh/PkwsGg3vkDQ==", "integrity": "sha512-gmMB/pJcqUVs/NklR1sCGlNYM7TizEw+1gebz20BMc/8bTm/r7QUp3ZPSPlG8Z5XRlvb7qhjEjq/+bdIfUCL2A==",
"requires": { "requires": {
"moment-timezone": "^0.5.x" "moment-timezone": "^0.5.x"
} }
@ -1163,14 +1170,14 @@
"dev": true "dev": true
}, },
"dns-prefetch-control": { "dns-prefetch-control": {
"version": "0.1.0", "version": "0.2.0",
"resolved": "https://verdaccio.lossless.one/dns-prefetch-control/-/dns-prefetch-control-0.1.0.tgz", "resolved": "https://verdaccio.lossless.one/dns-prefetch-control/-/dns-prefetch-control-0.2.0.tgz",
"integrity": "sha1-YN20V3dOF48flBXwyrsOhbCzALI=" "integrity": "sha512-hvSnros73+qyZXhHFjx2CMLwoj3Fe7eR9EJsFsqmcI1bB2OBWL/+0YzaEaKssCHnj/6crawNnUyw74Gm2EKe+Q=="
}, },
"dont-sniff-mimetype": { "dont-sniff-mimetype": {
"version": "1.0.0", "version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/dont-sniff-mimetype/-/dont-sniff-mimetype-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz",
"integrity": "sha1-WTKJDcn04vGeXrAqIAJuXl78j1g=" "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug=="
}, },
"ecc-jsbn": { "ecc-jsbn": {
"version": "0.1.2", "version": "0.1.2",
@ -1296,9 +1303,9 @@
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
}, },
"esutils": { "esutils": {
"version": "2.0.2", "version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.2.tgz", "resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true "dev": true
}, },
"etag": { "etag": {
@ -1659,25 +1666,25 @@
"dev": true "dev": true
}, },
"helmet": { "helmet": {
"version": "3.18.0", "version": "3.20.0",
"resolved": "https://verdaccio.lossless.one/helmet/-/helmet-3.18.0.tgz", "resolved": "https://verdaccio.lossless.one/helmet/-/helmet-3.20.0.tgz",
"integrity": "sha512-TsKlGE5UVkV0NiQ4PllV9EVfZklPjyzcMEMjWlyI/8S6epqgRT+4s4GHVgc25x0TixsKvp3L7c91HQQt5l0+QA==", "integrity": "sha512-Ob+TqmQFZ5f7WgP8kBbAzNPsbf6p1lOj5r+327/ymw/IILWih3wcx9u/u/S8Mwv5wbBkO7Li6x5s23t3COhUKw==",
"requires": { "requires": {
"depd": "2.0.0", "depd": "2.0.0",
"dns-prefetch-control": "0.1.0", "dns-prefetch-control": "0.2.0",
"dont-sniff-mimetype": "1.0.0", "dont-sniff-mimetype": "1.1.0",
"expect-ct": "0.2.0", "expect-ct": "0.2.0",
"feature-policy": "0.3.0", "feature-policy": "0.3.0",
"frameguard": "3.1.0", "frameguard": "3.1.0",
"helmet-crossdomain": "0.3.0", "helmet-crossdomain": "0.4.0",
"helmet-csp": "2.7.1", "helmet-csp": "2.8.0",
"hide-powered-by": "1.0.0", "hide-powered-by": "1.1.0",
"hpkp": "2.0.0", "hpkp": "2.0.0",
"hsts": "2.2.0", "hsts": "2.2.0",
"ienoopen": "1.1.0", "ienoopen": "1.1.0",
"nocache": "2.1.0", "nocache": "2.1.0",
"referrer-policy": "1.2.0", "referrer-policy": "1.2.0",
"x-xss-protection": "1.1.0" "x-xss-protection": "1.2.0"
}, },
"dependencies": { "dependencies": {
"depd": { "depd": {
@ -1688,25 +1695,25 @@
} }
}, },
"helmet-crossdomain": { "helmet-crossdomain": {
"version": "0.3.0", "version": "0.4.0",
"resolved": "https://verdaccio.lossless.one/helmet-crossdomain/-/helmet-crossdomain-0.3.0.tgz", "resolved": "https://verdaccio.lossless.one/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz",
"integrity": "sha512-YiXhj0E35nC4Na5EPE4mTfoXMf9JTGpN4OtB4aLqShKuH9d2HNaJX5MQoglO6STVka0uMsHyG5lCut5Kzsy7Lg==" "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
}, },
"helmet-csp": { "helmet-csp": {
"version": "2.7.1", "version": "2.8.0",
"resolved": "https://verdaccio.lossless.one/helmet-csp/-/helmet-csp-2.7.1.tgz", "resolved": "https://verdaccio.lossless.one/helmet-csp/-/helmet-csp-2.8.0.tgz",
"integrity": "sha512-sCHwywg4daQ2mY0YYwXSZRsgcCeerUwxMwNixGA7aMLkVmPTYBl7gJoZDHOZyXkqPrtuDT3s2B1A+RLI7WxSdQ==", "integrity": "sha512-MlCPeM0Sm3pS9RACRihx70VeTHmkQwa7sum9EK1tfw1VZyvFU0dBWym9nHh3CRkTRNlyNm/WFCMvuh9zXkOjNw==",
"requires": { "requires": {
"camelize": "1.0.0", "camelize": "1.0.0",
"content-security-policy-builder": "2.0.0", "content-security-policy-builder": "2.1.0",
"dasherize": "2.0.0", "dasherize": "2.0.0",
"platform": "1.3.5" "platform": "1.3.5"
} }
}, },
"hide-powered-by": { "hide-powered-by": {
"version": "1.0.0", "version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/hide-powered-by/-/hide-powered-by-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/hide-powered-by/-/hide-powered-by-1.1.0.tgz",
"integrity": "sha1-SoWtZYgfYoV/xwr3F0oRhNzM4ys=" "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg=="
}, },
"hpkp": { "hpkp": {
"version": "2.0.0", "version": "2.0.0",
@ -1847,7 +1854,6 @@
"version": "3.13.1", "version": "3.13.1",
"resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.13.1.tgz", "resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.13.1.tgz",
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": { "requires": {
"argparse": "^1.0.7", "argparse": "^1.0.7",
"esprima": "^4.0.0" "esprima": "^4.0.0"
@ -1930,11 +1936,6 @@
"path-exists": "^3.0.0" "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": { "lodash._baseassign": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://verdaccio.lossless.one/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", "resolved": "https://verdaccio.lossless.one/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
@ -1984,6 +1985,16 @@
"lodash.keys": "^3.0.0" "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": { "lodash.isarguments": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://verdaccio.lossless.one/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "resolved": "https://verdaccio.lossless.one/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
@ -2004,11 +2015,21 @@
"lodash.isarray": "^3.0.0" "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": { "lodash.restparam": {
"version": "3.6.1", "version": "3.6.1",
"resolved": "https://verdaccio.lossless.one/lodash.restparam/-/lodash.restparam-3.6.1.tgz", "resolved": "https://verdaccio.lossless.one/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
"integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" "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": { "log-symbols": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://verdaccio.lossless.one/log-symbols/-/log-symbols-2.2.0.tgz", "resolved": "https://verdaccio.lossless.one/log-symbols/-/log-symbols-2.2.0.tgz",
@ -2019,9 +2040,9 @@
} }
}, },
"luxon": { "luxon": {
"version": "1.12.1", "version": "1.17.2",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.12.1.tgz", "resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.17.2.tgz",
"integrity": "sha512-Zv/qJb2X1ESTrlniAViWx2aqGwi2cVpeoZFTbPdPiCu4EsadKsmb/QCH8HQjMUpDZKKJIHKHsJxV5Rwpq47HKQ==" "integrity": "sha512-qELKtIj3HD41N+MvgoxArk8DZGUb4Gpiijs91oi+ZmKJzRlxY6CoyTwNoUwnogCVs4p8HuxVJDik9JbnYgrCng=="
}, },
"make-error": { "make-error": {
"version": "1.3.5", "version": "1.3.5",
@ -2125,9 +2146,9 @@
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
}, },
"moment-timezone": { "moment-timezone": {
"version": "0.5.25", "version": "0.5.26",
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.25.tgz", "resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.26.tgz",
"integrity": "sha512-DgEaTyN/z0HFaVcVbSyVCUU6HeFdnNC3vE4c9cgu2dgMTvjBUBdBzWfasTBmAW45u5OIMeCJtU8yNjM22DHucw==", "integrity": "sha512-sFP4cgEKTCymBBKgoxZjYzlSovC20Y6J7y3nanDc5RoBIXKlZhoYwBoZGe3flwU6A372AcRwScH8KiwV6zjy1g==",
"requires": { "requires": {
"moment": ">= 2.9.0" "moment": ">= 2.9.0"
} }
@ -2138,9 +2159,9 @@
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}, },
"nan": { "nan": {
"version": "2.13.2", "version": "2.14.0",
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.13.2.tgz", "resolved": "https://verdaccio.lossless.one/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
"dev": true "dev": true
}, },
"nanoid": { "nanoid": {
@ -2402,9 +2423,9 @@
} }
}, },
"psl": { "psl": {
"version": "1.1.32", "version": "1.3.0",
"resolved": "https://verdaccio.lossless.one/psl/-/psl-1.1.32.tgz", "resolved": "https://verdaccio.lossless.one/psl/-/psl-1.3.0.tgz",
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==" "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag=="
}, },
"pump": { "pump": {
"version": "3.0.0", "version": "3.0.0",
@ -2443,9 +2464,9 @@
} }
}, },
"readable-stream": { "readable-stream": {
"version": "3.1.1", "version": "3.4.0",
"resolved": "https://verdaccio.lossless.one/readable-stream/-/readable-stream-3.1.1.tgz", "resolved": "https://verdaccio.lossless.one/readable-stream/-/readable-stream-3.4.0.tgz",
"integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
"requires": { "requires": {
"inherits": "^2.0.3", "inherits": "^2.0.3",
"string_decoder": "^1.1.1", "string_decoder": "^1.1.1",
@ -2523,9 +2544,9 @@
"dev": true "dev": true
}, },
"resolve": { "resolve": {
"version": "1.11.1", "version": "1.12.0",
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.11.1.tgz", "resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.12.0.tgz",
"integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
@ -2654,13 +2675,14 @@
"dev": true "dev": true
}, },
"sitemap": { "sitemap": {
"version": "2.2.0", "version": "3.2.2",
"resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-2.2.0.tgz", "resolved": "https://verdaccio.lossless.one/sitemap/-/sitemap-3.2.2.tgz",
"integrity": "sha512-9Zoi3UBhSIt5jWENDRUbzsqLMJ+Fha3P2aQ2PRghmh0FOivtHsC4FAJdkAEKHvATajd74BWp/57Yh7kz/UA53Q==", "integrity": "sha512-TModL/WU4m2q/mQcrDgNANn0P4LwprM9MMvG4hu5zP4c6IIKs2YLTu6nXXnNr8ODW/WFtxKggiJ1EGn2W0GNmg==",
"requires": { "requires": {
"lodash": "^4.17.10", "lodash.chunk": "^4.2.0",
"url-join": "^4.0.0", "lodash.padstart": "^4.6.1",
"xmlbuilder": "^10.0.0" "whatwg-url": "^7.0.0",
"xmlbuilder": "^13.0.0"
} }
}, },
"smartchai": { "smartchai": {
@ -2763,9 +2785,9 @@
"dev": true "dev": true
}, },
"source-map-support": { "source-map-support": {
"version": "0.5.12", "version": "0.5.13",
"resolved": "https://verdaccio.lossless.one/source-map-support/-/source-map-support-0.5.12.tgz", "resolved": "https://verdaccio.lossless.one/source-map-support/-/source-map-support-0.5.13.tgz",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"buffer-from": "^1.0.0", "buffer-from": "^1.0.0",
@ -2809,11 +2831,18 @@
} }
}, },
"string_decoder": { "string_decoder": {
"version": "1.2.0", "version": "1.3.0",
"resolved": "https://verdaccio.lossless.one/string_decoder/-/string_decoder-1.2.0.tgz", "resolved": "https://verdaccio.lossless.one/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.0",
"resolved": "https://verdaccio.lossless.one/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
}
} }
}, },
"strip-ansi": { "strip-ansi": {
@ -2866,17 +2895,16 @@
} }
}, },
"symbol-tree": { "symbol-tree": {
"version": "3.2.2", "version": "3.2.4",
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.2.tgz", "resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=" "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
}, },
"through2": { "through2": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/through2/-/through2-3.0.0.tgz", "resolved": "https://verdaccio.lossless.one/through2/-/through2-3.0.1.tgz",
"integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
"requires": { "requires": {
"readable-stream": "2 || 3", "readable-stream": "2 || 3"
"xtend": "~4.0.1"
} }
}, },
"to-array": { "to-array": {
@ -2905,10 +2933,18 @@
} }
} }
}, },
"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": { "ts-node": {
"version": "8.2.0", "version": "8.3.0",
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.2.0.tgz", "resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.3.0.tgz",
"integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==", "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
@ -2924,9 +2960,9 @@
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
}, },
"tslint": { "tslint": {
"version": "5.17.0", "version": "5.18.0",
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.17.0.tgz", "resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.18.0.tgz",
"integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==", "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@ -3034,11 +3070,6 @@
"punycode": "^2.1.0" "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": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://verdaccio.lossless.one/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -3103,6 +3134,21 @@
"defaults": "^1.0.3" "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": { "which": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://verdaccio.lossless.one/which/-/which-1.3.1.tgz", "resolved": "https://verdaccio.lossless.one/which/-/which-1.3.1.tgz",
@ -3179,25 +3225,20 @@
} }
}, },
"x-xss-protection": { "x-xss-protection": {
"version": "1.1.0", "version": "1.2.0",
"resolved": "https://verdaccio.lossless.one/x-xss-protection/-/x-xss-protection-1.1.0.tgz", "resolved": "https://verdaccio.lossless.one/x-xss-protection/-/x-xss-protection-1.2.0.tgz",
"integrity": "sha512-rx3GzJlgEeZ08MIcDsU2vY2B1QEriUKJTSiNHHUIem6eg9pzVOr2TL3Y4Pd6TMAM5D5azGjcxqI62piITBDHVg==" "integrity": "sha512-xN0kV+8XfOQM2OPPBdEbGtbvJNNP1pvZR7sE6d44cjJFQG4OiGDdienPg5iOUGswBTiGbBvtYDURd30BMJwwqg=="
}, },
"xmlbuilder": { "xmlbuilder": {
"version": "10.1.1", "version": "13.0.2",
"resolved": "https://verdaccio.lossless.one/xmlbuilder/-/xmlbuilder-10.1.1.tgz", "resolved": "https://verdaccio.lossless.one/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
"integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==" "integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ=="
}, },
"xmlhttprequest-ssl": { "xmlhttprequest-ssl": {
"version": "1.5.5", "version": "1.5.5",
"resolved": "https://verdaccio.lossless.one/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", "resolved": "https://verdaccio.lossless.one/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
"integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4="
}, },
"xtend": {
"version": "4.0.1",
"resolved": "https://verdaccio.lossless.one/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
},
"y18n": { "y18n": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/y18n/-/y18n-4.0.0.tgz", "resolved": "https://verdaccio.lossless.one/y18n/-/y18n-4.0.0.tgz",
@ -3240,9 +3281,9 @@
"integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk="
}, },
"yn": { "yn": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://verdaccio.lossless.one/yn/-/yn-3.1.0.tgz", "resolved": "https://verdaccio.lossless.one/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true "dev": true
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsocket", "name": "@pushrocks/smartsocket",
"version": "1.1.37", "version": "1.1.41",
"description": "easy and secure websocket communication", "description": "easy and secure websocket communication",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
@ -19,10 +19,10 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartsocket#README", "homepage": "https://gitlab.com/pushrocks/smartsocket#README",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^3.0.5", "@pushrocks/lik": "^3.0.10",
"@pushrocks/smartdelay": "^2.0.3", "@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartexpress": "^3.0.21", "@pushrocks/smartexpress": "^3.0.38",
"@pushrocks/smarthash": "^2.0.4", "@pushrocks/smarthash": "^2.0.6",
"@pushrocks/smartlog": "^2.0.19", "@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@types/shortid": "0.0.29", "@types/shortid": "0.0.29",
@ -34,12 +34,23 @@
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.11", "@gitzone/tsbuild": "^2.1.11",
"@gitzone/tsrun": "^1.2.6", "@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.24", "@gitzone/tstest": "^1.0.24",
"@pushrocks/tapbundle": "^3.0.9", "@pushrocks/tapbundle": "^3.0.11",
"@types/node": "^12.0.6", "@types/node": "^12.7.1",
"tslint": "^5.17.0", "tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"private": false "private": false,
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

1
test/common/test.ts Normal file
View File

@ -0,0 +1 @@
console.log('TODO');

View File

@ -36,10 +36,6 @@ tap.test('Should accept an smartExpressServer as server', async () => {
await myseServer.start(); await myseServer.start();
}); });
tap.test('should start listening when .started is called', async () => {
await testSmartsocket.start();
});
// class socketrole // class socketrole
tap.test('should add a socketrole', async () => { tap.test('should add a socketrole', async () => {
testSocketRole1 = new smartsocket.SocketRole({ testSocketRole1 = new smartsocket.SocketRole({
@ -53,16 +49,21 @@ tap.test('should add a socketrole', async () => {
tap.test('should register a new Function', async () => { tap.test('should register a new Function', async () => {
testSocketFunction1 = new smartsocket.SocketFunction({ testSocketFunction1 = new smartsocket.SocketFunction({
allowedRoles: [testSocketRole1], allowedRoles: [testSocketRole1],
funcDef: async dataArg => { funcDef: async (dataArg, socketConnectionArg) => {
return dataArg; return dataArg;
}, },
funcName: 'testFunction1' funcName: 'testFunction1'
}); });
testSmartsocket.addSocketFunction(testSocketFunction1);
console.log(testSmartsocket.socketFunctions);
});
tap.test('should start listening when .started is called', async () => {
await testSmartsocket.start();
}); });
// class SmartsocketClient // class SmartsocketClient
tap.test('should react to a new websocket connection from client', async () => { tap.test('should react to a new websocket connection from client', async () => {
const done = smartpromise.defer();
testSmartsocketClient = new smartsocket.SmartsocketClient({ testSmartsocketClient = new smartsocket.SmartsocketClient({
port: testConfig.port, port: testConfig.port,
url: 'http://localhost', url: 'http://localhost',
@ -70,26 +71,15 @@ tap.test('should react to a new websocket connection from client', async () => {
alias: 'testClient1', alias: 'testClient1',
role: 'testRole1' role: 'testRole1'
}); });
testSmartsocketClient.connect().then(() => { testSmartsocketClient.addSocketFunction(testSocketFunction1);
done.resolve(); console.log(testSmartsocketClient.socketFunctions);
}); await testSmartsocketClient.connect();
await done.promise;
}); });
tap.test('client should disconnect and reconnect', async () => {
let done = smartpromise.defer(); tap.test('client should disconnect and reconnect', async tools => {
testSmartsocketClient await testSmartsocketClient.disconnect();
.disconnect() await tools.delayFor(100);
.then(() => { await testSmartsocketClient.connect();
let done = smartpromise.defer();
setTimeout(() => {
testSmartsocketClient.connect().then(done.resolve);
}, 0);
return done.promise;
})
.then(() => {
done.resolve();
});
await done.promise;
}); });
tap.test('2 clients should connect in parallel', async () => { tap.test('2 clients should connect in parallel', async () => {
@ -97,37 +87,14 @@ tap.test('2 clients should connect in parallel', async () => {
}); });
tap.test('should be able to make a functionCall from client to server', async () => { tap.test('should be able to make a functionCall from client to server', async () => {
let done = smartpromise.defer(); const response = await testSmartsocketClient.serverCall('testFunction1', {
testSmartsocketClient value1: 'hello'
.serverCall('testFunction1', { });
value1: 'hello' console.log(response);
})
.then(dataArg => {
console.log(dataArg);
done.resolve();
});
await done.promise;
}); });
tap.test('should be able to make a functionCall from server to client', async () => { tap.test('should be able to make a functionCall from server to client', async () => {
let done = smartpromise.defer();
let targetSocket = (() => {
return smartsocket.allSocketConnections.find(socketConnectionArg => {
return socketConnectionArg.alias === 'testClient1';
});
})();
testSmartsocket
.clientCall(
'testFunction1',
{
value1: 'helloFromServer'
},
targetSocket
)
.then(dataArg => {
console.log(dataArg);
done.resolve();
});
}); });
// terminate // terminate

View File

@ -22,10 +22,6 @@ tap.test('should create a new smartsocket', async () => {
expect(testSmartsocket).be.instanceOf(smartsocket.Smartsocket); expect(testSmartsocket).be.instanceOf(smartsocket.Smartsocket);
}); });
tap.test('should start listening when .started is called', async () => {
await testSmartsocket.start();
});
// class socketrole // class socketrole
tap.test('should add a socketrole', async () => { tap.test('should add a socketrole', async () => {
testSocketRole1 = new smartsocket.SocketRole({ testSocketRole1 = new smartsocket.SocketRole({
@ -44,11 +40,16 @@ tap.test('should register a new Function', async () => {
}, },
funcName: 'testFunction1' funcName: 'testFunction1'
}); });
testSmartsocket.addSocketFunction(testSocketFunction1);
console.log(testSmartsocket.socketFunctions);
});
tap.test('should start listening when .started is called', async () => {
await testSmartsocket.start();
}); });
// class SmartsocketClient // class SmartsocketClient
tap.test('should react to a new websocket connection from client', async () => { tap.test('should react to a new websocket connection from client', async () => {
const done = smartpromise.defer();
testSmartsocketClient = new smartsocket.SmartsocketClient({ testSmartsocketClient = new smartsocket.SmartsocketClient({
port: testConfig.port, port: testConfig.port,
url: 'http://localhost', url: 'http://localhost',
@ -56,26 +57,15 @@ tap.test('should react to a new websocket connection from client', async () => {
alias: 'testClient1', alias: 'testClient1',
role: 'testRole1' role: 'testRole1'
}); });
testSmartsocketClient.connect().then(() => { testSmartsocketClient.addSocketFunction(testSocketFunction1);
done.resolve(); console.log(testSmartsocketClient.socketFunctions);
}); await testSmartsocketClient.connect();
await done.promise;
}); });
tap.test('client should disconnect and reconnect', async () => {
let done = smartpromise.defer(); tap.test('client should disconnect and reconnect', async tools => {
testSmartsocketClient await testSmartsocketClient.disconnect();
.disconnect() await tools.delayFor(100);
.then(() => { await testSmartsocketClient.connect();
let done = smartpromise.defer();
setTimeout(() => {
testSmartsocketClient.connect().then(done.resolve);
}, 0);
return done.promise;
})
.then(() => {
done.resolve();
});
await done.promise;
}); });
tap.test('2 clients should connect in parallel', async () => { tap.test('2 clients should connect in parallel', async () => {
@ -83,37 +73,17 @@ tap.test('2 clients should connect in parallel', async () => {
}); });
tap.test('should be able to make a functionCall from client to server', async () => { tap.test('should be able to make a functionCall from client to server', async () => {
let done = smartpromise.defer(); const response = await testSmartsocketClient.serverCall('testFunction1', {
testSmartsocketClient value1: 'hello'
.serverCall('testFunction1', { });
value1: 'hello' console.log(response);
})
.then(dataArg => {
console.log(dataArg);
done.resolve();
});
await done.promise;
}); });
tap.test('should be able to make a functionCall from server to client', async () => { tap.test('should be able to make a functionCall from server to client', async () => {
let done = smartpromise.defer(); const response = await testSmartsocketClient.serverCall('testFunction1', {
let targetSocket = (() => { hi: 'hi there from client'
return smartsocket.allSocketConnections.find(socketConnectionArg => { });
return socketConnectionArg.alias === 'testClient1'; console.log(response);
});
})();
testSmartsocket
.clientCall(
'testFunction1',
{
value1: 'helloFromServer'
},
targetSocket
)
.then(dataArg => {
console.log(dataArg);
done.resolve();
});
}); });
// terminate // terminate

View File

@ -1,5 +1,4 @@
import * as plugins from './smartsocket.plugins'; import * as plugins from './smartsocket.plugins';
import * as helpers from './smartsocket.helpers';
// classes // classes
import { Objectmap } from '@pushrocks/lik'; import { Objectmap } from '@pushrocks/lik';
@ -21,6 +20,8 @@ export class Smartsocket {
public io: SocketIO.Server; public io: SocketIO.Server;
public openSockets = new Objectmap<SocketConnection>(); public openSockets = new Objectmap<SocketConnection>();
public socketRoles = new Objectmap<SocketRole>(); public socketRoles = new Objectmap<SocketRole>();
public socketFunctions = new Objectmap<SocketFunction>();
public socketRequests = new Objectmap<SocketRequest>();
private socketServer = new SocketServer(this); private socketServer = new SocketServer(this);
@ -74,7 +75,7 @@ export class Smartsocket {
targetSocketConnectionArg: SocketConnection targetSocketConnectionArg: SocketConnection
) { ) {
const done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
const socketRequest = new SocketRequest({ const socketRequest = new SocketRequest(this, {
funcCallData: { funcCallData: {
funcDataArg: dataArg, funcDataArg: dataArg,
funcName: functionNameArg funcName: functionNameArg
@ -100,6 +101,10 @@ export class Smartsocket {
return; return;
} }
public addSocketFunction(socketFunction: SocketFunction) {
this.socketFunctions.add(socketFunction);
}
/** /**
* the standard handler for new socket connections * the standard handler for new socket connections
*/ */

View File

@ -3,6 +3,7 @@ import * as plugins from './smartsocket.plugins';
import { SocketConnection } from './smartsocket.classes.socketconnection'; import { SocketConnection } from './smartsocket.classes.socketconnection';
import { ISocketFunctionCall, SocketFunction } from './smartsocket.classes.socketfunction'; import { ISocketFunctionCall, SocketFunction } from './smartsocket.classes.socketfunction';
import { ISocketRequestDataObject, SocketRequest } from './smartsocket.classes.socketrequest'; import { ISocketRequestDataObject, SocketRequest } from './smartsocket.classes.socketrequest';
import { SocketRole } from './smartsocket.classes.socketrole';
/** /**
* interface for class SmartsocketClient * interface for class SmartsocketClient
@ -16,12 +17,17 @@ export interface ISmartsocketClientOptions {
} }
export class SmartsocketClient { export class SmartsocketClient {
alias: string; public alias: string;
role: string; public role: string;
socketConnection: SocketConnection; public socketConnection: SocketConnection;
serverUrl: string; public serverUrl: string;
serverPort: number; public serverPort: number;
serverPassword: string; public serverPassword: string;
public socketFunctions = new plugins.lik.Objectmap<SocketFunction>();
public socketRequests = new plugins.lik.Objectmap<SocketRequest>();
public socketRoles = new plugins.lik.Objectmap<SocketRole>();
constructor(optionsArg: ISmartsocketClientOptions) { constructor(optionsArg: ISmartsocketClientOptions) {
this.alias = optionsArg.alias; this.alias = optionsArg.alias;
this.role = optionsArg.role; this.role = optionsArg.role;
@ -30,19 +36,23 @@ export class SmartsocketClient {
this.serverPassword = optionsArg.password; this.serverPassword = optionsArg.password;
} }
public addSocketFunction(socketFunction: SocketFunction) {
this.socketFunctions.add(socketFunction);
}
/** /**
* connect the client to the server * connect the client to the server
*/ */
connect() { public connect() {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
plugins.smartlog.defaultLogger.log('info', 'trying to connect...'); plugins.smartlog.defaultLogger.log('info', 'trying to connect...');
let socketUrl = `${this.serverUrl}:${this.serverPort}`; const socketUrl = `${this.serverUrl}:${this.serverPort}`;
this.socketConnection = new SocketConnection({ this.socketConnection = new SocketConnection({
alias: this.alias, alias: this.alias,
authenticated: false, authenticated: false,
role: undefined, role: undefined,
side: 'client', side: 'client',
smartsocketHost: null, smartsocketHost: this,
socket: plugins.socketIoClient(socketUrl, { multiplex: false }) socket: plugins.socketIoClient(socketUrl, { multiplex: false })
}); });
this.socketConnection.socket.on('requestAuth', () => { this.socketConnection.socket.on('requestAuth', () => {
@ -62,8 +72,8 @@ export class SmartsocketClient {
return done.promise; return done.promise;
} }
disconnect() { public disconnect() {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
this.socketConnection.socket.disconnect(); this.socketConnection.socket.disconnect();
this.socketConnection = undefined; this.socketConnection = undefined;
plugins.smartlog.defaultLogger.log('ok', 'disconnected!'); plugins.smartlog.defaultLogger.log('ok', 'disconnected!');
@ -71,9 +81,9 @@ export class SmartsocketClient {
return done.promise; return done.promise;
} }
serverCall(functionNameArg: string, dataArg: any) { public serverCall(functionNameArg: string, dataArg: any) {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
let socketRequest = new SocketRequest({ const socketRequest = new SocketRequest(this, {
side: 'requesting', side: 'requesting',
originSocketConnection: this.socketConnection, originSocketConnection: this.socketConnection,
shortId: plugins.shortid.generate(), shortId: plugins.shortid.generate(),
@ -82,8 +92,8 @@ export class SmartsocketClient {
funcDataArg: dataArg funcDataArg: dataArg
} }
}); });
socketRequest.dispatch().then((dataArg: ISocketFunctionCall) => { socketRequest.dispatch().then((dataArg2: ISocketFunctionCall) => {
done.resolve(dataArg.funcDataArg); done.resolve(dataArg2.funcDataArg);
}); });
return done.promise; return done.promise;
} }

View File

@ -1,5 +1,4 @@
import * as plugins from './smartsocket.plugins'; import * as plugins from './smartsocket.plugins';
import * as helpers from './smartsocket.helpers';
import { Objectmap } from '@pushrocks/lik'; import { Objectmap } from '@pushrocks/lik';
@ -9,12 +8,12 @@ import { SocketFunction } from './smartsocket.classes.socketfunction';
import { import {
SocketRequest, SocketRequest,
ISocketRequestDataObject, ISocketRequestDataObject,
allSocketRequests
} from './smartsocket.classes.socketrequest'; } from './smartsocket.classes.socketrequest';
import { SocketRole } from './smartsocket.classes.socketrole'; import { SocketRole } from './smartsocket.classes.socketrole';
// socket.io // socket.io
import * as SocketIO from 'socket.io'; import * as SocketIO from 'socket.io';
import { SmartsocketClient } from './smartsocket.classes.smartsocketclient';
// export interfaces // export interfaces
@ -31,7 +30,7 @@ export interface ISocketConnectionConstructorOptions {
authenticated: boolean; authenticated: boolean;
role: SocketRole; role: SocketRole;
side: TSocketConnectionSide; side: TSocketConnectionSide;
smartsocketHost: Smartsocket; smartsocketHost: Smartsocket | SmartsocketClient;
socket: SocketIO.Socket | SocketIOClient.Socket; socket: SocketIO.Socket | SocketIOClient.Socket;
} }
@ -51,18 +50,18 @@ export let allSocketConnections = new Objectmap<SocketConnection>();
* class SocketConnection represents a websocket connection * class SocketConnection represents a websocket connection
*/ */
export class SocketConnection { export class SocketConnection {
alias: string; public alias: string;
side: TSocketConnectionSide; public side: TSocketConnectionSide;
authenticated: boolean = false; public authenticated: boolean = false;
role: SocketRole; public role: SocketRole;
smartsocketHost: Smartsocket; public smartsocketRef: Smartsocket | SmartsocketClient;
socket: any; // SocketIO.Socket | SocketIOClient.Socket public socket: SocketIO.Socket | SocketIOClient.Socket;
constructor(optionsArg: ISocketConnectionConstructorOptions) { constructor(optionsArg: ISocketConnectionConstructorOptions) {
this.alias = optionsArg.alias; this.alias = optionsArg.alias;
this.authenticated = optionsArg.authenticated; this.authenticated = optionsArg.authenticated;
this.role = optionsArg.role; this.role = optionsArg.role;
this.side = optionsArg.side; this.side = optionsArg.side;
this.smartsocketHost = optionsArg.smartsocketHost; this.smartsocketRef = optionsArg.smartsocketHost;
this.socket = optionsArg.socket; this.socket = optionsArg.socket;
// standard behaviour that is always true // standard behaviour that is always true
@ -82,19 +81,19 @@ export class SocketConnection {
/** /**
* authenticate the socket * authenticate the socket
*/ */
authenticate() { public authenticate() {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
this.socket.on('dataAuth', (dataArg: ISocketConnectionAuthenticationObject) => { this.socket.on('dataAuth', (dataArg: ISocketConnectionAuthenticationObject) => {
plugins.smartlog.defaultLogger.log( plugins.smartlog.defaultLogger.log(
'info', 'info',
'received authentication data. now hashing and comparing...' 'received authentication data. now hashing and comparing...'
); );
this.socket.removeListener('dataAuth', () => {}); this.socket.removeListener('dataAuth', () => {});
if (helpers.checkPasswordForRole(dataArg, this.smartsocketHost)) { if (SocketRole.checkPasswordForRole(dataArg, this.smartsocketRef)) {
// TODO: authenticate password // TODO: authenticate password
this.alias = dataArg.alias; this.alias = dataArg.alias;
this.authenticated = true; this.authenticated = true;
this.role = helpers.getSocketRoleByName(dataArg.role, this.smartsocketHost); this.role = SocketRole.getSocketRoleByName(this.smartsocketRef, dataArg.role);
this.socket.emit('authenticated'); this.socket.emit('authenticated');
plugins.smartlog.defaultLogger.log( plugins.smartlog.defaultLogger.log(
'ok', 'ok',
@ -116,20 +115,20 @@ export class SocketConnection {
/** /**
* listen to function requests * listen to function requests
*/ */
listenToFunctionRequests() { public listenToFunctionRequests() {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
if (this.authenticated) { if (this.authenticated) {
this.socket.on('function', (dataArg: ISocketRequestDataObject) => { this.socket.on('function', (dataArg: ISocketRequestDataObject) => {
// check if requested function is available to the socket's scope // check if requested function is available to the socket's scope
plugins.smartlog.defaultLogger.log('info', 'function request received'); plugins.smartlog.defaultLogger.log('info', 'function request received');
let referencedFunction: SocketFunction = this.role.allowedFunctions.find( const referencedFunction: SocketFunction = this.role.allowedFunctions.find(
socketFunctionArg => { socketFunctionArg => {
return socketFunctionArg.name === dataArg.funcCallData.funcName; return socketFunctionArg.name === dataArg.funcCallData.funcName;
} }
); );
if (referencedFunction !== undefined) { if (referencedFunction !== undefined) {
plugins.smartlog.defaultLogger.log('ok', 'function in access scope'); plugins.smartlog.defaultLogger.log('ok', 'function in access scope');
let localSocketRequest = new SocketRequest({ const localSocketRequest = new SocketRequest(this.smartsocketRef, {
side: 'responding', side: 'responding',
originSocketConnection: this, originSocketConnection: this,
shortId: dataArg.shortId, shortId: dataArg.shortId,
@ -148,7 +147,7 @@ export class SocketConnection {
'info', 'info',
`received response for request with id ${dataArg.shortId}` `received response for request with id ${dataArg.shortId}`
); );
let targetSocketRequest = helpers.getSocketRequestById(dataArg.shortId); const targetSocketRequest = SocketRequest.getSocketRequestById(this.smartsocketRef, dataArg.shortId);
targetSocketRequest.handleResponse(dataArg); targetSocketRequest.handleResponse(dataArg);
}); });
plugins.smartlog.defaultLogger.log( plugins.smartlog.defaultLogger.log(
@ -157,7 +156,7 @@ export class SocketConnection {
); );
done.resolve(this); done.resolve(this);
} else { } else {
let errMessage: 'socket needs to be authenticated first'; const errMessage = 'socket needs to be authenticated first';
plugins.smartlog.defaultLogger.log('error', errMessage); plugins.smartlog.defaultLogger.log('error', errMessage);
done.reject(errMessage); done.reject(errMessage);
} }

View File

@ -4,6 +4,8 @@ import * as plugins from './smartsocket.plugins';
import { Objectmap } from '@pushrocks/lik'; import { Objectmap } from '@pushrocks/lik';
import { SocketRole } from './smartsocket.classes.socketrole'; import { SocketRole } from './smartsocket.classes.socketrole';
import { SocketConnection } from './smartsocket.classes.socketconnection'; import { SocketConnection } from './smartsocket.classes.socketconnection';
import { Smartsocket } from './smartsocket.classes.smartsocket';
import { SmartsocketClient } from './smartsocket.classes.smartsocketclient';
// export interfaces // export interfaces
@ -29,18 +31,24 @@ export interface ISocketFunctionCall {
*/ */
export type TFuncDef = (dataArg: any, connectionArg: SocketConnection) => PromiseLike<any>; export type TFuncDef = (dataArg: any, connectionArg: SocketConnection) => PromiseLike<any>;
// export objects
export let allSocketFunctions = new Objectmap<SocketFunction>();
// export classes // export classes
/** /**
* class that respresents a function that can be transparently called using a SocketConnection * class that respresents a function that can be transparently called using a SocketConnection
*/ */
export class SocketFunction { export class SocketFunction {
name: string; // STATIC
funcDef: TFuncDef; public static getSocketFunctionByName (smartsocketRefArg: Smartsocket | SmartsocketClient, functionNameArg: string): SocketFunction {
roles: SocketRole[]; console.log(smartsocketRefArg.socketFunctions);
return smartsocketRefArg.socketFunctions.find(socketFunctionArg => {
return socketFunctionArg.name === functionNameArg;
});
}
// INSTANCE
public name: string;
public funcDef: TFuncDef;
public roles: SocketRole[];
/** /**
* the constructor for SocketFunction * the constructor for SocketFunction
@ -49,20 +57,19 @@ export class SocketFunction {
this.name = optionsArg.funcName; this.name = optionsArg.funcName;
this.funcDef = optionsArg.funcDef; this.funcDef = optionsArg.funcDef;
this.roles = optionsArg.allowedRoles; this.roles = optionsArg.allowedRoles;
for (let socketRoleArg of this.roles) { for (const socketRoleArg of this.roles) {
this._notifyRole(socketRoleArg); this._notifyRole(socketRoleArg);
} }
allSocketFunctions.add(this); // map instance with Objectmap
} }
/** /**
* invokes the function of this SocketFunction * invokes the function of this SocketFunction
*/ */
invoke(dataArg: ISocketFunctionCall, socketConnectionArg: SocketConnection): Promise<any> { public invoke(dataArg: ISocketFunctionCall, socketConnectionArg: SocketConnection): Promise<any> {
let done = plugins.smartpromise.defer(); const done = plugins.smartpromise.defer();
if (dataArg.funcName === this.name) { if (dataArg.funcName === this.name) {
this.funcDef(dataArg.funcDataArg, socketConnectionArg).then((resultData: any) => { this.funcDef(dataArg.funcDataArg, socketConnectionArg).then((resultData: any) => {
let funcResponseData: ISocketFunctionCall = { const funcResponseData: ISocketFunctionCall = {
funcName: this.name, funcName: this.name,
funcDataArg: resultData funcDataArg: resultData
}; };

View File

@ -1,14 +1,14 @@
import * as plugins from './smartsocket.plugins'; import * as plugins from './smartsocket.plugins';
import * as helpers from './smartsocket.helpers';
// import interfaces // import interfaces
import { ISocketFunctionCall } from './smartsocket.classes.socketfunction'; import { SocketFunction, ISocketFunctionCall } from './smartsocket.classes.socketfunction';
// import classes // import classes
import { Objectmap } from '@pushrocks/lik'; import { Objectmap } from '@pushrocks/lik';
import { SocketFunction } from './smartsocket.classes.socketfunction';
import { SocketConnection } from './smartsocket.classes.socketconnection'; import { SocketConnection } from './smartsocket.classes.socketconnection';
import { defaultLogger } from '@pushrocks/smartlog'; import { defaultLogger } from '@pushrocks/smartlog';
import { Smartsocket } from './smartsocket.classes.smartsocket';
import { SmartsocketClient } from './smartsocket.classes.smartsocketclient';
// export interfaces // export interfaces
export type TSocketRequestStatus = 'new' | 'pending' | 'finished'; export type TSocketRequestStatus = 'new' | 'pending' | 'finished';
@ -33,23 +33,36 @@ export interface ISocketRequestDataObject {
responseTimeout?: number; responseTimeout?: number;
} }
// export objects
export let allSocketRequests = new Objectmap<SocketRequest>();
// export classes // export classes
export class SocketRequest { export class SocketRequest {
// STATIC
public static getSocketRequestById(
smartsocketRef: Smartsocket | SmartsocketClient,
shortIdArg: string
): SocketRequest {
return smartsocketRef.socketRequests.find(socketRequestArg => {
return socketRequestArg.shortid === shortIdArg;
});
}
// INSTANCE
public status: TSocketRequestStatus = 'new'; public status: TSocketRequestStatus = 'new';
public side: TSocketRequestSide; public side: TSocketRequestSide;
public shortid: string; public shortid: string;
public originSocketConnection: SocketConnection; public originSocketConnection: SocketConnection;
public funcCallData: ISocketFunctionCall; public funcCallData: ISocketFunctionCall;
public done = plugins.smartpromise.defer(); public done = plugins.smartpromise.defer();
constructor(optionsArg: SocketRequestConstructorOptions) {
public smartsocketRef: Smartsocket | SmartsocketClient;
constructor(smartsocketRefArg: Smartsocket | SmartsocketClient, optionsArg: SocketRequestConstructorOptions) {
this.smartsocketRef = smartsocketRefArg;
this.side = optionsArg.side; this.side = optionsArg.side;
this.shortid = optionsArg.shortId; this.shortid = optionsArg.shortId;
this.funcCallData = optionsArg.funcCallData; this.funcCallData = optionsArg.funcCallData;
this.originSocketConnection = optionsArg.originSocketConnection; this.originSocketConnection = optionsArg.originSocketConnection;
allSocketRequests.add(this); this.smartsocketRef.socketRequests.add(this);
} }
// requesting -------------------------- // requesting --------------------------
@ -58,7 +71,7 @@ export class SocketRequest {
* dispatches a socketrequest from the requesting to the receiving side * dispatches a socketrequest from the requesting to the receiving side
*/ */
public dispatch() { public dispatch() {
let requestData: ISocketRequestDataObject = { const requestData: ISocketRequestDataObject = {
funcCallData: this.funcCallData, funcCallData: this.funcCallData,
shortId: this.shortid shortId: this.shortid
}; };
@ -72,7 +85,7 @@ export class SocketRequest {
public handleResponse(responseDataArg: ISocketRequestDataObject) { public handleResponse(responseDataArg: ISocketRequestDataObject) {
plugins.smartlog.defaultLogger.log('info', 'handling response!'); plugins.smartlog.defaultLogger.log('info', 'handling response!');
this.done.resolve(responseDataArg.funcCallData); this.done.resolve(responseDataArg.funcCallData);
allSocketRequests.remove(this); this.smartsocketRef.socketRequests.remove(this);
} }
// responding -------------------------- // responding --------------------------
@ -81,9 +94,11 @@ export class SocketRequest {
* creates the response on the responding side * creates the response on the responding side
*/ */
public async createResponse(): Promise<void> { public async createResponse(): Promise<void> {
const targetSocketFunction: SocketFunction = helpers.getSocketFunctionByName( const targetSocketFunction: SocketFunction = SocketFunction.getSocketFunctionByName(
this.smartsocketRef,
this.funcCallData.funcName this.funcCallData.funcName
); );
if (!targetSocketFunction) { if (!targetSocketFunction) {
defaultLogger.log( defaultLogger.log(
'warn', 'warn',
@ -95,12 +110,12 @@ export class SocketRequest {
plugins.smartlog.defaultLogger.log('info', `invoking ${targetSocketFunction.name}`); plugins.smartlog.defaultLogger.log('info', `invoking ${targetSocketFunction.name}`);
targetSocketFunction.invoke(this.funcCallData, this.originSocketConnection).then(resultData => { targetSocketFunction.invoke(this.funcCallData, this.originSocketConnection).then(resultData => {
plugins.smartlog.defaultLogger.log('info', 'got resultData. Sending it to requesting party.'); plugins.smartlog.defaultLogger.log('info', 'got resultData. Sending it to requesting party.');
let requestData: ISocketRequestDataObject = { const requestData: ISocketRequestDataObject = {
funcCallData: resultData, funcCallData: resultData,
shortId: this.shortid shortId: this.shortid
}; };
this.originSocketConnection.socket.emit('functionResponse', requestData); this.originSocketConnection.socket.emit('functionResponse', requestData);
allSocketRequests.remove(this); this.smartsocketRef.socketRequests.remove(this);
}); });
} }
} }

View File

@ -1,8 +1,12 @@
import * as plugins from './smartsocket.plugins'; import * as plugins from './smartsocket.plugins';
// import classes // import classes
import { Objectmap } from '@pushrocks/lik'; import { Objectmap } from '@pushrocks/lik';
import { SocketFunction } from './smartsocket.classes.socketfunction'; import { SocketFunction } from './smartsocket.classes.socketfunction';
import { Smartsocket } from './smartsocket.classes.smartsocket';
import { SmartsocketClient } from './smartsocket.classes.smartsocketclient';
import { ISocketConnectionAuthenticationObject } from './smartsocket.classes.socketconnection';
/** /**
* interface for class SocketRole * interface for class SocketRole
@ -16,14 +20,34 @@ export interface SocketRoleOptions {
* A socketrole defines access to certain routines. * A socketrole defines access to certain routines.
*/ */
export class SocketRole { export class SocketRole {
name: string; // STATIC
passwordHash: string; public static getSocketRoleByName(
allowedFunctions = new Objectmap<SocketFunction>(); referenceSmartsocket: Smartsocket | SmartsocketClient,
socketRoleNameArg: string,
): SocketRole{
return referenceSmartsocket.socketRoles.find(socketRoleArg => {
return socketRoleArg.name === socketRoleNameArg;
});
}
public static checkPasswordForRole (
dataArg: ISocketConnectionAuthenticationObject,
referenceSmartsocket: Smartsocket | SmartsocketClient
): boolean {
const targetPasswordHash = SocketRole.getSocketRoleByName(referenceSmartsocket, dataArg.role).passwordHash;
const computedCompareHash = plugins.smarthash.sha256FromStringSync(dataArg.password);
return targetPasswordHash === computedCompareHash;
}
// INSTANCE
public name: string;
public passwordHash: string;
public allowedFunctions = new Objectmap<SocketFunction>();
constructor(optionsArg: SocketRoleOptions) { constructor(optionsArg: SocketRoleOptions) {
this.name = optionsArg.name; this.name = optionsArg.name;
this.passwordHash = optionsArg.passwordHash; this.passwordHash = optionsArg.passwordHash;
} }
addSocketFunction(socketFunctionArg: SocketFunction) { public addSocketFunction(socketFunctionArg: SocketFunction) {
this.allowedFunctions.add(socketFunctionArg); this.allowedFunctions.add(socketFunctionArg);
} }
} }

View File

@ -1,60 +0,0 @@
import * as plugins from './smartsocket.plugins';
// classes
import { Smartsocket } from './smartsocket.classes.smartsocket';
import { SocketFunction, allSocketFunctions } from './smartsocket.classes.socketfunction';
import {
SocketConnection,
ISocketConnectionAuthenticationObject
} from './smartsocket.classes.socketconnection';
import {
SocketRequest,
allSocketRequests,
TSocketRequestSide
} from './smartsocket.classes.socketrequest';
import { SocketRole } from './smartsocket.classes.socketrole';
// SocketConnection helpers
export let checkPasswordForRole = (
dataArg: ISocketConnectionAuthenticationObject,
referenceSmartsocket: Smartsocket
): boolean => {
let targetPasswordHash = getSocketRoleByName(dataArg.role, referenceSmartsocket).passwordHash;
let computedCompareHash = plugins.smarthash.sha256FromStringSync(dataArg.password);
return targetPasswordHash === computedCompareHash;
};
// SocketFunction helpers
export let getSocketFunctionByName = (functionNameArg: string): SocketFunction => {
return allSocketFunctions.find(socketFunctionArg => {
return socketFunctionArg.name === functionNameArg;
});
};
// SocketRequest helpers
/**
* get corresponding Socketrequest instance by shortId
*/
export let getSocketRequestById = (
shortIdArg: string,
requestSide?: TSocketRequestSide
): SocketRequest => {
return allSocketRequests.find(socketRequestArg => {
return socketRequestArg.shortid === shortIdArg;
});
};
// SocketRole helpers
/**
* get corresponding SocketRole instance by name
*/
export let getSocketRoleByName = (
socketRoleNameArg: string,
referenceSmartsocket: Smartsocket
): SocketRole => {
return referenceSmartsocket.socketRoles.find(socketRoleArg => {
return socketRoleArg.name === socketRoleNameArg;
});
};