From a96144d6dcf5c885eab9a0c796b3c4b15f941e40 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Mon, 8 Nov 2021 12:47:26 +0100 Subject: [PATCH] Remove empty catch blocks and remove allow-empty-catch tslint rule (#170) * Remove empty catch blocks and remove allow-empty-catch tslint rule * Update jslib to #513 * Fix build errors after update of jslib * Add missing params to LoginCommand ctor * Fix build errors due to missing dependencies * Add changes to package.json and package-lock.json * Fixed formatting in tslint.json --- jslib | 2 +- package-lock.json | 506 ++++--------------------- package.json | 4 +- src/app/accounts/apiKey.component.ts | 7 +- src/app/app.component.ts | 7 +- src/app/services/services.module.ts | 2 +- src/app/tabs/settings.component.ts | 7 +- src/bwdc.ts | 38 ++ src/main.ts | 2 +- src/program.ts | 3 +- src/services/ldap-directory.service.ts | 4 +- tslint.json | 2 +- 12 files changed, 134 insertions(+), 450 deletions(-) diff --git a/jslib b/jslib index cb006046..f09fb698 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit cb00604617a3d38fb450d900dbdf63b636ae01f6 +Subproject commit f09fb69882525b3be7b2e257e7723eeb79b343d1 diff --git a/package-lock.json b/package-lock.json index 0e1dc24b..c8ba7b62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,8 +103,8 @@ "version": "0.0.0", "license": "GPL-3.0", "dependencies": { - "@microsoft/signalr": "3.1.13", - "@microsoft/signalr-protocol-msgpack": "3.1.13", + "@microsoft/signalr": "5.0.10", + "@microsoft/signalr-protocol-msgpack": "5.0.10", "big-integer": "1.6.48", "browser-hrtime": "^1.1.8", "lunr": "^2.3.9", @@ -1142,21 +1142,23 @@ "dev": true }, "node_modules/@microsoft/signalr": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-3.1.13.tgz", - "integrity": "sha512-U3QuWlu5piriiHBPuTdc3rLJudcJM0CS/g8Y5p0eDSkCXbygTal2N28xEpbeUQ0AxW9XE/yfriesjdRicEtIdw==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-5.0.10.tgz", + "integrity": "sha512-7jg6s/cmULyeVvt5/bTB4N9T30HvAF1S06hL+nPcQMODXcclRo34Zcli/dfTLR8lCX31/cVEOmVgxXBOVRQ+Dw==", "dependencies": { + "abort-controller": "^3.0.0", "eventsource": "^1.0.7", - "request": "^2.88.0", + "fetch-cookie": "^0.7.3", + "node-fetch": "^2.6.0", "ws": "^6.0.0" } }, "node_modules/@microsoft/signalr-protocol-msgpack": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-3.1.13.tgz", - "integrity": "sha512-IR8IqvRFb9hGA/nSKhzT8X4bY40Wk4QvR0epcbGgUXLhThKUnd2YpFpqJIEgd8b8XkLgVX+PBOi+kiBx0+4yDw==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-5.0.10.tgz", + "integrity": "sha512-HqZiNLyjYP1ONeLgYUjFBUsnhxSp5CW4AW8InsLI7lyAXZl2drUhkiBxf3xK9UsTErO1+9r5sdaYdSmUY8nx9A==", "dependencies": { - "@microsoft/signalr": ">=3.1.13", + "@microsoft/signalr": ">=5.0.10", "msgpack5": "^4.5.0" } }, @@ -1882,6 +1884,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2391,19 +2394,6 @@ "node": ">=10.12.0" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" - }, "node_modules/backoff": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", @@ -2508,14 +2498,6 @@ } ] }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/big-integer": { "version": "1.6.48", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", @@ -3107,11 +3089,6 @@ "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "dev": true }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4650,15 +4627,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -5340,6 +5308,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es6-denodeify": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-denodeify/-/es6-denodeify-0.1.5.tgz", + "integrity": "sha1-MdTV/pxVA+ElRgQ5MQ4WoqPznB8=" + }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -5753,7 +5726,8 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", @@ -5789,6 +5763,15 @@ "pend": "~1.2.0" } }, + "node_modules/fetch-cookie": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.7.3.tgz", + "integrity": "sha512-rZPkLnI8x5V+zYAiz8QonAHsTb4BY+iFowFBI1RFn0zrO343AVp9X7/yUj/9wL6Ef/8fLls8b/vGtzUvmyAUGA==", + "dependencies": { + "es6-denodeify": "^0.1.1", + "tough-cookie": "^2.3.3" + } + }, "node_modules/figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -5950,14 +5933,6 @@ "node": ">=4" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "engines": { - "node": "*" - } - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -6261,14 +6236,6 @@ "node": ">=0.10.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -6532,27 +6499,6 @@ "node": ">=10" } }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -6892,20 +6838,6 @@ "node": ">= 6" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -7620,7 +7552,8 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "node_modules/is-unicode-supported": { "version": "0.1.0", @@ -7692,11 +7625,6 @@ "node": ">=0.10.0" } }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "node_modules/jake": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", @@ -7800,11 +7728,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -7843,15 +7766,11 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/json-schema-typed": { "version": "7.0.3", @@ -7861,7 +7780,8 @@ "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "optional": true }, "node_modules/json5": { "version": "2.2.0", @@ -7886,28 +7806,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "node_modules/jsprim/node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "engines": [ - "node >=0.6.0" - ] - }, "node_modules/jwa": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", @@ -9363,14 +9261,6 @@ "node": ">=0.10.0" } }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -10024,11 +9914,6 @@ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, "node_modules/picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", @@ -11049,67 +10934,6 @@ "node": ">=0.10" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -11989,30 +11813,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -13372,11 +13172,6 @@ "node": "*" } }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -15402,8 +15197,8 @@ "@bitwarden/jslib-common": { "version": "file:jslib/common", "requires": { - "@microsoft/signalr": "3.1.13", - "@microsoft/signalr-protocol-msgpack": "3.1.13", + "@microsoft/signalr": "5.0.10", + "@microsoft/signalr-protocol-msgpack": "5.0.10", "@types/lunr": "^2.3.3", "@types/node": "^14.17.1", "@types/node-forge": "^0.9.7", @@ -15736,21 +15531,23 @@ "dev": true }, "@microsoft/signalr": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-3.1.13.tgz", - "integrity": "sha512-U3QuWlu5piriiHBPuTdc3rLJudcJM0CS/g8Y5p0eDSkCXbygTal2N28xEpbeUQ0AxW9XE/yfriesjdRicEtIdw==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-5.0.10.tgz", + "integrity": "sha512-7jg6s/cmULyeVvt5/bTB4N9T30HvAF1S06hL+nPcQMODXcclRo34Zcli/dfTLR8lCX31/cVEOmVgxXBOVRQ+Dw==", "requires": { + "abort-controller": "^3.0.0", "eventsource": "^1.0.7", - "request": "^2.88.0", + "fetch-cookie": "^0.7.3", + "node-fetch": "^2.6.0", "ws": "^6.0.0" } }, "@microsoft/signalr-protocol-msgpack": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-3.1.13.tgz", - "integrity": "sha512-IR8IqvRFb9hGA/nSKhzT8X4bY40Wk4QvR0epcbGgUXLhThKUnd2YpFpqJIEgd8b8XkLgVX+PBOi+kiBx0+4yDw==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-5.0.10.tgz", + "integrity": "sha512-HqZiNLyjYP1ONeLgYUjFBUsnhxSp5CW4AW8InsLI7lyAXZl2drUhkiBxf3xK9UsTErO1+9r5sdaYdSmUY8nx9A==", "requires": { - "@microsoft/signalr": ">=3.1.13", + "@microsoft/signalr": ">=5.0.10", "msgpack5": "^4.5.0" } }, @@ -16417,6 +16214,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -16820,16 +16618,6 @@ "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz", "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==" }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" - }, "backoff": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", @@ -16904,14 +16692,6 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, "big-integer": { "version": "1.6.48", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", @@ -17380,11 +17160,6 @@ "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -18584,15 +18359,6 @@ } } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -19130,6 +18896,11 @@ "is-symbol": "^1.0.2" } }, + "es6-denodeify": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-denodeify/-/es6-denodeify-0.1.5.tgz", + "integrity": "sha1-MdTV/pxVA+ElRgQ5MQ4WoqPznB8=" + }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -19452,7 +19223,8 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -19488,6 +19260,15 @@ "pend": "~1.2.0" } }, + "fetch-cookie": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.7.3.tgz", + "integrity": "sha512-rZPkLnI8x5V+zYAiz8QonAHsTb4BY+iFowFBI1RFn0zrO343AVp9X7/yUj/9wL6Ef/8fLls8b/vGtzUvmyAUGA==", + "requires": { + "es6-denodeify": "^0.1.1", + "tough-cookie": "^2.3.3" + } + }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -19613,11 +19394,6 @@ "prebuild-install": "^5.0.0" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -19869,14 +19645,6 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -20075,20 +19843,6 @@ "jws": "^4.0.0" } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -20342,16 +20096,6 @@ "debug": "4" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -20859,7 +20603,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-unicode-supported": { "version": "0.1.0", @@ -20910,11 +20655,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "jake": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", @@ -20999,11 +20739,6 @@ "argparse": "^2.0.1" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -21036,15 +20771,11 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-schema-typed": { "version": "7.0.3", @@ -21054,7 +20785,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "optional": true }, "json5": { "version": "2.2.0", @@ -21073,24 +20805,6 @@ "graceful-fs": "^4.1.6" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, - "dependencies": { - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - } - } - }, "jwa": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", @@ -22269,11 +21983,6 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -22795,11 +22504,6 @@ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, "picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", @@ -23579,55 +23283,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -24306,22 +23961,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -25455,11 +25094,6 @@ "safe-buffer": "^5.0.1" } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", diff --git a/package.json b/package.json index a6eac3a8..9b207909 100644 --- a/package.json +++ b/package.json @@ -155,6 +155,7 @@ "mini-css-extract-plugin": "^1.5.0", "node-loader": "^1.0.3", "pkg": "^5.1.0", + "prebuild-install": "^5.0.0", "rimraf": "^3.0.2", "sass": "^1.32.11", "sass-loader": "^10.1.1", @@ -167,8 +168,7 @@ "webpack": "^4.46.0", "webpack-cli": "^4.6.0", "webpack-merge": "^5.7.3", - "webpack-node-externals": "^3.0.0", - "prebuild-install": "^5.0.0" + "webpack-node-externals": "^3.0.0" }, "dependencies": { "@bitwarden/jslib-angular": "file:jslib/angular", diff --git a/src/app/accounts/apiKey.component.ts b/src/app/accounts/apiKey.component.ts index c837803e..f9ffc683 100644 --- a/src/app/accounts/apiKey.component.ts +++ b/src/app/accounts/apiKey.component.ts @@ -12,6 +12,7 @@ import { EnvironmentComponent } from './environment.component'; import { ApiKeyService } from 'jslib-common/abstractions/apiKey.service'; import { AuthService } from 'jslib-common/abstractions/auth.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { ModalService } from 'jslib-angular/services/modal.service'; @@ -35,7 +36,7 @@ export class ApiKeyComponent { constructor(private authService: AuthService, private apiKeyService: ApiKeyService, private router: Router, private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver, private configurationService: ConfigurationService, private platformUtilsService: PlatformUtilsService, - private modalService: ModalService) { } + private modalService: ModalService, private logService: LogService) { } async submit() { if (this.clientId == null || this.clientId === '') { @@ -67,7 +68,9 @@ export class ApiKeyComponent { const organizationId = await this.apiKeyService.getEntityId(); await this.configurationService.saveOrganizationId(organizationId); this.router.navigate([this.successRoute]); - } catch { } + } catch (e) { + this.logService.error(e); + } } async settings() { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1eebc9f3..19beae68 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -24,6 +24,7 @@ import { BroadcasterService } from 'jslib-angular/services/broadcaster.service'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { AuthService } from 'jslib-common/abstractions/auth.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { StateService } from 'jslib-common/abstractions/state.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; @@ -62,7 +63,7 @@ export class AppComponent implements OnInit { private sanitizer: DomSanitizer, private ngZone: NgZone, private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService, private configurationService: ConfigurationService, private syncService: SyncService, - private stateService: StateService, private apiService: ApiService) { + private stateService: StateService, private apiService: ApiService, private logService: LogService) { (window as any).BitwardenToasterService = toasterService; } @@ -108,7 +109,9 @@ export class AppComponent implements OnInit { if (lastSyncAgo >= syncInterval) { await this.syncService.sync(false, false); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.messagingService.send('scheduleNextDirSync'); break; diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 7ed595c8..363367d4 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -83,7 +83,7 @@ const configurationService = new ConfigurationService(storageService, secureStor const syncService = new SyncService(configurationService, logService, cryptoFunctionService, apiService, messagingService, i18nService, environmentService); const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, null); -const policyService = new PolicyService(userService, storageService); +const policyService = new PolicyService(userService, storageService, apiService); containerService.attachToWindow(window); diff --git a/src/app/tabs/settings.component.ts b/src/app/tabs/settings.component.ts index 61dcb8f2..01a20664 100644 --- a/src/app/tabs/settings.component.ts +++ b/src/app/tabs/settings.component.ts @@ -7,6 +7,7 @@ import { } from '@angular/core'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { StateService } from 'jslib-common/abstractions/state.service'; import { ProfileOrganizationResponse } from 'jslib-common/models/response/profileOrganizationResponse'; @@ -45,7 +46,7 @@ export class SettingsComponent implements OnInit, OnDestroy { constructor(private i18nService: I18nService, private configurationService: ConfigurationService, private changeDetectorRef: ChangeDetectorRef, private ngZone: NgZone, - private stateService: StateService) { + private stateService: StateService, private logService: LogService) { this.directoryOptions = [ { name: i18nService.t('select'), value: null }, { name: 'Active Directory / LDAP', value: DirectoryType.Ldap }, @@ -105,7 +106,9 @@ export class SettingsComponent implements OnInit, OnDestroy { this.gsuite.clientEmail = result.client_email; this.gsuite.privateKey = result.private_key; } - } catch { } + } catch (e) { + this.logService.error(e); + } this.changeDetectorRef.detectChanges(); }); diff --git a/src/bwdc.ts b/src/bwdc.ts index cada7499..e921802b 100644 --- a/src/bwdc.ts +++ b/src/bwdc.ts @@ -18,12 +18,21 @@ import { NodeCryptoFunctionService } from 'jslib-node/services/nodeCryptoFunctio import { ApiKeyService } from 'jslib-common/services/apiKey.service'; import { AppIdService } from 'jslib-common/services/appId.service'; +import { CipherService } from 'jslib-common/services/cipher.service'; +import { CollectionService } from 'jslib-common/services/collection.service'; import { ConstantsService } from 'jslib-common/services/constants.service'; import { ContainerService } from 'jslib-common/services/container.service'; import { CryptoService } from 'jslib-common/services/crypto.service'; import { EnvironmentService } from 'jslib-common/services/environment.service'; +import { FileUploadService } from 'jslib-common/services/fileUpload.service'; +import { FolderService } from 'jslib-common/services/folder.service'; import { NoopMessagingService } from 'jslib-common/services/noopMessaging.service'; import { PasswordGenerationService } from 'jslib-common/services/passwordGeneration.service'; +import { PolicyService } from 'jslib-common/services/policy.service'; +import { SearchService } from 'jslib-common/services/search.service'; +import { SendService } from 'jslib-common/services/send.service'; +import { SettingsService } from 'jslib-common/services/settings.service'; +import { SyncService as LoginSyncService } from 'jslib-common/services/sync.service'; import { TokenService } from 'jslib-common/services/token.service'; import { UserService } from 'jslib-common/services/user.service'; @@ -35,6 +44,7 @@ import { refreshToken } from './services/api.service'; // tslint:disable-next-line const packageJson = require('./package.json'); +export let searchService: SearchService = null; export class Main { dataFilePath: string; logService: ConsoleLogService; @@ -55,8 +65,17 @@ export class Main { cryptoFunctionService: NodeCryptoFunctionService; authService: AuthService; configurationService: ConfigurationService; + collectionService: CollectionService; + cipherService: CipherService; + fileUploadService: FileUploadService; + folderService: FolderService; + searchService: SearchService; + sendService: SendService; + settingsService: SettingsService; syncService: SyncService; passwordGenerationService: PasswordGenerationService; + policyService: PolicyService; + loginSyncService: LoginSyncService; program: Program; constructor() { @@ -108,6 +127,25 @@ export class Main { this.syncService = new SyncService(this.configurationService, this.logService, this.cryptoFunctionService, this.apiService, this.messagingService, this.i18nService, this.environmentService); this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService, null); + this.policyService = new PolicyService(this.userService, this.storageService, this.apiService); + this.settingsService = new SettingsService(this.userService, this.storageService); + this.fileUploadService = new FileUploadService(this.logService, this.apiService); + this.cipherService = new CipherService(this.cryptoService, this.userService, this.settingsService, + this.apiService, this.fileUploadService, this.storageService, this.i18nService, () => searchService, + this.logService); + this.searchService = new SearchService(this.cipherService, this.logService, this.i18nService); + this.folderService = new FolderService(this.cryptoService, this.userService, this.apiService, + this.storageService, this.i18nService, this.cipherService); + this.collectionService = new CollectionService(this.cryptoService, this.userService, this.storageService, + this.i18nService); + this.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService, this.storageService, + this.i18nService, this.cryptoFunctionService); + + this.loginSyncService = new LoginSyncService(this.userService, this.apiService, this.settingsService, + this.folderService, this.cipherService, this.cryptoService, this.collectionService, this.storageService, + this.messagingService, this.policyService, this.sendService, this.logService, + async (expired: boolean) => this.messagingService.send('logout', { expired: expired })); + this.program = new Program(this); } diff --git a/src/main.ts b/src/main.ts index 6be0a434..e9f89f8f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,7 +52,7 @@ export class Main { this.i18nService = new I18nService('en', './locales/'); this.storageService = new ElectronStorageService(app.getPath('userData')); - this.windowMain = new WindowMain(this.storageService, false, 800, 600, arg => this.processDeepLink(arg), null); + this.windowMain = new WindowMain(this.storageService, this.logService, false, 800, 600, arg => this.processDeepLink(arg), null); this.menuMain = new MenuMain(this); this.updaterMain = new UpdaterMain(this.i18nService, this.windowMain, 'directory-connector', () => { this.messagingService.send('checkingForUpdate'); diff --git a/src/program.ts b/src/program.ts index 71955500..b73ea3fa 100644 --- a/src/program.ts +++ b/src/program.ts @@ -101,7 +101,8 @@ export class Program extends BaseProgram { await this.exitIfAuthed(); const command = new LoginCommand(this.main.authService, this.main.apiService, this.main.i18nService, this.main.environmentService, this.main.passwordGenerationService, this.main.cryptoFunctionService, - this.main.platformUtilsService, 'connector'); + this.main.platformUtilsService, this.main.userService, this.main.cryptoService, + this.main.policyService, 'connector', this.main.loginSyncService); if (!Utils.isNullOrWhitespace(clientId)) { process.env.BW_CLIENTID = clientId; diff --git a/src/services/ldap-directory.service.ts b/src/services/ldap-directory.service.ts index f4649f69..de72e73b 100644 --- a/src/services/ldap-directory.service.ts +++ b/src/services/ldap-directory.service.ts @@ -284,7 +284,9 @@ export class LdapDirectoryService implements IDirectoryService { const control = parseInt(c, null); // tslint:disable-next-line return (control & UserControlAccountDisabled) === UserControlAccountDisabled; - } catch { } + } catch (e) { + this.logService.error(e); + } } return false; diff --git a/tslint.json b/tslint.json index 56dfb1f8..86fe8059 100644 --- a/tslint.json +++ b/tslint.json @@ -34,7 +34,7 @@ ] } ], - "no-empty": [ true, "allow-empty-catch" ], + "no-empty": [ true ], "object-literal-sort-keys": false, "object-literal-shorthand": [ true, "never" ], "prefer-for-of": false,