From 5ba178baacc8df610fa0e6e684c10b12eed44344 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 30 Jun 2023 20:26:56 +0200 Subject: [PATCH] deps: update fastify to 4.19.0 --- packages/api/package.json | 2 +- packages/api/src/utils/server/types.ts | 4 +- packages/beacon-node/package.json | 2 +- packages/beacon-node/src/api/impl/errors.ts | 6 +- yarn.lock | 80 +++++++++++---------- 5 files changed, 52 insertions(+), 42 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index 131283eb77e7..319cad174859 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -83,7 +83,7 @@ "@types/eventsource": "^1.1.11", "@types/qs": "^6.9.7", "ajv": "^8.12.0", - "fastify": "^4.15.0" + "fastify": "^4.19.0" }, "keywords": [ "ethereum", diff --git a/packages/api/src/utils/server/types.ts b/packages/api/src/utils/server/types.ts index c4e0de749a80..0e2d5201f51c 100644 --- a/packages/api/src/utils/server/types.ts +++ b/packages/api/src/utils/server/types.ts @@ -1,12 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import type {FastifyInstance} from "fastify"; +import type {FastifyInstance, FastifyContextConfig} from "fastify"; // eslint-disable-next-line import/no-extraneous-dependencies import type * as fastify from "fastify"; import {ReqGeneric} from "../types.js"; export type ServerInstance = FastifyInstance; -export type RouteConfig = { +export type RouteConfig = FastifyContextConfig & { operationId: ServerRoute["id"]; }; diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index 94182c1a71d0..a5b315d00ff8 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -139,7 +139,7 @@ "datastore-core": "^8.0.1", "datastore-level": "^9.0.1", "deepmerge": "^4.3.1", - "fastify": "^4.15.0", + "fastify": "^4.19.0", "gc-stats": "^1.4.0", "interface-datastore": "^7.0.0", "it-all": "^3.0.1", diff --git a/packages/beacon-node/src/api/impl/errors.ts b/packages/beacon-node/src/api/impl/errors.ts index 2830a0438f3b..7169b7138295 100644 --- a/packages/beacon-node/src/api/impl/errors.ts +++ b/packages/beacon-node/src/api/impl/errors.ts @@ -1,6 +1,8 @@ +import {HttpErrorCodes} from "@lodestar/api"; + export class ApiError extends Error { - statusCode: number; - constructor(statusCode: number, message?: string) { + statusCode: HttpErrorCodes; + constructor(statusCode: HttpErrorCodes, message?: string) { super(message); this.statusCode = statusCode; } diff --git a/yarn.lock b/yarn.lock index dba94ac93595..abf9763d38da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1608,17 +1608,17 @@ resolved "https://registry.yarnpkg.com/@fastify/deepmerge/-/deepmerge-1.3.0.tgz#8116858108f0c7d9fd460d05a7d637a13fe3239a" integrity sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A== -"@fastify/error@^3.0.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@fastify/error/-/error-3.2.0.tgz#9010e0acfe07965f5fc7d2b367f58f042d0f4106" - integrity sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ== +"@fastify/error@^3.2.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@fastify/error/-/error-3.3.0.tgz#eba790082e1144bfc8def0c2c8ef350064bc537b" + integrity sha512-dj7vjIn1Ar8sVXj2yAXiMNCJDmS9MQ9XMlIecX2dIzzhjSHCyKo4DdXjXMs7wKW2kj6yvVRSpuQjOZ3YLrh56w== -"@fastify/fast-json-stringify-compiler@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.2.0.tgz#52d047fac76b0d75bd660f04a5dd606659f57c5a" - integrity sha512-ypZynRvXA3dibfPykQN3RB5wBdEUgSGgny8Qc6k163wYPLD4mEGEDkACp+00YmqkGvIm8D/xYoHajwyEdWD/eg== +"@fastify/fast-json-stringify-compiler@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz#5df89fa4d1592cbb8780f78998355feb471646d5" + integrity sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA== dependencies: - fast-json-stringify "^5.0.0" + fast-json-stringify "^5.7.0" "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" @@ -4734,7 +4734,7 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -avvio@^8.2.0: +avvio@^8.2.1: version "8.2.1" resolved "https://registry.yarnpkg.com/avvio/-/avvio-8.2.1.tgz#b5a482729847abb84d5aadce06511c04a0a62f82" integrity sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw== @@ -7649,7 +7649,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-json-stringify@^5.0.0: +fast-json-stringify@^5.7.0: version "5.7.0" resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz#b0a04c848fdeb6ecd83440c71a4db35067023bed" integrity sha512-sBVPTgnAZseLu1Qgj6lUbQ0HfjFhZWXAmpZ5AaSGkyLh5gAXBga/uPJjQPHpDFjC9adWIpdOcCLSDTgrZ7snoQ== @@ -7700,26 +7700,27 @@ fastify-plugin@^4.0.0: resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-4.5.0.tgz#8b853923a0bba6ab6921bb8f35b81224e6988d91" integrity sha512-79ak0JxddO0utAXAQ5ccKhvs6vX2MGyHHMMsmZkBANrq3hXc1CHzvNPHOcvTsVMEPl5I+NT+RO4YKMGehOfSIg== -fastify@^4.15.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/fastify/-/fastify-4.15.0.tgz#4ebadaea706217467a332341f9cfa632072d51f2" - integrity sha512-m/CaRN8nf5uyYdrDe2qqq+0z3oGyE+A++qlKQoLJTI4WI0nWK9D6R3FxXQ3MVwt/md977GMR4F43pE9oqrS2zw== +fastify@^4.19.0: + version "4.19.0" + resolved "https://registry.yarnpkg.com/fastify/-/fastify-4.19.0.tgz#2475b4cf0075aa7bd3b9651ee9fc57a1bf67cee0" + integrity sha512-Fb7w46k3kum/V+OMiw2/LN1lo2xqhJqwTsv+LGie5n7YNdA9bmDUntXfcec9rG6VRDXIBfPf5xmFv2wooBdxzg== dependencies: "@fastify/ajv-compiler" "^3.5.0" - "@fastify/error" "^3.0.0" - "@fastify/fast-json-stringify-compiler" "^4.2.0" + "@fastify/error" "^3.2.0" + "@fastify/fast-json-stringify-compiler" "^4.3.0" abstract-logging "^2.0.1" - avvio "^8.2.0" + avvio "^8.2.1" fast-content-type-parse "^1.0.0" + fast-json-stringify "^5.7.0" find-my-way "^7.6.0" - light-my-request "^5.6.1" - pino "^8.5.0" - process-warning "^2.0.0" + light-my-request "^5.9.1" + pino "^8.12.0" + process-warning "^2.2.0" proxy-addr "^2.0.7" rfdc "^1.3.0" secure-json-parse "^2.5.0" - semver "^7.3.7" - tiny-lru "^10.0.0" + semver "^7.5.0" + tiny-lru "^11.0.1" fastq@^1.6.0: version "1.13.0" @@ -10309,10 +10310,10 @@ libp2p@0.42.2: wherearewe "^2.0.0" xsalsa20 "^1.1.0" -light-my-request@^5.6.1: - version "5.9.1" - resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-5.9.1.tgz#076f8d4cc4639408cc48381d4f2860212d469d4b" - integrity sha512-UT7pUk8jNCR1wR7w3iWfIjx32DiB2f3hFdQSOwy3/EPQ3n3VocyipUxcyRZR0ahoev+fky69uA+GejPa9KuHKg== +light-my-request@^5.9.1: + version "5.10.0" + resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-5.10.0.tgz#0a2bbc1d1bb573ed3b78143960920ecdc05bf157" + integrity sha512-ZU2D9GmAcOUculTTdH9/zryej6n8TzT+fNGdNtm6SDp5MMMpHrJJkvAdE3c6d8d2chE9i+a//dS9CWZtisknqA== dependencies: cookie "^0.5.0" process-warning "^2.0.0" @@ -12597,10 +12598,10 @@ pino-std-serializers@^6.0.0: resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.2.0.tgz#169048c0df3f61352fce56aeb7fb962f1b66ab43" integrity sha512-IWgSzUL8X1w4BIWTwErRgtV8PyOGOOi60uqv0oKuS/fOA8Nco/OeI6lBuc4dyP8MMfdFwyHqTMcBIA7nDiqEqA== -pino@^8.5.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/pino/-/pino-8.11.0.tgz#2a91f454106b13e708a66c74ebc1c2ab7ab38498" - integrity sha512-Z2eKSvlrl2rH8p5eveNUnTdd4AjJk8tAsLkHYZQKGHP4WTh2Gi1cOSOs3eWPqaj+niS3gj4UkoreoaWgF3ZWYg== +pino@^8.12.0: + version "8.14.1" + resolved "https://registry.yarnpkg.com/pino/-/pino-8.14.1.tgz#bb38dcda8b500dd90c1193b6c9171eb777a47ac8" + integrity sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw== dependencies: atomic-sleep "^1.0.0" fast-redact "^3.1.1" @@ -12707,7 +12708,7 @@ process-on-spawn@^1.0.0: dependencies: fromentries "^1.2.0" -process-warning@^2.0.0: +process-warning@^2.0.0, process-warning@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-2.2.0.tgz#008ec76b579820a8e5c35d81960525ca64feb626" integrity sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg== @@ -13635,6 +13636,13 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve dependencies: lru-cache "^6.0.0" +semver@^7.5.0: + version "7.5.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -14644,10 +14652,10 @@ timers-browserify@^2.0.4: dependencies: setimmediate "^1.0.4" -tiny-lru@^10.0.0: - version "10.4.1" - resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-10.4.1.tgz#dec67a62115a4cb31d2065b8116d010daac362fe" - integrity sha512-buLIzw7ppqymuO3pt10jHk/6QMeZLbidihMQU+N6sogF6EnBzG0qtDWIHuhw1x3dyNgVL/KTGIZsTK81+yCzLg== +tiny-lru@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-11.0.1.tgz#629d6ddd88bd03c0929722680167f1feadf576f2" + integrity sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg== "tiny-worker@>= 2": version "2.3.0"