@vulkano/core 1.15.6 → 1.16.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.
- package/README.md +318 -51
- package/app.js +5 -7
- package/bootstrap/express.js +1 -1
- package/bootstrap/server.js +44 -15
- package/controllers/ScaffoldController.js +18 -0
- package/controllers/controllers.js +3 -3
- package/database/mongodb.js +6 -12
- package/database/scaffold.js +1 -4
- package/libs/ApiClient.js +44 -72
- package/libs/Filter.js +5 -5
- package/libs/Jwt.js +3 -4
- package/libs/Merge.js +109 -0
- package/libs/Paginate.js +49 -38
- package/libs/VSError.js +0 -2
- package/libs/i18n.js +0 -16
- package/package.json +16 -26
- package/public/.gitignore +3 -0
- package/responses/vsr.js +11 -9
- package/.eslintignore +0 -8
- package/.gitattributes +0 -108
- package/.nvmrc +0 -1
- package/bun.lockb +0 -0
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 ||
|
|
22
|
+
if (!promiseToRun || typeof promiseToRun.then !== 'function') {
|
|
25
23
|
|
|
26
|
-
|
|
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: '
|
|
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
|
|
72
|
-
code =
|
|
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;
|
|
@@ -82,6 +80,10 @@ module.exports = function VSRPromise(promiseToRun, httpStatusCode) {
|
|
|
82
80
|
};
|
|
83
81
|
|
|
84
82
|
})
|
|
85
|
-
.finally( () =>
|
|
83
|
+
.finally( () => {
|
|
84
|
+
if (!res.headersSent) {
|
|
85
|
+
res.status(code).jsonp(output);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
86
88
|
|
|
87
89
|
};
|
package/.eslintignore
DELETED
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
|