underpost 3.2.5 → 3.2.8
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/.github/workflows/release.cd.yml +1 -2
- package/CHANGELOG.md +251 -1
- package/CLI-HELP.md +26 -13
- package/Dockerfile +0 -4
- package/README.md +3 -3
- package/bin/build.js +13 -3
- package/bin/deploy.js +570 -1
- package/bin/file.js +5 -0
- package/conf.js +11 -2
- package/jsconfig.json +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -6
- package/manifests/deployment/dd-test-development/deployment.yaml +136 -66
- package/manifests/deployment/dd-test-development/proxy.yaml +41 -5
- package/package.json +20 -11
- package/src/api/core/core.controller.js +10 -10
- package/src/api/core/core.service.js +10 -10
- package/src/api/default/default.controller.js +10 -10
- package/src/api/default/default.service.js +10 -10
- package/src/api/document/document.controller.js +12 -12
- package/src/api/document/document.model.js +10 -16
- package/src/api/file/file.controller.js +8 -8
- package/src/api/file/file.model.js +10 -10
- package/src/api/file/file.service.js +36 -36
- package/src/api/test/test.controller.js +8 -8
- package/src/api/test/test.service.js +8 -8
- package/src/api/user/guest.service.js +99 -0
- package/src/api/user/user.controller.js +6 -6
- package/src/api/user/user.model.js +8 -13
- package/src/api/user/user.service.js +3 -20
- package/src/cli/deploy.js +33 -30
- package/src/cli/fs.js +62 -5
- package/src/cli/image.js +43 -1
- package/src/cli/index.js +5 -1
- package/src/cli/release.js +57 -1
- package/src/cli/repository.js +35 -3
- package/src/cli/run.js +300 -35
- package/src/cli/ssh.js +1 -1
- package/src/cli/static.js +43 -115
- package/src/client/Default.index.js +21 -33
- package/src/client/components/core/404.js +4 -4
- package/src/client/components/core/500.js +4 -4
- package/src/client/components/core/Account.js +73 -60
- package/src/client/components/core/AgGrid.js +23 -33
- package/src/client/components/core/Alert.js +12 -13
- package/src/client/components/core/AppStore.js +1 -1
- package/src/client/components/core/Auth.js +20 -32
- package/src/client/components/core/Badge.js +7 -13
- package/src/client/components/core/BtnIcon.js +15 -17
- package/src/client/components/core/CalendarCore.js +42 -63
- package/src/client/components/core/Chat.js +13 -15
- package/src/client/components/core/ClientEvents.js +87 -0
- package/src/client/components/core/ColorPaletteElement.js +309 -0
- package/src/client/components/core/Content.js +17 -14
- package/src/client/components/core/Css.js +15 -71
- package/src/client/components/core/CssCore.js +12 -16
- package/src/client/components/core/D3Chart.js +4 -4
- package/src/client/components/core/Docs.js +60 -59
- package/src/client/components/core/DropDown.js +69 -91
- package/src/client/components/core/EventBus.js +92 -0
- package/src/client/components/core/EventsUI.js +14 -17
- package/src/client/components/core/FileExplorer.js +102 -234
- package/src/client/components/core/FullScreen.js +47 -75
- package/src/client/components/core/Input.js +24 -69
- package/src/client/components/core/Keyboard.js +25 -18
- package/src/client/components/core/KeyboardAvoidance.js +145 -0
- package/src/client/components/core/LoadingAnimation.js +25 -31
- package/src/client/components/core/LogIn.js +41 -41
- package/src/client/components/core/LogOut.js +23 -14
- package/src/client/components/core/Modal.js +397 -176
- package/src/client/components/core/NotificationManager.js +14 -18
- package/src/client/components/core/Panel.js +54 -50
- package/src/client/components/core/PanelForm.js +25 -125
- package/src/client/components/core/Polyhedron.js +110 -214
- package/src/client/components/core/PublicProfile.js +39 -32
- package/src/client/components/core/Recover.js +52 -48
- package/src/client/components/core/Responsive.js +88 -32
- package/src/client/components/core/RichText.js +9 -18
- package/src/client/components/core/Router.js +24 -3
- package/src/client/components/core/SearchBox.js +37 -37
- package/src/client/components/core/SignUp.js +39 -30
- package/src/client/components/core/SocketIo.js +31 -2
- package/src/client/components/core/SocketIoHandler.js +6 -6
- package/src/client/components/core/ToggleSwitch.js +8 -20
- package/src/client/components/core/ToolTip.js +5 -17
- package/src/client/components/core/Translate.js +56 -59
- package/src/client/components/core/Validator.js +26 -16
- package/src/client/components/core/Wallet.js +15 -26
- package/src/client/components/core/Worker.js +140 -25
- package/src/client/components/core/windowGetDimensions.js +7 -7
- package/src/client/components/default/{MenuDefault.js → AppShellDefault.js} +87 -87
- package/src/client/components/default/CssDefault.js +12 -12
- package/src/client/components/default/LogInDefault.js +6 -4
- package/src/client/components/default/LogOutDefault.js +6 -4
- package/src/client/components/default/RouterDefault.js +47 -0
- package/src/client/components/default/SettingsDefault.js +4 -4
- package/src/client/components/default/SignUpDefault.js +6 -4
- package/src/client/components/default/TranslateDefault.js +3 -3
- package/src/client/services/core/core.service.js +17 -49
- package/src/client/services/default/default.management.js +139 -242
- package/src/client/services/default/default.service.js +10 -16
- package/src/client/services/document/document.service.js +14 -19
- package/src/client/services/file/file.service.js +8 -13
- package/src/client/services/test/test.service.js +8 -13
- package/src/client/services/user/guest.service.js +79 -0
- package/src/client/services/user/user.management.js +5 -5
- package/src/client/services/user/user.service.js +14 -20
- package/src/client/ssr/body/404.js +3 -3
- package/src/client/ssr/body/500.js +3 -3
- package/src/client/ssr/body/CacheControl.js +5 -2
- package/src/client/ssr/body/DefaultSplashScreen.js +19 -12
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +19 -20
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +15 -16
- package/src/client/ssr/offline/Maintenance.js +12 -11
- package/src/client/ssr/offline/NoNetworkConnection.js +3 -3
- package/src/client/ssr/pages/Test.js +2 -2
- package/src/client/sw/core.sw.js +212 -0
- package/src/index.js +1 -1
- package/src/runtime/express/Dockerfile +4 -4
- package/src/runtime/lampp/Dockerfile +8 -7
- package/src/runtime/wp/Dockerfile +11 -17
- package/src/server/client-build-docs.js +45 -46
- package/src/server/client-build.js +334 -60
- package/src/server/client-formatted.js +47 -16
- package/src/server/conf.js +5 -4
- package/src/server/ipfs-client.js +232 -91
- package/src/server/process.js +13 -27
- package/src/server/start.js +6 -3
- package/src/server/valkey.js +134 -235
- package/tsconfig.docs.json +15 -0
- package/typedoc.json +20 -0
- package/jsdoc.json +0 -52
- package/src/client/components/core/ColorPalette.js +0 -5267
- package/src/client/components/core/JoyStick.js +0 -80
- package/src/client/components/default/RoutesDefault.js +0 -49
- package/src/client/sw/default.sw.js +0 -127
- package/src/client/sw/template.sw.js +0 -84
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Auth } from '../../components/core/Auth.js';
|
|
2
2
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
3
|
import { getApiBaseUrl, headersFactory, payloadFactory, buildQueryUrl } from '../core/core.service.js';
|
|
4
|
-
|
|
5
4
|
const logger = loggerFactory(import.meta);
|
|
6
|
-
|
|
7
5
|
logger.info('Load service');
|
|
8
|
-
|
|
9
6
|
const endpoint = 'default';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
post: (options = { id: '', body: {} }) =>
|
|
7
|
+
class DefaultService {
|
|
8
|
+
static post = (options = { id: '', body: {} }) =>
|
|
13
9
|
new Promise((resolve, reject) =>
|
|
14
10
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
15
11
|
method: 'POST',
|
|
@@ -28,8 +24,8 @@ const DefaultService = {
|
|
|
28
24
|
logger.error(error);
|
|
29
25
|
return reject(error);
|
|
30
26
|
}),
|
|
31
|
-
)
|
|
32
|
-
put
|
|
27
|
+
);
|
|
28
|
+
static put = (options = { id: '', body: {} }) =>
|
|
33
29
|
new Promise((resolve, reject) =>
|
|
34
30
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
35
31
|
method: 'PUT',
|
|
@@ -48,8 +44,8 @@ const DefaultService = {
|
|
|
48
44
|
logger.error(error);
|
|
49
45
|
return reject(error);
|
|
50
46
|
}),
|
|
51
|
-
)
|
|
52
|
-
get
|
|
47
|
+
);
|
|
48
|
+
static get = (options = {}) => {
|
|
53
49
|
const { id, page, limit, filterModel, sortModel, sort, asc, order } = options;
|
|
54
50
|
const url = buildQueryUrl(getApiBaseUrl({ id, endpoint }), {
|
|
55
51
|
page,
|
|
@@ -60,7 +56,6 @@ const DefaultService = {
|
|
|
60
56
|
asc,
|
|
61
57
|
order,
|
|
62
58
|
});
|
|
63
|
-
|
|
64
59
|
return new Promise((resolve, reject) =>
|
|
65
60
|
fetch(url.toString(), {
|
|
66
61
|
method: 'GET',
|
|
@@ -79,8 +74,8 @@ const DefaultService = {
|
|
|
79
74
|
return reject(error);
|
|
80
75
|
}),
|
|
81
76
|
);
|
|
82
|
-
}
|
|
83
|
-
delete
|
|
77
|
+
};
|
|
78
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
84
79
|
new Promise((resolve, reject) =>
|
|
85
80
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
86
81
|
method: 'DELETE',
|
|
@@ -99,7 +94,6 @@ const DefaultService = {
|
|
|
99
94
|
logger.error(error);
|
|
100
95
|
return reject(error);
|
|
101
96
|
}),
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
|
|
97
|
+
);
|
|
98
|
+
}
|
|
105
99
|
export { DefaultService };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Auth } from '../../components/core/Auth.js';
|
|
2
2
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
3
|
import { getApiBaseUrl, headersFactory, payloadFactory } from '../core/core.service.js';
|
|
4
|
-
|
|
5
4
|
const logger = loggerFactory(import.meta);
|
|
6
|
-
|
|
7
5
|
logger.info('Load service');
|
|
8
|
-
|
|
9
6
|
const endpoint = 'document';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
post: (options = { id: '', body: {} }) =>
|
|
7
|
+
class DocumentService {
|
|
8
|
+
static post = (options = { id: '', body: {} }) =>
|
|
13
9
|
new Promise((resolve, reject) =>
|
|
14
10
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
15
11
|
method: 'POST',
|
|
@@ -28,8 +24,8 @@ const DocumentService = {
|
|
|
28
24
|
logger.error(error);
|
|
29
25
|
return reject(error);
|
|
30
26
|
}),
|
|
31
|
-
)
|
|
32
|
-
get
|
|
27
|
+
);
|
|
28
|
+
static get = (options = { id: '' }) =>
|
|
33
29
|
new Promise((resolve, reject) => {
|
|
34
30
|
const url = new URL(getApiBaseUrl({ id: options.id, endpoint }));
|
|
35
31
|
if (options.params) {
|
|
@@ -51,8 +47,8 @@ const DocumentService = {
|
|
|
51
47
|
logger.error(error);
|
|
52
48
|
return reject(error);
|
|
53
49
|
});
|
|
54
|
-
})
|
|
55
|
-
delete
|
|
50
|
+
});
|
|
51
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
56
52
|
new Promise((resolve, reject) =>
|
|
57
53
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
58
54
|
method: 'DELETE',
|
|
@@ -71,8 +67,8 @@ const DocumentService = {
|
|
|
71
67
|
logger.error(error);
|
|
72
68
|
return reject(error);
|
|
73
69
|
}),
|
|
74
|
-
)
|
|
75
|
-
put
|
|
70
|
+
);
|
|
71
|
+
static put = (options = { id: '', body: {} }) =>
|
|
76
72
|
new Promise((resolve, reject) =>
|
|
77
73
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
78
74
|
method: 'PUT',
|
|
@@ -91,8 +87,8 @@ const DocumentService = {
|
|
|
91
87
|
logger.error(error);
|
|
92
88
|
return reject(error);
|
|
93
89
|
}),
|
|
94
|
-
)
|
|
95
|
-
patch
|
|
90
|
+
);
|
|
91
|
+
static patch = (options = { id: '', action: '' }) =>
|
|
96
92
|
new Promise((resolve, reject) =>
|
|
97
93
|
fetch(getApiBaseUrl({ id: `${options.id}/${options.action}`, endpoint }), {
|
|
98
94
|
method: 'PATCH',
|
|
@@ -110,8 +106,8 @@ const DocumentService = {
|
|
|
110
106
|
logger.error(error);
|
|
111
107
|
return reject(error);
|
|
112
108
|
}),
|
|
113
|
-
)
|
|
114
|
-
high
|
|
109
|
+
);
|
|
110
|
+
static high = (options = { params: {} }) =>
|
|
115
111
|
new Promise((resolve, reject) => {
|
|
116
112
|
const url = new URL(getApiBaseUrl({ id: 'public/high', endpoint }));
|
|
117
113
|
if (options.params) {
|
|
@@ -133,7 +129,6 @@ const DocumentService = {
|
|
|
133
129
|
logger.error(error);
|
|
134
130
|
return reject(error);
|
|
135
131
|
});
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
|
|
132
|
+
});
|
|
133
|
+
}
|
|
139
134
|
export { DocumentService };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Auth } from '../../components/core/Auth.js';
|
|
2
2
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
3
|
import { getApiBaseUrl, headersFactory, payloadFactory } from '../core/core.service.js';
|
|
4
|
-
|
|
5
4
|
const logger = loggerFactory(import.meta);
|
|
6
|
-
|
|
7
5
|
logger.info('Load service');
|
|
8
|
-
|
|
9
6
|
const endpoint = 'file';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
post: (options = { id: '', body: {}, headerId: 'file' }) =>
|
|
7
|
+
class FileService {
|
|
8
|
+
static post = (options = { id: '', body: {}, headerId: 'file' }) =>
|
|
13
9
|
new Promise((resolve, reject) =>
|
|
14
10
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
15
11
|
method: 'POST',
|
|
@@ -27,8 +23,8 @@ const FileService = {
|
|
|
27
23
|
logger.error(error);
|
|
28
24
|
return reject(error);
|
|
29
25
|
}),
|
|
30
|
-
)
|
|
31
|
-
get
|
|
26
|
+
);
|
|
27
|
+
static get = (options = { id: '' }) =>
|
|
32
28
|
new Promise((resolve, reject) => {
|
|
33
29
|
// Handle blob endpoint - fetch binary data directly
|
|
34
30
|
if (options.id && options.id.startsWith('blob/')) {
|
|
@@ -73,8 +69,8 @@ const FileService = {
|
|
|
73
69
|
return reject(error);
|
|
74
70
|
});
|
|
75
71
|
}
|
|
76
|
-
})
|
|
77
|
-
delete
|
|
72
|
+
});
|
|
73
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
78
74
|
new Promise((resolve, reject) =>
|
|
79
75
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
80
76
|
method: 'DELETE',
|
|
@@ -93,7 +89,6 @@ const FileService = {
|
|
|
93
89
|
logger.error(error);
|
|
94
90
|
return reject(error);
|
|
95
91
|
}),
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
92
|
+
);
|
|
93
|
+
}
|
|
99
94
|
export { FileService };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Auth } from '../../components/core/Auth.js';
|
|
2
2
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
3
|
import { getApiBaseUrl, headersFactory, payloadFactory } from '../core/core.service.js';
|
|
4
|
-
|
|
5
4
|
const logger = loggerFactory(import.meta);
|
|
6
|
-
|
|
7
5
|
logger.info('Load service');
|
|
8
|
-
|
|
9
6
|
const endpoint = 'test';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
post: (options = { id: '', body: {} }) =>
|
|
7
|
+
class TestService {
|
|
8
|
+
static post = (options = { id: '', body: {} }) =>
|
|
13
9
|
new Promise((resolve, reject) =>
|
|
14
10
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
15
11
|
method: 'POST',
|
|
@@ -28,8 +24,8 @@ const TestService = {
|
|
|
28
24
|
logger.error(error);
|
|
29
25
|
return reject(error);
|
|
30
26
|
}),
|
|
31
|
-
)
|
|
32
|
-
get
|
|
27
|
+
);
|
|
28
|
+
static get = (options = { id: '' }) =>
|
|
33
29
|
new Promise((resolve, reject) =>
|
|
34
30
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
35
31
|
method: 'GET',
|
|
@@ -47,8 +43,8 @@ const TestService = {
|
|
|
47
43
|
logger.error(error);
|
|
48
44
|
return reject(error);
|
|
49
45
|
}),
|
|
50
|
-
)
|
|
51
|
-
delete
|
|
46
|
+
);
|
|
47
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
52
48
|
new Promise((resolve, reject) =>
|
|
53
49
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
54
50
|
method: 'DELETE',
|
|
@@ -67,7 +63,6 @@ const TestService = {
|
|
|
67
63
|
logger.error(error);
|
|
68
64
|
return reject(error);
|
|
69
65
|
}),
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
|
|
66
|
+
);
|
|
67
|
+
}
|
|
73
68
|
export { TestService };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import Dexie from 'dexie';
|
|
2
|
+
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
|
+
|
|
4
|
+
const logger = loggerFactory(import.meta);
|
|
5
|
+
|
|
6
|
+
const USER_TOKEN_KEY = 'jwt';
|
|
7
|
+
const GUEST_TOKEN_KEY = 'jwt.g';
|
|
8
|
+
|
|
9
|
+
class SessionMetaDb extends Dexie {
|
|
10
|
+
constructor() {
|
|
11
|
+
super('session-meta-db');
|
|
12
|
+
this.version(1).stores({
|
|
13
|
+
meta: '&key,value,updatedAt',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const db = new SessionMetaDb();
|
|
19
|
+
|
|
20
|
+
class GuestService {
|
|
21
|
+
static setUserToken(value = '') {
|
|
22
|
+
if (value) localStorage.setItem(USER_TOKEN_KEY, value);
|
|
23
|
+
else localStorage.removeItem(USER_TOKEN_KEY);
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static getUserToken() {
|
|
28
|
+
return localStorage.getItem(USER_TOKEN_KEY) || '';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static clearUserToken() {
|
|
32
|
+
localStorage.removeItem(USER_TOKEN_KEY);
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static setGuestToken(value = '') {
|
|
37
|
+
if (value) localStorage.setItem(GUEST_TOKEN_KEY, value);
|
|
38
|
+
else localStorage.removeItem(GUEST_TOKEN_KEY);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static getGuestToken() {
|
|
43
|
+
return localStorage.getItem(GUEST_TOKEN_KEY) || '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static clearGuestToken() {
|
|
47
|
+
localStorage.removeItem(GUEST_TOKEN_KEY);
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static getAuthorizationToken() {
|
|
52
|
+
return this.getUserToken() || this.getGuestToken() || '';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static getAuthorizationHeader() {
|
|
56
|
+
const token = this.getAuthorizationToken();
|
|
57
|
+
return token ? `Bearer ${token}` : '';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static async setMeta(key, value) {
|
|
61
|
+
try {
|
|
62
|
+
await db.meta.put({ key, value, updatedAt: Date.now() });
|
|
63
|
+
} catch (error) {
|
|
64
|
+
logger.warn('session meta write failed', { key, error: error?.message });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static async getMeta(key) {
|
|
69
|
+
try {
|
|
70
|
+
const row = await db.meta.get(key);
|
|
71
|
+
return row ? row.value : null;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
logger.warn('session meta read failed', { key, error: error?.message });
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { GuestService };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DefaultManagement } from '../default/default.management.js';
|
|
2
2
|
import { UserService } from './user.service.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class UserManagement {
|
|
5
|
+
static instance = async ({ appStore }) => {
|
|
6
6
|
const user = appStore.Data.user.main.model.user;
|
|
7
7
|
const { role } = user;
|
|
8
|
-
return await DefaultManagement.
|
|
8
|
+
return await DefaultManagement.instance({
|
|
9
9
|
idModal: 'modal-user-management',
|
|
10
10
|
serviceId: 'user-management',
|
|
11
11
|
entity: 'user',
|
|
@@ -46,6 +46,6 @@ const UserManagement = {
|
|
|
46
46
|
defaultColKeyFocus: 'username',
|
|
47
47
|
ServiceProvider: UserService,
|
|
48
48
|
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
51
|
export { UserManagement };
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { Auth } from '../../components/core/Auth.js';
|
|
2
2
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
3
|
import { getApiBaseUrl, headersFactory, payloadFactory, buildQueryUrl } from '../core/core.service.js';
|
|
4
|
-
|
|
5
4
|
const logger = loggerFactory(import.meta);
|
|
6
|
-
|
|
7
5
|
logger.info('Load service');
|
|
8
|
-
|
|
9
6
|
const endpoint = 'user';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
default: {
|
|
7
|
+
class UserMock {
|
|
8
|
+
static default = {
|
|
13
9
|
username: 'guest',
|
|
14
10
|
email: `guest@${location.hostname}`,
|
|
15
11
|
role: 'guest',
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
post: (options = { id: '', body: {} }) =>
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
class UserService {
|
|
15
|
+
static post = (options = { id: '', body: {} }) =>
|
|
21
16
|
new Promise((resolve, reject) =>
|
|
22
17
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
23
18
|
method: 'POST',
|
|
@@ -36,8 +31,8 @@ const UserService = {
|
|
|
36
31
|
logger.error(error);
|
|
37
32
|
return reject(error);
|
|
38
33
|
}),
|
|
39
|
-
)
|
|
40
|
-
get
|
|
34
|
+
);
|
|
35
|
+
static get = (options = {}) => {
|
|
41
36
|
const { id = 'all', page, limit, filterModel, sortModel, sort, asc, order } = options;
|
|
42
37
|
const url = buildQueryUrl(getApiBaseUrl({ id, endpoint }), {
|
|
43
38
|
page,
|
|
@@ -66,8 +61,8 @@ const UserService = {
|
|
|
66
61
|
return reject(error);
|
|
67
62
|
}),
|
|
68
63
|
);
|
|
69
|
-
}
|
|
70
|
-
delete
|
|
64
|
+
};
|
|
65
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
71
66
|
new Promise((resolve, reject) =>
|
|
72
67
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
73
68
|
method: 'DELETE',
|
|
@@ -86,8 +81,8 @@ const UserService = {
|
|
|
86
81
|
logger.error(error);
|
|
87
82
|
return reject(error);
|
|
88
83
|
}),
|
|
89
|
-
)
|
|
90
|
-
put
|
|
84
|
+
);
|
|
85
|
+
static put = (options = { id: '', body: {}, headerId: '' }) =>
|
|
91
86
|
new Promise((resolve, reject) =>
|
|
92
87
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
93
88
|
method: 'PUT',
|
|
@@ -106,7 +101,6 @@ const UserService = {
|
|
|
106
101
|
logger.error(error);
|
|
107
102
|
return reject(error);
|
|
108
103
|
}),
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
|
|
104
|
+
);
|
|
105
|
+
}
|
|
112
106
|
export { UserService, UserMock };
|
|
@@ -23,7 +23,7 @@ const main = () => {
|
|
|
23
23
|
es: 'Volver a <br> la pagina principal',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
instance: function (id) {
|
|
27
27
|
return this.Data[id][getLang()] ? this.Data[id][getLang()] : this.Data[id]['en'];
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -58,9 +58,9 @@ const main = () => {
|
|
|
58
58
|
<br />
|
|
59
59
|
<span class="bold">404</span>
|
|
60
60
|
<br />
|
|
61
|
-
<br />${Translate.
|
|
61
|
+
<br />${Translate.instance('page-not-found')} <br />
|
|
62
62
|
<br />
|
|
63
|
-
<a target="_top" href="${location.origin}">${Translate.
|
|
63
|
+
<a target="_top" href="${location.origin}">${Translate.instance('back')}</a>
|
|
64
64
|
</div>`,
|
|
65
65
|
);
|
|
66
66
|
};
|
|
@@ -23,7 +23,7 @@ const main = () => {
|
|
|
23
23
|
es: 'Volver a <br> la pagina principal',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
instance: function (id) {
|
|
27
27
|
return this.Data[id][getLang()] ? this.Data[id][getLang()] : this.Data[id]['en'];
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -57,9 +57,9 @@ const main = () => {
|
|
|
57
57
|
<br />
|
|
58
58
|
<span class="bold">500</span>
|
|
59
59
|
<br />
|
|
60
|
-
<br />${Translate.
|
|
60
|
+
<br />${Translate.instance('page-broken')} <br />
|
|
61
61
|
<br />
|
|
62
|
-
<a target="_top" href="${location.origin}">${Translate.
|
|
62
|
+
<a target="_top" href="${location.origin}">${Translate.instance('back')}</a>
|
|
63
63
|
</div>`,
|
|
64
64
|
);
|
|
65
65
|
};
|
|
@@ -78,8 +78,11 @@ SrrComponent = ({ ttiLoadTimeLimit, version }) => {
|
|
|
78
78
|
(selector) => html`
|
|
79
79
|
<style>
|
|
80
80
|
${selector} {
|
|
81
|
-
text-shadow:
|
|
82
|
-
|
|
81
|
+
text-shadow:
|
|
82
|
+
${px}px -${px}px ${px}px ${color},
|
|
83
|
+
-${px}px ${px}px ${px}px ${color},
|
|
84
|
+
-${px}px -${px}px ${px}px ${color},
|
|
85
|
+
${px}px ${px}px ${px}px ${color};
|
|
83
86
|
}
|
|
84
87
|
</style>
|
|
85
88
|
`,
|
|
@@ -6,12 +6,12 @@ SrrComponent = ({ backgroundImage, metadata }) => html`
|
|
|
6
6
|
}
|
|
7
7
|
</style>`
|
|
8
8
|
: metadata?.themeColor
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
? html`<style class="style-ssr-background-image">
|
|
10
|
+
.ssr-background-image {
|
|
11
|
+
background: ${metadata.themeColor};
|
|
12
|
+
}
|
|
13
|
+
</style>`
|
|
14
|
+
: ''}
|
|
15
15
|
|
|
16
16
|
<style>
|
|
17
17
|
.ssr-top-bar {
|
|
@@ -61,13 +61,19 @@ SrrComponent = ({ backgroundImage, metadata }) => html`
|
|
|
61
61
|
}
|
|
62
62
|
@keyframes l16 {
|
|
63
63
|
0% {
|
|
64
|
-
background-position:
|
|
64
|
+
background-position:
|
|
65
|
+
-150% 0,
|
|
66
|
+
-150% 0;
|
|
65
67
|
}
|
|
66
68
|
66% {
|
|
67
|
-
background-position:
|
|
69
|
+
background-position:
|
|
70
|
+
250% 0,
|
|
71
|
+
-150% 0;
|
|
68
72
|
}
|
|
69
73
|
100% {
|
|
70
|
-
background-position:
|
|
74
|
+
background-position:
|
|
75
|
+
250% 0,
|
|
76
|
+
250% 0;
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
</style>
|
|
@@ -77,9 +83,10 @@ SrrComponent = ({ backgroundImage, metadata }) => html`
|
|
|
77
83
|
${new Array(6)
|
|
78
84
|
.fill()
|
|
79
85
|
.map(
|
|
80
|
-
(v, i) =>
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
(v, i) =>
|
|
87
|
+
html`<div class="ssr-abs ssr-btn ssr-btn-${i}">
|
|
88
|
+
<div class="ssr-shimmer"></div>
|
|
89
|
+
</div>`,
|
|
83
90
|
)
|
|
84
91
|
.join('')}
|
|
85
92
|
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
SrrComponent = (render = { style: {}, renderStyle: () => '' }, options) =>
|
|
2
|
-
|
|
3
|
-
<div style="${render.renderStyle('
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</p>
|
|
16
|
-
</div>
|
|
17
|
-
<div style="${render.renderStyle('.footer')}">
|
|
18
|
-
<p>{{COMPANY}}</p>
|
|
19
|
-
</div>
|
|
1
|
+
SrrComponent = (render = { style: {}, renderStyle: () => '' }, options) => html`
|
|
2
|
+
<div style="${render.renderStyle('body')}">
|
|
3
|
+
<div style="${render.renderStyle('.container')}">
|
|
4
|
+
<h1 style="${render.renderStyle('h1')}">{{H1}}</h1>
|
|
5
|
+
<p style="${render.renderStyle('p')}">{{P1}}</p>
|
|
6
|
+
<p style="${render.renderStyle('p')}">
|
|
7
|
+
<a href="{{RECOVER_WEB_URL}}" style="${render.renderStyle('button')}"
|
|
8
|
+
><img
|
|
9
|
+
src="http${options.transport.secure ? 's' : ''}://${options.host}${options.path === '/'
|
|
10
|
+
? ''
|
|
11
|
+
: options.path}/api/user/recover/{{TOKEN}}"
|
|
12
|
+
/><br />{{RECOVER_BTN_LABEL}}</a
|
|
13
|
+
>
|
|
14
|
+
</p>
|
|
20
15
|
</div>
|
|
21
|
-
|
|
16
|
+
<div style="${render.renderStyle('.footer')}">
|
|
17
|
+
<p>{{COMPANY}}</p>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
SrrComponent = (render = { style: {}, renderStyle: () => '' }, options) =>
|
|
2
|
-
|
|
3
|
-
<div style="${render.renderStyle('
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
<div style="${render.renderStyle('.footer')}">
|
|
14
|
-
<p>{{COMPANY}}</p>
|
|
15
|
-
</div>
|
|
1
|
+
SrrComponent = (render = { style: {}, renderStyle: () => '' }, options) => html`
|
|
2
|
+
<div style="${render.renderStyle('body')}">
|
|
3
|
+
<div style="${render.renderStyle('.container')}">
|
|
4
|
+
<h1 style="${render.renderStyle('h1')}">{{H1}}</h1>
|
|
5
|
+
<p style="${render.renderStyle('p')}">{{P1}}</p>
|
|
6
|
+
<img
|
|
7
|
+
src="http${options.transport.secure ? 's' : ''}://${options.host}${options.path === '/'
|
|
8
|
+
? ''
|
|
9
|
+
: options.path}/api/user/mailer/{{TOKEN}}"
|
|
10
|
+
/>
|
|
16
11
|
</div>
|
|
17
|
-
|
|
12
|
+
<div style="${render.renderStyle('.footer')}">
|
|
13
|
+
<p>{{COMPANY}}</p>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
@@ -15,7 +15,7 @@ const main = () => {
|
|
|
15
15
|
es: 'El servidor está en mantenimiento <br> volveremos pronto.',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
instance: function (id) {
|
|
19
19
|
return this.Data[id][getLang()] ? this.Data[id][getLang()] : this.Data[id]['en'];
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -47,17 +47,18 @@ const main = () => {
|
|
|
47
47
|
<div class="abs center" style="top: 45%">
|
|
48
48
|
${icon}
|
|
49
49
|
<br />
|
|
50
|
-
<br />${Translate.
|
|
50
|
+
<br />${Translate.instance('server-maintenance')}
|
|
51
51
|
</div>`,
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
SrrComponent = () =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
SrrComponent = () =>
|
|
56
|
+
html`<script>
|
|
57
|
+
{
|
|
58
|
+
const s = ${s};
|
|
59
|
+
const append = ${append};
|
|
60
|
+
const getLang = ${getLang};
|
|
61
|
+
const main = ${main};
|
|
62
|
+
window.onload = main;
|
|
63
|
+
}
|
|
64
|
+
</script>`;
|