diff --git a/package-lock.json b/package-lock.json index 0ebd30d..d9285ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,6 +80,14 @@ "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", "dev": true }, + "@babel/runtime": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, "@babel/template": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", @@ -180,10 +188,130 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@types/bn.js": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", + "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", + "requires": { + "@types/node": "*" + } + }, + "@types/body-parser": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", + "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/bson": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.0.tgz", + "integrity": "sha512-pq/rqJwJWkbS10crsG5bgnrisL8pML79KlMKQMoQwLUjlPAkrUHMvHJ3oGwE7WHR61Lv/nadMwXVAD2b+fpD8Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.32", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", + "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/dotenv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.1.tgz", + "integrity": "sha512-ftQl3DtBvqHl9L16tpqqzA4YzCSXZfi7g8cQceTz5rOlYtk/IZbFjAv3mLOQlNIgOaylCQWQoBdDQHPgEBJPHg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/express": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.0.tgz", + "integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.16.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", + "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/range-parser": "*" + } + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@types/lodash": { + "version": "4.14.134", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz", + "integrity": "sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw==", + "dev": true + }, + "@types/mime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", + "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==", + "dev": true + }, + "@types/mongodb": { + "version": "3.1.28", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.28.tgz", + "integrity": "sha512-tG+QqJ/hir2p0069ee28t2O9tlGRJKDq1WFZC2QYMlU47LGdldLL8tepfTq6aFLvP58OpwSoxaJ/qjW93ob1NQ==", + "dev": true, + "requires": { + "@types/bson": "*", + "@types/node": "*" + } + }, + "@types/mongoose": { + "version": "5.5.6", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.6.tgz", + "integrity": "sha512-Duco8iiwOEGB756eIyafsrFbsAxjXQPkb/nplZtbxGOhfmsA90rXjO/GbDsBYbUz5nkGOCRHuNfxOJzoVAMHMg==", + "dev": true, + "requires": { + "@types/mongodb": "*", + "@types/node": "*" + } + }, "@types/node": { - "version": "10.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.9.tgz", - "integrity": "sha512-NelG/dSahlXYtSoVPErrp06tYFrvzj8XLWmKA+X8x0W//4MqbUyZu++giUG/v0bjAT6/Qxa8IjodrfdACyb0Fg==" + "version": "10.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.10.tgz", + "integrity": "sha512-V8wj+w2YMNvGuhgl/MA5fmTxgjmVHVoasfIaxMMZJV6Y8Kk+Ydpi1z2whoShDCJ2BuNVoqH/h1hrygnBxkrw/Q==" + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", + "dev": true + }, + "@types/serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "dev": true, + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } }, "accepts": { "version": "1.3.7", @@ -203,6 +331,7 @@ "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -225,11 +354,6 @@ "color-convert": "^1.9.0" } }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "append-transform": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", @@ -275,24 +399,16 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assertion-error": { "version": "1.1.0", @@ -308,25 +424,23 @@ "lodash": "^4.17.10" } }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "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=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "axios": { "version": "0.19.0", @@ -340,36 +454,32 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } }, - "bl": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" + "file-uri-to-path": "1.0.0" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "requires": { - "inherits": "~2.0.0" + "safe-buffer": "^5.0.1" } }, "bluebird": { @@ -413,6 +523,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -470,76 +581,11 @@ } } }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sha3": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", - "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", - "requires": { - "js-sha3": "^0.6.1", - "safe-buffer": "^5.1.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, "bson": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.1.tgz", "integrity": "sha512-jCGVYLoYMHDkOsbwJZBCqwMHyH4c+wzgI9hG7Z6SZJRXWr+x58pdIbm2i9a/jFGCkRJqRUr8eoI7lDWa0hTkxg==" }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -606,7 +652,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "chai": { "version": "4.1.2", @@ -722,6 +769,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -729,7 +777,8 @@ "commander": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true }, "commondir": { "version": "1.0.1", @@ -740,7 +789,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "content-disposition": { "version": "0.5.2", @@ -781,15 +831,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, "coveralls": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.2.tgz", @@ -806,7 +847,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -843,15 +884,6 @@ } } }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -896,28 +928,11 @@ "which": "^1.2.9" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -941,21 +956,6 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, - "decompress": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", - "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", - "requires": { - "decompress-tar": "^4.0.0", - "decompress-tarbz2": "^4.0.0", - "decompress-targz": "^4.0.0", - "decompress-unzip": "^4.0.1", - "graceful-fs": "^4.1.10", - "make-dir": "^1.0.0", - "pify": "^2.3.0", - "strip-dirs": "^2.0.0" - } - }, "decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -964,72 +964,6 @@ "mimic-response": "^1.0.0" } }, - "decompress-tar": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", - "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" - } - }, - "decompress-tarbz2": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", - "requires": { - "decompress-tar": "^4.1.0", - "file-type": "^6.1.0", - "is-stream": "^1.1.0", - "seek-bzip": "^1.0.5", - "unbzip2-stream": "^1.0.9" - }, - "dependencies": { - "file-type": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==" - } - } - }, - "decompress-targz": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", - "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" - } - }, - "decompress-unzip": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", - "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", - "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" - }, - "dependencies": { - "file-type": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" - }, - "get-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - } - } - }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -1050,6 +984,12 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "deepmerge": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", + "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", + "dev": true + }, "default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", @@ -1075,7 +1015,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "depd": { "version": "1.1.2", @@ -1112,16 +1053,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dirty-chai": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/dirty-chai/-/dirty-chai-2.0.1.tgz", @@ -1138,15 +1069,21 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.0.0.tgz", "integrity": "sha512-FlWbnhgjtwD+uNLUGHbMykMOYQaTivdHEmYwAKFjn6GKe/CqY0fNae93ZHTd20snh9ZLr8mTzIL9m0APQ1pjQg==" }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -1158,9 +1095,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -1194,6 +1131,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -1307,33 +1245,50 @@ "requires": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - } } }, "eth-lib": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", - "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", "requires": { "bn.js": "^4.11.6", "elliptic": "^6.4.0", - "keccakjs": "^0.2.1", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", "xhr-request-promise": "^0.1.2" } }, + "ethereum-common": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", + "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" + }, + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, "ethers": { - "version": "4.0.0-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", - "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", + "version": "4.0.31", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.31.tgz", + "integrity": "sha512-S2zKBGvEBIng7hghAXZ9259xCkClyRr/bM0F297O3lAnC6sYjTHNIMtiqWmA89qieAIyzWUZn/aCLUslRlJFkw==", "requires": { "@types/node": "^10.3.2", "aes-js": "3.0.0", @@ -1341,7 +1296,7 @@ "elliptic": "6.3.3", "hash.js": "1.1.3", "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", + "scrypt-js": "2.0.4", "setimmediate": "1.0.4", "uuid": "2.0.1", "xmlhttprequest": "1.8.0" @@ -1367,16 +1322,6 @@ "minimalistic-assert": "^1.0.0" } }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - }, "uuid": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", @@ -1400,10 +1345,19 @@ } } }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, "eventemitter3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", - "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, "evp_bytestokey": { "version": "1.0.3", @@ -1463,7 +1417,7 @@ }, "express": { "version": "4.16.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz", "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "requires": { "accepts": "~1.3.5", @@ -1511,22 +1465,26 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -1538,23 +1496,15 @@ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==" }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "~1.2.0" - } - }, "fecha": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" }, - "file-type": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "finalhandler": { "version": "1.1.1", @@ -1647,12 +1597,14 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "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==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -1669,46 +1621,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" - } - }, - "fs-promise": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", - "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", - "requires": { - "any-promise": "^1.3.0", - "fs-extra": "^2.0.0", - "mz": "^2.6.0", - "thenify-all": "^1.6.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "function-bind": { "version": "1.1.1", @@ -1736,15 +1653,11 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -1753,6 +1666,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1777,36 +1691,11 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true }, "growl": { "version": "1.10.5", @@ -1829,12 +1718,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, "requires": { "ajv": "^6.5.5", "har-schema": "^2.0.0" @@ -1854,24 +1745,11 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" - }, "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, "hash-base": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", @@ -1932,15 +1810,11 @@ "statuses": ">= 1.4.0 < 2" } }, - "http-https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", - "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=" - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -1967,11 +1841,6 @@ } } }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1982,6 +1851,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2047,21 +1917,6 @@ "define-properties": "^1.1.1" } }, - "is-natural-number": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", - "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -2070,11 +1925,6 @@ "has": "^1.0.1" } }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -2107,7 +1957,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "istanbul-lib-coverage": { "version": "2.0.5", @@ -2240,19 +2091,10 @@ "handlebars": "^4.1.2" } }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" }, "js-tokens": { "version": "4.0.0", @@ -2273,7 +2115,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsesc": { "version": "2.5.2", @@ -2290,24 +2133,36 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "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-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=", + "dev": true }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "jsonpath": { @@ -2331,6 +2186,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -2349,13 +2205,15 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz", "integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg==" }, - "keccakjs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", - "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { - "browserify-sha3": "^0.0.4", - "sha3": "^1.2.2" + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } }, "kuler": { @@ -2472,11 +2330,6 @@ "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", "integrity": "sha1-lyHXiLR+C8taJMLivuGg2lXatRQ=" }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" - }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -2487,21 +2340,6 @@ "yallist": "^2.1.2" } }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - }, "make-error": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", @@ -2575,15 +2413,6 @@ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", @@ -2635,6 +2464,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2642,24 +2472,18 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } }, - "mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", - "requires": { - "mkdirp": "*" - } - }, "mocha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", @@ -2710,11 +2534,6 @@ } } }, - "mock-fs": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.1.tgz", - "integrity": "sha512-w22rOL5ZYu6HbUehB5deurghGM0hS/xBVyHMGKOuQctkk93J9z9VEOhDsiWrXOprVNQpP9uzGKdl8v9mFspKuw==" - }, "moment": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", @@ -2794,11 +2613,6 @@ "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" }, - "mout": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz", - "integrity": "sha1-ujYR318OWx/7/QEWa48C0fX6K5k=" - }, "mpath": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.5.1.tgz", @@ -2828,26 +2642,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "nan": { "version": "2.13.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" }, - "nano-json-stream-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", - "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" - }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -3022,7 +2821,7 @@ }, "resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "resolved": false, "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true } @@ -3031,7 +2830,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -3043,14 +2843,6 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, - "oboe": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", - "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", - "requires": { - "http-https": "^1.0.0" - } - }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -3120,11 +2912,6 @@ "mem": "^4.0.0" } }, - "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" - }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -3134,7 +2921,8 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true }, "p-is-promise": { "version": "2.1.0", @@ -3160,14 +2948,6 @@ "p-limit": "^2.0.0" } }, - "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", - "requires": { - "p-finally": "^1.0.0" - } - }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -3186,19 +2966,6 @@ "release-zalgo": "^1.0.0" } }, - "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-headers": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz", @@ -3232,7 +2999,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "2.0.1", @@ -3286,33 +3054,11 @@ "sha.js": "^2.4.8" } }, - "pend": { - "version": "1.2.0", - "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=" - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "pkg-dir": { "version": "3.0.0", @@ -3328,14 +3074,9 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, "pretty-hrtime": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" }, "process": { @@ -3372,27 +3113,8 @@ "psl": { "version": "1.1.32", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz", - "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==" - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } + "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==", + "dev": true }, "pump": { "version": "3.0.0", @@ -3407,7 +3129,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "qs": { "version": "6.5.1", @@ -3424,6 +3147,11 @@ "strict-uri-encode": "^1.0.0" } }, + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3432,20 +3160,6 @@ "safe-buffer": "^5.1.0" } }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "randomhex": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", - "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -3520,6 +3234,11 @@ "util-deprecate": "~1.0.1" } }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + }, "regexp-clone": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", @@ -3538,6 +3257,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -3564,12 +3284,14 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -3594,6 +3316,11 @@ "semver": "^5.1.0" } }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, "resolve": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", @@ -3612,6 +3339,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -3625,6 +3353,23 @@ "inherits": "^2.0.1" } }, + "rlp": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "requires": { + "bn.js": "^4.11.1", + "safe-buffer": "^5.1.1" + } + }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -3633,7 +3378,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "saslprep": { "version": "1.0.3", @@ -3648,19 +3394,20 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", + "optional": true, "requires": { "nan": "^2.0.8" } }, "scrypt-js": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" }, "scrypt.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.2.0.tgz", - "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", + "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", "requires": { "scrypt": "^6.0.2", "scryptsy": "^1.2.1" @@ -3674,21 +3421,30 @@ "pbkdf2": "^3.0.3" } }, - "seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", - "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "secp256k1": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "requires": { - "commander": "~2.8.1" + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.4.1", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" }, "dependencies": { - "commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, @@ -3738,18 +3494,6 @@ "send": "0.16.2" } }, - "servify": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", - "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3757,9 +3501,9 @@ "dev": true }, "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" }, "setprototypeof": { "version": "1.1.0", @@ -3775,14 +3519,6 @@ "safe-buffer": "^5.0.1" } }, - "sha3": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.3.tgz", - "integrity": "sha512-sOWDZi8cDBRkLfWOw18wvJyNblXDHzwMGnRWut8zNNeIeLnmMRO17bjpLc7OzMuj1ASUgx2IyohzUCAl+Kx5vA==", - "requires": { - "nan": "2.13.2" - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -3940,6 +3676,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -4019,14 +3756,6 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, - "strip-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", - "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", - "requires": { - "is-natural-number": "^4.0.1" - } - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -4050,69 +3779,6 @@ "has-flag": "^3.0.0" } }, - "swarm-js": { - "version": "0.1.37", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", - "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", - "requires": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "decompress": "^4.0.0", - "eth-lib": "^0.1.26", - "fs-extra": "^2.1.2", - "fs-promise": "^2.0.0", - "got": "^7.1.0", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar.gz": "^1.0.5", - "xhr-request-promise": "^0.1.2" - } - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - } - }, - "tar.gz": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", - "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", - "requires": { - "bluebird": "^2.9.34", - "commander": "^2.8.1", - "fstream": "^1.0.8", - "mout": "^0.11.0", - "tar": "^2.1.1" - }, - "dependencies": { - "bluebird": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", - "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" - } - } - }, "test-exclude": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", @@ -4130,37 +3796,11 @@ "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, - "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -4171,6 +3811,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -4179,7 +3820,8 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, @@ -4215,11 +3857,31 @@ } } }, + "tsconfig-paths": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.8.0.tgz", + "integrity": "sha512-zZEYFo4sjORK8W58ENkRn9s+HmQFkkwydDG7My5s/fnfr2YYCaiyXe/HBUcIgU8epEKOXwiahOO+KZYjiXlWyQ==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "deepmerge": "^2.0.1", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" }, "tslint": { "version": "5.17.0", @@ -4255,6 +3917,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -4262,7 +3925,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-check": { "version": "0.3.2", @@ -4312,20 +3976,6 @@ "source-map": "~0.6.1" } }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" - }, - "unbzip2-stream": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", - "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", - "requires": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, "underscore": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", @@ -4340,16 +3990,18 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "url-parse": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", + "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", "requires": { - "prepend-http": "^1.0.1" + "querystringify": "^2.0.0", + "requires-port": "^1.0.0" } }, "url-set-query": { @@ -4357,11 +4009,6 @@ "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=" }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" - }, "utf8": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", @@ -4401,6 +4048,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -4408,327 +4056,218 @@ } }, "web3": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.36.tgz", - "integrity": "sha512-fZDunw1V0AQS27r5pUN3eOVP7u8YAvyo6vOapdgVRolAu5LgaweP7jncYyLINqIX9ZgWdS5A090bt+ymgaYHsw==", - "requires": { - "web3-bzz": "1.0.0-beta.36", - "web3-core": "1.0.0-beta.36", - "web3-eth": "1.0.0-beta.36", - "web3-eth-personal": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-shh": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - } - }, - "web3-bzz": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.36.tgz", - "integrity": "sha512-clDRS/ziboJ5ytnrfxq80YSu9HQsT0vggnT3BkoXadrauyEE/9JNLxRu016jjUxqdkfdv4MgIPDdOS3Bv2ghiw==", - "requires": { - "got": "7.1.0", - "swarm-js": "0.1.37", - "underscore": "1.8.3" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.55.tgz", + "integrity": "sha512-yJpwy4IUA3T/F9hWzYQVn0GbJCrAaZ0KTIO3iuqkhaYH0Y09KV7k4GzFi4hN7hT4cFTj4yIKaeVCwQ5kzvi2Vg==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/node": "^10.12.18", + "web3-core": "1.0.0-beta.55", + "web3-eth": "1.0.0-beta.55", + "web3-eth-personal": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-shh": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.36.tgz", - "integrity": "sha512-C2QW9CMMRZdYAiKiLkMrKRSp+gekSqTDgZTNvlxAdN1hXn4d9UmcmWSJXOmIHqr5N2ISbRod+bW+qChODxVE3Q==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.55.tgz", + "integrity": "sha512-AMMp7TLEtE7u8IJAu/THrRhBTZyZzeo7Y6GiWYNwb5+KStC9hIGLr9cI1KX9R6ZioTOLRHrqT7awDhnJ1ku2mg==", "requires": { - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-requestmanager": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "@types/node": "^10.12.18", + "lodash": "^4.17.11", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-helpers": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.36.tgz", - "integrity": "sha512-gu74l0htiGWuxLQuMnZqKToFvkSM+UFPE7qUuy1ZosH/h2Jd+VBWg6k4CyNYVYfP0hL5x3CN8SBmB+HMowo55A==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.55.tgz", + "integrity": "sha512-suj9Xy/lIqajaYLJTEjr2rlFgu6hGYwChHmf8+qNrC2luZA6kirTamtB9VThWMxbywx7p0bqQFjW6zXogAgWhg==", "requires": { - "underscore": "1.8.3", - "web3-eth-iban": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "@babel/runtime": "^7.3.1", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-eth-iban": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-method": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.36.tgz", - "integrity": "sha512-dJsP3KkGaqBBSdxfzvLsYPOmVaSs1lR/3oKob/gtUYG7UyTnwquwliAc7OXj+gqRA2E/FHZcM83cWdl31ltdSA==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } - } - }, - "web3-core-promievent": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.36.tgz", - "integrity": "sha512-RGIL6TjcOeJTullFLMurChPTsg94cPF6LI763y/sPYtXTDol1vVa+J5aGLp/4WW8v+s+1bSQO6zYq2ZtkbmtEQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.55.tgz", + "integrity": "sha512-w1cW/s2ji9qGELHk2uMJCn1ooay0JJLVoPD1nvmsW6OTRWcVjxa62nJrFQhe6P5lEb83Xk9oHgmCxZoVUHibOw==", "requires": { - "any-promise": "1.3.0", - "eventemitter3": "1.1.1" - } - }, - "web3-core-requestmanager": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.36.tgz", - "integrity": "sha512-/CHuaMbiMDu1v8ANGYI7yFCnh1GaCWx5pKnUPJf+QTk2xAAw+Bvd97yZJIWPOK5AOPUIzxgwx9Ob/5ln6mTmYA==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "web3-providers-http": "1.0.0-beta.36", - "web3-providers-ipc": "1.0.0-beta.36", - "web3-providers-ws": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "@babel/runtime": "^7.3.1", + "eventemitter3": "3.1.0", + "lodash": "^4.17.11", + "rxjs": "^6.4.0", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-subscriptions": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.36.tgz", - "integrity": "sha512-/evyLQ8CMEYXC5aUCodDpmEnmGVYQxaIjiEIfA/85f9ifHkfzP1aOwCAjcsLsJWnwrWDagxSpjCYrDtnNabdEw==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.55.tgz", + "integrity": "sha512-pb3oQbUzK7IoyXwag8TYInQddg0rr7BHxKc+Pbs/92hVNQ5ps4iGMVJKezdrjlQ1IJEEUiDIglXl4LZ1hIuMkw==", "requires": { - "eventemitter3": "1.1.1", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "@babel/runtime": "^7.3.1", + "eventemitter3": "^3.1.0", + "lodash": "^4.17.11" } }, "web3-eth": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.36.tgz", - "integrity": "sha512-uEa0UnbnNHUB4N2O1U+LsvxzSPJ/w3azy5115IseaUdDaiz6IFFgFfFP3ssauayQNCf7v2F44GXLfPhrNeb/Sw==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-eth-accounts": "1.0.0-beta.36", - "web3-eth-contract": "1.0.0-beta.36", - "web3-eth-ens": "1.0.0-beta.36", - "web3-eth-iban": "1.0.0-beta.36", - "web3-eth-personal": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.55.tgz", + "integrity": "sha512-F3zJ9I1gOgQdNGfi2Dy2lmj6OqCMJoRN01XHhQZagq0HY1JYMfObtfMi5E3L+qsegsSddHbqp4YY57tKx6uxpA==", + "requires": { + "@babel/runtime": "^7.3.1", + "ethereumjs-tx": "^1.3.7", + "rxjs": "^6.4.0", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-eth-contract": "1.0.0-beta.55", + "web3-eth-ens": "1.0.0-beta.55", + "web3-eth-iban": "1.0.0-beta.55", + "web3-eth-personal": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-abi": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.36.tgz", - "integrity": "sha512-fBfW+7hvA0rxEMV45fO7JU+0R32ayT7aRwG9Cl6NW2/QvhFeME2qVbMIWw0q5MryPZGIN8A6366hKNuWvVidDg==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.55.tgz", + "integrity": "sha512-3h1xnm/vYmKUXTOYAOP0OsB5uijQV76pNNRGKOB6Dq6GR1pbcbD3WrB/4I643YA8l91t5FRzFzUiA3S77R2iqw==", "requires": { - "ethers": "4.0.0-beta.1", - "underscore": "1.8.3", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "@babel/runtime": "^7.3.1", + "ethers": "^4.0.27", + "lodash": "^4.17.11", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-accounts": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.36.tgz", - "integrity": "sha512-MmgIlBEZ0ILLWV4+wfMrbeVVMU/VmQnCpgSDcw7wHKOKu47bKncJ6rVqVsUbC6d9F613Rios+Yj2Ua6SCHtmrg==", - "requires": { - "any-promise": "1.3.0", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.7", - "scrypt.js": "0.2.0", - "underscore": "1.8.3", - "uuid": "2.0.1", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", - "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" - } + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.55.tgz", + "integrity": "sha512-VfzvwpSDHXqRVelIxsBVhgbV9BkFvhJ/q+bKhnVUUXV0JAhMK/7uC92TsqKk4EBYuqpHyZ1jjqrL4n03fMU7zw==", + "requires": { + "@babel/runtime": "^7.3.1", + "browserify-cipher": "^1.0.1", + "eth-lib": "0.2.8", + "lodash": "^4.17.11", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "scrypt.js": "0.3.0", + "uuid": "3.3.2", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-contract": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.36.tgz", - "integrity": "sha512-cywqcIrUsCW4fyqsHdOb24OCC8AnBol8kNiptI+IHRylyCjTNgr53bUbjrXWjmEnear90rO0QhAVjLB1a4iEbQ==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.55.tgz", + "integrity": "sha512-v6oB1wfH039/A5sTb4ZTKX++fcBTHEkuQGpq50ATIDoxP/UTz2+6S+iL+3sCJTsByPw2/Bni/HM7NmLkXqzg/Q==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-ens": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.36.tgz", - "integrity": "sha512-8ZdD7XoJfSX3jNlZHSLe4G837xQ0v5a8cHCcDcd1IoqoY855X9SrIQ0Xdqia9p4mR1YcH1vgmkXY9/3hsvxS7g==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.55.tgz", + "integrity": "sha512-jEL17coO0FJXb7KYq4+7DhVXj0Rh+wHfZ86jOvFUvJsRaUHfqK2TlMatuhD2mbrmxpBYb6oMPnXVnNK9bnD5Rg==", "requires": { + "@babel/runtime": "^7.3.1", "eth-ens-namehash": "2.0.8", - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-eth-contract": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-eth-contract": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-iban": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.36.tgz", - "integrity": "sha512-b5AEDjjhOLR4q47Hbzf65zYE+7U7JgCgrUb13RU4HMIGoMb1q4DXaJw1UH8VVHCZulevl2QBjpCyrntecMqqCQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.55.tgz", + "integrity": "sha512-a2Fxsb5Mssa+jiXgjUdIzJipE0175IcQXJbZLpKft2+zeSJWNTbaa3PQD2vPPpIM4W789q06N+f9Zc0Fyls+1g==", "requires": { - "bn.js": "4.11.6", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" - } + "@babel/runtime": "^7.3.1", + "bn.js": "4.11.8", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-personal": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.36.tgz", - "integrity": "sha512-+oxvhojeWh4C/XtnlYURWRR3F5Cg7bQQNjtN1ZGnouKAZyBLoYDVVJ6OaPiveNtfC9RKnzLikn9/Uqc0xz410A==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.55.tgz", + "integrity": "sha512-H0mahLQx6Oj7lpgTamKAswr3rHChRUZijeWAar2Hj7BABQlLRKwx8n09nYhxggvvLYQNQS90JjvQue7rAo2LQQ==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-net": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.36.tgz", - "integrity": "sha512-BriXK0Pjr6Hc/VDq1Vn8vyOum4JB//wpCjgeGziFD6jC7Of8YaWC7AJYXje89OckzfcqX1aJyJlBwDpasNkAzQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.55.tgz", + "integrity": "sha512-do2WY8+/GArJSWX7k/zZ7nBnV9Y3n6LhPYkwT3LeFqDzD515bKwlomaNC8hOaTc6UQyXIoPprYTK2FevL7jrZw==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, - "web3-providers-http": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.36.tgz", - "integrity": "sha512-KLSqMS59nRdpet9B0B64MKgtM3n9wAHTcAHJ03hv79avQNTjHxtjZm0ttcjcFUPpWDgTCtcYCa7tqaYo9Pbeog==", + "web3-providers": { + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.55.tgz", + "integrity": "sha512-MNifc7W+iF6rykpbDR1MuX152jshWdZXHAU9Dk0Ja2/23elhIs4nCWs7wOX9FHrKgdrQbscPoq0uy+0aGzyWVQ==", "requires": { - "web3-core-helpers": "1.0.0-beta.36", + "@babel/runtime": "^7.3.1", + "@types/node": "^10.12.18", + "eventemitter3": "3.1.0", + "lodash": "^4.17.11", + "url-parse": "1.4.4", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55", + "websocket": "^1.0.28", "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.36.tgz", - "integrity": "sha512-iEUrmdd2CzoWgp+75/ydom/1IaoLw95qkAzsgwjjZp1waDncHP/cvVGX74+fbUx4hRaPdchyzxCQfNpgLDmNjQ==", - "requires": { - "oboe": "2.1.3", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36" - }, - "dependencies": { - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } - } - }, - "web3-providers-ws": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.36.tgz", - "integrity": "sha512-wAnENuZx75T5ZSrT2De2LOaUuPf2yRjq1VfcbD7+Zd79F3DZZLBJcPyCNVQ1U0fAXt0wfgCKl7sVw5pffqR9Bw==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible" }, "dependencies": { "debug": { @@ -4739,58 +4278,49 @@ "ms": "2.0.0" } }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - }, "websocket": { - "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible", + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", + "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", "requires": { "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", + "nan": "^2.11.0", + "typedarray-to-buffer": "^3.1.5", "yaeti": "^0.0.6" } } } }, "web3-shh": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.36.tgz", - "integrity": "sha512-bREGHS/WprYFSvGUhyIk8RSpT2Z5SvJOKGBrsUW2nDIMWO6z0Op8E7fzC6GXY2HZfZliAqq6LirbXLgcLRWuPw==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.55.tgz", + "integrity": "sha512-lGP2HQ/1ThNnfoU8677aL48KsTx4Ht+2KQIn39dGpxVZqysQmovQIltbymVnAr4h8wofwcEz46iNHGa+PAyNzA==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-utils": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.36.tgz", - "integrity": "sha512-7ri74lG5fS2Th0fhYvTtiEHMB1Pmf2p7dQx1COQ3OHNI/CHNEMjzoNMEbBU6FAENrywfoFur40K4m0AOmEUq5A==", - "requires": { - "bn.js": "4.11.6", - "eth-lib": "0.1.27", - "ethjs-unit": "0.1.6", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.55.tgz", + "integrity": "sha512-ASWqUi8gtWK02Tp8ZtcoAbHenMpQXNvHrakgzvqTNNZn26wgpv+Q4mdPi0KOR6ZgHFL8R/9b5BBoUTglS1WPpg==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "@types/node": "^10.12.18", + "bn.js": "4.11.8", + "eth-lib": "0.2.8", + "ethjs-unit": "^0.1.6", + "lodash": "^4.17.11", "number-to-bn": "1.7.0", - "randomhex": "0.1.5", - "underscore": "1.8.3", + "randombytes": "^2.1.0", "utf8": "2.1.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - } } }, "websocket": { @@ -4886,16 +4416,6 @@ "signal-exit": "^3.0.2" } }, - "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, "xhr": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", @@ -5003,15 +4523,6 @@ "decamelize": "^1.2.0" } }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "yn": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", diff --git a/package.json b/package.json index e5dc6ac..1c0e348 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "Off-chain oracle server for listening on data requests from Ethereum blockchain", "main": "index.js", "scripts": { - "start": "ts-node src/index.ts", + "start": "ts-node -r tsconfig-paths/register src/index.ts", "build": "tsc", - "test": "mocha -r ts-node/register 'src/**/*.spec.ts'", + "test": "mocha -r ts-node/register -r tsconfig-paths/register 'src/**/*.spec.ts'", "integration-test": "mocha -r ts-node/register 'src/**/*.integration.ts'", "ganache": "ganache-cli -d", "lint": "tslint --config ./tslint.json --project ./tsconfig.json 'src/**/*.ts'" @@ -38,13 +38,17 @@ "lodash": "4.17.11", "mongoose": "5.3.12", "node-schedule": "1.3.0", - "web3": "1.0.0-beta.36", + "web3": "1.0.0-beta.55", "websocket": "1.0.26", "winston": "3.0.0", "xmldom": "0.1.27", "xpath": "0.0.27" }, "devDependencies": { + "@types/dotenv": "^6.1.1", + "@types/express": "^4.17.0", + "@types/lodash": "^4.14.134", + "@types/mongoose": "^5.5.6", "chai": "4.1.2", "chai-as-promised": "7.1.1", "coveralls": "3.0.2", @@ -56,6 +60,7 @@ "sinon": "7.1.1", "sinon-mongoose": "2.2.1", "ts-node": "^8.3.0", + "tsconfig-paths": "^3.8.0", "tslint": "^5.17.0", "typescript": "^3.5.2" } diff --git a/src/adapter/AxiosUrlDataFetcherAdapter.ts b/src/adapter/AxiosUrlDataFetcherAdapter.ts index d704ced..2f0eb25 100644 --- a/src/adapter/AxiosUrlDataFetcherAdapter.ts +++ b/src/adapter/AxiosUrlDataFetcherAdapter.ts @@ -1,9 +1,9 @@ +import UrlDataFetcher from '@core/domain/common/port/UrlDataFetcherPort'; +import { HttpError } from '@core/domain/common/utils/error'; import axios from 'axios'; -import UrlDataFetcher from '../../domain/common/port/UrlDataFetcherPort'; -import { HttpError } from '../../domain/common/utils/error'; -class AxiosUrlDataFetcherAdapter extends UrlDataFetcher { - async fetch(url) { +class AxiosUrlDataFetcherAdapter implements UrlDataFetcher { + async fetch(url): Promise { try { const response = await axios.get(url); diff --git a/src/adapter/ConsoleLoggerAdapter.ts b/src/adapter/ConsoleLoggerAdapter.ts index 3a8ec7c..5b45196 100644 --- a/src/adapter/ConsoleLoggerAdapter.ts +++ b/src/adapter/ConsoleLoggerAdapter.ts @@ -2,7 +2,7 @@ import LoggerPort from '../domain/common/port/LoggerPort'; -class ConsoleLoggerAdapter extends LoggerPort { +class ConsoleLoggerAdapter implements LoggerPort { info(message) { console.log(message); } diff --git a/src/adapter/index.ts b/src/adapter/index.ts index acb0ae2..a3a63ab 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,8 +1,8 @@ -import AxiosUrlDataFetcherAdapter from './AxiosUrlDataFetcherAdapter'; -import ConsoleLoggerAdapter from './ConsoleLoggerAdapter'; import IdentitySelectorAdapter from '../infrastructure/selectors/IdentitySelectorAdapter'; import JsonSelectorAdapter from '../infrastructure/selectors/JsonSelectorAdapter'; import XmlSelectorAdapter from '../infrastructure/selectors/XmlSelectorAdapter'; +import AxiosUrlDataFetcherAdapter from './AxiosUrlDataFetcherAdapter'; +import ConsoleLoggerAdapter from './ConsoleLoggerAdapter'; export { AxiosUrlDataFetcherAdapter, diff --git a/src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts b/src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts index d704ced..6542248 100644 --- a/src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts +++ b/src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts @@ -2,8 +2,8 @@ import axios from 'axios'; import UrlDataFetcher from '../../domain/common/port/UrlDataFetcherPort'; import { HttpError } from '../../domain/common/utils/error'; -class AxiosUrlDataFetcherAdapter extends UrlDataFetcher { - async fetch(url) { +class AxiosUrlDataFetcherAdapter implements UrlDataFetcher { + async fetch(url): Promise { try { const response = await axios.get(url); diff --git a/src/application/logger/ConsoleLoggerAdapter.ts b/src/application/logger/ConsoleLoggerAdapter.ts index f4b0c04..7286911 100644 --- a/src/application/logger/ConsoleLoggerAdapter.ts +++ b/src/application/logger/ConsoleLoggerAdapter.ts @@ -1,12 +1,12 @@ /* eslint-disable no-console */ import LoggerPort from '../../domain/common/port/LoggerPort'; -class ConsoleLoggerAdapter extends LoggerPort { - info(message) { +class ConsoleLoggerAdapter implements LoggerPort { + info(message): void { console.log(message); } - error(message, error) { + error(message, error): void { console.error(message, error); } } diff --git a/src/application/selector/identity/IdentitySelectorAdapter.ts b/src/application/selector/identity/IdentitySelectorAdapter.ts index d0ed9aa..b0cbf0b 100644 --- a/src/application/selector/identity/IdentitySelectorAdapter.ts +++ b/src/application/selector/identity/IdentitySelectorAdapter.ts @@ -1,12 +1,11 @@ -/* eslint-disable no-unused-vars */ -import DataSelectorPort from '../../../domain/common/port/DataSelectorPort'; +import {DataSelectorPort} from '@core/domain/common/port'; -class IdentitySelectorAdapter extends DataSelectorPort { - canHandle(contentType) { +class IdentitySelectorAdapter implements DataSelectorPort { + canHandle(contentType: string): boolean { return contentType === 'ipfs'; } - select(data, path) { + select(data: string, path: string): string { if (path) { throw new Error('Path must be empty for IdentitySelector'); } diff --git a/src/application/selector/json/JsonSelectorAdapter.ts b/src/application/selector/json/JsonSelectorAdapter.ts index 09ad3bc..91f2723 100644 --- a/src/application/selector/json/JsonSelectorAdapter.ts +++ b/src/application/selector/json/JsonSelectorAdapter.ts @@ -2,7 +2,7 @@ import * as jp from 'jsonpath'; import DataSelectorPort from '../../../domain/common/port/DataSelectorPort'; import JsonResultConverter from './JsonResultConverter'; -class JsonSelectorAdapter extends DataSelectorPort { +class JsonSelectorAdapter implements DataSelectorPort { canHandle(contentType) { return contentType === 'json'; } diff --git a/src/application/selector/xml/XmlSelectorAdapter.ts b/src/application/selector/xml/XmlSelectorAdapter.ts index afcbe3a..a5d21cc 100644 --- a/src/application/selector/xml/XmlSelectorAdapter.ts +++ b/src/application/selector/xml/XmlSelectorAdapter.ts @@ -1,36 +1,36 @@ import { DOMParser, XMLSerializer } from 'xmldom'; import * as xpath from 'xpath'; -import XmlResultConverter from './XmlResultConverter'; import DataSelectorPort from '../../../domain/common/port/DataSelectorPort'; +import XmlResultConverter from './XmlResultConverter'; + +class XmlSelectorAdapter implements DataSelectorPort { + private readonly domParser: DOMParser; + private readonly xmlSerializer: XMLSerializer; -class XmlSelectorAdapter extends DataSelectorPort { - domParser: DOMParser; - xmlSerializer: XMLSerializer; constructor() { - super(); this.domParser = new DOMParser(); this.xmlSerializer = new XMLSerializer(); } - canHandle(contentType) { + canHandle(contentType): boolean { return ['xml', 'html'].includes(contentType); } - select(data, path) { + select(data: string, path: string): string { if (!path) { return data; } const doc = this.domParser.parseFromString(data); - this.__checkXmlValidity(doc); + this.checkXmlValidity(doc); const selected = xpath.select(path, doc); return XmlResultConverter.toString(selected); } - __checkXmlValidity(doc) { + private checkXmlValidity(doc): void { // throws an error when doc is invalid xml this.xmlSerializer.serializeToString(doc); } diff --git a/src/config/configuredChai.ts b/src/config/configuredChai.ts new file mode 100644 index 0000000..1067503 --- /dev/null +++ b/src/config/configuredChai.ts @@ -0,0 +1,6 @@ +import * as chai from 'chai'; +import * as chaiAsPromised from 'chai-as-promised'; + +chai.use(chaiAsPromised); + +export const { expect } = chai; diff --git a/src/domain/blockchain/port/BlockchainPort.ts b/src/domain/blockchain/port/BlockchainPort.ts index f270a0b..7155e25 100644 --- a/src/domain/blockchain/port/BlockchainPort.ts +++ b/src/domain/blockchain/port/BlockchainPort.ts @@ -1,7 +1,3 @@ -class BlockchainPort { - getBlockNumber() { - throw new Error('Not implemented'); - } +export default interface BlockchainPort { + getBlockNumber(): Promise; } - -export default BlockchainPort; diff --git a/src/domain/blockchain/port/OracleGateway.ts b/src/domain/blockchain/port/OracleGateway.ts index f82f78d..6342308 100644 --- a/src/domain/blockchain/port/OracleGateway.ts +++ b/src/domain/blockchain/port/OracleGateway.ts @@ -1,13 +1,6 @@ -/* eslint-disable no-unused-vars */ +import Request from '@core/domain/request/Request'; -class OracleGateway { - getRequests(fromBlock, toBlock) { - throw new Error('Not implemented'); - } - - sendResponse(response) { - throw new Error('Not implemented'); - } +export default interface OracleGateway { + getRequests(fromBlock, toBlock): Promise; + sendResponse(response): Promise; } - -export default OracleGateway; diff --git a/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.spec.ts b/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.spec.ts index ac3ea50..41d4447 100644 --- a/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.spec.ts +++ b/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.spec.ts @@ -1,7 +1,8 @@ -import { describe, it, beforeEach } from 'mocha'; import { expect } from 'chai'; +import { beforeEach, describe, it } from 'mocha'; +import {ConsoleLoggerAdapter} from '@core/adapter'; +import {OracleGateway} from '../port'; import FetchNewOracleRequestsUseCase from './FetchNewOracleRequestsUseCase'; -import { Logger } from '../../common/utils/TestMocks'; describe('FetchNewOracleRequestUseCase', () => { const oracle = () => ({ @@ -13,7 +14,7 @@ describe('FetchNewOracleRequestUseCase', () => { beforeEach(() => { // given - sut = new FetchNewOracleRequestsUseCase(oracle(), new Logger(), 1); + sut = new FetchNewOracleRequestsUseCase(oracle() as OracleGateway, new ConsoleLoggerAdapter(), 1); }); it('should fetch new oracle responses', async () => { @@ -23,7 +24,6 @@ describe('FetchNewOracleRequestUseCase', () => { expect(requests).to.be.an.instanceof(Array); expect(requests).to.have.lengthOf(1); expect(sut.lastBlock).to.equal(4); - expect(sut.logger.list().length).to.equal(1); }); it('should return empty array if new block is equal to current one', async () => { diff --git a/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.ts b/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.ts index b26f343..5cf5d00 100644 --- a/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.ts +++ b/src/domain/blockchain/usecase/FetchNewOracleRequestsUseCase.ts @@ -1,15 +1,19 @@ +import {OracleGateway} from '@core/domain/blockchain/port'; +import LoggerPort from '@core/domain/common/port/LoggerPort'; +import Request from '@core/domain/request/Request'; + class FetchNewOracleRequestsUseCase { - oracle: any; - logger: any; - lastBlock: number; - constructor(oracle, logger, startBlockNumber) { - this.oracle = oracle; - this.logger = logger; + private lastBlock: number; + constructor( + private readonly oracle: OracleGateway, + private readonly logger: LoggerPort, + startBlockNumber: number, + ) { this.lastBlock = startBlockNumber - 1; } - async fetchNewRequests(blockNumber) { + async fetchNewRequests(blockNumber): Promise { if (blockNumber <= this.lastBlock) { return []; } diff --git a/src/domain/blockchain/usecase/SendResponseToOracleUseCase.spec.ts b/src/domain/blockchain/usecase/SendResponseToOracleUseCase.spec.ts index 517c23e..c9371d6 100644 --- a/src/domain/blockchain/usecase/SendResponseToOracleUseCase.spec.ts +++ b/src/domain/blockchain/usecase/SendResponseToOracleUseCase.spec.ts @@ -1,8 +1,9 @@ +import { expect } from '@core/config/configuredChai'; import { describe, it } from 'mocha'; -const { expect } = require('chai').use(require('chai-as-promised')); -import SendResponseToOracleUseCase from './SendResponseToOracleUseCase'; +import ConsoleLoggerAdapter from '../../../application/logger/ConsoleLoggerAdapter'; import Response from '../../response/Response'; -import { Logger } from '../../common/utils/TestMocks'; +import {OracleGateway} from '../port'; +import SendResponseToOracleUseCase from './SendResponseToOracleUseCase'; describe('SendResponseUseCase', () => { const oracle = () => ({ @@ -16,7 +17,7 @@ describe('SendResponseUseCase', () => { it('should send response back to oracle without throwing error', async () => { // given const response = new Response('id'); - const sut = new SendResponseToOracleUseCase(oracle(), new Logger()); + const sut = new SendResponseToOracleUseCase(oracle() as unknown as OracleGateway, new ConsoleLoggerAdapter()); // when, then return expect(sut.sendResponse(response)).to.be.fulfilled; }); @@ -24,7 +25,7 @@ describe('SendResponseUseCase', () => { it('should throw error when sending response failed', async () => { // given const response = new Response('id'); - const sut = new SendResponseToOracleUseCase(failingOracle(), new Logger()); + const sut = new SendResponseToOracleUseCase(failingOracle() as unknown as OracleGateway, new ConsoleLoggerAdapter()); // when, then return expect(() => sut.sendResponse(response)).to.be.rejected; }); diff --git a/src/domain/blockchain/usecase/SendResponseToOracleUseCase.ts b/src/domain/blockchain/usecase/SendResponseToOracleUseCase.ts index 858b819..69d6a59 100644 --- a/src/domain/blockchain/usecase/SendResponseToOracleUseCase.ts +++ b/src/domain/blockchain/usecase/SendResponseToOracleUseCase.ts @@ -1,12 +1,13 @@ +import {OracleGateway} from '@core/domain/blockchain/port'; +import LoggerPort from '@core/domain/common/port/LoggerPort'; + class SendResponseToOracleUseCase { - oracle: any; - logger: any; - constructor(oracle, logger) { - this.oracle = oracle; - this.logger = logger; - } + constructor( + private readonly oracle: OracleGateway, + private readonly logger: LoggerPort, + ) {} - async sendResponse(response) { + async sendResponse(response): Promise { await this.oracle.sendResponse(response); this.logger.info(`Response sent to blockchain [requestId=${response.requestId}]`); } diff --git a/src/domain/common/DataSelectorFinder.spec.ts b/src/domain/common/DataSelectorFinder.spec.ts index 4e2b73a..40a9b59 100644 --- a/src/domain/common/DataSelectorFinder.spec.ts +++ b/src/domain/common/DataSelectorFinder.spec.ts @@ -1,8 +1,7 @@ +import { expect } from '@core/config/configuredChai'; import { describe, it } from 'mocha'; -const { expect } = require('chai').use(require('chai-as-promised')); import DataSelectorFinder from './DataSelectorFinder'; - describe('DataSelectorFinder', () => { it('should select selector which can handle given contentType', async () => { // given diff --git a/src/domain/common/port/DataSelectorPort.ts b/src/domain/common/port/DataSelectorPort.ts index f7ea757..17fcc71 100644 --- a/src/domain/common/port/DataSelectorPort.ts +++ b/src/domain/common/port/DataSelectorPort.ts @@ -1,13 +1,4 @@ -/* eslint-disable no-unused-vars */ - -class DataSelectorPort { - select(data, path) { - throw new Error('Not implemented'); - } - - canHandle(contentType) { - throw new Error('Not implemented'); - } +export default interface DataSelectorPort { + select(data, path): string; + canHandle(contentType): boolean; } - -export default DataSelectorPort; diff --git a/src/domain/common/port/LoggerPort.ts b/src/domain/common/port/LoggerPort.ts index 97525fa..01221b0 100644 --- a/src/domain/common/port/LoggerPort.ts +++ b/src/domain/common/port/LoggerPort.ts @@ -1,13 +1,4 @@ -/* eslint-disable no-unused-vars */ - -class LoggerPort { - info(message) { - throw new Error('Not implemented'); - } - - error(message, error) { - throw new Error('Not implemented'); - } +export default interface LoggerPort { + info(message): void; + error(message, error): void; } - -export default LoggerPort; diff --git a/src/domain/common/port/UrlDataFetcherPort.ts b/src/domain/common/port/UrlDataFetcherPort.ts index 59747f3..8350f86 100644 --- a/src/domain/common/port/UrlDataFetcherPort.ts +++ b/src/domain/common/port/UrlDataFetcherPort.ts @@ -1,9 +1,3 @@ -/* eslint-disable no-unused-vars */ - -class UrlDataFetcherPort { - fetch(url) { - throw new Error('Not implemented'); - } +export default interface UrlDataFetcherPort { + fetch(url: string): Promise; } - -export default UrlDataFetcherPort; diff --git a/src/domain/common/usecase/FetchDataUseCase.spec.ts b/src/domain/common/usecase/FetchDataUseCase.spec.ts index 28bfcd8..2822629 100644 --- a/src/domain/common/usecase/FetchDataUseCase.spec.ts +++ b/src/domain/common/usecase/FetchDataUseCase.spec.ts @@ -1,10 +1,10 @@ /* eslint-disable no-unused-vars */ +import { expect } from '@core/config/configuredChai'; import { describe, it } from 'mocha'; -const { expect } = require('chai').use(require('chai-as-promised')); -import FetchDataUseCase from './FetchDataUseCase'; +import {ConsoleLoggerAdapter} from '../../../adapter'; import Request from '../../request/Request'; import { RequestStateEnum } from '../../request/RequestStateEnum'; -import { Logger } from '../utils/TestMocks'; +import FetchDataUseCase from './FetchDataUseCase'; describe('FetchDataUseCase', () => { const urlDataFetcher = () => ({ @@ -18,17 +18,16 @@ describe('FetchDataUseCase', () => { it('should fetch data for request and return rawData', async () => { // given const request = new Request('1', 'json(http://example.com).key1', Date.now()); - const sut = new FetchDataUseCase(urlDataFetcher(), new Logger()); + const sut = new FetchDataUseCase(urlDataFetcher(), new ConsoleLoggerAdapter()); // when const fetchedData = await sut.fetchData(request.id, 'http://example.com'); // then expect(fetchedData).to.equal('{"key1":"value1"}'); - expect(sut.logger.list()).to.have.lengthOf(1); }); it('should throw error if data fetch failed', () => { const request = new Request('1', 'json(http://example.com).key1', Date.now(), RequestStateEnum.PROCESSED); - const sut = new FetchDataUseCase(failingDataFetcher(), new Logger()); + const sut = new FetchDataUseCase(failingDataFetcher(), new ConsoleLoggerAdapter()); // when return expect(() => sut.fetchData(request.id, request.getRawUrl())).to.be.rejected; }); diff --git a/src/domain/common/usecase/SelectDataUseCase.spec.ts b/src/domain/common/usecase/SelectDataUseCase.spec.ts index 11e9251..76607d9 100644 --- a/src/domain/common/usecase/SelectDataUseCase.spec.ts +++ b/src/domain/common/usecase/SelectDataUseCase.spec.ts @@ -1,8 +1,9 @@ +import { expect } from '@core/config/configuredChai'; import { describe, it } from 'mocha'; -const { expect } = require('chai').use(require('chai-as-promised')); -import SelectDataUseCase from './SelectDataUseCase'; +import {ConsoleLoggerAdapter} from '../../../adapter'; +import DataSelectorFinder from '../DataSelectorFinder'; import { InvalidSelectorDataError, NoMatchingElementsFoundError } from '../utils/error'; -import { Logger } from '../utils/TestMocks'; +import SelectDataUseCase from './SelectDataUseCase'; describe('SelectDataUseCase', () => { it('should select appropriate data', async () => { @@ -10,12 +11,11 @@ describe('SelectDataUseCase', () => { const finder = () => ({ find: () => ({ select: () => Promise.resolve('selectedData') }), }); - const sut = new SelectDataUseCase(finder(), new Logger()); + const sut = new SelectDataUseCase(finder() as unknown as DataSelectorFinder, new ConsoleLoggerAdapter()); // when const selectedData = await sut.selectFromRawData('fetchedData', 'json', '.key1'); // then expect(selectedData).to.equal('selectedData'); - expect(sut.logger.list()).to.have.lengthOf(1); }); it('should throw NoMatchingElementsFoundError when no data matched', async () => { @@ -23,7 +23,7 @@ describe('SelectDataUseCase', () => { const finder = () => ({ find: () => ({ select: () => Promise.resolve(null) }), }); - const sut = new SelectDataUseCase(finder(), new Logger()); + const sut = new SelectDataUseCase(finder() as unknown as DataSelectorFinder, new ConsoleLoggerAdapter()); // when, then return expect(sut.selectFromRawData('fetchedData', 'json', '.key1')).to.be.rejectedWith(NoMatchingElementsFoundError); }); @@ -33,7 +33,7 @@ describe('SelectDataUseCase', () => { const finder = () => ({ find: () => ({ select: () => Promise.reject(new Error('fail')) }), }); - const sut = new SelectDataUseCase(finder(), new Logger()); + const sut = new SelectDataUseCase(finder() as unknown as DataSelectorFinder, new ConsoleLoggerAdapter()); // when, then return expect(sut.selectFromRawData('fetchedData', 'json', '.key1')).to.be.rejectedWith(InvalidSelectorDataError); }); diff --git a/src/domain/common/usecase/SelectDataUseCase.ts b/src/domain/common/usecase/SelectDataUseCase.ts index 6b6fc02..b8c0e07 100644 --- a/src/domain/common/usecase/SelectDataUseCase.ts +++ b/src/domain/common/usecase/SelectDataUseCase.ts @@ -1,10 +1,14 @@ -import { InvalidSelectorDataError, NoMatchingElementsFoundError } from '../utils/error'; +import DataSelectorFinder from '@core/domain/common/DataSelectorFinder'; +import {LoggerPort} from '@core/domain/common/port'; +import { InvalidSelectorDataError, NoMatchingElementsFoundError} from '../utils/error'; class SelectDataUseCase { - constructor(private dataSelectorFinder, public logger) { - } + constructor( + private readonly dataSelectorFinder: DataSelectorFinder, + private readonly logger: LoggerPort, + ) {} - async selectFromRawData(fetchedData, contentType, path) { + async selectFromRawData(fetchedData, contentType, path): Promise { let selectedData; try { diff --git a/src/domain/common/utils/TestMocks.ts b/src/domain/common/utils/TestMocks.ts deleted file mode 100644 index 67661ef..0000000 --- a/src/domain/common/utils/TestMocks.ts +++ /dev/null @@ -1,43 +0,0 @@ -class Logger { - logs: any[]; - constructor() { - this.logs = []; - } - - info(log) { - this.logs.push(log); - } - - error(log) { - this.logs.push(log); - } - - list() { - return this.logs; - } -} - - -class Repository { - collection: Map; - constructor() { - this.collection = new Map(); - } - - save(req) { - this.collection.set(req.id, req); - } - - list() { - return Array.from(this.collection.values()); - } - - exists(id) { - return this.collection.has(id); - } -} - -export { - Logger, - Repository, -}; diff --git a/src/domain/common/utils/error/InvalidRequestError.ts b/src/domain/common/utils/error/InvalidRequestError.ts index a2ccd7f..ddab2f9 100644 --- a/src/domain/common/utils/error/InvalidRequestError.ts +++ b/src/domain/common/utils/error/InvalidRequestError.ts @@ -1,11 +1,10 @@ class InvalidRequestError extends Error { - constructor(message, code) { + code: number; + + constructor(message: string, code: number) { super(message); this.code = code; } - code(code: any) { - throw new Error('Method not implemented.'); - } } export default InvalidRequestError; diff --git a/src/domain/request/Request.spec.ts b/src/domain/request/Request.spec.ts index f6ea37a..c081ee7 100644 --- a/src/domain/request/Request.spec.ts +++ b/src/domain/request/Request.spec.ts @@ -1,5 +1,5 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; +import { describe, it } from 'mocha'; import Request from './Request'; import RequestState from './RequestState'; diff --git a/src/domain/request/Request.ts b/src/domain/request/Request.ts index 34bc902..82e59b6 100644 --- a/src/domain/request/Request.ts +++ b/src/domain/request/Request.ts @@ -3,9 +3,9 @@ import RequestStateFactory from './RequestStateFactory'; import RequestUrlParser from './RequestUrlParser'; class Request { - id: any; - url: any; - validFrom: any; + id: string; + url: string; + validFrom: number; state: RequestState; constructor(id, url, validFrom, state?) { // TODO param validation? diff --git a/src/domain/request/RequestState.spec.ts b/src/domain/request/RequestState.spec.ts index 27d9c54..4aa9209 100644 --- a/src/domain/request/RequestState.spec.ts +++ b/src/domain/request/RequestState.spec.ts @@ -1,5 +1,5 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; +import { describe, it } from 'mocha'; import RequestState from './RequestState'; import { RequestStateEnum } from './RequestStateEnum'; diff --git a/src/domain/request/RequestStateFactory.spec.ts b/src/domain/request/RequestStateFactory.spec.ts index 943ea1a..10359e3 100644 --- a/src/domain/request/RequestStateFactory.spec.ts +++ b/src/domain/request/RequestStateFactory.spec.ts @@ -1,7 +1,7 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; -import RequestStateFactory from './RequestStateFactory'; +import { describe, it } from 'mocha'; import RequestState from './RequestState'; +import RequestStateFactory from './RequestStateFactory'; describe('RequestStateFactory', () => { const oneMinute = 60 * 1000; diff --git a/src/domain/request/RequestUrlParser.ts b/src/domain/request/RequestUrlParser.ts index dbe1cd3..f2e2092 100644 --- a/src/domain/request/RequestUrlParser.ts +++ b/src/domain/request/RequestUrlParser.ts @@ -1,7 +1,7 @@ import { InvalidContentTypeError, InvalidUrlError } from '../common/utils/error'; class RequestUrlParser { - static resolveRawUrl(wrappedUrl) { + static resolveRawUrl(wrappedUrl): string { const urlRegex = new RegExp(/\(https?:\/\/[^)]+\)/); const matched = urlRegex.exec(wrappedUrl); if (!matched) { @@ -12,7 +12,7 @@ class RequestUrlParser { return firstMatched.substring(1, firstMatched.length - 1); } - static resolveContentType(wrappedUrl) { + static resolveContentType(wrappedUrl): string { const typeRegex = new RegExp(/^(json|xml|html|ipfs)\(.+\)/); if (typeRegex.test(wrappedUrl)) { @@ -22,7 +22,7 @@ class RequestUrlParser { throw new InvalidContentTypeError('Request type is neither json nor xml nor html nor ipfs'); } - static resolveSelectionPath(wrappedUrl) { + static resolveSelectionPath(wrappedUrl): string { const rawUrl = this.resolveRawUrl(wrappedUrl); const pathStartIndex = wrappedUrl.indexOf(rawUrl) + rawUrl.length + 1; // + 1 for bracket char diff --git a/src/domain/request/port/RequestRepositoryPort.ts b/src/domain/request/port/RequestRepositoryPort.ts index d75e525..8aa7388 100644 --- a/src/domain/request/port/RequestRepositoryPort.ts +++ b/src/domain/request/port/RequestRepositoryPort.ts @@ -1,21 +1,9 @@ -/* eslint-disable no-unused-vars */ - -class RequestRepositoryPort { - exists(id) { - throw new Error('Not implemented'); - } - - save(request) { - throw new Error('Not implemented'); - } - - getScheduledRequestsWithValidFromBeforeNow() { - throw new Error('Not implemented'); - } - - getReadyRequests() { - throw new Error('Not implemented'); - } +import Request from '@core/domain/request/Request'; + +export default interface RequestRepositoryPort { + get(id): Promise; + exists(id): Promise; + save(request): Promise; + getScheduledRequestsWithValidFromBeforeNow(): Promise; + getReadyRequests(): Promise; } - -export default RequestRepositoryPort; diff --git a/src/domain/request/usecase/CreateRequestUseCase.spec.ts b/src/domain/request/usecase/CreateRequestUseCase.spec.ts index 474ebe1..1fa0b09 100644 --- a/src/domain/request/usecase/CreateRequestUseCase.spec.ts +++ b/src/domain/request/usecase/CreateRequestUseCase.spec.ts @@ -1,16 +1,20 @@ -import { describe, it, beforeEach } from 'mocha'; -const { expect } = require('chai').use(require('chai-as-promised')); +import ConsoleLoggerAdapter from '@core/application/logger/ConsoleLoggerAdapter'; +import { expect } from '@core/config/configuredChai'; +import InMemoryRequestRepositoryAdapter from '@core/infrastructure/persistence/inmemory/InMemoryRequestRepositoryAdapter'; +import { beforeEach, describe, it } from 'mocha'; +import {RequestRepositoryPort} from '../port'; import CreateRequestUseCase from './CreateRequestUseCase'; -import { Logger, Repository } from '../../common/utils/TestMocks'; describe('CreateRequestUseCase', () => { - let sut; + let sut: CreateRequestUseCase; + let repository: RequestRepositoryPort; beforeEach(() => { - sut = new CreateRequestUseCase(new Repository(), new Logger()); + repository = new InMemoryRequestRepositoryAdapter(); + sut = new CreateRequestUseCase(repository, new ConsoleLoggerAdapter()); }); - it('should save request in the repository and log message', async () => { + it('should save request in the repository', async () => { // given const id = '123'; const url = 'qwerty'; @@ -18,8 +22,10 @@ describe('CreateRequestUseCase', () => { // when await sut.createRequest(id, url, validFrom); // then - expect(sut.requestRepository.list()[0].id).to.equal(id); - expect(sut.logger.list().length).to.equal(1); + const savedRequest = await repository.get(id); + expect(savedRequest.id).to.equal(id); + expect(savedRequest.url).to.equal(url); + expect(savedRequest.validFrom).to.equal(validFrom); }); it('should throw error if the same request is passed twice', async () => { diff --git a/src/domain/request/usecase/CreateRequestUseCase.ts b/src/domain/request/usecase/CreateRequestUseCase.ts index a905075..19e1894 100644 --- a/src/domain/request/usecase/CreateRequestUseCase.ts +++ b/src/domain/request/usecase/CreateRequestUseCase.ts @@ -1,14 +1,13 @@ +import {LoggerPort} from '@core/domain/common/port'; +import {RequestRepositoryPort} from '@core/domain/request/port'; import Request from '../Request'; class CreateRequestUseCase { - requestRepository: any; - logger: any; - constructor(requestRepository, logger) { - this.requestRepository = requestRepository; - this.logger = logger; - } + constructor( + private readonly requestRepository: RequestRepositoryPort, + private readonly logger: LoggerPort) {} - async createRequest(id, url, validFrom) { + async createRequest(id, url, validFrom): Promise { if (await this.requestRepository.exists(id)) { throw new Error(`Request ${id} already in the system`); } diff --git a/src/domain/request/usecase/ExecuteReadyRequestsUseCase.spec.ts b/src/domain/request/usecase/ExecuteReadyRequestsUseCase.spec.ts index 1b0dd44..7f56fab 100644 --- a/src/domain/request/usecase/ExecuteReadyRequestsUseCase.spec.ts +++ b/src/domain/request/usecase/ExecuteReadyRequestsUseCase.spec.ts @@ -1,9 +1,14 @@ -import { describe, it } from 'mocha'; +import InMemoryResponseRepositoryAdapter from '@core/infrastructure/persistence/inmemory/InMemoryResponseRepositoryAdapter'; import { expect } from 'chai'; -import ExecuteReadyRequestsUseCase from './ExecuteReadyRequestsUseCase'; -import Request from '../Request'; -import { Logger } from '../../common/utils/TestMocks'; +import { describe, it } from 'mocha'; +import {ConsoleLoggerAdapter} from '../../../adapter'; +import SendResponseToOracleUseCase from '../../blockchain/usecase/SendResponseToOracleUseCase'; +import FetchDataUseCase from '../../common/usecase/FetchDataUseCase'; +import SelectDataUseCase from '../../common/usecase/SelectDataUseCase'; import InvalidUrlError from '../../common/utils/error/InvalidUrlError'; +import {RequestRepositoryPort} from '../port'; +import Request from '../Request'; +import ExecuteReadyRequestsUseCase from './ExecuteReadyRequestsUseCase'; describe('ExecuteReadyRequestsUseCase', () => { const oneMinuteMillis = 60 * 1000; @@ -18,14 +23,6 @@ describe('ExecuteReadyRequestsUseCase', () => { }; }; - const responseRepository = () => { - const responses = []; - return { - save: res => responses.push(res), - list: () => responses, - }; - }; - const fetchDataUseCase = () => ({ fetchData: () => Promise.resolve('fetchedData'), }); @@ -52,55 +49,58 @@ describe('ExecuteReadyRequestsUseCase', () => { it('should execute ready request which is finished after that and generate response', async () => { // given + const responseRepository = new InMemoryResponseRepositoryAdapter(); const sut = new ExecuteReadyRequestsUseCase( - fetchDataUseCase(), - selectDataUseCase(), - sendResponseToOracleUseCase(), - requestRepository(), - responseRepository(), - new Logger(), + fetchDataUseCase() as unknown as FetchDataUseCase, + selectDataUseCase() as unknown as SelectDataUseCase, + sendResponseToOracleUseCase() as unknown as SendResponseToOracleUseCase, + requestRepository() as unknown as RequestRepositoryPort, + responseRepository, + new ConsoleLoggerAdapter(), ); // when await sut.executeReadyRequests(); // then - const response = await sut.responseRepository.list()[0]; + const response = await responseRepository.get('123'); expect(response.requestId).to.equal('123'); expect(response.fetchedData).to.equal('fetchedData'); expect(response.selectedData).to.equal('selectedData'); expect(response.state.name).to.equal('Sent'); - expect(sut.logger.list()).to.have.lengthOf(4); }); it('should mark request as failed if error does not have code property', async () => { // given + const responseRepository = new InMemoryResponseRepositoryAdapter(); + const reqRepository = requestRepository(); const sut = new ExecuteReadyRequestsUseCase( - fetchDataUseCase(), - failedSelectDataUseCase(), - sendResponseToOracleUseCase(), - requestRepository(), - responseRepository(), - new Logger(), + fetchDataUseCase() as unknown as FetchDataUseCase, + failedSelectDataUseCase() as unknown as SelectDataUseCase, + sendResponseToOracleUseCase() as unknown as SendResponseToOracleUseCase, + reqRepository as unknown as RequestRepositoryPort, + responseRepository, + new ConsoleLoggerAdapter(), ); // when await sut.executeReadyRequests(); // then - expect(sut.requestRepository.list()[0].state.name).to.equal('Failed'); + expect(reqRepository.list()[0].state.name).to.equal('Failed'); }); it('should create response with errorCode if error with code property handled', async () => { // given + const responseRepository = new InMemoryResponseRepositoryAdapter(); const sut = new ExecuteReadyRequestsUseCase( - failedFetchDataUseCase(), - selectDataUseCase(), - sendResponseToOracleUseCase(), - requestRepository(), - responseRepository(), - new Logger(), + failedFetchDataUseCase() as unknown as FetchDataUseCase, + selectDataUseCase() as unknown as SelectDataUseCase, + sendResponseToOracleUseCase() as unknown as SendResponseToOracleUseCase, + requestRepository() as unknown as RequestRepositoryPort, + responseRepository, + new ConsoleLoggerAdapter(), ); // when await sut.executeReadyRequests(); // then - const response = await sut.responseRepository.list()[0]; + const response = await responseRepository.get('123'); expect(response.requestId).to.equal('123'); expect(response.selectedData).to.equal(undefined); expect(response.errorCode).to.equal(1000); @@ -109,18 +109,19 @@ describe('ExecuteReadyRequestsUseCase', () => { it('should mark response as failed if it failed to send to oracle', async () => { // given + const responseRepository = new InMemoryResponseRepositoryAdapter(); const sut = new ExecuteReadyRequestsUseCase( - fetchDataUseCase(), - selectDataUseCase(), - failedSendResponseToOracleUseCase(), - requestRepository(), - responseRepository(), - new Logger(), + fetchDataUseCase() as unknown as FetchDataUseCase, + selectDataUseCase() as unknown as SelectDataUseCase, + failedSendResponseToOracleUseCase() as unknown as SendResponseToOracleUseCase, + requestRepository() as unknown as RequestRepositoryPort, + responseRepository, + new ConsoleLoggerAdapter(), ); // when await sut.executeReadyRequests(); // then - const response = await sut.responseRepository.list()[0]; + const response = await responseRepository.get('123'); expect(response.requestId).to.equal('123'); expect(response.fetchedData).to.equal('fetchedData'); expect(response.selectedData).to.equal('selectedData'); diff --git a/src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts b/src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts index cbdeebf..55e0035 100644 --- a/src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts +++ b/src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts @@ -1,42 +1,48 @@ +import SendResponseToOracleUseCase from '@core/domain/blockchain/usecase/SendResponseToOracleUseCase'; +import {LoggerPort} from '@core/domain/common/port'; +import FetchDataUseCase from '@core/domain/common/usecase/FetchDataUseCase'; +import SelectDataUseCase from '@core/domain/common/usecase/SelectDataUseCase'; +import {RequestRepositoryPort} from '@core/domain/request/port'; +import ResponseRepositoryPort from '@core/domain/response/port/ResponseRepositoryPort'; import InvalidRequestError from '../../common/utils/error/InvalidRequestError'; import Response from '../../response/Response'; class ExecuteReadyRequestsUseCase { constructor( - public fetchDataUseCase, - public selectDataUseCase, - public sendResponseToOracleUseCase, - public requestRepository, - public responseRepository, - public logger, + private readonly fetchDataUseCase: FetchDataUseCase, + private readonly selectDataUseCase: SelectDataUseCase, + private readonly sendResponseToOracleUseCase: SendResponseToOracleUseCase, + private readonly requestRepository: RequestRepositoryPort, + private readonly responseRepository: ResponseRepositoryPort, + private readonly logger: LoggerPort, ) { } - async executeReadyRequests() { + async executeReadyRequests(): Promise { const requests = await this.requestRepository.getReadyRequests(); const promises = requests.map(async (request) => { request.state.markAsProcessed(); - this.requestRepository.save(request); + await this.requestRepository.save(request); this.logger.info(`Request marked as processed [requestId=${request.id}]`); - const response = await this._fetchAndSelectData(request); + const response = await this.fetchAndSelectData(request); if (!response) { return; } request.state.markAsFinished(); - this.requestRepository.save(request); + await this.requestRepository.save(request); this.logger.info(`Request marked as finished [requestId=${request.id}]`); - await this._sendResponse(response); - this.responseRepository.save(response); + await this.sendResponse(response); + await this.responseRepository.save(response); }); - return Promise.all(promises); + await Promise.all(promises); } - async _fetchAndSelectData(request) { + private async fetchAndSelectData(request): Promise { const response = new Response(request.id); this.logger.info(`Created response [response=${JSON.stringify(response)}]`); @@ -60,13 +66,13 @@ class ExecuteReadyRequestsUseCase { } request.state.markAsFailed(); - this.requestRepository.save(request); + await this.requestRepository.save(request); this.logger.error(`Request marked as failed [requestId=${request.id}]`, e); return null; } } - async _sendResponse(response) { + private async sendResponse(response): Promise { try { await this.sendResponseToOracleUseCase.sendResponse(response); response.state.markAsSent(); diff --git a/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.spec.ts b/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.spec.ts index 99f3826..c391b8f 100644 --- a/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.spec.ts +++ b/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.spec.ts @@ -1,11 +1,12 @@ /* eslint-disable no-unused-vars */ -import { describe, it } from 'mocha'; import { expect } from 'chai'; +import { describe, it } from 'mocha'; import Request from '../Request'; import { RequestStateEnum } from '../RequestStateEnum'; import MarkValidRequestsAsReadyUseCase from './MarkValidRequestsAsReadyUseCase'; -import { Logger } from '../../common/utils/TestMocks'; +import {ConsoleLoggerAdapter} from "../../../adapter"; +import {RequestRepositoryPort} from "../port"; describe('MarkValidRequestsAsReadyUseCase', () => { const repository = () => { @@ -23,12 +24,11 @@ describe('MarkValidRequestsAsReadyUseCase', () => { const requestRepository = repository(); requestRepository.save(new Request('1', 'url', Date.now(), RequestStateEnum.SCHEDULED)); - const sut = new MarkValidRequestsAsReadyUseCase(requestRepository, new Logger()); + const sut = new MarkValidRequestsAsReadyUseCase(requestRepository as unknown as RequestRepositoryPort, new ConsoleLoggerAdapter()); // when await sut.markValidRequestsAsReady(); // then expect(requestRepository.getById('1').state.name).to.equal(RequestStateEnum.READY); - expect(sut.logger.list().length).to.equal(1); }); }); diff --git a/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.ts b/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.ts index 94c0277..df38c9d 100644 --- a/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.ts +++ b/src/domain/request/usecase/MarkValidRequestsAsReadyUseCase.ts @@ -1,12 +1,13 @@ +import {LoggerPort} from '@core/domain/common/port'; +import {RequestRepositoryPort} from '@core/domain/request/port'; + class MarkValidRequestsAsReadyUseCase { - requestRepository: any; - logger: any; - constructor(requestRepository, logger) { - this.requestRepository = requestRepository; - this.logger = logger; - } + constructor( + private readonly requestRepository: RequestRepositoryPort, + private readonly logger: LoggerPort, + ) {} - async markValidRequestsAsReady() { + async markValidRequestsAsReady(): Promise { const requests = await this.requestRepository.getScheduledRequestsWithValidFromBeforeNow(); requests.forEach((request) => { diff --git a/src/domain/response/Response.ts b/src/domain/response/Response.ts index 5d43c89..d628145 100644 --- a/src/domain/response/Response.ts +++ b/src/domain/response/Response.ts @@ -1,29 +1,26 @@ import ResponseState from './ResponseState'; class Response { - requestId: any; + requestId: string; state: any; errorCode: number; - selectedData: any; + selectedData: string; + fetchedData: string; - constructor(requestId) { + constructor(requestId: string) { this.requestId = requestId; this.state = new ResponseState(); this.errorCode = 0; } - fetchedData(fetchedData: any, arg1: any, arg2: any) { - throw new Error('Method not implemented.'); - } - - addFetchedData(fetchedData) { + addFetchedData(fetchedData: string) { if (this.fetchedData) { throw new Error('Fetched data already added'); } this.fetchedData = fetchedData; } - addSelectedData(selectedData) { + addSelectedData(selectedData: string) { if (!this.fetchedData) { throw new Error('Cannot add selected data without fetched data'); } @@ -33,7 +30,7 @@ class Response { this.selectedData = selectedData; } - setError(errorCode) { + setError(errorCode: number) { this.errorCode = errorCode; } } diff --git a/src/domain/response/ResponseState.spec.ts b/src/domain/response/ResponseState.spec.ts index 697ea81..3ee9537 100644 --- a/src/domain/response/ResponseState.spec.ts +++ b/src/domain/response/ResponseState.spec.ts @@ -1,5 +1,5 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; +import { describe, it } from 'mocha'; import ResponseState from './ResponseState'; const stateMachine = [ diff --git a/src/domain/response/port/ResponseRepositoryPort.ts b/src/domain/response/port/ResponseRepositoryPort.ts index 96ba164..3737683 100644 --- a/src/domain/response/port/ResponseRepositoryPort.ts +++ b/src/domain/response/port/ResponseRepositoryPort.ts @@ -1,9 +1,6 @@ -/* eslint-disable no-unused-vars */ +import Response from '@core/domain/response/Response'; -class ResponseRepositoryPort { - save(response) { - throw new Error('Not implemented'); - } +export default interface ResponseRepositoryPort { + save(response): Promise; + get(responseId: string): Promise; } - -export default ResponseRepositoryPort; diff --git a/src/index.ts b/src/index.ts index a846636..edd191f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,8 @@ -// tslint:disable-next-line -require('dotenv').load(); +import * as dotenv from 'dotenv'; +dotenv.config(); -import express from 'express'; +import * as express from 'express'; +import statusEndpoint from './infrastructure/systemHealth/statusEndpoint'; import { EthereumBlockchainAdapter as Blockchain, @@ -43,6 +44,7 @@ import DataSelectorFinder from './domain/common/DataSelectorFinder'; import BlockListener from './infrastructure/blockchain/BlockListener'; +import {AbiItem} from 'web3-utils/types'; import { RequestRepositoryFactory, ResponseRepositoryFactory } from './infrastructure/persistence'; import PersistenceConnectionInitializer from './infrastructure/persistence/PersistenceConnectionInitializer'; @@ -60,7 +62,7 @@ new PersistenceConnectionInitializer().init(PERSISTENCE, persistenceOptions); const logger = new Logger(); const requestRepository = RequestRepositoryFactory.create(PERSISTENCE, logger); const responseRepository = ResponseRepositoryFactory.create(PERSISTENCE, logger); -const oracle = new Oracle(web3, oracleAbi, process.env.ORACLE_ADDRESS); +const oracle = new Oracle(web3, oracleAbi as AbiItem[], process.env.ORACLE_ADDRESS); const urlDataFetcher = new UrlDataFetcher(); const jsonSelector = new JsonSelector(); const xmlSelector = new XmlSelector(); @@ -71,7 +73,7 @@ const createRequestUseCase = new CreateRequestUseCase(requestRepository, logger) const fetchNewOracleRequestsUseCase = new FetchNewOracleRequestsUseCase( oracle, logger, - START_BLOCK, + parseInt(START_BLOCK, 10), ); const markValidRequestsAsReadyUseCase = new MarkValidRequestsAsReadyUseCase( requestRepository, @@ -112,7 +114,7 @@ blockListener.listen(); const app = express(); const port = API_PORT; -// tslint:disable-next-line -require('./infrastructure/systemHealth/statusEndpoint')(app, checkHealthStatusUseCase); +// @ts-ignore +statusEndpoint(app, checkHealthStatusUseCase); app.listen(port); diff --git a/src/infrastructure/blockchain/ethereum/EthereumBlockchainAdapter.ts b/src/infrastructure/blockchain/ethereum/EthereumBlockchainAdapter.ts index e374b61..29fee0d 100644 --- a/src/infrastructure/blockchain/ethereum/EthereumBlockchainAdapter.ts +++ b/src/infrastructure/blockchain/ethereum/EthereumBlockchainAdapter.ts @@ -1,13 +1,10 @@ -import BlockchainPort from '../../../domain/blockchain/port/BlockchainPort'; +import { BlockchainPort } from '@core/domain/blockchain/port'; +import Web3 from 'web3/types'; -class EthereumBlockchainAdapter extends BlockchainPort { - web3: any; - constructor(web3) { - super(); - this.web3 = web3; - } +class EthereumBlockchainAdapter implements BlockchainPort { + constructor(private readonly web3: Web3) {} - getBlockNumber() { + getBlockNumber(): Promise { return this.web3.eth.getBlockNumber(); } } diff --git a/src/infrastructure/blockchain/ethereum/EthereumOracleAdapter.ts b/src/infrastructure/blockchain/ethereum/EthereumOracleAdapter.ts index b498126..6a1b1f4 100644 --- a/src/infrastructure/blockchain/ethereum/EthereumOracleAdapter.ts +++ b/src/infrastructure/blockchain/ethereum/EthereumOracleAdapter.ts @@ -1,35 +1,42 @@ import * as EventEmitter from 'events'; import _ from 'lodash'; +import Request from '@core/domain/request/Request'; +import {Contract} from 'web3-eth-contract/types'; +import {AbiItem} from 'web3-utils/types'; +import Web3 from 'web3/types'; import OracleGateway from '../../../domain/blockchain/port/OracleGateway'; const ONE_SECOND_MILLIS = 1000; -class EthereumOracleAdapter extends OracleGateway { - static _finishedEventName(requestId) { +class EthereumOracleAdapter implements OracleGateway { + private static finishedEventName(requestId): string { return `finished-${requestId}`; } - contract: any; - pendingResponses: any[]; - emitter: EventEmitter; - guard: boolean; - constructor(web3, abi, address) { - super(); + private pendingResponses: any[]; + private emitter: EventEmitter; + private guard: boolean; + private contract: Contract; + + constructor(web3: Web3, abi: AbiItem[], address: string) { + // @ts-ignore this.contract = new web3.eth.Contract(abi, address, { from: web3.eth.defaultAccount }); this.pendingResponses = []; this.emitter = new EventEmitter(); this.guard = false; - setInterval(() => this._sendPendingResponse(), ONE_SECOND_MILLIS); + setInterval(() => this.sendPendingResponse(), ONE_SECOND_MILLIS); } - getRequests(fromBlock, toBlock) { + public getRequests(fromBlock, toBlock): Promise { + // @ts-ignore const dataRequestedEventsPromise = this.contract.getPastEvents('DataRequested', { fromBlock, toBlock }) .then(events => events.map( event => _.pick(event.returnValues, ['id', 'url']), )); + // @ts-ignore const delayedDataRequestedEventsPromise = this.contract.getPastEvents('DelayedDataRequested', { fromBlock, toBlock }) .then(events => events.map( event => _.pick(event.returnValues, ['id', 'url', 'validFrom']), @@ -45,10 +52,10 @@ class EthereumOracleAdapter extends OracleGateway { }))); } - sendResponse(response) { + public sendResponse(response): Promise { this.pendingResponses.push(response); return new Promise((resolve, reject) => { - this.emitter.on(EthereumOracleAdapter._finishedEventName(response.requestId), (error) => { + this.emitter.on(EthereumOracleAdapter.finishedEventName(response.requestId), (error) => { if (error) { reject(error); } else { @@ -58,7 +65,7 @@ class EthereumOracleAdapter extends OracleGateway { }); } - async _sendPendingResponse() { + private async sendPendingResponse(): Promise { if (this.guard) { return; } @@ -84,7 +91,7 @@ class EthereumOracleAdapter extends OracleGateway { error = e; } - this.emitter.emit(EthereumOracleAdapter._finishedEventName(response.requestId), error); + this.emitter.emit(EthereumOracleAdapter.finishedEventName(response.requestId), error); this.guard = false; } } diff --git a/src/infrastructure/blockchain/ethereum/createAndUnlockWeb3.ts b/src/infrastructure/blockchain/ethereum/createAndUnlockWeb3.ts index 2493f8e..6a0240f 100644 --- a/src/infrastructure/blockchain/ethereum/createAndUnlockWeb3.ts +++ b/src/infrastructure/blockchain/ethereum/createAndUnlockWeb3.ts @@ -1,5 +1,6 @@ -import Web3 from 'web3'; +import * as Web3 from 'web3'; +// @ts-ignore const web3 = new Web3(process.env.NODE_URL); web3.eth.accounts.wallet.add(process.env.PRIVATE_KEY); diff --git a/src/infrastructure/persistence/PersistenceConnectionInitializer.ts b/src/infrastructure/persistence/PersistenceConnectionInitializer.ts index 0236bfe..c55555f 100644 --- a/src/infrastructure/persistence/PersistenceConnectionInitializer.ts +++ b/src/infrastructure/persistence/PersistenceConnectionInitializer.ts @@ -1,4 +1,4 @@ -import mongoose from 'mongoose'; +import * as mongoose from 'mongoose'; import { PersistenceType } from './PersistenceType'; class PersistenceConnectionInitializer { diff --git a/src/infrastructure/persistence/RequestRepositoryFactory.spec.ts b/src/infrastructure/persistence/RequestRepositoryFactory.spec.ts index 4a0c839..d5f5c2e 100644 --- a/src/infrastructure/persistence/RequestRepositoryFactory.spec.ts +++ b/src/infrastructure/persistence/RequestRepositoryFactory.spec.ts @@ -1,27 +1,27 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; -import RequestRepositoryFactory from './RequestRepositoryFactory'; +import { describe, it } from 'mocha'; +import {ConsoleLoggerAdapter} from '../../adapter'; import InMemoryRequestRepository from './inmemory/InMemoryRequestRepositoryAdapter'; import MongoDBRequestRepository from './mongodb/MongoDbRequestRepositoryAdapter'; -import { Logger } from '../../domain/common/utils/TestMocks'; +import RequestRepositoryFactory from './RequestRepositoryFactory'; describe('RequestRepositoryFactory', () => { it('should create InMemoryRequestRepository when type is INMEMORY', () => { // when - const requestRepository = RequestRepositoryFactory.create('INMEMORY', new Logger()); + const requestRepository = RequestRepositoryFactory.create('INMEMORY', new ConsoleLoggerAdapter()); // then expect(requestRepository).to.be.an.instanceOf(InMemoryRequestRepository); }); it('should create MongoDBRequestRepository when type if MONGODB', () => { // when - const requestRepository = RequestRepositoryFactory.create('MONGODB', new Logger()); + const requestRepository = RequestRepositoryFactory.create('MONGODB', new ConsoleLoggerAdapter()); // then expect(requestRepository).to.be.an.instanceOf(MongoDBRequestRepository); }); it('should fail if type is neither INMEMORY nor MONGODB', () => { // when/then - expect(() => RequestRepositoryFactory.create('INVALID', new Logger())).to.throw(); + expect(() => RequestRepositoryFactory.create('INVALID', new ConsoleLoggerAdapter())).to.throw(); }); }); diff --git a/src/infrastructure/persistence/ResponseRepositoryFactory.spec.ts b/src/infrastructure/persistence/ResponseRepositoryFactory.spec.ts index fd172fd..d28e42c 100644 --- a/src/infrastructure/persistence/ResponseRepositoryFactory.spec.ts +++ b/src/infrastructure/persistence/ResponseRepositoryFactory.spec.ts @@ -1,28 +1,27 @@ -import { describe, it } from 'mocha'; import { expect } from 'chai'; -import ResponseRepositoryFactory from './ResponseRepositoryFactory'; +import { describe, it } from 'mocha'; +import {ConsoleLoggerAdapter} from '../../adapter'; import InMemoryResponseRepository from './inmemory/InMemoryResponseRepositoryAdapter'; import MongoDbResponseRepository from './mongodb/MongoDbResponseRepositoryAdapter'; -import { Logger } from '../../domain/common/utils/TestMocks'; - +import ResponseRepositoryFactory from './ResponseRepositoryFactory'; describe('ResponseRepositoryFactory', () => { it('should create InMemoryResponseRepository when type is INMEMORY', () => { // when - const responseRepository = ResponseRepositoryFactory.create('INMEMORY', new Logger()); + const responseRepository = ResponseRepositoryFactory.create('INMEMORY', new ConsoleLoggerAdapter()); // then expect(responseRepository).to.be.an.instanceOf(InMemoryResponseRepository); }); it('should create MongoDbResponseRepository when type if MONGODB', () => { // when - const responseRepository = ResponseRepositoryFactory.create('MONGODB', new Logger()); + const responseRepository = ResponseRepositoryFactory.create('MONGODB', new ConsoleLoggerAdapter()); // then expect(responseRepository).to.be.an.instanceOf(MongoDbResponseRepository); }); it('should fail if type is neither INMEMORY nor MONGODB', () => { // when/then - expect(() => ResponseRepositoryFactory.create('INVALID', new Logger())).to.throw(); + expect(() => ResponseRepositoryFactory.create('INVALID', new ConsoleLoggerAdapter())).to.throw(); }); }); diff --git a/src/infrastructure/persistence/inmemory/InMemoryRequestRepositoryAdapter.ts b/src/infrastructure/persistence/inmemory/InMemoryRequestRepositoryAdapter.ts index 44062e5..f61bc60 100644 --- a/src/infrastructure/persistence/inmemory/InMemoryRequestRepositoryAdapter.ts +++ b/src/infrastructure/persistence/inmemory/InMemoryRequestRepositoryAdapter.ts @@ -1,30 +1,41 @@ +import Request from '@core/domain/request/Request'; +import { RequestStateEnum } from '@core/domain/request/RequestStateEnum'; import RequestRepositoryPort from '../../../domain/request/port/RequestRepositoryPort'; -import { RequestStateEnum } from '../../../domain/request/RequestStateEnum'; -class InMemoryRequestRepositoryAdapter extends RequestRepositoryPort { - requests: Map; +class InMemoryRequestRepositoryAdapter implements RequestRepositoryPort { + private requests: Map; + constructor() { - super(); this.requests = new Map(); } - exists(id) { - return this.requests.has(id); + get(id): Promise { + return Promise.resolve(this.requests.get(id)); + } + + exists(id): Promise { + return Promise.resolve(this.requests.has(id)); } - save(request) { + save(request): Promise { this.requests.set(request.id, request); + + return Promise.resolve(); } - getScheduledRequestsWithValidFromBeforeNow() { - return Array.from(this.requests.values()) + getScheduledRequestsWithValidFromBeforeNow(): Promise { + const requests = Array.from(this.requests.values()) .filter(request => request.state.name === RequestStateEnum.SCHEDULED) .filter(request => request.validFrom <= Date.now()); + + return Promise.resolve(requests); } - getReadyRequests() { - return Array.from(this.requests.values()) + getReadyRequests(): Promise { + const requests = Array.from(this.requests.values()) .filter(request => request.state.name === RequestStateEnum.READY); + + return Promise.resolve(requests); } } diff --git a/src/infrastructure/persistence/inmemory/InMemoryResponseRepositoryAdapter.ts b/src/infrastructure/persistence/inmemory/InMemoryResponseRepositoryAdapter.ts index f356237..246549f 100644 --- a/src/infrastructure/persistence/inmemory/InMemoryResponseRepositoryAdapter.ts +++ b/src/infrastructure/persistence/inmemory/InMemoryResponseRepositoryAdapter.ts @@ -1,14 +1,20 @@ +import Response from '@core/domain/response/Response'; import ResponseRepositoryPort from '../../../domain/response/port/ResponseRepositoryPort'; -class InMemoryResponseRepositoryAdapter extends ResponseRepositoryPort { - responses: Map; +class InMemoryResponseRepositoryAdapter implements ResponseRepositoryPort { + responses: Map; constructor() { - super(); this.responses = new Map(); } - save(response) { + save(response): Promise { this.responses.set(response.requestId, response); + + return Promise.resolve(); + } + + get(responseId: string): Promise { + return Promise.resolve(this.responses.get(responseId)); } } diff --git a/src/infrastructure/persistence/mongodb/MongoDbRequestRepositoryAdapter.ts b/src/infrastructure/persistence/mongodb/MongoDbRequestRepositoryAdapter.ts index 8baffc3..99c8daf 100644 --- a/src/infrastructure/persistence/mongodb/MongoDbRequestRepositoryAdapter.ts +++ b/src/infrastructure/persistence/mongodb/MongoDbRequestRepositoryAdapter.ts @@ -1,22 +1,27 @@ import { omit } from 'lodash'; +import {LoggerPort} from '@core/domain/common/port'; +import { RequestStateEnum } from '@core/domain/request/RequestStateEnum'; import RequestRepositoryPort from '../../../domain/request/port/RequestRepositoryPort'; import Request from '../../../domain/request/Request'; -import { RequestStateEnum } from '../../../domain/request/RequestStateEnum'; import RequestModel from './RequestModel'; -class MongoDbRequestRepositoryAdapter extends RequestRepositoryPort { - constructor(private logger) { - super(); - } +class MongoDbRequestRepositoryAdapter implements RequestRepositoryPort { + constructor(private readonly logger: LoggerPort) {} - async exists(id) { + async exists(id): Promise { const count = await RequestModel.count({ _id: id }); return count > 0; } - save(request) { + public async get(id): Promise { + const result = await RequestModel.findById(id); + + return this.mapMongoResultToDomainRequest(result); + } + + public async save(request): Promise { const mongoRequest = RequestModel({ _id: request.id, url: request.url, @@ -33,26 +38,29 @@ class MongoDbRequestRepositoryAdapter extends RequestRepositoryPort { ).then(result => this.logger.info(`Request saved into database [request=${JSON.stringify(result)}]`)); } - async getScheduledRequestsWithValidFromBeforeNow() { + public async getScheduledRequestsWithValidFromBeforeNow(): Promise { const results = await RequestModel.find({ state: RequestStateEnum.SCHEDULED, validFrom: { $lt: Date.now() }, }).exec(); - return this._mapMongoResultsToDomainRequests(results); + return this.mapMongoResultsToDomainRequests(results); } - async getReadyRequests() { + public async getReadyRequests(): Promise { const results = await RequestModel.find({ state: RequestStateEnum.READY, }).exec(); - return this._mapMongoResultsToDomainRequests(results); + return this.mapMongoResultsToDomainRequests(results); + } + + private mapMongoResultsToDomainRequests(results): Request[] { + return results.map(this.mapMongoResultToDomainRequest); } - _mapMongoResultsToDomainRequests(results) { - return results - .map(result => new Request(result._id, result.url, result.validFrom, result.state)); + private mapMongoResultToDomainRequest(result): Request { + return new Request(result._id, result.url, result.validFrom, result.state); } } diff --git a/src/infrastructure/persistence/mongodb/MongoDbResponseRepositoryAdapter.ts b/src/infrastructure/persistence/mongodb/MongoDbResponseRepositoryAdapter.ts index cb66b8f..f44a400 100644 --- a/src/infrastructure/persistence/mongodb/MongoDbResponseRepositoryAdapter.ts +++ b/src/infrastructure/persistence/mongodb/MongoDbResponseRepositoryAdapter.ts @@ -1,15 +1,15 @@ +import {LoggerPort} from '@core/domain/common/port'; +import Response from '@core/domain/response/Response'; import { omit } from 'lodash'; import ResponseRepositoryPort from '../../../domain/response/port/ResponseRepositoryPort'; import ResponseModel from './ResponseModel'; -class MongoDbResponseRepositoryAdapter extends ResponseRepositoryPort { - logger: any; - constructor(logger) { - super(); +class MongoDbResponseRepositoryAdapter implements ResponseRepositoryPort { + constructor(private readonly logger: LoggerPort) { this.logger = logger; } - save(response) { + public async save(response): Promise { const mongoResponse = new ResponseModel({ _id: response.requestId, fetchedData: response.fetchedData, @@ -25,6 +25,16 @@ class MongoDbResponseRepositoryAdapter extends ResponseRepositoryPort { { upsert: true, new: true }, ).then(result => this.logger.info(`Response saved into database [response=${JSON.stringify(result)}]`)); } + + public async get(responseId: string): Promise { + const responseModel = await ResponseModel.findById(responseId); + + const response = new Response(responseModel._id); + response.addFetchedData(responseModel.fetchedData); + response.addSelectedData(responseModel.selectedData); + + return response; + } } export default MongoDbResponseRepositoryAdapter; diff --git a/src/infrastructure/selectors/IdentitySelectorAdapter.ts b/src/infrastructure/selectors/IdentitySelectorAdapter.ts index dbcb21d..a89eefe 100644 --- a/src/infrastructure/selectors/IdentitySelectorAdapter.ts +++ b/src/infrastructure/selectors/IdentitySelectorAdapter.ts @@ -1,6 +1,6 @@ -import { DataSelectorPort } from "../../domain/common/port"; +import { DataSelectorPort } from '../../domain/common/port'; -class IdentitySelectorAdapter extends DataSelectorPort { +class IdentitySelectorAdapter implements DataSelectorPort { canHandle(contentType) { return contentType === 'ipfs'; } diff --git a/src/infrastructure/selectors/JsonSelectorAdapter.ts b/src/infrastructure/selectors/JsonSelectorAdapter.ts index 093d3c2..d6ff174 100644 --- a/src/infrastructure/selectors/JsonSelectorAdapter.ts +++ b/src/infrastructure/selectors/JsonSelectorAdapter.ts @@ -3,7 +3,7 @@ import * as jp from 'jsonpath'; import JsonResultConverter from '../../application/selector/json/JsonResultConverter'; import DataSelectorPort from '../../domain/common/port/DataSelectorPort'; -class JsonSelectorAdapter extends DataSelectorPort { +class JsonSelectorAdapter implements DataSelectorPort { canHandle(contentType) { return contentType === 'json'; } diff --git a/src/infrastructure/selectors/XmlSelectorAdapter.ts b/src/infrastructure/selectors/XmlSelectorAdapter.ts index d814f95..decea57 100644 --- a/src/infrastructure/selectors/XmlSelectorAdapter.ts +++ b/src/infrastructure/selectors/XmlSelectorAdapter.ts @@ -1,12 +1,12 @@ +import { DOMParser, XMLSerializer } from 'xmldom'; import * as xpath from 'xpath'; -import { XMLSerializer, DOMParser } from 'xmldom'; import DataSelectorPort from '../../domain/common/port/DataSelectorPort'; -class XmlSelectorAdapter extends DataSelectorPort { - domParser: any; - xmlSerializer: any; +class XmlSelectorAdapter implements DataSelectorPort { + private readonly domParser: DOMParser; + private readonly xmlSerializer: XMLSerializer; + constructor() { - super(); this.domParser = new DOMParser(); this.xmlSerializer = new XMLSerializer(); } diff --git a/tsconfig.json b/tsconfig.json index 9244477..037c46d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "target": "esnext", "outDir": "./dist", "noUnusedLocals": true, "noImplicitReturns": true, @@ -16,4 +17,4 @@ "typeRoots": [ "node_modules/@types" ] -} \ No newline at end of file +} diff --git a/tslint.json b/tslint.json index 022a991..2b81365 100644 --- a/tslint.json +++ b/tslint.json @@ -10,7 +10,8 @@ "arrow-parens": false, "max-line-length": [true, 140], "no-console": [true, "debug"], - "object-literal-sort-keys": false + "object-literal-sort-keys": false, + "interface-name": false }, "rulesDirectory": [] -} \ No newline at end of file +}