diff --git a/common/karma.conf.js b/common/karma.conf.js index 4a8b5d9a..3eef47b6 100644 --- a/common/karma.conf.js +++ b/common/karma.conf.js @@ -1,3 +1,4 @@ +const path = require('path'); const webpack = require('webpack'); module.exports = (config) => { @@ -58,6 +59,9 @@ module.exports = (config) => { "util": require.resolve("util/"), "url": require.resolve("url/"), }, + alias: { + src: path.resolve(__dirname, 'src/'), + }, }, plugins: [ new webpack.ProvidePlugin({ diff --git a/common/package-lock.json b/common/package-lock.json index 45e51a5f..f618f792 100644 --- a/common/package-lock.json +++ b/common/package-lock.json @@ -42,11 +42,36 @@ "process": "^0.11.10", "rimraf": "^3.0.2", "ts-loader": "^9.2.6", + "ttypescript": "^1.5.13", "typescript": "4.3.5", + "typescript-transform-paths": "^3.3.1", "url": "^0.11.0", "util": "^0.12.4" } }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@fluffy-spoon/substitute": { "version": "1.208.0", "resolved": "https://registry.npmjs.org/@fluffy-spoon/substitute/-/substitute-1.208.0.tgz", @@ -90,6 +115,34 @@ "node": ">= 10" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true, + "peer": true + }, "node_modules/@types/component-emitter": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", @@ -526,6 +579,13 @@ "node": ">= 8" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "peer": true + }, "node_modules/async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -926,6 +986,13 @@ "node": ">= 0.10" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "peer": true + }, "node_modules/cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -1053,6 +1120,16 @@ "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", "dev": true }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -1891,6 +1968,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -2446,6 +2535,13 @@ "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "peer": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2733,6 +2829,12 @@ "node": ">=0.10.0" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -2897,6 +2999,19 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -3436,11 +3551,80 @@ "webpack": "^5.0.0" } }, + "node_modules/ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/tslib": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, + "node_modules/ttypescript": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.13.tgz", + "integrity": "sha512-KT/RBfGGlVJFqEI8cVvI3nMsmYcFvPSZh8bU0qX+pAwbi7/ABmYkzn7l/K8skw0xmYjVCoyaV6WLsBQxdadybQ==", + "dev": true, + "dependencies": { + "resolve": ">=1.9.0" + }, + "bin": { + "ttsc": "bin/tsc", + "ttsserver": "bin/tsserver" + }, + "peerDependencies": { + "ts-node": ">=8.0.2", + "typescript": ">=3.2.2" + } + }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -3479,6 +3663,18 @@ "node": ">=4.2.0" } }, + "node_modules/typescript-transform-paths": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.3.1.tgz", + "integrity": "sha512-c+8Cqd2rsRtTU68rJI0NX/OtqgBDddNs1fIxm1nCNyhn0WpoyqtpUxc1w9Ke5c5kgE4/OT5xYbKf2cf694RYEg==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + }, + "peerDependencies": { + "typescript": ">=3.6.5" + } + }, "node_modules/ua-parser-js": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", @@ -3931,6 +4127,16 @@ "node": ">=10" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/zxcvbn": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/zxcvbn/-/zxcvbn-4.4.2.tgz", @@ -3938,6 +4144,23 @@ } }, "dependencies": { + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "peer": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "peer": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, "@fluffy-spoon/substitute": { "version": "1.208.0", "resolved": "https://registry.npmjs.org/@fluffy-spoon/substitute/-/substitute-1.208.0.tgz", @@ -3971,6 +4194,34 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true, + "peer": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true, + "peer": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true, + "peer": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true, + "peer": true + }, "@types/component-emitter": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", @@ -4365,6 +4616,13 @@ "picomatch": "^2.0.4" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "peer": true + }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -4684,6 +4942,13 @@ "vary": "^1" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "peer": true + }, "cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -4784,6 +5049,13 @@ "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", "dev": true }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "peer": true + }, "dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -5425,6 +5697,15 @@ "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", "dev": true }, + "is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -5834,6 +6115,13 @@ "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "peer": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -6063,6 +6351,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -6195,6 +6489,16 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -6596,11 +6900,50 @@ "semver": "^7.3.4" } }, + "ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "peer": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "peer": true + } + } + }, "tslib": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, + "ttypescript": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.13.tgz", + "integrity": "sha512-KT/RBfGGlVJFqEI8cVvI3nMsmYcFvPSZh8bU0qX+pAwbi7/ABmYkzn7l/K8skw0xmYjVCoyaV6WLsBQxdadybQ==", + "dev": true, + "requires": { + "resolve": ">=1.9.0" + } + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -6626,6 +6969,15 @@ "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "dev": true }, + "typescript-transform-paths": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.3.1.tgz", + "integrity": "sha512-c+8Cqd2rsRtTU68rJI0NX/OtqgBDddNs1fIxm1nCNyhn0WpoyqtpUxc1w9Ke5c5kgE4/OT5xYbKf2cf694RYEg==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, "ua-parser-js": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", @@ -6977,6 +7329,13 @@ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "peer": true + }, "zxcvbn": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/zxcvbn/-/zxcvbn-4.4.2.tgz", diff --git a/common/package.json b/common/package.json index 6cdade11..a9e87d5e 100644 --- a/common/package.json +++ b/common/package.json @@ -14,8 +14,8 @@ "license": "GPL-3.0", "scripts": { "clean": "rimraf dist/**/*", - "build": "npm run clean && tsc", - "build:watch": "npm run clean && tsc -watch", + "build": "npm run clean && ttsc", + "build:watch": "npm run clean && ttsc -watch", "lint": "tslint 'src/**/*.ts' 'spec/**/*.ts'", "lint:fix": "tslint 'src/**/*.ts' 'spec/**/*.ts' --fix", "test": "karma start --single-run", @@ -43,7 +43,9 @@ "process": "^0.11.10", "rimraf": "^3.0.2", "ts-loader": "^9.2.6", + "ttypescript": "^1.5.13", "typescript": "4.3.5", + "typescript-transform-paths": "^3.3.1", "url": "^0.11.0", "util": "^0.12.4" }, diff --git a/common/spec/importers/firefoxCsvImporter.spec.ts b/common/spec/importers/firefoxCsvImporter.spec.ts index b5c61a54..c3ea67f4 100644 --- a/common/spec/importers/firefoxCsvImporter.spec.ts +++ b/common/spec/importers/firefoxCsvImporter.spec.ts @@ -1,8 +1,8 @@ -import { FirefoxCsvImporter as Importer } from '../../src/importers/firefoxCsvImporter'; +import { FirefoxCsvImporter as Importer } from 'src/importers/firefoxCsvImporter'; -import { CipherView } from '../../src/models/view/cipherView'; -import { LoginUriView } from '../../src/models/view/loginUriView'; -import { LoginView } from '../../src/models/view/loginView'; +import { CipherView } from 'src/models/view/cipherView'; +import { LoginUriView } from 'src/models/view/loginUriView'; +import { LoginView } from 'src/models/view/loginView'; import { data as firefoxAccountsData } from './testData/firefoxCsv/firefoxAccountsData.csv'; import { data as simplePasswordData } from './testData/firefoxCsv/simplePasswordData.csv'; diff --git a/common/spec/importers/keepass2XmlImporter.spec.ts b/common/spec/importers/keepass2XmlImporter.spec.ts index 756bb6e2..f27bbcce 100644 --- a/common/spec/importers/keepass2XmlImporter.spec.ts +++ b/common/spec/importers/keepass2XmlImporter.spec.ts @@ -1,4 +1,4 @@ -import { KeePass2XmlImporter as Importer } from '../../src/importers/keepass2XmlImporter'; +import { KeePass2XmlImporter as Importer } from 'src/importers/keepass2XmlImporter'; const TestData: string = ` diff --git a/common/spec/importers/lastpassCsvImporter.spec.ts b/common/spec/importers/lastpassCsvImporter.spec.ts index 6cb426af..cd6da095 100644 --- a/common/spec/importers/lastpassCsvImporter.spec.ts +++ b/common/spec/importers/lastpassCsvImporter.spec.ts @@ -1,11 +1,11 @@ -import { LastPassCsvImporter as Importer } from '../../src/importers/lastpassCsvImporter'; +import { LastPassCsvImporter as Importer } from 'src/importers/lastpassCsvImporter'; -import { ImportResult } from '../../src/models/domain/importResult'; -import { CipherView } from '../../src/models/view/cipherView'; -import { FieldView } from '../../src/models/view/fieldView'; +import { ImportResult } from 'src/models/domain/importResult'; +import { CipherView } from 'src/models/view/cipherView'; +import { FieldView } from 'src/models/view/fieldView'; -import { CipherType } from '../../src/enums/cipherType'; -import { FieldType } from '../../src/enums/fieldType'; +import { CipherType } from 'src/enums/cipherType'; +import { FieldType } from 'src/enums/fieldType'; function baseExcept(result: ImportResult) { expect(result).not.toBeNull(); diff --git a/common/spec/importers/nordpassCsvImporter.spec.ts b/common/spec/importers/nordpassCsvImporter.spec.ts index 3edaf18d..b24b00e8 100644 --- a/common/spec/importers/nordpassCsvImporter.spec.ts +++ b/common/spec/importers/nordpassCsvImporter.spec.ts @@ -1,9 +1,9 @@ -import { NordPassCsvImporter as Importer } from '../../src/importers/nordpassCsvImporter'; +import { NordPassCsvImporter as Importer } from 'src/importers/nordpassCsvImporter'; -import { CipherType } from '../../src/enums/cipherType'; -import { SecureNoteType } from '../../src/enums/secureNoteType'; -import { CipherView } from '../../src/models/view/cipherView'; -import { IdentityView } from '../../src/models/view/identityView'; +import { CipherType } from 'src/enums/cipherType'; +import { SecureNoteType } from 'src/enums/secureNoteType'; +import { CipherView } from 'src/models/view/cipherView'; +import { IdentityView } from 'src/models/view/identityView'; import { data as creditCardData } from './testData/nordpassCsv/nordpass.card.csv'; import { data as identityData } from './testData/nordpassCsv/nordpass.identity.csv'; diff --git a/common/spec/importers/onepassword1PifImporter.spec.ts b/common/spec/importers/onepassword1PifImporter.spec.ts index 3505cb10..14a948c5 100644 --- a/common/spec/importers/onepassword1PifImporter.spec.ts +++ b/common/spec/importers/onepassword1PifImporter.spec.ts @@ -1,5 +1,5 @@ -import { FieldType } from '../../src/enums/fieldType'; -import { OnePassword1PifImporter as Importer } from '../../src/importers/onepasswordImporters/onepassword1PifImporter'; +import { FieldType } from 'src/enums/fieldType'; +import { OnePassword1PifImporter as Importer } from 'src/importers/onepasswordImporters/onepassword1PifImporter'; const TestData: string = '***aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee***\n' + JSON.stringify({ diff --git a/common/spec/importers/onepasswordMacCsvImporter.spec.ts b/common/spec/importers/onepasswordMacCsvImporter.spec.ts index 00b5fed0..b6e61c5d 100644 --- a/common/spec/importers/onepasswordMacCsvImporter.spec.ts +++ b/common/spec/importers/onepasswordMacCsvImporter.spec.ts @@ -1,7 +1,7 @@ -import { OnePasswordMacCsvImporter as Importer } from '../../src/importers/onepasswordImporters/onepasswordMacCsvImporter'; +import { OnePasswordMacCsvImporter as Importer } from 'src/importers/onepasswordImporters/onepasswordMacCsvImporter'; -import { CipherType } from '../../src/enums/cipherType'; -import { CipherView } from '../../src/models/view/cipherView'; +import { CipherType } from 'src/enums/cipherType'; +import { CipherView } from 'src/models/view/cipherView'; import { data as creditCardData } from './testData/onePasswordCsv/creditCard.mac.csv'; import { data as identityData } from './testData/onePasswordCsv/identity.mac.csv'; diff --git a/common/spec/importers/onepasswordWinCsvImporter.spec.ts b/common/spec/importers/onepasswordWinCsvImporter.spec.ts index c7492da3..2986f52c 100644 --- a/common/spec/importers/onepasswordWinCsvImporter.spec.ts +++ b/common/spec/importers/onepasswordWinCsvImporter.spec.ts @@ -1,9 +1,9 @@ -import { OnePasswordWinCsvImporter as Importer } from '../../src/importers/onepasswordImporters/onepasswordWinCsvImporter'; +import { OnePasswordWinCsvImporter as Importer } from 'src/importers/onepasswordImporters/onepasswordWinCsvImporter'; -import { CipherType } from '../../src/enums/cipherType'; -import { FieldType } from '../../src/enums/fieldType'; -import { CipherView } from '../../src/models/view/cipherView'; -import { FieldView } from '../../src/models/view/fieldView'; +import { CipherType } from 'src/enums/cipherType'; +import { FieldType } from 'src/enums/fieldType'; +import { CipherView } from 'src/models/view/cipherView'; +import { FieldView } from 'src/models/view/fieldView'; import { data as creditCardData } from './testData/onePasswordCsv/creditCard.windows.csv'; import { data as identityData } from './testData/onePasswordCsv/identity.windows.csv'; diff --git a/common/spec/misc/sequentialize.spec.ts b/common/spec/misc/sequentialize.spec.ts index ff21e001..0d8e8911 100644 --- a/common/spec/misc/sequentialize.spec.ts +++ b/common/spec/misc/sequentialize.spec.ts @@ -1,4 +1,4 @@ -import { sequentialize } from '../../src/misc/sequentialize'; +import { sequentialize } from 'src/misc/sequentialize'; describe('sequentialize decorator', () => { it('should call the function once', async () => { diff --git a/common/spec/misc/throttle.spec.ts b/common/spec/misc/throttle.spec.ts index daa0240d..7628c069 100644 --- a/common/spec/misc/throttle.spec.ts +++ b/common/spec/misc/throttle.spec.ts @@ -1,5 +1,5 @@ -import { sequentialize } from '../../src/misc/sequentialize'; -import { throttle } from '../../src/misc/throttle'; +import { sequentialize } from 'src/misc/sequentialize'; +import { throttle } from 'src/misc/throttle'; describe('throttle decorator', () => { it('should call the function once at a time', async () => { diff --git a/common/spec/misc/utils.spec.ts b/common/spec/misc/utils.spec.ts index 9c5e68d3..1daf1b05 100644 --- a/common/spec/misc/utils.spec.ts +++ b/common/spec/misc/utils.spec.ts @@ -1,4 +1,4 @@ -import { Utils } from '../../src/misc/utils'; +import { Utils } from 'src/misc/utils'; describe('Utils Service', () => { describe('getDomain', () => { diff --git a/common/spec/services/cipher.service.spec.ts b/common/spec/services/cipher.service.spec.ts index 92fdaa55..ef18a65d 100644 --- a/common/spec/services/cipher.service.spec.ts +++ b/common/spec/services/cipher.service.spec.ts @@ -1,21 +1,21 @@ import { Arg, Substitute, SubstituteOf } from '@fluffy-spoon/substitute'; -import { ApiService } from '../../src/abstractions/api.service'; -import { CryptoService } from '../../src/abstractions/crypto.service'; -import { FileUploadService } from '../../src/abstractions/fileUpload.service'; -import { I18nService } from '../../src/abstractions/i18n.service'; -import { LogService } from '../../src/abstractions/log.service'; -import { SearchService } from '../../src/abstractions/search.service'; -import { SettingsService } from '../../src/abstractions/settings.service'; -import { StorageService } from '../../src/abstractions/storage.service'; -import { UserService } from '../../src/abstractions/user.service'; -import { Utils } from '../../src/misc/utils'; -import { Cipher } from '../../src/models/domain/cipher'; -import { EncArrayBuffer } from '../../src/models/domain/encArrayBuffer'; -import { EncString } from '../../src/models/domain/encString'; -import { SymmetricCryptoKey } from '../../src/models/domain/symmetricCryptoKey'; +import { ApiService } from 'src/abstractions/api.service'; +import { CryptoService } from 'src/abstractions/crypto.service'; +import { FileUploadService } from 'src/abstractions/fileUpload.service'; +import { I18nService } from 'src/abstractions/i18n.service'; +import { LogService } from 'src/abstractions/log.service'; +import { SearchService } from 'src/abstractions/search.service'; +import { SettingsService } from 'src/abstractions/settings.service'; +import { StorageService } from 'src/abstractions/storage.service'; +import { UserService } from 'src/abstractions/user.service'; +import { Utils } from 'src/misc/utils'; +import { Cipher } from 'src/models/domain/cipher'; +import { EncArrayBuffer } from 'src/models/domain/encArrayBuffer'; +import { EncString } from 'src/models/domain/encString'; +import { SymmetricCryptoKey } from 'src/models/domain/symmetricCryptoKey'; -import { CipherService } from '../../src/services/cipher.service'; +import { CipherService } from 'src/services/cipher.service'; const ENCRYPTED_TEXT = 'This data has been encrypted'; const ENCRYPTED_BYTES = new EncArrayBuffer(Utils.fromUtf8ToArray(ENCRYPTED_TEXT).buffer); diff --git a/common/spec/services/consoleLog.service.spec.ts b/common/spec/services/consoleLog.service.spec.ts index ec3e6e30..e6a6eca2 100644 --- a/common/spec/services/consoleLog.service.spec.ts +++ b/common/spec/services/consoleLog.service.spec.ts @@ -1,4 +1,4 @@ -import { ConsoleLogService } from '../../src/services/consoleLog.service'; +import { ConsoleLogService } from 'src/services/consoleLog.service'; const originalConsole = console; let caughtMessage: any; diff --git a/common/spec/services/export.service.spec.ts b/common/spec/services/export.service.spec.ts index 4f2a097d..af56f1f9 100644 --- a/common/spec/services/export.service.spec.ts +++ b/common/spec/services/export.service.spec.ts @@ -1,20 +1,20 @@ import { Substitute, SubstituteOf } from '@fluffy-spoon/substitute'; -import { ApiService } from '../../src/abstractions/api.service'; -import { CipherService } from '../../src/abstractions/cipher.service'; -import { CryptoService } from '../../src/abstractions/crypto.service'; -import { FolderService } from '../../src/abstractions/folder.service'; +import { ApiService } from 'src/abstractions/api.service'; +import { CipherService } from 'src/abstractions/cipher.service'; +import { CryptoService } from 'src/abstractions/crypto.service'; +import { FolderService } from 'src/abstractions/folder.service'; -import { ExportService } from '../../src/services/export.service'; +import { ExportService } from 'src/services/export.service'; -import { Cipher } from '../../src/models/domain/cipher'; -import { EncString } from '../../src/models/domain/encString'; -import { Login } from '../../src/models/domain/login'; -import { CipherWithIds as CipherExport } from '../../src/models/export/cipherWithIds'; +import { Cipher } from 'src/models/domain/cipher'; +import { EncString } from 'src/models/domain/encString'; +import { Login } from 'src/models/domain/login'; +import { CipherWithIds as CipherExport } from 'src/models/export/cipherWithIds'; -import { CipherType } from '../../src/enums/cipherType'; -import { CipherView } from '../../src/models/view/cipherView'; -import { LoginView } from '../../src/models/view/loginView'; +import { CipherType } from 'src/enums/cipherType'; +import { CipherView } from 'src/models/view/cipherView'; +import { LoginView } from 'src/models/view/loginView'; import { BuildTestObject, GetUniqueString } from '../utils'; diff --git a/common/spec/web/services/webCryptoFunction.service.spec.ts b/common/spec/web/services/webCryptoFunction.service.spec.ts index 9ae4befb..c0bb2157 100644 --- a/common/spec/web/services/webCryptoFunction.service.spec.ts +++ b/common/spec/web/services/webCryptoFunction.service.spec.ts @@ -1,11 +1,11 @@ import Substitute from '@fluffy-spoon/substitute'; -import { PlatformUtilsService } from '../../../src/abstractions/platformUtils.service'; +import { PlatformUtilsService } from 'src/abstractions/platformUtils.service'; -import { WebCryptoFunctionService } from '../../../src/services/webCryptoFunction.service'; +import { WebCryptoFunctionService } from 'src/services/webCryptoFunction.service'; -import { Utils } from '../../../src/misc/utils'; -import { SymmetricCryptoKey } from '../../../src/models/domain/symmetricCryptoKey'; +import { Utils } from 'src/misc/utils'; +import { SymmetricCryptoKey } from 'src/models/domain/symmetricCryptoKey'; const RsaPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl0Vawl/toXzkEvB82FEtqHP' + '4xlU2ab/v0crqIfXfIoWF/XXdHGIdrZeilnRXPPJT1B9dTsasttEZNnua/0Rek/cjNDHtzT52irfoZYS7X6HNIfOi54Q+egP' + diff --git a/common/tsconfig.json b/common/tsconfig.json index c31c33eb..9cbcc976 100644 --- a/common/tsconfig.json +++ b/common/tsconfig.json @@ -14,7 +14,17 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "declarationDir": "dist/types", - "outDir": "dist" + "outDir": "dist", + "paths": { + "src/*": [ + "./src/*" + ] + }, + "plugins": [ + { + "transform": "typescript-transform-paths" + } + ] }, "include": [ "src", diff --git a/node/spec/cli/consoleLog.service.spec.ts b/node/spec/cli/consoleLog.service.spec.ts index 509b255c..de34b5e8 100644 --- a/node/spec/cli/consoleLog.service.spec.ts +++ b/node/spec/cli/consoleLog.service.spec.ts @@ -1,4 +1,4 @@ -import { ConsoleLogService } from '../../src/cli/services/consoleLog.service'; +import { ConsoleLogService } from 'src/cli/services/consoleLog.service'; const originalConsole = console; let caughtMessage: any; diff --git a/node/spec/services/nodeCryptoFunction.service.spec.ts b/node/spec/services/nodeCryptoFunction.service.spec.ts index a33e69ea..f32fc0c2 100644 --- a/node/spec/services/nodeCryptoFunction.service.spec.ts +++ b/node/spec/services/nodeCryptoFunction.service.spec.ts @@ -1,4 +1,4 @@ -import { NodeCryptoFunctionService } from '../../src/services/nodeCryptoFunction.service'; +import { NodeCryptoFunctionService } from 'src/services/nodeCryptoFunction.service'; import { Utils } from 'jslib-common/misc/utils'; import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey'; diff --git a/node/tsconfig.json b/node/tsconfig.json index 245ce84a..b58392ca 100644 --- a/node/tsconfig.json +++ b/node/tsconfig.json @@ -16,6 +16,9 @@ "paths": { "jslib-common/*": [ "../common/src/*" + ], + "src/*": [ + "./src/*" ] }, "plugins": [ diff --git a/package-lock.json b/package-lock.json index 9e98f0f7..f334e350 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "@angular/router": "^12.2.13", "@bitwarden/jslib-common": "file:../common", "duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git", + "ngx-toastr": "14.1.4", "rxjs": "^7.4.0", "tldjs": "^2.3.1", "zone.js": "0.11.4" @@ -86,7 +87,9 @@ "process": "^0.11.10", "rimraf": "^3.0.2", "ts-loader": "^9.2.6", + "ttypescript": "^1.5.13", "typescript": "4.3.5", + "typescript-transform-paths": "^3.3.1", "url": "^0.11.0", "util": "^0.12.4" } @@ -4168,6 +4171,19 @@ "dev": true, "peer": true }, + "node_modules/ngx-toastr": { + "version": "14.1.4", + "resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-14.1.4.tgz", + "integrity": "sha512-t1/9r+pOXm65LIl0gevvFat6XIl0g3tMA8UOArFjI4ta/nGwDe/14J/f4cZvOBDcomedvjvGAWi+d/2URdSTBg==", + "dependencies": { + "tslib": "^2.2.0" + }, + "peerDependencies": { + "@angular/common": ">=12.0.0-0", + "@angular/core": ">=12.0.0-0", + "@angular/platform-browser": ">=12.0.0-0" + } + }, "node_modules/node-abi": { "version": "2.30.1", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", @@ -6595,6 +6611,7 @@ "@bitwarden/jslib-common": "file:../common", "@types/duo_web_sdk": "^2.7.1", "duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git", + "ngx-toastr": "14.1.4", "rimraf": "^3.0.2", "rxjs": "^7.4.0", "tldjs": "^2.3.1", @@ -6635,7 +6652,9 @@ "rxjs": "^7.4.0", "tldjs": "^2.3.1", "ts-loader": "^9.2.6", + "ttypescript": "^1.5.13", "typescript": "4.3.5", + "typescript-transform-paths": "^3.3.1", "url": "^0.11.0", "util": "^0.12.4", "zxcvbn": "^4.4.2" @@ -9648,6 +9667,14 @@ "dev": true, "peer": true }, + "ngx-toastr": { + "version": "14.1.4", + "resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-14.1.4.tgz", + "integrity": "sha512-t1/9r+pOXm65LIl0gevvFat6XIl0g3tMA8UOArFjI4ta/nGwDe/14J/f4cZvOBDcomedvjvGAWi+d/2URdSTBg==", + "requires": { + "tslib": "^2.2.0" + } + }, "node-abi": { "version": "2.30.1", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz",