Skip to content
Merged
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
3,193 changes: 1,823 additions & 1,370 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/http",
"version": "5.42.0",
"version": "5.43.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down Expand Up @@ -75,25 +75,25 @@
"#tests": "./tests/index.js"
},
"devDependencies": {
"@athenna/artisan": "^5.7.0",
"@athenna/common": "^5.18.0",
"@athenna/config": "^5.4.0",
"@athenna/artisan": "^5.11.0",
"@athenna/common": "^5.30.0",
"@athenna/config": "^5.6.0",
"@athenna/ioc": "^5.2.0",
"@athenna/logger": "^5.10.0",
"@athenna/test": "^5.5.0",
"@athenna/logger": "^5.14.0",
"@athenna/test": "^5.6.0",
"@athenna/tsconfig": "^5.0.0",
"@athenna/view": "^5.4.0",
"@athenna/vite": "^5.15.0",
"@fastify/aws-lambda": "^6.0.0",
"@fastify/aws-lambda": "^6.4.0",
"@fastify/cors": "^10.1.0",
"@fastify/helmet": "^13.0.1",
"@fastify/multipart": "^9.0.3",
"@fastify/helmet": "^13.0.2",
"@fastify/multipart": "^9.4.0",
"@fastify/rate-limit": "^10.3.0",
"@fastify/static": "^8.2.0",
"@fastify/swagger": "^9.5.1",
"@fastify/swagger-ui": "^5.2.3",
"@typescript-eslint/eslint-plugin": "^8.39.0",
"@typescript-eslint/parser": "^8.39.0",
"@fastify/static": "^8.3.0",
"@fastify/swagger": "^9.7.0",
"@fastify/swagger-ui": "^5.2.5",
"@typescript-eslint/eslint-plugin": "^8.57.0",
"@typescript-eslint/parser": "^8.57.0",
"autocannon": "^7.15.0",
"commitizen": "^4.3.1",
"cz-conventional-changelog": "^3.3.0",
Expand All @@ -109,7 +109,7 @@
"lint-staged": "^12.5.0",
"ora": "^8.2.0",
"prettier": "^2.8.8",
"vite": "^6.3.5",
"vite": "^6.4.1",
"vite-plugin-restart": "^0.4.2"
},
"c8": {
Expand Down
5 changes: 3 additions & 2 deletions src/handlers/HttpExceptionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
* file that was distributed with this source code.
*/

import { Is, Json, String, ExceptionHandler } from '@athenna/common'

import { Log } from '@athenna/logger'
import type { ErrorContext } from '#src/types'
import { Is, Json, String } from '@athenna/common'

export class HttpExceptionHandler {
export class HttpExceptionHandler extends ExceptionHandler {
/**
* Error codes that should be ignored from logging.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/router/Route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Route extends Macroable {
this.route = {
url,
methods,
data: {},
data: null,
deleted: false,
prefixes: [],
middlewares: {
Expand Down
2 changes: 1 addition & 1 deletion src/server/ServerImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export class ServerImpl extends Macroable {
}

if (middlewares.length) {
route.preHandler = middlewares.map(m => FastifyHandler.handle(m))
route.preHandler = middlewares.map(m => FastifyHandler.handle(m)) as any[]
}

if (interceptors.length) {
Expand Down
30 changes: 15 additions & 15 deletions templates/controller.edge
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { Controller, type Context } from '@athenna/http'

@Controller()
export class {{ namePascal }} {
public async index({ response }: Context) {
return response.status(200).send([{}])
}
public async index({ response }: Context) {
return response.status(200).send([{}])
}

public async store({ response }: Context) {
return response.status(201).send({})
}
public async store({ response }: Context) {
return response.status(201).send({})
}

public async show({ response }: Context) {
return response.status(200).send({})
}
public async show({ response }: Context) {
return response.status(200).send({})
}

public async update({ request, response }: Context) {
return response.status(200).send({ id: request.param('id') })
}
public async update({ request, response }: Context) {
return response.status(200).send({ id: request.param('id') })
}

public async delete({ response }: Context) {
return response.status(204)
}
public async delete({ response }: Context) {
return response.status(204)
}
}
6 changes: 3 additions & 3 deletions templates/interceptor.edge
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { InterceptorContract, InterceptContext } from '@athenna/http'

@Interceptor()
export class {{ namePascal }} implements InterceptorContract {
public async intercept(ctx: InterceptContext): Promise<unknown> {
return ctx.response.body
}
public async intercept(ctx: InterceptContext): Promise<unknown> {
return ctx.response.body
}
}
2 changes: 1 addition & 1 deletion templates/middleware.edge
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import type { Context, MiddlewareContract } from '@athenna/http'

@Middleware()
export class {{ namePascal }} implements MiddlewareContract {
public async handle(ctx: Context): Promise<void> {}
public async handle(ctx: Context): Promise<void> {}
}
2 changes: 1 addition & 1 deletion templates/terminator.edge
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import type { TerminateContext, TerminatorContract } from '@athenna/http'

@Terminator()
export class {{ namePascal }} implements TerminatorContract {
public async terminate(ctx: TerminateContext): Promise<void> {}
public async terminate(ctx: TerminateContext): Promise<void> {}
}
2 changes: 1 addition & 1 deletion tests/unit/server/ServerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class ServerTest {

@Test()
public async shouldBeAbleToGetTheFastifyVersionFromTheHttpServer({ assert }: Context) {
assert.equal(Server.getFastifyVersion(), '5.4.0')
assert.equal(Server.getFastifyVersion(), '5.8.2')
}

@Test()
Expand Down
Loading