@underpostnet/underpost 2.7.94 → 2.8.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/.vscode/settings.json +5 -1
- package/bin/deploy.js +41 -16
- package/bin/index.js +4 -5
- package/bin/util.js +18 -0
- package/conf.js +8 -1
- package/docker-compose.yml +1 -1
- package/package.json +11 -8
- package/src/api/user/user.model.js +1 -1
- package/src/api/user/user.service.js +22 -21
- package/src/client/components/core/Account.js +144 -124
- package/src/client/components/core/Auth.js +94 -1
- package/src/client/components/core/Docs.js +2 -1
- package/src/client/components/core/JoyStick.js +8 -5
- package/src/client/components/core/LogIn.js +8 -1
- package/src/client/components/core/LogOut.js +3 -2
- package/src/client/components/core/Modal.js +14 -9
- package/src/client/components/core/Panel.js +17 -3
- package/src/client/components/core/PanelForm.js +8 -1
- package/src/client/components/core/SignUp.js +3 -3
- package/src/client/components/core/SocketIo.js +2 -0
- package/src/client/components/core/Translate.js +14 -0
- package/src/client/components/core/Validator.js +9 -2
- package/src/client/components/core/VanillaJs.js +4 -1
- package/src/client/components/default/LogInDefault.js +2 -23
- package/src/client/components/default/LogOutDefault.js +3 -5
- package/src/client/public/default/plantuml/client-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-schema.svg +1 -1
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
- package/src/client/services/core/core.service.js +2 -0
- package/src/client/services/user/user.service.js +9 -1
- package/src/client/ssr/body/CacheControl.js +2 -1
- package/src/client/ssr/body/DefaultSplashScreen.js +3 -3
- package/src/client/ssr/offline/Maintenance.js +63 -0
- package/src/client/sw/default.sw.js +31 -5
- package/src/index.js +8 -0
- package/src/server/client-build.js +27 -25
- package/src/server/client-icons.js +13 -3
- package/src/server/conf.js +5 -4
- package/src/server/logger.js +8 -6
- package/src/server/network.js +4 -0
- package/src/server/ssl.js +2 -2
- package/src/server/valkey.js +126 -0
|
@@ -35,6 +35,8 @@ const SocketIo = {
|
|
|
35
35
|
// forceNew: true,
|
|
36
36
|
// reconnectionAttempts: 'Infinity',
|
|
37
37
|
// timeout: 10000,
|
|
38
|
+
// withCredentials: true,
|
|
39
|
+
// autoConnect: 5000,
|
|
38
40
|
transports: ['websocket', 'polling', 'flashsocket'],
|
|
39
41
|
};
|
|
40
42
|
// logger.error(`connect options:`, JSON.stringify(connectOptions, null, 4));
|
|
@@ -460,6 +460,20 @@ const TranslateCore = {
|
|
|
460
460
|
es: 'Carga completada',
|
|
461
461
|
};
|
|
462
462
|
Translate.Data['play'] = { es: 'Jugar', en: 'Play' };
|
|
463
|
+
Translate.Data['pause'] = { es: 'Pausar', en: 'Pause' };
|
|
464
|
+
Translate.Data['stop'] = { es: 'Parar', en: 'Stop' };
|
|
465
|
+
Translate.Data['previous'] = { es: 'Anterior', en: 'Previous' };
|
|
466
|
+
Translate.Data['next'] = { es: 'Siguiente', en: 'Next' };
|
|
467
|
+
Translate.Data['buy'] = { es: 'comprar', en: 'Buy' };
|
|
468
|
+
Translate.Data['sell'] = { es: 'Vender', en: 'sell' };
|
|
469
|
+
|
|
470
|
+
Translate.Data['monday'] = { es: 'Lunes', en: 'Monday' };
|
|
471
|
+
Translate.Data['tuesday'] = { es: 'Martes', en: 'Tuesday' };
|
|
472
|
+
Translate.Data['wednesday'] = { es: 'Miércoles', en: 'Wednesday' };
|
|
473
|
+
Translate.Data['thursday'] = { es: 'Jueves', en: 'Thursday' };
|
|
474
|
+
Translate.Data['friday'] = { es: 'Viernes', en: 'Friday' };
|
|
475
|
+
Translate.Data['saturday'] = { es: 'Sábado', en: 'Saturday' };
|
|
476
|
+
Translate.Data['sunday'] = { es: 'Domingo', en: 'Sunday' };
|
|
463
477
|
},
|
|
464
478
|
};
|
|
465
479
|
|
|
@@ -88,11 +88,18 @@ const Validator = {
|
|
|
88
88
|
|
|
89
89
|
return async () => {
|
|
90
90
|
let errorMessage = '';
|
|
91
|
+
const errorKeys = [];
|
|
92
|
+
const successKeys = [];
|
|
91
93
|
for (const validatorKey of Object.keys(validatorFunction)) {
|
|
92
94
|
const result = await validatorFunction[validatorKey]();
|
|
93
|
-
if (result && result.errorMessage)
|
|
95
|
+
if (result && result.errorMessage) {
|
|
96
|
+
errorMessage += result.errorMessage;
|
|
97
|
+
errorKeys.push(validatorKey);
|
|
98
|
+
} else {
|
|
99
|
+
successKeys.push(validatorKey);
|
|
100
|
+
}
|
|
94
101
|
}
|
|
95
|
-
return { errorMessage };
|
|
102
|
+
return { errorMessage, errorKeys, successKeys };
|
|
96
103
|
};
|
|
97
104
|
},
|
|
98
105
|
};
|
|
@@ -148,7 +148,10 @@ const pasteData = () => new Promise((resolve) => navigator.clipboard.readText().
|
|
|
148
148
|
* history.
|
|
149
149
|
* @memberof VanillaJS
|
|
150
150
|
*/
|
|
151
|
-
const setPath = (path = '/', stateStorage = {}, title = '') =>
|
|
151
|
+
const setPath = (path = '/', stateStorage = {}, title = '') => {
|
|
152
|
+
if (window.location.pathname === path || window.location.pathname === `${path}/`) return;
|
|
153
|
+
return history.pushState(stateStorage, title, path);
|
|
154
|
+
};
|
|
152
155
|
|
|
153
156
|
/**
|
|
154
157
|
* The function `getQueryParams` extracts query parameters from the current URL and returns them as an
|
|
@@ -7,35 +7,14 @@ import { ElementsDefault } from './ElementsDefault.js';
|
|
|
7
7
|
const LogInDefault = async function () {
|
|
8
8
|
LogIn.Event['LogInDefault'] = async (options) => {
|
|
9
9
|
const { token, user } = options;
|
|
10
|
-
|
|
11
|
-
if (token) {
|
|
12
|
-
localStorage.setItem('jwt', token);
|
|
13
|
-
Auth.setToken(token);
|
|
14
|
-
}
|
|
15
10
|
ElementsDefault.Data.user.main.model.user = user;
|
|
16
|
-
|
|
17
11
|
s(`.main-btn-log-in`).style.display = 'none';
|
|
18
12
|
s(`.main-btn-sign-up`).style.display = 'none';
|
|
19
13
|
s(`.main-btn-log-out`).style.display = null;
|
|
20
14
|
s(`.main-btn-account`).style.display = null;
|
|
21
|
-
|
|
22
|
-
if (s(`.modal-log-in`)) s(`.btn-close-modal-log-in`).click();
|
|
23
|
-
if (s(`.modal-sign-up`)) s(`.btn-close-modal-sign-up`).click();
|
|
24
15
|
};
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
Auth.setToken(token);
|
|
28
|
-
const result = await UserService.get({ id: 'auth' });
|
|
29
|
-
if (result.status === 'success' && result.data) {
|
|
30
|
-
const user = result.data;
|
|
31
|
-
await LogIn.Trigger({
|
|
32
|
-
token,
|
|
33
|
-
user,
|
|
34
|
-
});
|
|
35
|
-
} else localStorage.removeItem('jwt');
|
|
36
|
-
} else {
|
|
37
|
-
// Anon
|
|
38
|
-
}
|
|
16
|
+
const { user } = await Auth.sessionIn();
|
|
17
|
+
ElementsDefault.Data.user.main.model.user = user;
|
|
39
18
|
};
|
|
40
19
|
|
|
41
20
|
export { LogInDefault };
|
|
@@ -6,8 +6,9 @@ import { s } from '../core/VanillaJs.js';
|
|
|
6
6
|
import { ElementsDefault } from './ElementsDefault.js';
|
|
7
7
|
|
|
8
8
|
const LogOutDefault = async function () {
|
|
9
|
-
LogOut.Event['LogOutDefault'] = async () => {
|
|
10
|
-
|
|
9
|
+
LogOut.Event['LogOutDefault'] = async (result = { user: { _id: '' } }) => {
|
|
10
|
+
ElementsDefault.Data.user.main.model.user = result.user;
|
|
11
|
+
|
|
11
12
|
s(`.main-btn-log-out`).style.display = 'none';
|
|
12
13
|
s(`.main-btn-account`).style.display = 'none';
|
|
13
14
|
s(`.main-btn-log-in`).style.display = null;
|
|
@@ -15,9 +16,6 @@ const LogOutDefault = async function () {
|
|
|
15
16
|
if (s(`.modal-log-out`)) s(`.btn-close-modal-log-out`).click();
|
|
16
17
|
if (s(`.modal-account`)) s(`.btn-close-modal-account`).click();
|
|
17
18
|
|
|
18
|
-
ElementsDefault.Data.user.main.model.user = { _id: '' };
|
|
19
|
-
Auth.deleteToken();
|
|
20
|
-
|
|
21
19
|
NotificationManager.Push({
|
|
22
20
|
html: Translate.Render(`success-logout`),
|
|
23
21
|
status: 'success',
|