@athenna/http 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenna/http",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "The Athenna Http server. Built on top of fastify.",
5
5
  "license": "MIT",
6
6
  "author": "João Lenon <lenon@athenna.io>",
@@ -54,10 +54,11 @@
54
54
  "#tests/*": "./tests/*.js"
55
55
  },
56
56
  "dependencies": {
57
- "@athenna/artisan": "1.5.2",
58
- "@athenna/ioc": "1.2.6",
59
- "@athenna/logger": "1.3.3",
60
- "@secjs/utils": "2.0.1",
57
+ "@athenna/artisan": "1.5.5",
58
+ "@athenna/config": "1.1.8",
59
+ "@athenna/ioc": "1.2.7",
60
+ "@athenna/logger": "1.3.4",
61
+ "@athenna/common": "1.0.0",
61
62
  "fastify": "3.27.4",
62
63
  "fastify-cors": "6.0.3",
63
64
  "fastify-rate-limit": "5.8.0"
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Path } from '@secjs/utils'
10
+ import { Path } from '@athenna/common'
11
11
  import { Command } from '@athenna/artisan'
12
12
 
13
13
  export class MakeController extends Command {
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Path, String } from '@secjs/utils'
10
+ import { Path, String } from '@athenna/common'
11
11
  import { Artisan, Command, FilePropertiesHelper } from '@athenna/artisan'
12
12
 
13
13
  export class MakeMiddleware extends Command {
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { Command } from '@athenna/artisan'
11
- import { Module, Path, String } from '@secjs/utils'
11
+ import { Module, Path, String } from '@athenna/common'
12
12
 
13
13
  import { Route } from '#src/index'
14
14
 
@@ -7,7 +7,8 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Config, Is } from '@secjs/utils'
10
+ import { Is } from '@athenna/common'
11
+ import { Config } from '@athenna/config'
11
12
 
12
13
  export class Request {
13
14
  /**
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Exception } from '@secjs/utils'
10
+ import { Exception } from '@athenna/common'
11
11
 
12
12
  export class HttpException extends Exception {
13
13
  /**
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Exception } from '@secjs/utils'
10
+ import { Exception } from '@athenna/common'
11
11
 
12
12
  export class UndefinedMethodException extends Exception {
13
13
  /**
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Is } from '@secjs/utils'
10
+ import { Is } from '@athenna/common'
11
11
  import { Request } from '#src/Context/Request'
12
12
  import { Response } from '#src/Context/Response'
13
13
 
@@ -1,5 +1,6 @@
1
1
  import { Log } from '@athenna/logger'
2
- import { Config, Exception, String } from '@secjs/utils'
2
+ import { Config } from '@athenna/config'
3
+ import { Exception, String } from '@athenna/common'
3
4
 
4
5
  export class HttpExceptionHandler {
5
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path'
2
- import { Folder, Module } from '@secjs/utils'
2
+ import { Folder, Module } from '@athenna/common'
3
3
 
4
4
  export class HttpLoader {
5
5
  /**
@@ -24,6 +24,6 @@ export class HttpLoader {
24
24
  const dirname = Module.createDirname(import.meta.url)
25
25
  const templatesPath = join(dirname, '..', '..', 'templates')
26
26
 
27
- return new Folder(templatesPath).loadSync().getFilesByPattern('**/*.ejs')
27
+ return new Folder(templatesPath).loadSync().getFilesByPattern('**/*.edge')
28
28
  }
29
29
  }
@@ -1,5 +1,6 @@
1
1
  import { Log } from '@athenna/logger'
2
- import { Config, Module, Path, Uuid } from '@secjs/utils'
2
+ import { Config } from '@athenna/config'
3
+ import { Module, Path, Uuid } from '@athenna/common'
3
4
 
4
5
  import { Server } from '#src/Facades/Server'
5
6
 
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Module, Path } from '@secjs/utils'
10
+ import { Module, Path } from '@athenna/common'
11
11
  import { ServiceProvider } from '@athenna/ioc'
12
12
 
13
13
  export class ControllerProvider extends ServiceProvider {
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Module, Path } from '@secjs/utils'
10
+ import { Module, Path } from '@athenna/common'
11
11
  import { ServiceProvider } from '@athenna/ioc'
12
12
 
13
13
  export class MiddlewareProvider extends ServiceProvider {
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Is } from '@secjs/utils'
10
+ import { Is } from '@athenna/common'
11
11
  import { removeSlashes } from '#src/Utils/removeSlashes'
12
12
  import { isMiddlewareContract } from '#src/Utils/isMiddlewareContract'
13
13
  import { UndefinedMethodException } from '#src/Exceptions/UndefinedMethodException'
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { Route } from '#src/Router/Route'
11
- import { Is, String } from '@secjs/utils'
11
+ import { Is, String } from '@athenna/common'
12
12
 
13
13
  export class RouteResource {
14
14
  /**
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Is } from '@secjs/utils'
10
+ import { Is } from '@athenna/common'
11
11
 
12
12
  import { Route } from '#src/Router/Route'
13
13
  import { Server } from '#src/Facades/Server'
@@ -1,4 +1,4 @@
1
- import { Is } from '@secjs/utils'
1
+ import { Is } from '@athenna/common'
2
2
 
3
3
  /**
4
4
  * Remove additional slashes from url.
package/src/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { Facade } from '@athenna/ioc'
11
11
  import { FastifyReply, FastifyRequest } from 'fastify'
12
- import { Exception } from '@secjs/utils'
12
+ import { Exception } from '@athenna/common'
13
13
 
14
14
  export const Server: Facade & Http
15
15
  export const Route: Facade & Router.Router
@@ -23,6 +23,7 @@ export class HttpKernel {
23
23
  * @type {any | Promise<any>}
24
24
  */
25
25
  get globalMiddlewares(): any | Promise<any>
26
+
26
27
  /**
27
28
  * The application's named HTTP middlewares.
28
29
  *
@@ -82,6 +83,7 @@ export class HttpExceptionHandler {
82
83
  * @type {string[]}
83
84
  */
84
85
  get ignoreCodes(): string[]
86
+
85
87
  /**
86
88
  * Error statuses that should be ignored by Log.
87
89
  *
@@ -199,7 +201,12 @@ export class Http {
199
201
  * @param {any} [middlewares]
200
202
  * @return {void}
201
203
  */
202
- route(url: string, methods: string[], handler: HandlerContract, middlewares?: any): void
204
+ route(
205
+ url: string,
206
+ methods: string[],
207
+ handler: HandlerContract,
208
+ middlewares?: any,
209
+ ): void
203
210
 
204
211
  /**
205
212
  * Add a new GET route to the http server.
@@ -420,7 +427,11 @@ declare module Router {
420
427
  * @param {string|any} handler
421
428
  * @return {Route}
422
429
  */
423
- route(url: string, methods: string[], handler: string | HandlerContract): Route
430
+ route(
431
+ url: string,
432
+ methods: string[],
433
+ handler: string | HandlerContract,
434
+ ): Route
424
435
 
425
436
  /**
426
437
  * Creates a new route group.
@@ -687,7 +698,12 @@ export class HttpException extends Exception {
687
698
  * @param {string} [code]
688
699
  * @param {string|null} [help]
689
700
  */
690
- constructor(content?: string, status?: number, code?: string, help?: string | null)
701
+ constructor(
702
+ content?: string,
703
+ status?: number,
704
+ code?: string,
705
+ help?: string | null,
706
+ )
691
707
  }
692
708
 
693
709
  export class BadGatewayException extends Exception {
package/src/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
 
10
- import { Options } from '@secjs/utils'
10
+ import { Options } from '@athenna/common'
11
11
 
12
12
  import fastify from 'fastify'
13
13
  import fastifyCors from 'fastify-cors'
@@ -1,4 +1,4 @@
1
- export class <%= namePascal %> {
1
+ export class {{ namePascal }} {
2
2
  /**
3
3
  * Resolve any dependency of the service container
4
4
  * inside the constructor.
@@ -1,4 +1,4 @@
1
- export class <%= namePascal %> {
1
+ export class {{ namePascal }} {
2
2
  /**
3
3
  * Resolve any dependency of the service container
4
4
  * inside the constructor.