Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fastify update to fastify 5 #609

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,333 changes: 576 additions & 757 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"@aws-sdk/client-s3": "3.654.0",
"@aws-sdk/lib-storage": "3.654.0",
"@aws-sdk/s3-request-presigner": "3.654.0",
"@fastify/accepts": "^4.3.0",
"@fastify/multipart": "^8.3.0",
"@fastify/accepts": "^5.0.2",
"@fastify/multipart": "^9.0.1",
"@fastify/rate-limit": "^7.6.0",
"@fastify/swagger": "^8.3.1",
"@fastify/swagger-ui": "^4.1.0",
"@fastify/swagger": "^9.4.0",
"@fastify/swagger-ui": "^5.2.0",
"@isaacs/ttlcache": "^1.4.1",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/auto-instrumentations-node": "^0.50.0",
Expand All @@ -55,9 +55,9 @@
"conventional-changelog-conventionalcommits": "^5.0.0",
"crypto-js": "^4.2.0",
"dotenv": "^16.0.0",
"fastify": "^4.28.1",
"fastify-metrics": "^10.2.0",
"fastify-plugin": "^4.5.1",
"fastify": "^5.2.1",
"fastify-metrics": "^10.6.0",
"fastify-plugin": "^5.0.1",
"fastify-xml-body-parser": "^2.2.0",
"fs-extra": "^10.0.1",
"fs-xattr": "0.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/http/plugins/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const db = fastifyPlugin(
async function db(fastify) {
fastify.register(migrations)

fastify.decorateRequest('db', null)
fastify.decorateRequest('db')

fastify.addHook('preHandler', async (request) => {
const adminUser = await getServiceKeyUser(request.tenantId)
Expand Down Expand Up @@ -97,7 +97,7 @@ interface DbSuperUserPluginOptions {
export const dbSuperUser = fastifyPlugin<DbSuperUserPluginOptions>(
async function dbSuperUser(fastify, opts) {
fastify.register(migrations)
fastify.decorateRequest('db', null)
fastify.decorateRequest('db')

fastify.addHook('preHandler', async (request) => {
const adminUser = await getServiceKeyUser(request.tenantId)
Expand Down
2 changes: 1 addition & 1 deletion src/http/plugins/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const storageBackend = createStorageBackend(storageBackendType)

export const storage = fastifyPlugin(
async function storagePlugin(fastify) {
fastify.decorateRequest('storage', null)
fastify.decorateRequest('storage')
fastify.addHook('preHandler', async (request) => {
const database = new StorageKnexDB(request.db, {
tenantId: request.tenantId,
Expand Down
2 changes: 1 addition & 1 deletion src/http/routes/object/getObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ interface getObjectRequestInterface extends AuthenticatedRangeRequest {
async function requestHandler(
request: FastifyRequest<getObjectRequestInterface, Server, IncomingMessage>,
response: FastifyReply<
getObjectRequestInterface,
Server,
IncomingMessage,
ServerResponse,
getObjectRequestInterface,
unknown
>
) {
Expand Down
2 changes: 1 addition & 1 deletion src/http/routes/object/getObjectInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ interface getObjectRequestInterface extends AuthenticatedRangeRequest {
async function requestHandler(
request: FastifyRequest<getObjectRequestInterface, Server, IncomingMessage>,
response: FastifyReply<
getObjectRequestInterface,
Server,
IncomingMessage,
ServerResponse,
getObjectRequestInterface,
unknown
>,
publicRoute = false,
Expand Down
4 changes: 2 additions & 2 deletions src/start/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async function httpServer(signal: AbortSignal) {
const { exposeDocs, requestTraceHeader, port, host } = getConfig()

const app: FastifyInstance<Server, IncomingMessage, ServerResponse> = build({
logger,
loggerInstance: logger,
disableRequestLogging: true,
exposeDocs,
requestIdHeader: requestTraceHeader,
Expand Down Expand Up @@ -141,7 +141,7 @@ async function httpAdminServer(

const adminApp = buildAdmin(
{
logger,
loggerInstance: logger,
disableRequestLogging: true,
requestIdHeader: adminRequestIdHeader,
},
Expand Down
2 changes: 1 addition & 1 deletion src/start/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function main() {
])

const server = adminApp({
logger,
loggerInstance: logger,
disableRequestLogging: true,
requestIdHeader: requestTraceHeader,
})
Expand Down
2 changes: 1 addition & 1 deletion src/test/tus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Tus multipart', () => {

beforeAll(async () => {
server = await app({
logger: logger,
loggerInstance: logger,
})

await server.listen({
Expand Down
Loading