@shadow-library/fastify 1.6.2 → 1.6.3

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.
@@ -9,5 +9,5 @@ const app_1 = require("@shadow-library/app");
9
9
  * Declaring the constants
10
10
  */
11
11
  function ApiOperation(options) {
12
- return (0, app_1.Route)({ operation: options });
12
+ return (0, app_1.Route)({ operation: options }, { arrayStrategy: 'replace' });
13
13
  }
@@ -23,6 +23,10 @@ const ERROR_STATUS_CODES = {
23
23
  [common_1.ErrorType.UNAUTHORIZED]: 403,
24
24
  [common_1.ErrorType.VALIDATION_ERROR]: 422,
25
25
  [common_1.ErrorType.CONFLICT]: 409,
26
+ [common_1.ErrorType.INVALID_REQUEST]: 400,
27
+ [common_1.ErrorType.IO_ERROR]: 400,
28
+ [common_1.ErrorType.PERMISSION_DENIED]: 403,
29
+ [common_1.ErrorType.INTERNAL_ERROR]: 500,
26
30
  };
27
31
  class ServerError extends common_1.AppError {
28
32
  getStatusCode() {
@@ -6,5 +6,5 @@ import { Route } from '@shadow-library/app';
6
6
  * Declaring the constants
7
7
  */
8
8
  export function ApiOperation(options) {
9
- return Route({ operation: options });
9
+ return Route({ operation: options }, { arrayStrategy: 'replace' });
10
10
  }
@@ -20,6 +20,10 @@ const ERROR_STATUS_CODES = {
20
20
  [ErrorType.UNAUTHORIZED]: 403,
21
21
  [ErrorType.VALIDATION_ERROR]: 422,
22
22
  [ErrorType.CONFLICT]: 409,
23
+ [ErrorType.INVALID_REQUEST]: 400,
24
+ [ErrorType.IO_ERROR]: 400,
25
+ [ErrorType.PERMISSION_DENIED]: 403,
26
+ [ErrorType.INTERNAL_ERROR]: 500,
23
27
  };
24
28
  export class ServerError extends AppError {
25
29
  getStatusCode() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shadow-library/fastify",
3
3
  "type": "module",
4
- "version": "1.6.2",
4
+ "version": "1.6.3",
5
5
  "sideEffects": false,
6
6
  "description": "A Fastify wrapper featuring decorator-based routing, middleware and error handling",
7
7
  "repository": {
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@fastify/view": "^10.0.0",
30
- "@shadow-library/app": "^1.0.11",
31
- "@shadow-library/class-schema": "^0.1.3",
32
- "@shadow-library/common": "^1.0.22",
30
+ "@shadow-library/app": "^1.3.1",
31
+ "@shadow-library/class-schema": "^0.2.0",
32
+ "@shadow-library/common": "^1.5.2",
33
33
  "reflect-metadata": "^0.2.2"
34
34
  },
35
35
  "peerDependenciesMeta": {