From 5e05b2e35cd76c81cb702d501dca75e6584652cf Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 10:08:15 +0100 Subject: [PATCH 01/13] Bump all hapi packages to the newest version --- package.json | 35 ++-- yarn.lock | 579 ++++++++++++++++++++++----------------------------- 2 files changed, 268 insertions(+), 346 deletions(-) diff --git a/package.json b/package.json index 9ee9df67b8aea..53a59fb5b93ff 100644 --- a/package.json +++ b/package.json @@ -73,10 +73,6 @@ "url": "https://github.com/elastic/kibana.git" }, "resolutions": { - "**/@hapi/iron": "^5.1.4", - "**/@types/hapi__boom": "^7.4.1", - "**/@types/hapi__hapi": "^18.2.6", - "**/@types/hapi__mimos": "4.1.0", "**/@types/node": "14.14.7", "**/chokidar": "^3.4.3", "**/cross-fetch/node-fetch": "^2.6.1", @@ -115,17 +111,17 @@ "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "link:packages/elastic-safer-lodash-set", "@elastic/search-ui-app-search-connector": "^1.5.0", - "@hapi/boom": "^7.4.11", - "@hapi/cookie": "^10.1.2", - "@hapi/good-squeeze": "5.2.1", - "@hapi/h2o2": "^8.3.2", - "@hapi/hapi": "^18.4.1", - "@hapi/hoek": "^8.5.1", - "@hapi/inert": "^5.2.2", - "@hapi/podium": "^3.4.3", - "@hapi/statehood": "^6.1.2", - "@hapi/vision": "^5.5.4", - "@hapi/wreck": "^15.0.2", + "@hapi/boom": "^9.1.0", + "@hapi/cookie": "^11.0.2", + "@hapi/good-squeeze": "6.0.0", + "@hapi/h2o2": "^9.0.2", + "@hapi/hapi": "^20.0.3", + "@hapi/hoek": "^9.1.0", + "@hapi/inert": "^6.0.3", + "@hapi/podium": "^4.1.1", + "@hapi/statehood": "^7.0.3", + "@hapi/vision": "^6.0.1", + "@hapi/wreck": "^17.1.0", "@kbn/ace": "link:packages/kbn-ace", "@kbn/analytics": "link:packages/kbn-analytics", "@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader", @@ -448,14 +444,11 @@ "@types/graphql": "^0.13.2", "@types/gulp": "^4.0.6", "@types/gulp-zip": "^4.0.1", - "@types/hapi__boom": "^7.4.1", "@types/hapi__cookie": "^10.1.1", - "@types/hapi__h2o2": "8.3.0", - "@types/hapi__hapi": "^18.2.6", - "@types/hapi__hoek": "^6.2.0", - "@types/hapi__inert": "^5.2.1", + "@types/hapi__h2o2": "^8.3.2", + "@types/hapi__hapi": "^20.0.2", + "@types/hapi__inert": "^5.2.2", "@types/hapi__podium": "^3.4.1", - "@types/hapi__wreck": "^15.0.1", "@types/has-ansi": "^3.0.0", "@types/he": "^1.1.1", "@types/history": "^4.7.3", diff --git a/yarn.lock b/yarn.lock index 2cf4f36f7e593..da5193f1ef992 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1765,18 +1765,13 @@ normalize-path "^2.0.1" through2 "^2.0.3" -"@hapi/accept@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-3.2.4.tgz#687510529493fe1d7d47954c31aff360d9364bd1" - integrity sha512-soThGB+QMgfxlh0Vzhzlf3ZOEOPk5biEwcOXhkF0Eedqx8VnhGiggL9UYHrIsOb1rUg3Be3K8kp0iDL2wbVSOQ== +"@hapi/accept@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.1.tgz#068553e867f0f63225a506ed74e899441af53e10" + integrity sha512-fMr4d7zLzsAXo28PRRQPXR1o2Wmu+6z+VY1UzDp0iFo13Twj8WePakwXBiqn3E1aAlTpSNzCXdnnQXFhst8h8Q== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" - -"@hapi/address@2.x.x", "@hapi/address@^2.1.2": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" - integrity sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ== + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" "@hapi/address@^4.1.0": version "4.1.0" @@ -1785,225 +1780,194 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@hapi/ammo@3.x.x", "@hapi/ammo@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@hapi/ammo/-/ammo-3.1.2.tgz#a9edf5d48d99b75fdcd7ab3dabf9059942a06961" - integrity sha512-ej9OtFmiZv1qr45g1bxEZNGyaR4jRpyMxU6VhbxjaYThymvOwsyIsUKMZnP5Qw2tfYFuwqCJuIBHGpeIbdX9gQ== +"@hapi/ammo@5.x.x", "@hapi/ammo@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@hapi/ammo/-/ammo-5.0.1.tgz#9d34560f5c214eda563d838c01297387efaab490" + integrity sha512-FbCNwcTbnQP4VYYhLNGZmA76xb2aHg9AMPiy18NZyWMG310P5KdFGyA9v2rm5ujrIny77dEEIkMOwl0Xv+fSSA== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/b64@4.x.x": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-4.2.1.tgz#bf8418d7907c5e73463f2e3b5c6fca7e9f2a1357" - integrity sha512-zqHpQuH5CBMw6hADzKfU/IGNrxq1Q+/wTYV+OiZRQN9F3tMyk+9BUMeBvFRMamduuqL8iSp62QAnJ+7ATiYLWA== +"@hapi/b64@5.x.x": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-5.0.0.tgz#b8210cbd72f4774985e78569b77e97498d24277d" + integrity sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/boom@7.x.x", "@hapi/boom@^7.4.11": - version "7.4.11" - resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-7.4.11.tgz#37af8417eb9416aef3367aa60fa04a1a9f1fc262" - integrity sha512-VSU/Cnj1DXouukYxxkes4nNJonCnlogHvIff1v1RVoN4xzkKhMXX+GRmb3NyH1iar10I9WFPDv2JPwfH3GaV0A== +"@hapi/boom@9.x.x", "@hapi/boom@^9.0.0", "@hapi/boom@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.0.tgz#0d9517657a56ff1e0b42d0aca9da1b37706fec56" + integrity sha512-4nZmpp4tXbm162LaZT45P7F7sgiem8dwAh2vHWT6XX24dozNjGMg6BvKCRvtCUcmcXqeMIUqWN8Rc5X8yKuROQ== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/bounce@1.x.x": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@hapi/bounce/-/bounce-1.3.2.tgz#3b096bb02f67de6115e6e4f0debc390be5a86bad" - integrity sha512-3bnb1AlcEByFZnpDIidxQyw1Gds81z/1rSqlx4bIEE+wUN0ATj0D49B5cE1wGocy90Rp/de4tv7GjsKd5RQeew== +"@hapi/bounce@2.x.x": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@hapi/bounce/-/bounce-2.0.0.tgz#e6ef56991c366b1e2738b2cd83b01354d938cf3d" + integrity sha512-JesW92uyzOOyuzJKjoLHM1ThiOvHPOLDHw01YV8yh5nCso7sDwJho1h0Ad2N+E62bZyz46TG3xhAi/78Gsct6A== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "^8.3.1" + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/bourne@1.x.x": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-1.3.2.tgz#0a7095adea067243ce3283e1b56b8a8f453b242a" - integrity sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA== +"@hapi/bourne@2.x.x": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-2.0.0.tgz#5bb2193eb685c0007540ca61d166d4e1edaf918d" + integrity sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg== -"@hapi/call@^5.1.3": - version "5.1.3" - resolved "https://registry.yarnpkg.com/@hapi/call/-/call-5.1.3.tgz#217af45e3bc3d38b03aa5c9edfe1be939eee3741" - integrity sha512-5DfWpMk7qZiYhvBhM5oUiT4GQ/O8a2rFR121/PdwA/eZ2C1EsuD547ZggMKAR5bZ+FtxOf0fdM20zzcXzq2mZA== +"@hapi/call@8.x.x": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@hapi/call/-/call-8.0.1.tgz#9e64cd8ba6128eb5be6e432caaa572b1ed8cd7c0" + integrity sha512-bOff6GTdOnoe5b8oXRV3lwkQSb/LAWylvDMae6RgEWWntd0SHtkYbQukDHKlfaYtVnSAgIavJ0kqszF/AIBb6g== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/catbox-memory@4.x.x": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@hapi/catbox-memory/-/catbox-memory-4.1.1.tgz#263a6f3361f7a200552c5772c98a8e80a1da712f" - integrity sha512-T6Hdy8DExzG0jY7C8yYWZB4XHfc0v+p1EGkwxl2HoaPYAmW7I3E59M/IvmSVpis8RPcIoBp41ZpO2aZPBpM2Ww== +"@hapi/catbox-memory@5.x.x": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@hapi/catbox-memory/-/catbox-memory-5.0.0.tgz#6c18dad1a80737480d1c33bfbefd5d028deec86d" + integrity sha512-ByuxVJPHNaXwLzbBv4GdTr6ccpe1nG+AfYt+8ftDWEJY7EWBWzD+Klhy5oPTDGzU26pNUh1e7fcYI1ILZRxAXQ== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/catbox@10.x.x": - version "10.2.3" - resolved "https://registry.yarnpkg.com/@hapi/catbox/-/catbox-10.2.3.tgz#2df51ab943d7613df3718fa2bfd981dd9558cec5" - integrity sha512-kN9hXO4NYyOHW09CXiuj5qW1syc/0XeVOBsNNk0Tz89wWNQE5h21WF+VsfAw3uFR8swn/Wj3YEVBnWqo82m/JQ== +"@hapi/catbox@^11.1.1": + version "11.1.1" + resolved "https://registry.yarnpkg.com/@hapi/catbox/-/catbox-11.1.1.tgz#d277e2d5023fd69cddb33d05b224ea03065fec0c" + integrity sha512-u/8HvB7dD/6X8hsZIpskSDo4yMKpHxFd7NluoylhGrL6cUfYxdQPnvUp9YU2C6F9hsyBVLGulBd9vBN1ebfXOQ== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" - "@hapi/podium" "3.x.x" + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/podium" "4.x.x" + "@hapi/validate" "1.x.x" -"@hapi/content@^4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@hapi/content/-/content-4.1.1.tgz#179673d1e2b7eb36c564d8f9605d019bd2252cbf" - integrity sha512-3TWvmwpVPxFSF3KBjKZ8yDqIKKZZIm7VurDSweYpXYENZrJH3C1hd1+qEQW9wQaUaI76pPBLGrXl6I3B7i3ipA== +"@hapi/content@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@hapi/content/-/content-5.0.2.tgz#ae57954761de570392763e64cdd75f074176a804" + integrity sha512-mre4dl1ygd4ZyOH3tiYBrOUBzV7Pu/EOs8VLGf58vtOEECWed8Uuw6B4iR9AN/8uQt42tB04qpVaMyoMQh0oMw== dependencies: - "@hapi/boom" "7.x.x" + "@hapi/boom" "9.x.x" -"@hapi/cookie@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@hapi/cookie/-/cookie-10.1.2.tgz#9ea7d80f05d764faaf892b84e80c1bf13f5e3bf5" - integrity sha512-wch/uT5NgDEujmaLIqUoohbEP6PUr4ML2Z6zqheWHeHrSzXangPH4dveW+fiMsoPMW2S9ecAyUjCfkh4qRfxjg== +"@hapi/cookie@^11.0.2": + version "11.0.2" + resolved "https://registry.yarnpkg.com/@hapi/cookie/-/cookie-11.0.2.tgz#7169c060157a3541146b976e5f0ca9b3f7577d7f" + integrity sha512-LRpSuHC53urzml83c5eUHSPPt7YtK1CaaPZU9KmnhZlacVVojrWJzOUIcwOADDvCZjDxowCO3zPMaOqzEm9kgg== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/bounce" "1.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" + "@hapi/boom" "9.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" -"@hapi/cryptiles@4.x.x": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-4.2.1.tgz#ff0f18d79074659838caedbb911851313ad1ffbc" - integrity sha512-XoqgKsHK0l/VpqPs+tr6j6vE+VQ3+2bkF2stvttmc7xAOf1oSAwHcJ0tlp/6MxMysktt1IEY0Csy3khKaP9/uQ== +"@hapi/cryptiles@5.x.x": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-5.1.0.tgz#655de4cbbc052c947f696148c83b187fc2be8f43" + integrity sha512-fo9+d1Ba5/FIoMySfMqPBR/7Pa29J2RsiPrl7bkwo5W5o+AN1dAYQRi4SPrPwwVxVGKjgLOEWrsvt1BonJSfLA== dependencies: - "@hapi/boom" "7.x.x" - -"@hapi/file@1.x.x": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@hapi/file/-/file-1.0.0.tgz#c91c39fd04db8bed5af82d2e032e7a4e65555b38" - integrity sha512-Bsfp/+1Gyf70eGtnIgmScvrH8sSypO3TcK3Zf0QdHnzn/ACnAkI6KLtGACmNRPEzzIy+W7aJX5E+1fc9GwIABQ== + "@hapi/boom" "9.x.x" -"@hapi/formula@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-1.2.0.tgz#994649c7fea1a90b91a0a1e6d983523f680e10cd" - integrity sha512-UFbtbGPjstz0eWHb+ga/GM3Z9EzqKXFWIbSOFURU0A/Gku0Bky4bCk9/h//K2Xr3IrCfjFNhMm4jyZ5dbCewGA== +"@hapi/file@2.x.x": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@hapi/file/-/file-2.0.0.tgz#2ecda37d1ae9d3078a67c13b7da86e8c3237dfb9" + integrity sha512-WSrlgpvEqgPWkI18kkGELEZfXr0bYLtr16iIN4Krh9sRnzBZN6nnWxHFxtsnP684wueEySBbXPDg/WfA9xJdBQ== "@hapi/formula@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-2.0.0.tgz#edade0619ed58c8e4f164f233cda70211e787128" integrity sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A== -"@hapi/good-squeeze@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@hapi/good-squeeze/-/good-squeeze-5.2.1.tgz#a7ed3f344c9602348af8f059beda663610ab8a4c" - integrity sha512-ZBiRgEDMtI5XowD0i4jgYD3wntN2JneY5EA1lUbSk9YoVIV9rWc77+6S0oqwfG0nj4xU/FjrXHvAahNEvRc6tg== +"@hapi/good-squeeze@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@hapi/good-squeeze/-/good-squeeze-6.0.0.tgz#bb72d6869cd7398b615a6b7270f630dc4f76aebf" + integrity sha512-UgHAF9Lm8fJPzgf2HymtowOwNc1+IL+p08YTVR+XA4d8nmyE1t9x3RLA4riqldnOKHkVqGakJ1jGqUG7jk77Cg== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/hoek" "9.x.x" fast-safe-stringify "2.x.x" -"@hapi/h2o2@^8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@hapi/h2o2/-/h2o2-8.3.2.tgz#008a8f9ec3d9bba29077691aa9ec0ace93d4de80" - integrity sha512-2WkZq+QAkvYHWGqnUuG0stcVeGyv9T7bopBYnCJSUEuvBZlUf2BTX2JCVSKxsnTLOxCYwoC/aI4Rr0ZSRd2oVg== - dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" - "@hapi/wreck" "15.x.x" - -"@hapi/hapi@^18.4.1": - version "18.4.1" - resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-18.4.1.tgz#023fbc131074b1cb2cd7f6766d65f4b0e92df788" - integrity sha512-9HjVGa0Z4Qv9jk9AVoUdJMQLA+KuZ+liKWyEEkVBx3e3H1F0JM6aGbPkY9jRfwsITBWGBU2iXazn65SFKSi/tg== - dependencies: - "@hapi/accept" "^3.2.4" - "@hapi/ammo" "^3.1.2" - "@hapi/boom" "7.x.x" - "@hapi/bounce" "1.x.x" - "@hapi/call" "^5.1.3" - "@hapi/catbox" "10.x.x" - "@hapi/catbox-memory" "4.x.x" - "@hapi/heavy" "6.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "15.x.x" - "@hapi/mimos" "4.x.x" - "@hapi/podium" "3.x.x" - "@hapi/shot" "4.x.x" - "@hapi/somever" "2.x.x" - "@hapi/statehood" "6.x.x" - "@hapi/subtext" "^6.1.3" - "@hapi/teamwork" "3.x.x" - "@hapi/topo" "3.x.x" - -"@hapi/heavy@6.x.x": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@hapi/heavy/-/heavy-6.2.2.tgz#d42a282c62d5bb6332e497d8ce9ba52f1609f3e6" - integrity sha512-PY1dCCO6dsze7RlafIRhTaGeyTgVe49A/lSkxbhKGjQ7x46o/OFf7hLiRqTCDh3atcEKf6362EaB3+kTUbCsVA== +"@hapi/h2o2@^9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@hapi/h2o2/-/h2o2-9.0.2.tgz#e9f1dfe789257c80d6ee37ec9fe358f8c69f855a" + integrity sha512-V7RsmVyl7uyWeuEko4uaSZbFpBHKcSFSui6PXNRaRLJHFX+iPbqWmeH6m1pW/WJ8DuaCVJFKhluDCDI9l4+1cw== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" - -"@hapi/hoek@8.x.x", "@hapi/hoek@^8.2.4", "@hapi/hoek@^8.3.0", "@hapi/hoek@^8.3.1", "@hapi/hoek@^8.5.1": - version "8.5.1" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" - integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" + "@hapi/wreck" "17.x.x" + +"@hapi/hapi@^20.0.3": + version "20.0.3" + resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-20.0.3.tgz#e72cad460394e6d2c15f9c57abb5d3332dea27e3" + integrity sha512-aqJVHVjoY3phiZsgsGjDRG15CoUNIs1azScqLZDOCZUSKYGTbzPi+K0QP+RUjUJ0m8L9dRuTZ27c8HKxG3wEhA== + dependencies: + "@hapi/accept" "^5.0.1" + "@hapi/ammo" "^5.0.1" + "@hapi/boom" "9.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/call" "8.x.x" + "@hapi/catbox" "^11.1.1" + "@hapi/catbox-memory" "5.x.x" + "@hapi/heavy" "^7.0.1" + "@hapi/hoek" "9.x.x" + "@hapi/mimos" "5.x.x" + "@hapi/podium" "^4.1.1" + "@hapi/shot" "^5.0.1" + "@hapi/somever" "3.x.x" + "@hapi/statehood" "^7.0.3" + "@hapi/subtext" "^7.0.3" + "@hapi/teamwork" "5.x.x" + "@hapi/topo" "5.x.x" + "@hapi/validate" "^1.1.0" + +"@hapi/heavy@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@hapi/heavy/-/heavy-7.0.1.tgz#73315ae33b6e7682a0906b7a11e8ca70e3045874" + integrity sha512-vJ/vzRQ13MtRzz6Qd4zRHWS3FaUc/5uivV2TIuExGTM9Qk+7Zzqj0e2G7EpE6KztO9SalTbiIkTh7qFKj/33cA== + dependencies: + "@hapi/boom" "9.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" -"@hapi/hoek@9.x.x", "@hapi/hoek@^9.0.0": +"@hapi/hoek@9.x.x", "@hapi/hoek@^9.0.0", "@hapi/hoek@^9.0.4", "@hapi/hoek@^9.1.0": version "9.1.0" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.1.0.tgz#6c9eafc78c1529248f8f4d92b0799a712b6052c6" integrity sha512-i9YbZPN3QgfighY/1X1Pu118VUz2Fmmhd6b2n0/O8YVgGGfw0FbUYoA97k7FkpGJ+pLCFEDLUmAPPV4D1kpeFw== -"@hapi/inert@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@hapi/inert/-/inert-5.2.2.tgz#3ba4d93afc6d5b42e4bab19cd09556ddd49b5dac" - integrity sha512-8IaGfAEF8SwZtpdaTq0G3aDPG35ZTfWKjnMNniG2N3kE+qioMsBuImIGxna8TNQ+sYMXYK78aqmvzbQHno8qSQ== +"@hapi/inert@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@hapi/inert/-/inert-6.0.3.tgz#57af5d912893fabcb57eb4b956f84f6cd8020fe1" + integrity sha512-Z6Pi0Wsn2pJex5CmBaq+Dky9q40LGzXLUIUFrYpDtReuMkmfy9UuUeYc4064jQ1Xe9uuw7kbwE6Fq6rqKAdjAg== dependencies: - "@hapi/ammo" "3.x.x" - "@hapi/boom" "7.x.x" - "@hapi/bounce" "1.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" - lru-cache "4.1.x" + "@hapi/ammo" "5.x.x" + "@hapi/boom" "9.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" + lru-cache "^6.0.0" -"@hapi/iron@*", "@hapi/iron@5.x.x", "@hapi/iron@^5.1.4": - version "5.1.4" - resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-5.1.4.tgz#7406f36847f798f52b92d1d97f855e27973832b7" - integrity sha512-+ElC+OCiwWLjlJBmm8ZEWjlfzTMQTdgPnU/TsoU5QsktspIWmWi9IU4kU83nH+X/SSya8TP8h8P11Wr5L7dkQQ== - dependencies: - "@hapi/b64" "4.x.x" - "@hapi/boom" "7.x.x" - "@hapi/bourne" "1.x.x" - "@hapi/cryptiles" "4.x.x" - "@hapi/hoek" "8.x.x" - -"@hapi/joi@15.x.x": - version "15.1.1" - resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" - integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ== - dependencies: - "@hapi/address" "2.x.x" - "@hapi/bourne" "1.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/topo" "3.x.x" - -"@hapi/joi@16.x.x": - version "16.1.8" - resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-16.1.8.tgz#84c1f126269489871ad4e2decc786e0adef06839" - integrity sha512-wAsVvTPe+FwSrsAurNt5vkg3zo+TblvC5Bb1zMVK6SJzZqw9UrJnexxR+76cpePmtUZKHAPxcQ2Bf7oVHyahhg== - dependencies: - "@hapi/address" "^2.1.2" - "@hapi/formula" "^1.2.0" - "@hapi/hoek" "^8.2.4" - "@hapi/pinpoint" "^1.0.2" - "@hapi/topo" "^3.1.3" - -"@hapi/mimos@4.x.x": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@hapi/mimos/-/mimos-4.1.1.tgz#4dab8ed5c64df0603c204c725963a5faa4687e8a" - integrity sha512-CXoi/zfcTWfKYX756eEea8rXJRIb9sR4d7VwyAH9d3BkDyNgAesZxvqIdm55npQc6S9mU3FExinMAQVlIkz0eA== +"@hapi/iron@6.x.x", "@hapi/iron@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-6.0.0.tgz#ca3f9136cda655bdd6028de0045da0de3d14436f" + integrity sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/b64" "5.x.x" + "@hapi/boom" "9.x.x" + "@hapi/bourne" "2.x.x" + "@hapi/cryptiles" "5.x.x" + "@hapi/hoek" "9.x.x" + +"@hapi/mimos@5.x.x": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@hapi/mimos/-/mimos-5.0.0.tgz#245c6c98b1cc2c13395755c730321b913de074eb" + integrity sha512-EVS6wJYeE73InTlPWt+2e3Izn319iIvffDreci3qDNT+t3lA5ylJ0/SoTaID8e0TPNUkHUSsgJZXEmLHvoYzrA== + dependencies: + "@hapi/hoek" "9.x.x" mime-db "1.x.x" -"@hapi/nigel@3.x.x": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@hapi/nigel/-/nigel-3.1.1.tgz#84794021c9ee6e48e854fea9fb76e9f7e78c99ad" - integrity sha512-R9YWx4S8yu0gcCBrMUDCiEFm1SQT895dMlYoeNBp8I6YhF1BFF1iYPueKA2Kkp9BvyHdjmvrxCOns7GMmpl+Fw== +"@hapi/nigel@4.x.x": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@hapi/nigel/-/nigel-4.0.2.tgz#8f84ef4bca4fb03b2376463578f253b0b8e863c4" + integrity sha512-ht2KoEsDW22BxQOEkLEJaqfpoKPXxi7tvabXy7B/77eFtOyG5ZEstfZwxHQcqAiZhp58Ae5vkhEqI03kawkYNw== dependencies: - "@hapi/hoek" "8.x.x" - "@hapi/vise" "3.x.x" + "@hapi/hoek" "^9.0.4" + "@hapi/vise" "^4.0.0" "@hapi/oppsy@3.x.x": version "3.0.0" @@ -2012,97 +1976,86 @@ dependencies: "@hapi/hoek" "9.x.x" -"@hapi/pez@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-4.1.2.tgz#14984d0c31fed348f10c962968a21d9761f55503" - integrity sha512-8zSdJ8cZrJLFldTgwjU9Fb1JebID+aBCrCsycgqKYe0OZtM2r3Yv3aAwW5z97VsZWCROC1Vx6Mdn4rujh5Ktcg== +"@hapi/pez@^5.0.1": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-5.0.3.tgz#b75446e6fef8cbb16816573ab7da1b0522e7a2a1" + integrity sha512-mpikYRJjtrbJgdDHG/H9ySqYqwJ+QU/D7FXsYciS9P7NYBXE2ayKDAy3H0ou6CohOCaxPuTV4SZ0D936+VomHA== dependencies: - "@hapi/b64" "4.x.x" - "@hapi/boom" "7.x.x" - "@hapi/content" "^4.1.1" - "@hapi/hoek" "8.x.x" - "@hapi/nigel" "3.x.x" - -"@hapi/pinpoint@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-1.0.2.tgz#025b7a36dbbf4d35bf1acd071c26b20ef41e0d13" - integrity sha512-dtXC/WkZBfC5vxscazuiJ6iq4j9oNx1SHknmIr8hofarpKUZKmlUVYVIhNVzIEgK5Wrc4GMHL5lZtt1uS2flmQ== + "@hapi/b64" "5.x.x" + "@hapi/boom" "9.x.x" + "@hapi/content" "^5.0.2" + "@hapi/hoek" "9.x.x" + "@hapi/nigel" "4.x.x" "@hapi/pinpoint@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-2.0.0.tgz#805b40d4dbec04fc116a73089494e00f073de8df" integrity sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw== -"@hapi/podium@3.x.x", "@hapi/podium@^3.4.3": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-3.4.3.tgz#d28935870ae1372e2f983a7161e710c968a60de1" - integrity sha512-QJlnYLEYZWlKQ9fSOtuUcpANyoVGwT68GA9P0iQQCAetBK0fI+nbRBt58+aMixoifczWZUthuGkNjqKxgPh/CQ== +"@hapi/podium@4.x.x", "@hapi/podium@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-4.1.1.tgz#106e5849f2cb19b8767cc16007e0107f27c3c791" + integrity sha512-jh7a6+5Z4FUWzx8fgmxjaAa1DTBu+Qfg+NbVdo0f++rE5DgsVidUYrLDp3db65+QjDLleA2MfKQXkpT8ylBDXA== dependencies: - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/teamwork" "5.x.x" + "@hapi/validate" "1.x.x" -"@hapi/shot@4.x.x": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-4.1.2.tgz#69f999956041fe468701a89a413175a521dabed5" - integrity sha512-6LeHLjvsq/bQ0R+fhEyr7mqExRGguNTrxFZf5DyKe3CK6pNabiGgYO4JVFaRrLZ3JyuhkS0fo8iiRE2Ql2oA/A== +"@hapi/shot@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-5.0.4.tgz#6c978314f21a054c041f4becc50095dd78d3d775" + integrity sha512-PcEz0WJgFDA3xNSMeONgQmothFr7jhbbRRSAKaDh7chN7zOXBlhl13bvKZW6CMb2xVfJUmt34CW3e/oExMgBhQ== dependencies: - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" -"@hapi/somever@2.x.x": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@hapi/somever/-/somever-2.1.1.tgz#142bddf7cc4d829f678ed4e60618630a9a7ae845" - integrity sha512-cic5Sto4KGd9B0oQSdKTokju+rYhCbdpzbMb0EBnrH5Oc1z048hY8PaZ1lx2vBD7I/XIfTQVQetBH57fU51XRA== +"@hapi/somever@3.x.x": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@hapi/somever/-/somever-3.0.0.tgz#f4e9b16a948415b926b4dd898013602b0cb45758" + integrity sha512-Upw/kmKotC9iEmK4y047HMYe4LDKsE5NWfjgX41XNKmFvxsQL7OiaCWVhuyyhU0ShDGBfIAnCH8jZr49z/JzZA== dependencies: - "@hapi/bounce" "1.x.x" - "@hapi/hoek" "8.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/statehood@6.x.x", "@hapi/statehood@^6.1.2": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-6.1.2.tgz#6dda508b5da99a28a3ed295c3cac795cf6c12a02" - integrity sha512-pYXw1x6npz/UfmtcpUhuMvdK5kuOGTKcJNfLqdNptzietK2UZH5RzNJSlv5bDHeSmordFM3kGItcuQWX2lj2nQ== - dependencies: - "@hapi/boom" "7.x.x" - "@hapi/bounce" "1.x.x" - "@hapi/bourne" "1.x.x" - "@hapi/cryptiles" "4.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/iron" "5.x.x" - "@hapi/joi" "16.x.x" - -"@hapi/subtext@^6.1.3": - version "6.1.3" - resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-6.1.3.tgz#bbd07771ae2a4e73ac360c93ed74ac641718b9c6" - integrity sha512-qWN6NbiHNzohVcJMeAlpku/vzbyH4zIpnnMPMPioQMwIxbPFKeNViDCNI6fVBbMPBiw/xB4FjqiJkRG5P9eWWg== - dependencies: - "@hapi/boom" "7.x.x" - "@hapi/bourne" "1.x.x" - "@hapi/content" "^4.1.1" - "@hapi/file" "1.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/pez" "^4.1.2" - "@hapi/wreck" "15.x.x" - -"@hapi/teamwork@3.x.x": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-3.3.1.tgz#b52d0ec48682dc793926bd432e22ceb19c915d3f" - integrity sha512-61tiqWCYvMKP7fCTXy0M4VE6uNIwA0qvgFoiDubgfj7uqJ0fdHJFQNnVPGrxhLWlwz0uBPWrQlBH7r8y9vFITQ== +"@hapi/statehood@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-7.0.3.tgz#655166f3768344ed3c3b50375a303cdeca8040d9" + integrity sha512-pYB+pyCHkf2Amh67QAXz7e/DN9jcMplIL7Z6N8h0K+ZTy0b404JKPEYkbWHSnDtxLjJB/OtgElxocr2fMH4G7w== + dependencies: + "@hapi/boom" "9.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/bourne" "2.x.x" + "@hapi/cryptiles" "5.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/iron" "6.x.x" + "@hapi/validate" "1.x.x" -"@hapi/topo@3.x.x", "@hapi/topo@^3.1.3": - version "3.1.6" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.6.tgz#68d935fa3eae7fdd5ab0d7f953f3205d8b2bfc29" - integrity sha512-tAag0jEcjwH+P2quUfipd7liWCNX2F8NvYjQp2wtInsZxnMlypdw0FtAOLxtvvkO+GSRRbmNi8m/5y42PQJYCQ== +"@hapi/subtext@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-7.0.3.tgz#f7440fc7c966858e1f39681e99eb6171c71e7abd" + integrity sha512-CekDizZkDGERJ01C0+TzHlKtqdXZxzSWTOaH6THBrbOHnsr3GY+yiMZC+AfNCypfE17RaIakGIAbpL2Tk1z2+A== dependencies: - "@hapi/hoek" "^8.3.0" + "@hapi/boom" "9.x.x" + "@hapi/bourne" "2.x.x" + "@hapi/content" "^5.0.2" + "@hapi/file" "2.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/pez" "^5.0.1" + "@hapi/wreck" "17.x.x" -"@hapi/topo@^5.0.0": +"@hapi/teamwork@5.x.x": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-5.1.0.tgz#7801a61fc727f702fd2196ef7625eb4e389f4124" + integrity sha512-llqoQTrAJDTXxG3c4Kz/uzhBS1TsmSBa/XG5SPcVXgmffHE1nFtyLIK0hNJHCB3EuBKT84adzd1hZNY9GJLWtg== + +"@hapi/topo@5.x.x", "@hapi/topo@^5.0.0": version "5.0.0" resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.0.0.tgz#c19af8577fa393a06e9c77b60995af959be721e7" integrity sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw== dependencies: "@hapi/hoek" "^9.0.0" -"@hapi/validate@1.x.x": +"@hapi/validate@1.x.x", "@hapi/validate@^1.1.0": version "1.1.3" resolved "https://registry.yarnpkg.com/@hapi/validate/-/validate-1.1.3.tgz#f750a07283929e09b51aa16be34affb44e1931ad" integrity sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA== @@ -2110,31 +2063,31 @@ "@hapi/hoek" "^9.0.0" "@hapi/topo" "^5.0.0" -"@hapi/vise@3.x.x": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-3.1.1.tgz#dfc88f2ac90682f48bdc1b3f9b8f1eab4eabe0c8" - integrity sha512-OXarbiCSadvtg+bSdVPqu31Z1JoBL+FwNYz3cYoBKQ5xq1/Cr4A3IkGpAZbAuxU5y4NL5pZFZG3d2a3ZGm/dOQ== +"@hapi/vise@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-4.0.0.tgz#c6a94fe121b94a53bf99e7489f7fcc74c104db02" + integrity sha512-eYyLkuUiFZTer59h+SGy7hUm+qE9p+UemePTHLlIWppEd+wExn3Df5jO04bFQTm7nleF5V8CtuYQYb+VFpZ6Sg== dependencies: - "@hapi/hoek" "8.x.x" + "@hapi/hoek" "9.x.x" -"@hapi/vision@^5.5.4": - version "5.5.4" - resolved "https://registry.yarnpkg.com/@hapi/vision/-/vision-5.5.4.tgz#03a01374fb5e0a498d6e502e635a0b54d70501a1" - integrity sha512-/DFgnQtcrlf2eQNkh/DHnjrCRHLSmHraU+PHe1SlxLUJxATQCw8VIEt6rJraM2jGTpFgHNk6B6ELtu3sBJCClg== +"@hapi/vision@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@hapi/vision/-/vision-6.0.1.tgz#976c3575be56d3cb5b472ddcfe0b7403778706fd" + integrity sha512-xv4PwmhbXCLzDfojZ7l4+P/YynBhMInV8GtLPH4gB74prhwOl8lGcJxxK8V9rf1aMH/vonM5yVGd9FuoA9sT0A== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/bounce" "1.x.x" - "@hapi/hoek" "8.x.x" - "@hapi/joi" "16.x.x" + "@hapi/boom" "9.x.x" + "@hapi/bounce" "2.x.x" + "@hapi/hoek" "9.x.x" + "@hapi/validate" "1.x.x" -"@hapi/wreck@15.x.x", "@hapi/wreck@^15.0.2": - version "15.1.0" - resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-15.1.0.tgz#7917cd25950ce9b023f7fd2bea6e2ef72c71e59d" - integrity sha512-tQczYRTTeYBmvhsek/D49En/5khcShaBEmzrAaDjMrFXKJRuF8xA8+tlq1ETLBFwGd6Do6g2OC74rt11kzawzg== +"@hapi/wreck@17.x.x", "@hapi/wreck@^17.0.0", "@hapi/wreck@^17.1.0": + version "17.1.0" + resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-17.1.0.tgz#fbdc380c6f3fa1f8052dc612b2d3b6ce3e88dbec" + integrity sha512-nx6sFyfqOpJ+EFrHX+XWwJAxs3ju4iHdbB/bwR8yTNZOiYmuhA8eCe7lYPtYmb4j7vyK/SlbaQsmTtUrMvPEBw== dependencies: - "@hapi/boom" "7.x.x" - "@hapi/bourne" "1.x.x" - "@hapi/hoek" "8.x.x" + "@hapi/boom" "9.x.x" + "@hapi/bourne" "2.x.x" + "@hapi/hoek" "9.x.x" "@icons/material@^0.2.4": version "0.2.4" @@ -4807,11 +4760,6 @@ "@types/vinyl-fs" "*" chokidar "^2.1.2" -"@types/hapi__boom@*", "@types/hapi__boom@^7.4.1": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.1.tgz#06439d7637245dcbe6dd6548d2a91f2c1243d80b" - integrity sha512-x/ZK824GomII7Yoei/nMoB46NQcSfGe0iVpZK3uUivxIAfUUSzRvu8RQO7ZkKapIgzgshHZc+GR+z/BQ8l2VLg== - "@types/hapi__catbox@*": version "10.2.3" resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.3.tgz#c9279c16d709bf2987491c332e11d18124ae018f" @@ -4824,54 +4772,38 @@ dependencies: "@types/hapi__hapi" "*" -"@types/hapi__h2o2@8.3.0": - version "8.3.0" - resolved "https://registry.yarnpkg.com/@types/hapi__h2o2/-/hapi__h2o2-8.3.0.tgz#c2e6598ab6ed28edb1a5edd44ddc185e1c252dd8" - integrity sha512-jD6L+8BJ+SVbwBzQK3W7zGnDYgrwuCNDl9r1P0GdwoYsysNADl7STfrhJ/m9qPt2fD1vFVJsfsFjoJ/iCyNlOQ== +"@types/hapi__h2o2@^8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@types/hapi__h2o2/-/hapi__h2o2-8.3.2.tgz#43cce95972c3097a2ca3efe6b7054a0c95fbf291" + integrity sha512-l36uuLHTwUQNbNUIkT14Z4WbJl1CIWpBZu7ZCBemGBypiNnbJxN3o0YyQ6QAid3YYa2C7LVDIdyY4MhpX8q9ZA== dependencies: - "@types/hapi__boom" "*" + "@hapi/boom" "^9.0.0" + "@hapi/wreck" "^17.0.0" "@types/hapi__hapi" "*" "@types/node" "*" -"@types/hapi__hapi@*", "@types/hapi__hapi@^18.2.6": - version "18.2.6" - resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-18.2.6.tgz#61c1b210c55dee4636df594e7a0868ad48c8042a" - integrity sha512-sXFlSg9btu/LdHqK/N/kuQXVqZhSvibXbtZc0KfEcelRXKthdU5ZSu5qItDIov7SYnyK2faMe7dbZaC/VpC33w== +"@types/hapi__hapi@*", "@types/hapi__hapi@^20.0.2": + version "20.0.2" + resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-20.0.2.tgz#e7571451f7fb75e87ab3873ec91b92f92cd55fff" + integrity sha512-7FwFoaxSCtHXbHbDdArSeVABFOfMLgVkOvOUtWrqUBzw639B2rq9OHv3kOVDHY0bOao0f6ubMzUxio8WQ9QZfQ== dependencies: - "@types/hapi__boom" "*" + "@hapi/boom" "^9.0.0" + "@hapi/iron" "^6.0.0" "@types/hapi__catbox" "*" - "@types/hapi__iron" "*" - "@types/hapi__joi" "*" "@types/hapi__mimos" "*" "@types/hapi__podium" "*" "@types/hapi__shot" "*" + "@types/joi" "*" "@types/node" "*" -"@types/hapi__hoek@^6.2.0": - version "6.2.0" - resolved "https://registry.yarnpkg.com/@types/hapi__hoek/-/hapi__hoek-6.2.0.tgz#61ec4dfb93e6aaccf2b407d6074a0633069e5d2d" - integrity sha512-MMS8ZD0SR2lklVkpNJw7iUYBmlvBLw1T04VSBhbWpiOi0ee6RoJUCcocVao1FLnSYR8Tt03dykRBv+FkvPIJSg== - -"@types/hapi__inert@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@types/hapi__inert/-/hapi__inert-5.2.1.tgz#cce395e7470a969f63cf57d561da230218b8b2bb" - integrity sha512-pFvXfN9bTGgR6jkgKseXmu5/eHVGVEsGh0LKHCkcezEqZZMJV9YabREVLa6kcYEQMIDQzQSwSakSnemCFiSnOg== +"@types/hapi__inert@^5.2.2": + version "5.2.2" + resolved "https://registry.yarnpkg.com/@types/hapi__inert/-/hapi__inert-5.2.2.tgz#6513c487d216ed9377c2c0efceb178fda0928bfa" + integrity sha512-Vp9HS2wi3Qbm1oUlcTvzA2Zd+f3Dwg+tgLqWA6KTCgKbQX4LCPKIvVssbaQAVncmcpH0aPrtkAfftJlS/sMsGg== dependencies: "@types/hapi__hapi" "*" -"@types/hapi__iron@*": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/hapi__iron/-/hapi__iron-6.0.1.tgz#ec8b23eff3d69313f1187c234deb80652384ad6b" - integrity sha512-NTr+1FKl+nvEeSwVpfcks36dCm6+tbcQh3tJYbyQ5XWb5sIbCIptW6p38zmCYE5ppOoU/2PK1Y8taGpl6cOl5w== - dependencies: - "@hapi/iron" "*" - -"@types/hapi__joi@*": - version "17.1.6" - resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-17.1.6.tgz#b84663676aa9753c17183718338dd40ddcbd3754" - integrity sha512-y3A1MzNC0FmzD5+ys59RziE1WqKrL13nxtJgrSzjoO7boue5B7zZD2nZLPwrSuUviFjpKFQtgHYSvhDGfIE4jA== - -"@types/hapi__mimos@*", "@types/hapi__mimos@4.1.0": +"@types/hapi__mimos@*": version "4.1.0" resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.0.tgz#47dbf89ebfc05183c1de2797e9426793db9a0d85" integrity sha512-hcdSoYa32wcP+sEfyf85ieGwElwokcZ/mma8eyqQ4OTHeCAGwfaoiGxjG4z1Dm+RGhIYLHlW54ji5FFwahH12A== @@ -4890,14 +4822,6 @@ dependencies: "@types/node" "*" -"@types/hapi__wreck@^15.0.1": - version "15.0.1" - resolved "https://registry.yarnpkg.com/@types/hapi__wreck/-/hapi__wreck-15.0.1.tgz#41df4e122c49316f0057cb5e9c6eb4c00e671e95" - integrity sha512-OXhOaFWPFkWkqU5IlFwgTK/Q3yzc3iDhC1/S+3rQ6d2qkl6xvcRZaayJGjDXORf3krnGtDN1l3bIajNcuUl6QA== - dependencies: - "@types/hapi__boom" "*" - "@types/node" "*" - "@types/has-ansi@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/has-ansi/-/has-ansi-3.0.0.tgz#636403dc4e0b2649421c4158e5c404416f3f0330" @@ -5037,6 +4961,11 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" +"@types/joi@*": + version "14.3.4" + resolved "https://registry.yarnpkg.com/@types/joi/-/joi-14.3.4.tgz#eed1e14cbb07716079c814138831a520a725a1e0" + integrity sha512-1TQNDJvIKlgYXGNIABfgFp9y0FziDpuGrd799Q5RcnsDu+krD+eeW/0Fs5PHARvWWFelOhIG2OPCo6KbadBM4A== + "@types/joi@^13.4.2": version "13.6.1" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.6.1.tgz#325486a397504f8e22c8c551dc8b0e1d41d5d5ae" @@ -19174,7 +19103,7 @@ lowlight@^1.14.0, lowlight@^1.2.0: fault "^1.0.0" highlight.js "~10.4.0" -lru-cache@4.1.x, lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.5: +lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.5: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== From 3d4dae4bbcef254689017d239a0c991004a01247 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 10:22:47 +0100 Subject: [PATCH 02/13] [@hapi/boom] Implement breaking changes --- src/core/server/elasticsearch/legacy/errors.ts | 2 +- src/core/server/http/lifecycle/on_pre_response.ts | 4 ++-- src/core/server/http/router/response_adapter.ts | 4 ++-- src/core/server/http/router/router.ts | 5 ++++- src/core/server/saved_objects/service/lib/errors.ts | 2 +- x-pack/plugins/apm/server/routes/create_api/index.ts | 2 +- x-pack/plugins/fleet/server/errors/handlers.test.ts | 4 ++-- x-pack/plugins/fleet/server/errors/handlers.ts | 2 +- .../services/epm/elasticsearch/template/install.ts | 4 ++-- .../fleet/server/services/epm/packages/install.ts | 2 +- x-pack/plugins/lens/server/routes/existing_fields.ts | 2 +- x-pack/plugins/ml/common/types/data_frame_analytics.ts | 2 +- x-pack/plugins/ml/common/util/errors/errors.test.ts | 2 +- x-pack/plugins/ml/common/util/errors/types.ts | 9 +++++++-- x-pack/plugins/reporting/server/routes/generation.ts | 4 ++-- .../server/lib/detection_engine/routes/utils.test.ts | 6 +++--- .../copy_to_spaces/lib/create_empty_failure_response.ts | 4 ++-- .../plugins/transform/server/routes/api/error_utils.ts | 2 +- 18 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/core/server/elasticsearch/legacy/errors.ts b/src/core/server/elasticsearch/legacy/errors.ts index e557e7395fe56..763f06fdb5449 100644 --- a/src/core/server/elasticsearch/legacy/errors.ts +++ b/src/core/server/elasticsearch/legacy/errors.ts @@ -30,7 +30,7 @@ enum ErrorCode { * @deprecated. The new elasticsearch client doesn't wrap errors anymore. * @public * */ -export interface LegacyElasticsearchError extends Boom { +export interface LegacyElasticsearchError extends Boom.Boom { [code]?: string; } diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts index 42179374ec672..3c0fa916a3f6f 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/src/core/server/http/lifecycle/on_pre_response.ts @@ -178,8 +178,8 @@ export function adoptToHapiOnPreResponseFormat(fn: OnPreResponseHandler, log: Lo }; } -function isBoom(response: any): response is Boom { - return response instanceof Boom; +function isBoom(response: any): response is Boom.Boom { + return response instanceof Boom.Boom; } function setHeaders(response: ResponseObject, headers: ResponseHeaders) { diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 63acd2207ac3a..904bb6672a71a 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -56,7 +56,7 @@ export class HapiResponseAdapter { } public toInternalError() { - const error = new Boom('', { + const error = new Boom.Boom('', { statusCode: 500, }); @@ -129,7 +129,7 @@ export class HapiResponseAdapter { } // we use for BWC with Boom payload for error responses - {error: string, message: string, statusCode: string} - const error = new Boom('', { + const error = new Boom.Boom('', { statusCode: kibanaResponse.status, }); diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index b1e092ba5786a..ebc41a793f3b3 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -44,7 +44,10 @@ interface RouterRoute { method: RouteMethod; path: string; options: RouteConfigOptions; - handler: (req: Request, responseToolkit: ResponseToolkit) => Promise>; + handler: ( + req: Request, + responseToolkit: ResponseToolkit + ) => Promise>; } /** diff --git a/src/core/server/saved_objects/service/lib/errors.ts b/src/core/server/saved_objects/service/lib/errors.ts index e8836dbd8f7a1..c6c8eee003e4e 100644 --- a/src/core/server/saved_objects/service/lib/errors.ts +++ b/src/core/server/saved_objects/service/lib/errors.ts @@ -44,7 +44,7 @@ const CODE_GENERAL_ERROR = 'SavedObjectsClient/generalError'; const code = Symbol('SavedObjectsClientErrorCode'); -export interface DecoratedError extends Boom { +export interface DecoratedError extends Boom.Boom { [code]?: string; } diff --git a/x-pack/plugins/apm/server/routes/create_api/index.ts b/x-pack/plugins/apm/server/routes/create_api/index.ts index ef445617e9295..94711cf76c145 100644 --- a/x-pack/plugins/apm/server/routes/create_api/index.ts +++ b/x-pack/plugins/apm/server/routes/create_api/index.ts @@ -140,7 +140,7 @@ export function createApi() { } function convertBoomToKibanaResponse( - error: Boom, + error: Boom.Boom, response: KibanaResponseFactory ) { const opts = { body: error.message }; diff --git a/x-pack/plugins/fleet/server/errors/handlers.test.ts b/x-pack/plugins/fleet/server/errors/handlers.test.ts index 4f8eff6c6c75a..98139e9802fec 100644 --- a/x-pack/plugins/fleet/server/errors/handlers.test.ts +++ b/x-pack/plugins/fleet/server/errors/handlers.test.ts @@ -162,7 +162,7 @@ describe('defaultIngestErrorHandler', () => { describe('Boom', () => { it('500: constructor - one arg', async () => { - const error = new Boom('bam'); + const error = new Boom.Boom('bam'); const response = httpServerMock.createResponseFactory(); await defaultIngestErrorHandler({ error, response }); @@ -181,7 +181,7 @@ describe('defaultIngestErrorHandler', () => { }); it('custom: constructor - 2 args', async () => { - const error = new Boom('Problem doing something', { + const error = new Boom.Boom('Problem doing something', { statusCode: 456, }); const response = httpServerMock.createResponseFactory(); diff --git a/x-pack/plugins/fleet/server/errors/handlers.ts b/x-pack/plugins/fleet/server/errors/handlers.ts index fecfcf145ca99..e0b05d972bd38 100644 --- a/x-pack/plugins/fleet/server/errors/handlers.ts +++ b/x-pack/plugins/fleet/server/errors/handlers.ts @@ -27,7 +27,7 @@ type IngestErrorHandler = ( params: IngestErrorHandlerParams ) => IKibanaResponse | Promise; interface IngestErrorHandlerParams { - error: IngestManagerError | Boom | Error; + error: IngestManagerError | Boom.Boom | Error; response: KibanaResponseFactory; request?: KibanaRequest; context?: RequestHandlerContext; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts index 8b018f4a2a906..ceedc87275393 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts @@ -109,7 +109,7 @@ const installPreBuiltTemplates = async (paths: string[], callCluster: CallESAsCu try { return await Promise.all(templateInstallPromises); } catch (e) { - throw new Boom(`Error installing prebuilt index templates ${e.message}`, { + throw new Boom.Boom(`Error installing prebuilt index templates ${e.message}`, { statusCode: 400, }); } @@ -144,7 +144,7 @@ const installPreBuiltComponentTemplates = async ( try { return await Promise.all(templateInstallPromises); } catch (e) { - throw new Boom(`Error installing prebuilt component templates ${e.message}`, { + throw new Boom.Boom(`Error installing prebuilt component templates ${e.message}`, { statusCode: 400, }); } diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install.ts b/x-pack/plugins/fleet/server/services/epm/packages/install.ts index d641c4945e681..176bcf1381674 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -122,7 +122,7 @@ export async function handleInstallPackageFailure({ callCluster, }: { savedObjectsClient: SavedObjectsClientContract; - error: IngestManagerError | Boom | Error; + error: IngestManagerError | Boom.Boom | Error; pkgName: string; pkgVersion: string; installedPkg: SavedObject | undefined; diff --git a/x-pack/plugins/lens/server/routes/existing_fields.ts b/x-pack/plugins/lens/server/routes/existing_fields.ts index 43c56af7f71bc..3de3c6c7187c6 100644 --- a/x-pack/plugins/lens/server/routes/existing_fields.ts +++ b/x-pack/plugins/lens/server/routes/existing_fields.ts @@ -14,7 +14,7 @@ import { BASE_API_URL } from '../../common'; import { UI_SETTINGS } from '../../../../../src/plugins/data/server'; import { PluginStartContract } from '../plugin'; -export function isBoomError(error: { isBoom?: boolean }): error is Boom { +export function isBoomError(error: { isBoom?: boolean }): error is Boom.Boom { return error.isBoom === true; } diff --git a/x-pack/plugins/ml/common/types/data_frame_analytics.ts b/x-pack/plugins/ml/common/types/data_frame_analytics.ts index 3455b833c404a..e87e29a36084b 100644 --- a/x-pack/plugins/ml/common/types/data_frame_analytics.ts +++ b/x-pack/plugins/ml/common/types/data_frame_analytics.ts @@ -11,7 +11,7 @@ import { DATA_FRAME_TASK_STATE } from '../constants/data_frame_analytics'; export interface DeleteDataFrameAnalyticsWithIndexStatus { success: boolean; - error?: EsErrorBody | Boom; + error?: EsErrorBody | Boom.Boom; } export type IndexName = string; diff --git a/x-pack/plugins/ml/common/util/errors/errors.test.ts b/x-pack/plugins/ml/common/util/errors/errors.test.ts index 166264ebddee1..a42bf9384561d 100644 --- a/x-pack/plugins/ml/common/util/errors/errors.test.ts +++ b/x-pack/plugins/ml/common/util/errors/errors.test.ts @@ -76,7 +76,7 @@ describe('ML - error message utils', () => { expect(extractErrorMessage(bodyWithAttributes)).toBe(testMsg); // boom error - const boomError: Boom = { + const boomError: Boom.Boom = { message: '', reformat: () => '', name: '', diff --git a/x-pack/plugins/ml/common/util/errors/types.ts b/x-pack/plugins/ml/common/util/errors/types.ts index 667e6e34a5640..b6d43d8e0cf92 100644 --- a/x-pack/plugins/ml/common/util/errors/types.ts +++ b/x-pack/plugins/ml/common/util/errors/types.ts @@ -45,7 +45,12 @@ export interface MLHttpFetchError extends HttpFetchError { body: T; } -export type ErrorType = MLHttpFetchError | EsErrorBody | Boom | string | undefined; +export type ErrorType = + | MLHttpFetchError + | EsErrorBody + | Boom.Boom + | string + | undefined; export function isEsErrorBody(error: any): error is EsErrorBody { return error && error.error?.reason !== undefined; @@ -63,6 +68,6 @@ export function isMLResponseError(error: any): error is MLResponseError { return typeof error.body === 'object' && 'message' in error.body; } -export function isBoomError(error: any): error is Boom { +export function isBoomError(error: any): error is Boom.Boom { return error.isBoom === true; } diff --git a/x-pack/plugins/reporting/server/routes/generation.ts b/x-pack/plugins/reporting/server/routes/generation.ts index ba69b97bee7f1..064cdf0b28eb9 100644 --- a/x-pack/plugins/reporting/server/routes/generation.ts +++ b/x-pack/plugins/reporting/server/routes/generation.ts @@ -68,8 +68,8 @@ export function registerJobGenerationRoutes(reporting: ReportingCore, logger: Lo /* * Error should already have been logged by the time we get here */ - function handleError(res: typeof kibanaResponseFactory, err: Error | Boom) { - if (err instanceof Boom) { + function handleError(res: typeof kibanaResponseFactory, err: Error | Boom.Boom) { + if (err instanceof Boom.Boom) { return res.customError({ statusCode: err.output.statusCode, body: err.output.payload.message, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts index 36131c2e2844d..32c1d8d3cdf56 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts @@ -35,7 +35,7 @@ let alertsClient: ReturnType; describe('utils', () => { describe('transformError', () => { test('returns transformed output error from boom object with a 500 and payload of internal server error', () => { - const boom = new Boom('some boom message'); + const boom = new Boom.Boom('some boom message'); const transformed = transformError(boom); expect(transformed).toEqual({ message: 'An internal server error occurred', @@ -124,7 +124,7 @@ describe('utils', () => { describe('transformBulkError', () => { test('returns transformed object if it is a boom object', () => { - const boom = new Boom('some boom message', { statusCode: 400 }); + const boom = new Boom.Boom('some boom message', { statusCode: 400 }); const transformed = transformBulkError('rule-1', boom); const expected: BulkError = { rule_id: 'rule-1', @@ -252,7 +252,7 @@ describe('utils', () => { describe('transformImportError', () => { test('returns transformed object if it is a boom object', () => { - const boom = new Boom('some boom message', { statusCode: 400 }); + const boom = new Boom.Boom('some boom message', { statusCode: 400 }); const transformed = transformImportError('rule-1', boom, { success_count: 1, success: false, diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts index 764ae5a87ec0e..3980eef7caac2 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts @@ -6,10 +6,10 @@ import Boom, { Payload } from '@hapi/boom'; import { SavedObjectsImportError } from 'src/core/server'; -export const createEmptyFailureResponse = (errors?: Array) => { +export const createEmptyFailureResponse = (errors?: Array) => { const errorMessages: Array = (errors || []).map((error) => { if (Boom.isBoom(error as any)) { - return (error as Boom).output.payload as Payload; + return (error as Boom.Boom).output.payload as Payload; } return error as SavedObjectsImportError; }); diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index fe50830cd24f2..08d04c1d4e185 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -144,7 +144,7 @@ export function wrapEsError(err: any, statusCodeToMessageMap: Record Date: Wed, 9 Dec 2020 13:04:25 +0100 Subject: [PATCH 03/13] [typescript][@hapi/boom] Allow output.payload.attributes to exist --- src/core/server/http/router/response_adapter.ts | 1 + .../server/saved_objects/export/get_sorted_objects_for_export.ts | 1 + src/core/server/saved_objects/import/validate_references.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 904bb6672a71a..f26cd0f6e2305 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -137,6 +137,7 @@ export class HapiResponseAdapter { const attributes = getErrorAttributes(payload); if (attributes) { + // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) error.output.payload.attributes = attributes; } diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 84b14d0a5f02c..92822a7eca83e 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -154,6 +154,7 @@ async function fetchByObjects({ const erroredObjects = bulkGetResult.saved_objects.filter((obj) => !!obj.error); if (erroredObjects.length) { const err = Boom.badRequest(); + // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) err.output.payload.attributes = { objects: erroredObjects, }; diff --git a/src/core/server/saved_objects/import/validate_references.ts b/src/core/server/saved_objects/import/validate_references.ts index b0686215c00dd..925782ee7c71b 100644 --- a/src/core/server/saved_objects/import/validate_references.ts +++ b/src/core/server/saved_objects/import/validate_references.ts @@ -71,6 +71,7 @@ export async function getNonExistingReferenceAsKeys( ); if (erroredObjects.length) { const err = Boom.badRequest(); + // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) err.output.payload.attributes = { objects: erroredObjects, }; From 00cc63e43c1bffa52817b9731f22a2024e02526b Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 13:05:32 +0100 Subject: [PATCH 04/13] [typescript][@hapi/boom] No need to cast output.headers to 'any' anymore --- src/core/server/http/router/response_adapter.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index f26cd0f6e2305..32dfb36fd91ef 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -143,8 +143,7 @@ export class HapiResponseAdapter { const headers = kibanaResponse.options.headers; if (headers) { - // Hapi typings for header accept only strings, although string[] is a valid value - error.output.headers = headers as any; + error.output.headers = headers; } return error; From 80b48329e67984ee52af45d5fb8d395b80efdd78 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 13:06:45 +0100 Subject: [PATCH 05/13] [test][typescript][@hapi/boom] Update Boom mock with new properties --- x-pack/plugins/ml/common/util/errors/errors.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/ml/common/util/errors/errors.test.ts b/x-pack/plugins/ml/common/util/errors/errors.test.ts index a42bf9384561d..6f07c0150630d 100644 --- a/x-pack/plugins/ml/common/util/errors/errors.test.ts +++ b/x-pack/plugins/ml/common/util/errors/errors.test.ts @@ -78,6 +78,7 @@ describe('ML - error message utils', () => { // boom error const boomError: Boom.Boom = { message: '', + typeof: Boom.Boom.constructor, reformat: () => '', name: '', data: [], From a89563bc60788ba9634ba7ca3dd64974ce1403ce Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 13:08:05 +0100 Subject: [PATCH 06/13] [typescript][@hapi/boom] Cast output.headers to key/value object --- src/core/server/elasticsearch/legacy/errors.ts | 2 +- src/core/server/http/lifecycle/on_pre_response.ts | 8 ++++++-- src/core/server/http/router/error_wrapper.ts | 2 +- src/plugins/vis_type_timeseries/server/routes/fields.ts | 2 +- x-pack/plugins/case/server/routes/api/utils.ts | 2 +- x-pack/plugins/ml/server/client/error_wrapper.ts | 2 +- x-pack/plugins/monitoring/server/plugin.ts | 2 +- .../server/authentication/authentication_service.test.ts | 2 +- .../security/server/authentication/providers/kerberos.ts | 4 +++- x-pack/plugins/spaces/server/lib/errors.ts | 2 +- x-pack/plugins/transform/server/routes/api/error_utils.ts | 2 +- 11 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/core/server/elasticsearch/legacy/errors.ts b/src/core/server/elasticsearch/legacy/errors.ts index 763f06fdb5449..adc1fa0728784 100644 --- a/src/core/server/elasticsearch/legacy/errors.ts +++ b/src/core/server/elasticsearch/legacy/errors.ts @@ -86,7 +86,7 @@ export class LegacyElasticsearchErrorHelpers { const decoratedError = decorate(error, ErrorCode.NOT_AUTHORIZED, 401, reason); const wwwAuthHeader = get(error, 'body.error.header[WWW-Authenticate]') as string; - decoratedError.output.headers['WWW-Authenticate'] = + (decoratedError.output.headers as { [key: string]: string })['WWW-Authenticate'] = wwwAuthHeader || 'Basic realm="Authorization Required"'; return decoratedError; diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts index 3c0fa916a3f6f..9efcf46148e1f 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/src/core/server/http/lifecycle/on_pre_response.ts @@ -142,7 +142,11 @@ export function adoptToHapiOnPreResponseFormat(fn: OnPreResponseHandler, log: Lo if (preResponseResult.isNext(result)) { if (result.headers) { if (isBoom(response)) { - findHeadersIntersection(response.output.headers, result.headers, log); + findHeadersIntersection( + response.output.headers as { [key: string]: string }, + result.headers, + log + ); // hapi wraps all error response in Boom object internally response.output.headers = { ...response.output.headers, @@ -157,7 +161,7 @@ export function adoptToHapiOnPreResponseFormat(fn: OnPreResponseHandler, log: Lo const overriddenResponse = responseToolkit.response(result.body).code(statusCode); const originalHeaders = isBoom(response) ? response.output.headers : response.headers; - setHeaders(overriddenResponse, originalHeaders); + setHeaders(overriddenResponse, originalHeaders as { [key: string]: string }); if (result.headers) { setHeaders(overriddenResponse, result.headers); } diff --git a/src/core/server/http/router/error_wrapper.ts b/src/core/server/http/router/error_wrapper.ts index 5a4b7e9f77582..7d141e81ddf36 100644 --- a/src/core/server/http/router/error_wrapper.ts +++ b/src/core/server/http/router/error_wrapper.ts @@ -29,7 +29,7 @@ export const wrapErrors: RequestHandlerWrapper = (handler) => { return response.customError({ body: e.output.payload, statusCode: e.output.statusCode, - headers: e.output.headers, + headers: e.output.headers as { [key: string]: string }, }); } throw e; diff --git a/src/plugins/vis_type_timeseries/server/routes/fields.ts b/src/plugins/vis_type_timeseries/server/routes/fields.ts index a9a890845d154..e787fd8d08a29 100644 --- a/src/plugins/vis_type_timeseries/server/routes/fields.ts +++ b/src/plugins/vis_type_timeseries/server/routes/fields.ts @@ -39,7 +39,7 @@ export const fieldsRoutes = (framework: Framework) => { return res.customError({ body: err.output.payload, statusCode: err.output.statusCode, - headers: err.output.headers, + headers: err.output.headers as { [key: string]: string }, }); } diff --git a/x-pack/plugins/case/server/routes/api/utils.ts b/x-pack/plugins/case/server/routes/api/utils.ts index c8753772648c2..917afb487b1f4 100644 --- a/x-pack/plugins/case/server/routes/api/utils.ts +++ b/x-pack/plugins/case/server/routes/api/utils.ts @@ -96,7 +96,7 @@ export function wrapError(error: any): CustomHttpResponseOptions const boom = isBoom(error) ? error : boomify(error, options); return { body: boom, - headers: boom.output.headers, + headers: boom.output.headers as { [key: string]: string }, statusCode: boom.output.statusCode, }; } diff --git a/x-pack/plugins/ml/server/client/error_wrapper.ts b/x-pack/plugins/ml/server/client/error_wrapper.ts index e2e97e3a87696..fb41d30e34fae 100644 --- a/x-pack/plugins/ml/server/client/error_wrapper.ts +++ b/x-pack/plugins/ml/server/client/error_wrapper.ts @@ -17,7 +17,7 @@ export function wrapError(error: any): CustomHttpResponseOptions message: boom, ...(statusCode !== 500 && error.body ? { attributes: { body: error.body } } : {}), }, - headers: boom.output.headers, + headers: boom.output.headers as { [key: string]: string }, statusCode, }; } diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts index 9478e24c9560f..22ea6c31dbe69 100644 --- a/x-pack/plugins/monitoring/server/plugin.ts +++ b/x-pack/plugins/monitoring/server/plugin.ts @@ -59,7 +59,7 @@ const wrapError = (error: any): CustomHttpResponseOptions => { const boom = Boom.isBoom(error) ? error : Boom.boomify(error, options); return { body: boom, - headers: boom.output.headers, + headers: boom.output.headers as { [key: string]: string }, statusCode: boom.output.statusCode, }; }; diff --git a/x-pack/plugins/security/server/authentication/authentication_service.test.ts b/x-pack/plugins/security/server/authentication/authentication_service.test.ts index d81702691a3a1..244cf1d0a8f51 100644 --- a/x-pack/plugins/security/server/authentication/authentication_service.test.ts +++ b/x-pack/plugins/security/server/authentication/authentication_service.test.ts @@ -243,7 +243,7 @@ describe('AuthenticationService', () => { it('includes `WWW-Authenticate` header if `authenticate` fails to authenticate user and provides challenges', async () => { const mockResponse = httpServerMock.createLifecycleResponseFactory(); const originalError = Boom.unauthorized('some message'); - originalError.output.headers['WWW-Authenticate'] = [ + (originalError.output.headers as { [key: string]: string })['WWW-Authenticate'] = [ 'Basic realm="Access to prod", charset="UTF-8"', 'Basic', 'Negotiate', diff --git a/x-pack/plugins/security/server/authentication/providers/kerberos.ts b/x-pack/plugins/security/server/authentication/providers/kerberos.ts index 9bf419c7dacaa..b7abed979164e 100644 --- a/x-pack/plugins/security/server/authentication/providers/kerberos.ts +++ b/x-pack/plugins/security/server/authentication/providers/kerberos.ts @@ -333,7 +333,9 @@ export class KerberosAuthenticationProvider extends BaseAuthenticationProvider { * @param error Error to extract challenges from. */ private getNegotiateChallenge(error: LegacyElasticsearchError) { - const challenges = ([] as string[]).concat(error.output.headers[WWWAuthenticateHeaderName]); + const challenges = ([] as string[]).concat( + (error.output.headers as { [key: string]: string })[WWWAuthenticateHeaderName] + ); const negotiateChallenge = challenges.find((challenge) => challenge.toLowerCase().startsWith('negotiate') diff --git a/x-pack/plugins/spaces/server/lib/errors.ts b/x-pack/plugins/spaces/server/lib/errors.ts index 13a5c2440877a..0f6bf0f1d56b4 100644 --- a/x-pack/plugins/spaces/server/lib/errors.ts +++ b/x-pack/plugins/spaces/server/lib/errors.ts @@ -11,7 +11,7 @@ export function wrapError(error: any): CustomHttpResponseOptions const boom = isBoom(error) ? error : boomify(error); return { body: boom, - headers: boom.output.headers, + headers: boom.output.headers as { [key: string]: string }, statusCode: boom.output.statusCode, }; } diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index 08d04c1d4e185..d0d596d71c8e7 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -79,7 +79,7 @@ export function wrapError(error: any): CustomHttpResponseOptions const boom = Boom.isBoom(error) ? error : Boom.boomify(error, { statusCode: error.statusCode }); return { body: boom, - headers: boom.output.headers, + headers: boom.output.headers as { [key: string]: string }, statusCode: boom.output.statusCode, }; } From b0c439ddee55d45cc7b36e9e219cca5b87358892 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 9 Dec 2020 14:46:38 +0100 Subject: [PATCH 07/13] Fix route options.validate issue Hapi handles `{ validate: undefined }` differently from `{}` for route options. Having the `validate` key set to `undefined` on the `options` object resulted in the following error Cannot use 'in' operator to search for 'headers' in undefined This was because the key names were iterated over and their value expected to be an object. --- src/core/server/http/http_server.ts | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index 43f5264ff22e3..d38995b9c7692 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { Server } from '@hapi/hapi'; +import { Server, ServerRoute } from '@hapi/hapi'; import HapiStaticFiles from '@hapi/inert'; import url from 'url'; import uuid from 'uuid'; @@ -167,8 +167,6 @@ export class HttpServer { for (const router of this.registeredRouters) { for (const route of router.getRoutes()) { this.log.debug(`registering route handler for [${route.path}]`); - // Hapi does not allow payload validation to be specified for 'head' or 'get' requests - const validate = isSafeMethod(route.method) ? undefined : { payload: true }; const { authRequired, tags, body = {}, timeout } = route.options; const { accepts: allow, maxBytes, output, parse } = body; @@ -182,7 +180,7 @@ export class HttpServer { // real socket timeout. const fakeSocketTimeout = timeout?.payload ? timeout.payload + 1 : undefined; - this.server.route({ + const routeOpts: ServerRoute = { handler: route.handler, method: route.method, path: route.path, @@ -206,11 +204,6 @@ export class HttpServer { }, }, tags: tags ? Array.from(tags) : undefined, - // TODO: This 'validate' section can be removed once the legacy platform is completely removed. - // We are telling Hapi that NP routes can accept any payload, so that it can bypass the default - // validation applied in ./http_tools#getServerOptions - // (All NP routes are already required to specify their own validation in order to access the payload) - validate, payload: [allow, maxBytes, output, parse, timeout?.payload].some( (v) => typeof v !== 'undefined' ) @@ -226,7 +219,22 @@ export class HttpServer { socket: fakeSocketTimeout, }, }, - }); + }; + + // Hapi does not allow payload validation to be specified for 'head' or 'get' requests + if (!isSafeMethod(route.method)) { + // TODO: This 'validate' section can be removed once the legacy platform is completely removed. + // We are telling Hapi that NP routes can accept any payload, so that it can bypass the default + // validation applied in ./http_tools#getServerOptions + // (All NP routes are already required to specify their own validation in order to access the payload) + // TODO: Move the setting of the validate option back up to being set at `routeOpts` creation-time once + // https://github.com/hapijs/hoek/pull/365 is merged and released in @hapi/hoek v9.1.1. At that point I + // imagine the ts-error below will go away as well. + // @ts-expect-error "Property 'validate' does not exist on type 'RouteOptions'" <-- ehh?!? yes it does! + routeOpts.options!.validate = { payload: true }; + } + + this.server.route(routeOpts); } } From 6348063b2b0aefc1d0f8de5a379716522c4fe862 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 10 Dec 2020 16:08:13 +0100 Subject: [PATCH 08/13] Revert workaround for hapi pre v20 bug --- src/core/server/http/http_server.ts | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index d38995b9c7692..5d36e1b0e97de 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -174,12 +174,6 @@ export class HttpServer { xsrfRequired: route.options.xsrfRequired ?? !isSafeMethod(route.method), }; - // To work around https://github.com/hapijs/hapi/issues/4122 until v20, set the socket - // timeout on the route to a fake timeout only when the payload timeout is specified. - // Within the onPreAuth lifecycle of the route itself, we'll override the timeout with the - // real socket timeout. - const fakeSocketTimeout = timeout?.payload ? timeout.payload + 1 : undefined; - const routeOpts: ServerRoute = { handler: route.handler, method: route.method, @@ -187,26 +181,8 @@ export class HttpServer { options: { auth: this.getAuthOption(authRequired), app: kibanaRouteOptions, - ext: { - onPreAuth: { - method: (request, h) => { - // At this point, the socket timeout has only been set to work-around the HapiJS bug. - // We need to either set the real per-route timeout or use the default idle socket timeout - if (timeout?.idleSocket) { - request.raw.req.socket.setTimeout(timeout.idleSocket); - } else if (fakeSocketTimeout) { - // NodeJS uses a socket timeout of `0` to denote "no timeout" - request.raw.req.socket.setTimeout(this.config!.socketTimeout ?? 0); - } - - return h.continue; - }, - }, - }, tags: tags ? Array.from(tags) : undefined, - payload: [allow, maxBytes, output, parse, timeout?.payload].some( - (v) => typeof v !== 'undefined' - ) + payload: [allow, maxBytes, output, parse, timeout?.payload].some((x) => x !== undefined) ? { allow, maxBytes, @@ -216,7 +192,7 @@ export class HttpServer { } : undefined, timeout: { - socket: fakeSocketTimeout, + socket: timeout?.idleSocket ?? this.config!.socketTimeout ?? false, // TODO: Do we really want to fall back to NO timeout? Shouldn't we default to the default Node.js timeout of 2 minutes? }, }, }; From 448040d498e993636feb2d4fa6b0d7ef38460d82 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 10 Dec 2020 16:38:01 +0100 Subject: [PATCH 09/13] [hapi] temp fix for payload.multipart breaking change --- src/core/server/http/http_server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index 5d36e1b0e97de..d6ab306171d12 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -182,6 +182,7 @@ export class HttpServer { auth: this.getAuthOption(authRequired), app: kibanaRouteOptions, tags: tags ? Array.from(tags) : undefined, + // @ts-expect-error Types are outdated and doesn't allow `payload.multipart` to be `true` payload: [allow, maxBytes, output, parse, timeout?.payload].some((x) => x !== undefined) ? { allow, @@ -189,6 +190,7 @@ export class HttpServer { output, parse, timeout: timeout?.payload, + multipart: true, // TODO: Figure out what the default value should be } : undefined, timeout: { From 284f1ccde18360172d8570bb652e43e5e63b3b9e Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 10 Dec 2020 16:40:29 +0100 Subject: [PATCH 10/13] [test] fix http_server tests --- src/core/server/http/http_server.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/server/http/http_server.test.ts b/src/core/server/http/http_server.test.ts index e04131e5f0e5e..4c697d22b6565 100644 --- a/src/core/server/http/http_server.test.ts +++ b/src/core/server/http/http_server.test.ts @@ -1166,7 +1166,7 @@ describe('timeout options', () => { router.get( { path: '/', - validate: { body: schema.any() }, + validate: false, // TODO: Figure out if we can/should use `{ body: schema.any() }` instead }, (context, req, res) => { return res.ok({ @@ -1199,7 +1199,7 @@ describe('timeout options', () => { router.get( { path: '/', - validate: { body: schema.any() }, + validate: false, // TODO: Figure out if we can/should use `{ body: schema.any() }` instead options: { timeout: { idleSocket: 12000 } }, }, (context, req, res) => { From b1ed8e7f886548fcd6760b6478de133cf94e97ce Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 10 Dec 2020 17:42:36 +0100 Subject: [PATCH 11/13] Output of 'node scripts/check_published_api_changes --accept' --- .../kibana-plugin-core-server.legacyelasticsearcherror.md | 2 +- src/core/server/server.api.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyelasticsearcherror.md b/docs/development/core/server/kibana-plugin-core-server.legacyelasticsearcherror.md index 40fc1a8e05a68..7c53356615ee9 100644 --- a/docs/development/core/server/kibana-plugin-core-server.legacyelasticsearcherror.md +++ b/docs/development/core/server/kibana-plugin-core-server.legacyelasticsearcherror.md @@ -9,7 +9,7 @@ Signature: ```typescript -export interface LegacyElasticsearchError extends Boom +export interface LegacyElasticsearchError extends Boom.Boom ``` ## Properties diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 1ab06b7912d1f..06eac89e0a499 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -1542,7 +1542,7 @@ export type LegacyElasticsearchClientConfig = Pick Date: Mon, 14 Dec 2020 14:44:48 +0100 Subject: [PATCH 12/13] Address TODOs --- src/core/server/http/http_server.test.ts | 4 ++-- src/core/server/http/http_server.ts | 4 ++-- src/core/server/http/router/response_adapter.ts | 2 +- .../saved_objects/export/get_sorted_objects_for_export.ts | 2 +- src/core/server/saved_objects/import/validate_references.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/server/http/http_server.test.ts b/src/core/server/http/http_server.test.ts index 4c697d22b6565..739a146c6dcc5 100644 --- a/src/core/server/http/http_server.test.ts +++ b/src/core/server/http/http_server.test.ts @@ -1166,7 +1166,7 @@ describe('timeout options', () => { router.get( { path: '/', - validate: false, // TODO: Figure out if we can/should use `{ body: schema.any() }` instead + validate: { body: schema.maybe(schema.any()) }, }, (context, req, res) => { return res.ok({ @@ -1199,7 +1199,7 @@ describe('timeout options', () => { router.get( { path: '/', - validate: false, // TODO: Figure out if we can/should use `{ body: schema.any() }` instead + validate: { body: schema.maybe(schema.any()) }, options: { timeout: { idleSocket: 12000 } }, }, (context, req, res) => { diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index d6ab306171d12..42e89b66d9c51 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -190,11 +190,11 @@ export class HttpServer { output, parse, timeout: timeout?.payload, - multipart: true, // TODO: Figure out what the default value should be + multipart: true, } : undefined, timeout: { - socket: timeout?.idleSocket ?? this.config!.socketTimeout ?? false, // TODO: Do we really want to fall back to NO timeout? Shouldn't we default to the default Node.js timeout of 2 minutes? + socket: timeout?.idleSocket ?? this.config!.socketTimeout, }, }, }; diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 32dfb36fd91ef..beeab5c05e816 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -137,7 +137,7 @@ export class HapiResponseAdapter { const attributes = getErrorAttributes(payload); if (attributes) { - // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) + // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). error.output.payload.attributes = attributes; } diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 92822a7eca83e..1e6e8b213640a 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -154,7 +154,7 @@ async function fetchByObjects({ const erroredObjects = bulkGetResult.saved_objects.filter((obj) => !!obj.error); if (erroredObjects.length) { const err = Boom.badRequest(); - // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) + // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). err.output.payload.attributes = { objects: erroredObjects, }; diff --git a/src/core/server/saved_objects/import/validate_references.ts b/src/core/server/saved_objects/import/validate_references.ts index 925782ee7c71b..f58a9afcfd4ac 100644 --- a/src/core/server/saved_objects/import/validate_references.ts +++ b/src/core/server/saved_objects/import/validate_references.ts @@ -71,7 +71,7 @@ export async function getNonExistingReferenceAsKeys( ); if (erroredObjects.length) { const err = Boom.badRequest(); - // @ts-expect-error `attributes` does not exist on the `Payload` type, however it does exist in real life (https://github.com/hapijs/boom/issues/277) + // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). err.output.payload.attributes = { objects: erroredObjects, }; From d77b07990e763c957c142f6ca1f5fc994498dcd9 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Fri, 18 Dec 2020 10:51:55 +0100 Subject: [PATCH 13/13] Bump @hapi/boom to v9.1.1 This fixes a TypeScript error which means we can get rid of a few ts-expect-error comments. --- package.json | 2 +- src/core/server/http/router/response_adapter.ts | 1 - .../saved_objects/export/get_sorted_objects_for_export.ts | 1 - .../server/saved_objects/import/validate_references.ts | 1 - x-pack/plugins/transform/server/routes/api/error_utils.ts | 1 - yarn.lock | 8 ++++---- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 1ef41c531b5b2..84cde264ed9d8 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "link:packages/elastic-safer-lodash-set", "@elastic/search-ui-app-search-connector": "^1.5.0", - "@hapi/boom": "^9.1.0", + "@hapi/boom": "^9.1.1", "@hapi/cookie": "^11.0.2", "@hapi/good-squeeze": "6.0.0", "@hapi/h2o2": "^9.0.2", diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index beeab5c05e816..d80c21bde8de8 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -137,7 +137,6 @@ export class HapiResponseAdapter { const attributes = getErrorAttributes(payload); if (attributes) { - // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). error.output.payload.attributes = attributes; } diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 1e6e8b213640a..84b14d0a5f02c 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -154,7 +154,6 @@ async function fetchByObjects({ const erroredObjects = bulkGetResult.saved_objects.filter((obj) => !!obj.error); if (erroredObjects.length) { const err = Boom.badRequest(); - // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). err.output.payload.attributes = { objects: erroredObjects, }; diff --git a/src/core/server/saved_objects/import/validate_references.ts b/src/core/server/saved_objects/import/validate_references.ts index f58a9afcfd4ac..b0686215c00dd 100644 --- a/src/core/server/saved_objects/import/validate_references.ts +++ b/src/core/server/saved_objects/import/validate_references.ts @@ -71,7 +71,6 @@ export async function getNonExistingReferenceAsKeys( ); if (erroredObjects.length) { const err = Boom.badRequest(); - // @ts-expect-error Custom properties on `output.payload` aren't allowed by TS, however, it's the only way to send custom data to the client (https://github.com/hapijs/boom/issues/277). err.output.payload.attributes = { objects: erroredObjects, }; diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index 3f2c5545140de..356158913eb92 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -130,7 +130,6 @@ export function wrapEsError(err: any, statusCodeToMessageMap: Record