@vulkano/core 1.5.3 → 1.5.5
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/libs/Jwt.js +8 -1
- package/libs/Paginate.js +36 -3
- package/package.json +7 -7
- package/responses/vsr.js +1 -1
package/libs/Jwt.js
CHANGED
|
@@ -119,10 +119,12 @@ module.exports = {
|
|
|
119
119
|
decode(token, customKey) {
|
|
120
120
|
|
|
121
121
|
const {
|
|
122
|
-
key
|
|
122
|
+
key,
|
|
123
|
+
expiration: allowExpiration
|
|
123
124
|
} = this.getConfig();
|
|
124
125
|
|
|
125
126
|
let data = {};
|
|
127
|
+
|
|
126
128
|
try {
|
|
127
129
|
|
|
128
130
|
const payload = jwtSimple.decode(token, customKey || key);
|
|
@@ -143,6 +145,11 @@ module.exports = {
|
|
|
143
145
|
return null;
|
|
144
146
|
}
|
|
145
147
|
|
|
148
|
+
// Ignore expiration field
|
|
149
|
+
if (allowExpiration === false) {
|
|
150
|
+
return data;
|
|
151
|
+
}
|
|
152
|
+
|
|
146
153
|
// Expiration must be required
|
|
147
154
|
if (!expiration) {
|
|
148
155
|
console.log('JWT Without expiration date');
|
package/libs/Paginate.js
CHANGED
|
@@ -2,6 +2,39 @@ const _ = require('underscore');
|
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
|
|
5
|
+
accentToRegex(_text) {
|
|
6
|
+
|
|
7
|
+
const ACCENT_STRINGS = 'ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËẼÌÍÎÏĨÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëẽìíîïĩðñòóôõöøùúûüýÿ';
|
|
8
|
+
const NO_ACCENT_STRINGS = 'SOZsozYYuAAAAAAACEEEEEIIIIIDNOOOOOOUUUUYsaaaaaaaceeeeeiiiiionoooooouuuuyy';
|
|
9
|
+
|
|
10
|
+
const from = ACCENT_STRINGS.split('');
|
|
11
|
+
const to = NO_ACCENT_STRINGS.split('');
|
|
12
|
+
const result = [];
|
|
13
|
+
let text = _text;
|
|
14
|
+
|
|
15
|
+
to.forEach( (letter, key) => {
|
|
16
|
+
const exist = result.indexOf(letter);
|
|
17
|
+
if (exist >= 0) {
|
|
18
|
+
result[exist] += from[key];
|
|
19
|
+
} else {
|
|
20
|
+
result.push(letter);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
result.forEach( (rg, key) => {
|
|
25
|
+
const regex = new RegExp(`[${rg}]`);
|
|
26
|
+
text = text.replace(regex, `_${key}_`);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
result.forEach( (rg, key) => {
|
|
30
|
+
const regex = new RegExp(`_${key}_`);
|
|
31
|
+
text = text.replace(regex, `[${rg}]`);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return text;
|
|
35
|
+
|
|
36
|
+
},
|
|
37
|
+
|
|
5
38
|
serializeQuery(_props, _query) {
|
|
6
39
|
|
|
7
40
|
const props = typeof _props === 'object'
|
|
@@ -45,11 +78,11 @@ module.exports = {
|
|
|
45
78
|
if (type === String) {
|
|
46
79
|
|
|
47
80
|
if (searchType === 'startwith' || searchType === 'start') {
|
|
48
|
-
row[item] = new RegExp(['^',
|
|
81
|
+
row[item] = new RegExp(['^', this.accentToRegex(search), '*.'].join(''), 'i');
|
|
49
82
|
} else if (searchType === 'endwith' || searchType === 'end') {
|
|
50
|
-
row[item] = new RegExp(['.*',
|
|
83
|
+
row[item] = new RegExp(['.*', this.accentToRegex(search)].join(''), 'i');
|
|
51
84
|
} else {
|
|
52
|
-
row[item] = new RegExp(['.*',
|
|
85
|
+
row[item] = new RegExp(['.*', this.accentToRegex(search), '*.'].join(''), 'i');
|
|
53
86
|
}
|
|
54
87
|
|
|
55
88
|
} else if (type === Number) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulkano/core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "A MVC framework using Express 4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vulkano Team",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"compression": "^1.7.4",
|
|
37
37
|
"connect-timeout": "^1.9.0",
|
|
38
38
|
"cookie-parser": "^1.4.6",
|
|
39
|
-
"cron": "^3.1.
|
|
39
|
+
"cron": "^3.1.7",
|
|
40
40
|
"deepmerge": "^4.3.1",
|
|
41
41
|
"dotenv": "^16.4.5",
|
|
42
42
|
"express": "^4.19.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"fs": "^0.0.1-security",
|
|
47
47
|
"fs-extra": "^11.2.0",
|
|
48
48
|
"helmet": "^7.1.0",
|
|
49
|
-
"i18next": "^23.
|
|
49
|
+
"i18next": "^23.11.4",
|
|
50
50
|
"include-all": "^4.0.3",
|
|
51
51
|
"jwt-simple": "^0.5.6",
|
|
52
52
|
"moment": "^2.30.1",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"yargs": "^17.7.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@babel/core": "^7.24.
|
|
71
|
-
"@babel/eslint-parser": "^7.24.
|
|
70
|
+
"@babel/core": "^7.24.5",
|
|
71
|
+
"@babel/eslint-parser": "^7.24.5",
|
|
72
72
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
73
73
|
"@babel/plugin-syntax-jsx": "^7.24.1",
|
|
74
|
-
"@babel/preset-env": "^7.24.
|
|
74
|
+
"@babel/preset-env": "^7.24.5",
|
|
75
75
|
"@babel/preset-react": "^7.24.1",
|
|
76
76
|
"@babel/preset-stage-1": "^7.8.3",
|
|
77
77
|
"eslint": "^8.57.0",
|
|
@@ -79,6 +79,6 @@
|
|
|
79
79
|
"eslint-plugin-import": "^2.29.1",
|
|
80
80
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
81
81
|
"eslint-plugin-react": "^7.34.1",
|
|
82
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
82
|
+
"eslint-plugin-react-hooks": "^4.6.2"
|
|
83
83
|
}
|
|
84
84
|
}
|