diff --git a/package-lock.json b/package-lock.json index bbd064672..676169536 100644 --- a/package-lock.json +++ b/package-lock.json @@ -573,6 +573,14 @@ } } }, + "@grpc/grpc-js": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.3.7.tgz", + "integrity": "sha512-CKQVuwuSPh40tgOkR7c0ZisxYRiN05PcKPW72mQL5y++qd7CwBRoaJZvU5xfXnCJDFBmS3qZGQ71Frx6Ofo2XA==", + "requires": { + "@types/node": ">=12.12.47" + } + }, "@grpc/proto-loader": { "version": "0.6.4", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.4.tgz", @@ -1099,40 +1107,6 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz", "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==" }, - "@mapbox/node-pre-gyp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz", - "integrity": "sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==", - "requires": { - "detect-libc": "^1.0.3", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.1", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "rimraf": "^3.0.2", - "semver": "^7.3.4", - "tar": "^6.1.0" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1394,37 +1368,17 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "@relaycorp/cogrpc": { - "version": "1.3.19", - "resolved": "https://registry.npmjs.org/@relaycorp/cogrpc/-/cogrpc-1.3.19.tgz", - "integrity": "sha512-5fBplYaHj8ozGH2Vuc/C+JhhwHgdICnjdnXo5Wt3ZTcXYOgCUPIkMrVOxkXMmnnHHWJU7IHeDrUfluwpOagY+A==", + "version": "1.3.23", + "resolved": "https://registry.npmjs.org/@relaycorp/cogrpc/-/cogrpc-1.3.23.tgz", + "integrity": "sha512-QPw8JwADJkQ4O45F0oE8lcItt3UH7KNXv3CkI5iw8AI3zlWJdnprlR70hatsS8c84b7yoAhl8hhv4bLcBkTk+A==", "requires": { + "@grpc/grpc-js": "^1.3.7", "@grpc/proto-loader": "^0.6.4", "@relaycorp/relaynet-core": "^1.49.1", "check-ip": "^1.1.1", - "grpc": "^1.24.11", "it-pipe": "^1.1.0", "stream-to-it": "^0.2.4", "uuid-random": "^1.3.0" - }, - "dependencies": { - "@relaycorp/relaynet-core": { - "version": "1.49.1", - "resolved": "https://registry.npmjs.org/@relaycorp/relaynet-core/-/relaynet-core-1.49.1.tgz", - "integrity": "sha512-Anh6jy5jzo1D5S2Rn6GSE/QIbNypauD4MdWPoZott13P+zYVcYqRZeQ8yNs3D8rZMK3oAZt/oSQ7aAG5EDf/fw==", - "requires": { - "@peculiar/webcrypto": "^1.1.7", - "@types/verror": "^1.10.5", - "asn1js": "^2.1.1", - "binary-parser": "^1.9.2", - "buffer-to-arraybuffer": "0.0.6", - "dohdec": "^3.1.0", - "moment": "^2.29.1", - "pkijs": "^2.1.96", - "smart-buffer": "^4.1.0", - "uuid4": "^2.0.2", - "verror": "^1.10.0" - } - } } }, "@relaycorp/keystore-vault": { @@ -2043,15 +1997,6 @@ "@types/node": "*" } }, - "@types/bytebuffer": { - "version": "5.0.42", - "resolved": "https://registry.npmjs.org/@types/bytebuffer/-/bytebuffer-5.0.42.tgz", - "integrity": "sha512-lEgKojWUAc/MG2t649oZS5AfYFP2xRNPoDuwDBlBMjHXd8MaGPgFgtCXUK7inZdBOygmVf10qxc1Us8GXC96aw==", - "requires": { - "@types/long": "*", - "@types/node": "*" - } - }, "@types/graceful-fs": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", @@ -2283,11 +2228,6 @@ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -2422,54 +2362,11 @@ "picomatch": "^2.0.4" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "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==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2539,15 +2436,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "requires": { - "colour": "~0.7.1", - "optjs": "~3.2.2" - } - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -2808,7 +2696,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -2966,6 +2855,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" @@ -3050,21 +2940,6 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "requires": { - "long": "~3" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } - } - }, "bytestreamjs": { "version": "1.0.29", "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-1.0.29.tgz", @@ -3188,11 +3063,6 @@ } } }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -3260,11 +3130,6 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -3302,11 +3167,6 @@ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", "dev": true }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3349,7 +3209,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 }, "configstore": { "version": "5.0.1", @@ -3364,11 +3225,6 @@ "xdg-basedir": "^4.0.0" } }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, "conventional-changelog-angular": { "version": "5.0.12", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", @@ -3589,7 +3445,8 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true }, "decamelize-keys": { "version": "1.1.0", @@ -3736,11 +3593,6 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "denque": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", @@ -3752,11 +3604,6 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -4679,18 +4526,11 @@ "universalify": "^2.0.0" } }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -4704,54 +4544,6 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, "gaxios": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.0.tgz", @@ -4902,6 +4694,7 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4988,117 +4781,27 @@ "dev": true, "optional": true }, - "grpc": { - "version": "1.24.11", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.11.tgz", - "integrity": "sha512-8/AQdFCzCeCDWW3SoaMNp6ccbRvTQEH1O1u1uFtt29eWsg5gSZCJ3m6fbkduEIh3smY7WAPP+LgVJ5n3nZRxcA==", + "grpc-js-health-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/grpc-js-health-check/-/grpc-js-health-check-1.0.2.tgz", + "integrity": "sha512-DU1ATD57GnE+KFVbClLETykwCjLUvluc4YLOSzIh3WKo4DAH+aR1pdV8XmIXay2OabovSsVtidlwIgIFYV2yKw==", "requires": { - "@mapbox/node-pre-gyp": "^1.0.4", - "@types/bytebuffer": "^5.0.40", - "lodash.camelcase": "^4.3.0", - "lodash.clone": "^4.5.0", - "nan": "^2.13.2", - "protobufjs": "^5.0.3" + "@grpc/grpc-js": "^1.2.2", + "@grpc/proto-loader": "^0.5.5", + "lodash": "^4.17.20" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "protobufjs": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", - "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", - "requires": { - "ascli": "~1", - "bytebuffer": "~5", - "glob": "^7.0.5", - "yargs": "^3.10.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" - }, - "yargs": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "@grpc/proto-loader": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.6.tgz", + "integrity": "sha512-DT14xgw3PSzPxwS13auTEwxhMMOoz33DPUKNtmYK/QYbBSpLXJy78FGGs5yVoxVobEqPm4iW9MOIoz0A3bLTRQ==", "requires": { - "camelcase": "^2.0.1", - "cliui": "^3.0.3", - "decamelize": "^1.1.1", - "os-locale": "^1.4.0", - "string-width": "^1.0.1", - "window-size": "^0.1.4", - "y18n": "^3.2.0" + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" } } } }, - "grpc-health-check": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/grpc-health-check/-/grpc-health-check-1.8.0.tgz", - "integrity": "sha512-Fqa35Bg4VhliZE3Yfe88mmYm0nRfKVr/QRYw5zP1jtn1R0f7wwJJqlXsjaoexJy+pVTVXZpP6CxmNGuEv/bngw==", - "requires": { - "google-protobuf": "^3.4.0", - "grpc": "^1.6.0", - "lodash.clone": "^4.5.0", - "lodash.get": "^4.4.2" - } - }, "gtoken": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.3.0.tgz", @@ -5164,11 +4867,6 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -5393,6 +5091,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" @@ -5419,11 +5118,6 @@ "p-is-promise": "^3.0.0" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, "ip-range-check": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/ip-range-check/-/ip-range-check-0.0.2.tgz", @@ -7664,14 +7358,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -7755,22 +7441,12 @@ "integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=", "dev": true }, - "lodash.clone": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", - "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" - }, "lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, "lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -8066,6 +7742,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" } @@ -8087,23 +7764,6 @@ "kind-of": "^6.0.3" } }, - "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -8267,11 +7927,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -8403,14 +8058,6 @@ "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-1.0.4.tgz", "integrity": "sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA==" }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -10604,27 +10251,11 @@ "path-key": "^3.0.0" } }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "nuid": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/nuid/-/nuid-1.1.4.tgz", "integrity": "sha512-PXiYyHhGfrq8H4g5HyC8enO1lz6SBe5z6x1yx/JG4tmADzDGJVQy3l1sRf3VtEvPsN8dGn9hRFRwDKWL62x0BA==" }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -10637,11 +10268,6 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -10750,25 +10376,12 @@ "word-wrap": "~1.2.3" } }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, "p-each-series": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", @@ -10890,7 +10503,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": "3.1.1", @@ -11150,9 +10764,9 @@ }, "dependencies": { "@types/node": { - "version": "16.4.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.13.tgz", - "integrity": "sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg==" + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.0.tgz", + "integrity": "sha512-OyiZPohMMjZEYqcVo/UJ04GyAxXOJEZO/FpzyXxcH4r/ArrVoXHf4MbUrkLp0Tz7/p1mMKpo5zJ6ZHl8XBNthQ==" } } }, @@ -11976,7 +11590,8 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true }, "set-cookie-parser": { "version": "2.4.6", @@ -12619,26 +12234,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "tar": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.1.tgz", - "integrity": "sha512-GG0R7yt/CQkvG4fueXDi52Zskqxe2AyRJ+Wm54yqarnBgcX3qRIWh10qLVAAN+mlPFGTfP5UxvD3Fbi11UOTUQ==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - } - } - }, "teeny-request": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-7.1.1.tgz", @@ -13487,48 +13082,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 3df2a2239..3714db4aa 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ }, "homepage": "https://docs.relaycorp.tech/relaynet-internet-gateway/", "dependencies": { - "@relaycorp/cogrpc": "^1.3.19", + "@grpc/grpc-js": "^1.3.7", + "@relaycorp/cogrpc": "^1.3.23", "@relaycorp/keystore-vault": "^1.2.6", "@relaycorp/object-storage": "^1.4.5", "@relaycorp/pino-cloud": "^1.0.4", @@ -82,8 +83,7 @@ "env-var": "^7.0.1", "fastify": "^3.20.2", "fastify-mongoose": "^0.3.0", - "grpc": "^1.24.11", - "grpc-health-check": "^1.8.0", + "grpc-js-health-check": "^1.0.2", "it-pipe": "^1.1.0", "mongoose": "^5.13.7", "node-nats-streaming": "^0.3.2", diff --git a/src/functionalTests/cogrpc_server.test.ts b/src/functionalTests/cogrpc_server.test.ts index 1faa1ab90..49856fde0 100644 --- a/src/functionalTests/cogrpc_server.test.ts +++ b/src/functionalTests/cogrpc_server.test.ts @@ -1,3 +1,4 @@ +import * as grpc from '@grpc/grpc-js'; import { CogRPCClient, CogRPCError } from '@relaycorp/cogrpc'; import { Cargo, @@ -9,7 +10,6 @@ import { } from '@relaycorp/relaynet-core'; import { deliverParcel } from '@relaycorp/relaynet-pohttp'; import bufferToArray from 'buffer-to-arraybuffer'; -import grpc from 'grpc'; import { Message, Stan, Subscription } from 'node-nats-streaming'; import { diff --git a/src/services/cogrpc/_test_utils.ts b/src/services/cogrpc/_test_utils.ts index 9f88dbc52..6ddbb9858 100644 --- a/src/services/cogrpc/_test_utils.ts +++ b/src/services/cogrpc/_test_utils.ts @@ -1,4 +1,4 @@ -import grpc from 'grpc'; +import * as grpc from '@grpc/grpc-js'; import { Duplex } from 'stream'; export class MockGrpcBidiCall extends Duplex { diff --git a/src/services/cogrpc/server.spec.ts b/src/services/cogrpc/server.spec.ts index 2ed0c495b..3e37b47a2 100644 --- a/src/services/cogrpc/server.spec.ts +++ b/src/services/cogrpc/server.spec.ts @@ -1,6 +1,6 @@ +import * as grpc from '@grpc/grpc-js'; import { CargoRelayService } from '@relaycorp/cogrpc'; -import * as grpc from 'grpc'; -import * as grpcHealthCheck from 'grpc-health-check'; +import * as grpcHealthCheck from 'grpc-js-health-check'; import { Logger } from 'pino'; import selfsigned from 'selfsigned'; @@ -17,11 +17,11 @@ const makeServiceImplementationSpy = mockSpy( ); const mockServer = { addService: mockSpy(jest.fn()), - bind: mockSpy(jest.fn(), () => 1), + bindAsync: mockSpy(jest.fn(), (_netloc, _credentials, cb) => cb()), start: mockSpy(jest.fn()), }; -jest.mock('grpc', () => { - const grpcOriginal = jest.requireActual('grpc'); +jest.mock('@grpc/grpc-js', () => { + const grpcOriginal = jest.requireActual('@grpc/grpc-js'); return { ...grpcOriginal, Server: jest.fn().mockImplementation(() => mockServer), @@ -161,9 +161,8 @@ describe('runServer', () => { expect.anything(), expect.objectContaining({ statusMap: { - '': grpcHealthCheck.messages.HealthCheckResponse.ServingStatus.SERVING, - 'relaynet.cogrpc.CargoRelay': - grpcHealthCheck.messages.HealthCheckResponse.ServingStatus.SERVING, + '': grpcHealthCheck.servingStatus.SERVING, + 'relaynet.cogrpc.CargoRelay': grpcHealthCheck.servingStatus.SERVING, }, }), ); @@ -172,16 +171,19 @@ describe('runServer', () => { test('Server should listen on 0.0.0.0:8080', async () => { await runServer(); - expect(mockServer.bind).toBeCalledTimes(1); - expect(mockServer.bind).toBeCalledWith('0.0.0.0:8080', expect.anything()); + expect(mockServer.bindAsync).toBeCalledTimes(1); + expect(mockServer.bindAsync).toBeCalledWith( + '0.0.0.0:8080', + expect.anything(), + expect.anything(), + ); }); test('Failing to listen on specified port should result in error', async () => { - mockServer.bind.mockReturnValueOnce(-1); + const bindError = new Error('Port is apparently taken'); + mockServer.bindAsync.mockImplementation((_netloc, _credentials, cb) => cb(bindError)); - await expect(() => runServer()).rejects.toMatchObject({ - message: 'Failed to listen on 0.0.0.0:8080', - }); + await expect(() => runServer()).rejects.toBe(bindError); }); test('Server should use TLS with a self-issued certificate', async () => { @@ -189,7 +191,7 @@ describe('runServer', () => { await runServer(); - expect(mockServer.bind).toBeCalledTimes(1); + expect(mockServer.bindAsync).toBeCalledTimes(1); expect(spiedCreateSsl).toBeCalledWith(null, [ { cert_chain: Buffer.from(mockSelfSignedOutput.cert), @@ -215,7 +217,7 @@ describe('runServer', () => { expect(mockServer.start).toBeCalledTimes(1); expect(mockServer.start).toBeCalledWith(); - expect(mockServer.start).toHaveBeenCalledAfter(mockServer.bind as jest.Mock); + expect(mockServer.start).toHaveBeenCalledAfter(mockServer.bindAsync as jest.Mock); }); test('A log should be produced when the server is ready', async () => { diff --git a/src/services/cogrpc/server.ts b/src/services/cogrpc/server.ts index d6d020666..2df6e0fcf 100644 --- a/src/services/cogrpc/server.ts +++ b/src/services/cogrpc/server.ts @@ -1,7 +1,7 @@ +import { KeyCertPair, Server, ServerCredentials } from '@grpc/grpc-js'; import { CargoRelayService } from '@relaycorp/cogrpc'; import { get as getEnvVar } from 'env-var'; -import { KeyCertPair, Server, ServerCredentials } from 'grpc'; -import grpcHealthCheck from 'grpc-health-check'; +import * as grpcHealthCheck from 'grpc-js-health-check'; import { Logger } from 'pino'; import * as selfsigned from 'selfsigned'; import { configureExitHandling } from '../../utilities/exitHandling'; @@ -46,23 +46,25 @@ export async function runServer(logger?: Logger): Promise { parcelStoreBucket, publicAddress, }); - server.addService(CargoRelayService, serviceImplementation); + server.addService(CargoRelayService, serviceImplementation as any); // TODO: Health checks should be probing backing services const healthCheckService = new grpcHealthCheck.Implementation({ - '': grpcHealthCheck.messages.HealthCheckResponse.ServingStatus.SERVING, - 'relaynet.cogrpc.CargoRelay': - grpcHealthCheck.messages.HealthCheckResponse.ServingStatus.SERVING, + '': grpcHealthCheck.servingStatus.SERVING, + 'relaynet.cogrpc.CargoRelay': grpcHealthCheck.servingStatus.SERVING, }); - server.addService(grpcHealthCheck.service, healthCheckService); + server.addService(grpcHealthCheck.service, healthCheckService as any); - const bindResult = server.bind( - NETLOC, - ServerCredentials.createSsl(null, [await selfIssueCertificate()]), - ); - if (bindResult < 0) { - throw new Error(`Failed to listen on ${NETLOC}`); - } + const certificate = await selfIssueCertificate(); + await new Promise((resolve, reject) => { + server.bindAsync(NETLOC, ServerCredentials.createSsl(null, [certificate]), (error) => { + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); server.start(); baseLogger.info('Ready to receive requests'); diff --git a/src/services/cogrpc/service.spec.ts b/src/services/cogrpc/service.spec.ts index 772c814c2..241b8fc38 100644 --- a/src/services/cogrpc/service.spec.ts +++ b/src/services/cogrpc/service.spec.ts @@ -1,3 +1,4 @@ +import * as grpc from '@grpc/grpc-js'; import { CargoDelivery, CargoDeliveryAck, CargoRelayServerMethodSet } from '@relaycorp/cogrpc'; import { Cargo, @@ -23,7 +24,6 @@ import { import * as typegoose from '@typegoose/typegoose'; import bufferToArray from 'buffer-to-arraybuffer'; import { EventEmitter } from 'events'; -import * as grpc from 'grpc'; import mongoose from 'mongoose'; import { diff --git a/src/services/cogrpc/service.ts b/src/services/cogrpc/service.ts index 6fb4d9968..269775dc1 100644 --- a/src/services/cogrpc/service.ts +++ b/src/services/cogrpc/service.ts @@ -1,3 +1,4 @@ +import * as grpc from '@grpc/grpc-js'; import { CargoDelivery, CargoDeliveryAck, CargoRelayServerMethodSet } from '@relaycorp/cogrpc'; import { VaultPrivateKeyStore } from '@relaycorp/keystore-vault'; import { @@ -8,11 +9,9 @@ import { Gateway, } from '@relaycorp/relaynet-core'; import bufferToArray from 'buffer-to-arraybuffer'; -import * as grpc from 'grpc'; import pipe from 'it-pipe'; import { Connection } from 'mongoose'; import { Logger } from 'pino'; -import * as streamToIt from 'stream-to-it'; import uuid from 'uuid-random'; import { createMongooseConnectionFromEnv, initMongoDBKeyStore } from '../../backingServices/mongo'; @@ -135,7 +134,7 @@ async function deliverCargo( } try { - await pipe(streamToIt.source(call), validateDelivery, natsPublisher, ackDelivery); + await pipe(call, validateDelivery, natsPublisher, ackDelivery); } catch (err) { logger.error({ err }, 'Failed to store cargo'); call.emit('error', INTERNAL_SERVER_ERROR); // Also ends the call diff --git a/src/types/grpc-health-check.d.ts b/src/types/grpc-health-check.d.ts deleted file mode 100644 index a039570f3..000000000 --- a/src/types/grpc-health-check.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -declare module 'grpc-health-check' { - import { ServiceDefinition } from 'grpc'; - - export const service: ServiceDefinition; - export class Implementation { - constructor(map: { readonly [key: string]: string }); - } - - export const messages: { - readonly HealthCheckResponse: { - readonly ServingStatus: { - readonly NOT_SERVING: any; - readonly SERVING: any; - }; - }; - }; -} diff --git a/src/types/grpc-js-health-check.d.ts b/src/types/grpc-js-health-check.d.ts new file mode 100644 index 000000000..4c891cbd2 --- /dev/null +++ b/src/types/grpc-js-health-check.d.ts @@ -0,0 +1,13 @@ +declare module 'grpc-js-health-check' { + import { ServiceDefinition } from '@grpc/grpc-js'; + + export const service: ServiceDefinition; + export class Implementation { + constructor(map: { readonly [key: string]: string }); + } + + export const servingStatus: { + readonly NOT_SERVING: any; + readonly SERVING: any; + }; +}