@vulkano/core 1.15.6 → 1.17.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.
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@vulkano/core",
3
- "version": "1.15.6",
3
+ "version": "1.17.0",
4
4
  "description": "A MVC framework using Express 4",
5
5
  "license": "MIT",
6
6
  "author": "Vulkano Team",
7
7
  "engines": {
8
- "node": "^18 || ^20 || ^22"
8
+ "node": ">=20"
9
9
  },
10
10
  "main": "app.js",
11
11
  "scripts": {
12
- "test": "echo \"Error: no test specified\" && exit 1"
12
+ "test": "jest",
13
+ "test:watch": "jest --watch",
14
+ "test:coverage": "jest --coverage"
13
15
  },
14
16
  "preferGlobal": true,
15
17
  "homepage": "https://github.com/vulkanojs/vulkano-core",
@@ -28,44 +30,30 @@
28
30
  "url": "https://github.com/vulkanojs/vulkano-core/issues"
29
31
  },
30
32
  "dependencies": {
31
- "@socket.io/mongo-adapter": "^0.3.2",
33
+ "@socket.io/mongo-adapter": "^0.4.0",
32
34
  "@socket.io/redis-adapter": "^8.3.0",
33
- "axios": "^1.8.1",
34
- "bluebird": "^3.7.2",
35
- "body-parser": "^1.20.3",
36
35
  "compression": "^1.8.0",
37
36
  "connect-timeout": "^1.9.0",
38
37
  "cookie-parser": "^1.4.7",
39
38
  "cron": "^4.1.0",
40
- "deepmerge": "^4.3.1",
41
- "dotenv": "^16.4.7",
39
+ "dotenv": "^17.4.2",
42
40
  "express": "^4.21.2",
43
41
  "express-jwt": "^8.5.1",
44
42
  "express-session": "^1.18.1",
45
- "express-useragent": "^1.0.15",
43
+ "express-useragent": "^2.1.0",
46
44
  "frameguard": "^4.0.0",
47
- "fs": "^0.0.1-security",
48
- "fs-extra": "^11.3.0",
49
45
  "helmet": "^8.0.0",
50
- "i18next": "^24.2.2",
46
+ "i18next": "^26.0.8",
51
47
  "include-all": "^4.0.3",
52
48
  "jwt-simple": "^0.5.6",
53
- "moment": "^2.30.1",
54
- "moment-timezone": "^0.5.47",
55
49
  "mongoose": "^8.12.1",
56
- "mongoose-paginate-v2": "^1.9.0",
50
+ "mongoose-paginate-v2": "^1.9.4",
57
51
  "morgan": "^1.10.0",
58
- "multer": "^1.4.5-lts.1",
59
- "nodemon": "^3.1.9",
52
+ "multer": "^2.1.1",
60
53
  "nunjucks": "^3.2.4",
61
- "path": "^0.12.7",
62
- "promise.prototype.finally": "^3.1.8",
63
- "redis": "^4.7.0",
54
+ "redis": "^5.12.1",
64
55
  "socket.io": "^4.8.1",
65
- "socket.io-adapter": "^2.5.5",
66
- "socket.io-client": "4.8.1",
67
- "underscore": "^1.13.7",
68
- "yargs": "^17.7.2"
56
+ "undici": "^6.25.0"
69
57
  },
70
58
  "devDependencies": {
71
59
  "@babel/core": "^7.26.9",
@@ -81,6 +69,8 @@
81
69
  "eslint-plugin-import": "^2.31.0",
82
70
  "eslint-plugin-jsx-a11y": "^6.10.2",
83
71
  "eslint-plugin-react": "^7.37.4",
84
- "eslint-plugin-react-hooks": "^4.6.2"
72
+ "eslint-plugin-react-hooks": "^4.6.2",
73
+ "jest": "^29.7.0",
74
+ "nodemon": "^3.1.14"
85
75
  }
86
76
  }
@@ -0,0 +1,3 @@
1
+ # Ignore all except this file
2
+ *
3
+ !.gitignore
package/responses/vsr.js CHANGED
@@ -2,8 +2,6 @@
2
2
  * VULKANO STANDARD RESPONSE (VSR)
3
3
  */
4
4
 
5
- const Promise = require('bluebird');
6
-
7
5
  module.exports = function VSRPromise(promiseToRun, httpStatusCode) {
8
6
 
9
7
  const {
@@ -21,14 +19,14 @@ module.exports = function VSRPromise(promiseToRun, httpStatusCode) {
21
19
  statusCode: code
22
20
  };
23
21
 
24
- if (!promiseToRun || !promiseToRun.then) {
22
+ if (!promiseToRun || typeof promiseToRun.then !== 'function') {
25
23
 
26
- // Log error to console
27
- console.log('The response is not a promise');
24
+ console.error('[VSR] The response is not a Promise. Got:', typeof promiseToRun);
28
25
  return res.status(500).jsonp({
29
26
  success: false,
27
+ statusCode: 500,
30
28
  error: {
31
- detail: 'The response is not a promise.'
29
+ detail: 'Internal error: controller must return a Promise.'
32
30
  }
33
31
  });
34
32
 
@@ -68,8 +66,8 @@ module.exports = function VSRPromise(promiseToRun, httpStatusCode) {
68
66
  console.log(e);
69
67
  }
70
68
 
71
- const message = e.message !== undefined && typeof e.message === 'object' ? e.message : e;
72
- code = message.statusCode || e.statusCode || 400;
69
+ const message = (e.message !== undefined && typeof e.message !== 'object') ? e : (e.message || e);
70
+ code = e.statusCode || message.statusCode || 400;
73
71
 
74
72
  // Output
75
73
  output.success = false;
@@ -78,10 +76,14 @@ module.exports = function VSRPromise(promiseToRun, httpStatusCode) {
78
76
  errorCode: message.code || '001',
79
77
  errorName: message.name || 'BadRequest',
80
78
  detail: message.message || message.error || message.invalidAttributes || message.toString(),
81
- output: message
79
+ ...(app.PRODUCTION ? {} : { output: message })
82
80
  };
83
81
 
84
82
  })
85
- .finally( () => res.status(code).jsonp(output) );
83
+ .finally( () => {
84
+ if (!res.headersSent) {
85
+ res.status(code).jsonp(output);
86
+ }
87
+ });
86
88
 
87
89
  };
package/.eslintignore DELETED
@@ -1,8 +0,0 @@
1
- node_modules
2
-
3
- test
4
- bundle
5
- tasks
6
- docs
7
- public
8
- setup
package/.gitattributes DELETED
@@ -1,108 +0,0 @@
1
- # From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
2
-
3
- # Handle line endings automatically for files detected as text
4
- # and leave all files detected as binary untouched.
5
- * text=auto
6
-
7
- #
8
- # The above will handle all files NOT found below
9
- #
10
-
11
- #
12
- ## These files are text and should be normalized (Convert crlf => lf)
13
- #
14
-
15
- # source code
16
- *.php text
17
- *.css text
18
- *.sass text
19
- *.scss text
20
- *.less text
21
- *.styl text
22
- *.js text eol=lf
23
- *.jsx text eol=lf
24
- *.coffee text
25
- *.json text
26
- *.htm text
27
- *.html text
28
- *.xml text
29
- *.svg text
30
- *.txt text
31
- *.ini text
32
- *.inc text
33
- *.pl text
34
- *.rb text
35
- *.py text
36
- *.scm text
37
- *.sql text
38
- *.sh text
39
- *.bat text
40
-
41
- # templates
42
- *.ejs text
43
- *.hbt text
44
- *.jade text
45
- *.haml text
46
- *.hbs text
47
- *.dot text
48
- *.tmpl text
49
- *.phtml text
50
-
51
- # server config
52
- .htaccess text
53
-
54
- # git config
55
- .gitattributes text
56
- .gitignore text
57
- .gitconfig text
58
-
59
- # code analysis config
60
- .jshintrc text
61
- .jscsrc text
62
- .jshintignore text
63
- .csslintrc text
64
- .eslintrc text
65
-
66
- # misc config
67
- *.yaml text
68
- *.yml text
69
- .editorconfig text
70
-
71
- # build config
72
- *.npmignore text
73
- *.bowerrc text
74
-
75
- # Heroku
76
- Procfile text
77
- .slugignore text
78
-
79
- # Documentation
80
- *.md text
81
- LICENSE text
82
- AUTHORS text
83
-
84
-
85
- #
86
- ## These files are binary and should be left untouched
87
- #
88
-
89
- # (binary is a macro for -text -diff)
90
- *.png binary
91
- *.jpg binary
92
- *.jpeg binary
93
- *.gif binary
94
- *.ico binary
95
- *.mov binary
96
- *.mp4 binary
97
- *.mp3 binary
98
- *.flv binary
99
- *.fla binary
100
- *.swf binary
101
- *.gz binary
102
- *.zip binary
103
- *.7z binary
104
- *.ttf binary
105
- *.eot binary
106
- *.woff binary
107
- *.pyc binary
108
- *.pdf binary
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v22
package/bun.lockb DELETED
Binary file