Skip to content

Commit

Permalink
fix: updated fastify to version 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitsinghkaler committed Jan 10, 2025
1 parent b54c395 commit 40523a6
Show file tree
Hide file tree
Showing 9 changed files with 593 additions and 774 deletions.
1,333 changes: 576 additions & 757 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"author": "Supabase",
"license": "ISC",
"engines": {
"node": ">= 14.0.0"
"node": ">= 20.0.0"
},
"dependencies": {
"@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

0 comments on commit 40523a6

Please sign in to comment.