@adonisjs/http-server 6.8.0-0 → 6.8.2-0

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.
@@ -1,10 +1,8 @@
1
- import type { Logger } from '@adonisjs/logger';
2
1
  import type { Level } from '@adonisjs/logger/types';
3
2
  import type { HttpContext } from './http_context/main.js';
4
3
  import type { HttpError, StatusPageRange, StatusPageRenderer } from './types/server.js';
5
4
  export declare class ExceptionHandler {
6
5
  #private;
7
- protected logger: Logger;
8
6
  protected debug: boolean;
9
7
  protected renderStatusPages: boolean;
10
8
  protected statusPages: Record<StatusPageRange, StatusPageRenderer>;
@@ -17,7 +15,6 @@ export declare class ExceptionHandler {
17
15
  protected ignoreExceptions: any[];
18
16
  protected ignoreStatuses: number[];
19
17
  protected ignoreCodes: string[];
20
- constructor(logger: Logger);
21
18
  protected context(ctx: HttpContext): any;
22
19
  protected getResponseFormat(ctx: HttpContext): 'html' | 'json' | 'json_api';
23
20
  protected getErrorLogLevel(error: HttpError): Level;
@@ -2,7 +2,6 @@ import is from '@sindresorhus/is';
2
2
  import { parseRange } from './helpers.js';
3
3
  import * as errors from './exceptions.js';
4
4
  export class ExceptionHandler {
5
- logger;
6
5
  debug = process.env.NODE_ENV !== 'production';
7
6
  renderStatusPages = process.env.NODE_ENV === 'production';
8
7
  statusPages = {};
@@ -53,9 +52,6 @@ export class ExceptionHandler {
53
52
  ];
54
53
  ignoreStatuses = [400, 422, 401];
55
54
  ignoreCodes = [];
56
- constructor(logger) {
57
- this.logger = logger;
58
- }
59
55
  #expandStatusPages() {
60
56
  if (!this.#expandedStatusPages) {
61
57
  this.#expandedStatusPages = Object.keys(this.statusPages).reduce((result, range) => {
@@ -128,7 +124,7 @@ export class ExceptionHandler {
128
124
  return;
129
125
  }
130
126
  const level = this.getErrorLogLevel(httpError);
131
- this.logger.log(level, {
127
+ ctx.logger.log(level, {
132
128
  ...(level === 'error' || level === 'fatal' ? { err: httpError } : {}),
133
129
  ...this.context(ctx),
134
130
  }, httpError.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/http-server",
3
- "version": "6.8.0-0",
3
+ "version": "6.8.2-0",
4
4
  "description": "AdonisJS HTTP server with support packed with Routing and Cookies",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -39,22 +39,22 @@
39
39
  "author": "virk,adonisjs",
40
40
  "license": "MIT",
41
41
  "devDependencies": {
42
- "@adonisjs/application": "^7.1.0-0",
43
- "@adonisjs/config": "^4.2.0-0",
42
+ "@adonisjs/application": "^7.1.2-0",
43
+ "@adonisjs/config": "^4.2.1-0",
44
44
  "@adonisjs/encryption": "^5.1.2-0",
45
- "@adonisjs/events": "^8.4.7-0",
46
- "@adonisjs/fold": "^9.9.2-0",
45
+ "@adonisjs/events": "^8.4.9-0",
46
+ "@adonisjs/fold": "^9.9.3-0",
47
47
  "@adonisjs/logger": "^5.4.2-0",
48
- "@commitlint/cli": "^17.4.2",
49
- "@commitlint/config-conventional": "^17.4.2",
48
+ "@commitlint/cli": "^17.4.4",
49
+ "@commitlint/config-conventional": "^17.4.4",
50
50
  "@fastify/middie": "^8.1.0",
51
- "@japa/api-client": "^1.4.3",
51
+ "@japa/api-client": "^1.4.4",
52
52
  "@japa/assert": "^1.4.1",
53
53
  "@japa/expect-type": "^1.0.3",
54
54
  "@japa/run-failed-tests": "^1.1.1",
55
- "@japa/runner": "^2.3.0",
55
+ "@japa/runner": "^2.5.1",
56
56
  "@japa/spec-reporter": "^1.3.3",
57
- "@swc/core": "^1.3.35",
57
+ "@swc/core": "^1.3.37",
58
58
  "@types/accepts": "^1.3.5",
59
59
  "@types/content-disposition": "^0.5.5",
60
60
  "@types/cookie": "^0.5.1",
@@ -73,14 +73,14 @@
73
73
  "@types/type-is": "^1.6.3",
74
74
  "@types/vary": "^1.1.0",
75
75
  "autocannon": "^7.10.0",
76
- "c8": "^7.12.0",
76
+ "c8": "^7.13.0",
77
77
  "cross-env": "^7.0.3",
78
78
  "del-cli": "^5.0.0",
79
- "eslint": "^8.34.0",
79
+ "eslint": "^8.35.0",
80
80
  "eslint-config-prettier": "^8.6.0",
81
81
  "eslint-plugin-adonis": "^3.0.3",
82
82
  "eslint-plugin-prettier": "^4.2.1",
83
- "fastify": "^4.13.0",
83
+ "fastify": "^4.14.0",
84
84
  "fs-extra": "^11.1.0",
85
85
  "github-label-sync": "^2.2.0",
86
86
  "http-status-codes": "^2.2.0",
@@ -117,10 +117,10 @@
117
117
  "youch": "^3.2.3"
118
118
  },
119
119
  "peerDependencies": {
120
- "@adonisjs/application": "^7.1.0-0",
120
+ "@adonisjs/application": "^7.1.2-0",
121
121
  "@adonisjs/encryption": "^5.1.2-0",
122
- "@adonisjs/events": "^8.4.7-0",
123
- "@adonisjs/fold": "^9.9.2-0",
122
+ "@adonisjs/events": "^8.4.9-0",
123
+ "@adonisjs/fold": "^9.9.3-0",
124
124
  "@adonisjs/logger": "^5.4.2-0"
125
125
  },
126
126
  "repository": {