@point-hub/papi 0.2.6 → 0.3.1

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -2
  2. package/package.json +9 -7
package/lib/index.js CHANGED
@@ -59782,13 +59782,16 @@ var httpStatus = [
59782
59782
 
59783
59783
  // node_modules/@point-hub/express-error-handler/lib/api-error.js
59784
59784
  class ApiError extends BaseError {
59785
- constructor(codeStatus, errors) {
59785
+ constructor(codeStatus, message, errors) {
59786
59786
  const status = find(codeStatus);
59787
59787
  if (!status) {
59788
59788
  throw new Error(`Error codeStatus "${codeStatus}" not found`);
59789
59789
  }
59790
59790
  const error = status;
59791
- if (errors) {
59791
+ if (message) {
59792
+ error.message = message;
59793
+ }
59794
+ if (error.code === 422 && errors) {
59792
59795
  error.errors = errors;
59793
59796
  }
59794
59797
  super(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@point-hub/papi",
3
- "version": "0.2.6",
3
+ "version": "0.3.1",
4
4
  "description": "Point API Framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -21,6 +21,8 @@
21
21
  "bun",
22
22
  "papi",
23
23
  "express",
24
+ "nodejs",
25
+ "rest",
24
26
  "api",
25
27
  "boilerplate"
26
28
  ],
@@ -34,12 +36,12 @@
34
36
  "@types/compression": "^1.7.5",
35
37
  "@types/cors": "^2.8.17",
36
38
  "@types/express": "^4.17.21",
37
- "@types/node": "^20.11.26",
39
+ "@types/node": "^20.11.29",
38
40
  "@types/shelljs": "^0.8.15",
39
41
  "@types/validatorjs": "^3.15.5",
40
- "@typescript-eslint/eslint-plugin": "^7.2.0",
41
- "@typescript-eslint/parser": "^7.2.0",
42
- "bun-types": "^1.0.30",
42
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
43
+ "@typescript-eslint/parser": "^7.3.1",
44
+ "bun-types": "^1.0.33",
43
45
  "cross-env": "^7.0.3",
44
46
  "eslint": "^8.57.0",
45
47
  "eslint-config-prettier": "^9.1.0",
@@ -51,10 +53,10 @@
51
53
  },
52
54
  "dependencies": {
53
55
  "@point-hub/express-cli": "^0.2.2",
54
- "@point-hub/express-error-handler": "^0.1.3",
56
+ "@point-hub/express-error-handler": "^0.2.0",
55
57
  "@point-hub/express-factory": "^1.1.4",
56
58
  "@point-hub/express-utils": "^0.2.4",
57
- "date-fns": "^3.4.0",
59
+ "date-fns": "^3.6.0",
58
60
  "mongodb": "^6.5.0",
59
61
  "shelljs": "^0.8.5"
60
62
  },