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
|
@@ -4,19 +4,14 @@
|
|
|
4
4
|
* @module src/client/services/core/core.service.js
|
|
5
5
|
* @namespace CoreServiceClient
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import { Auth } from '../../components/core/Auth.js';
|
|
9
8
|
import { loggerFactory } from '../../components/core/Logger.js';
|
|
10
9
|
import { getProxyPath } from '../../components/core/Router.js';
|
|
11
|
-
|
|
10
|
+
import { GuestService } from '../user/guest.service.js';
|
|
12
11
|
const logger = loggerFactory(import.meta);
|
|
13
|
-
|
|
14
12
|
logger.info('Load service');
|
|
15
|
-
|
|
16
13
|
const endpoint = 'core';
|
|
17
|
-
|
|
18
14
|
// https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
|
19
|
-
|
|
20
15
|
/**
|
|
21
16
|
* Returns the normalized proxy path from renderPayload (always trailing `/`).
|
|
22
17
|
* Falls back to `null` when no apiBaseProxyPath is set.
|
|
@@ -29,7 +24,6 @@ const getApiBaseProxyPath = () =>
|
|
|
29
24
|
? window.renderPayload.apiBaseProxyPath
|
|
30
25
|
: `${window.renderPayload.apiBaseProxyPath}/`
|
|
31
26
|
: null;
|
|
32
|
-
|
|
33
27
|
/**
|
|
34
28
|
* Gets the base host for API requests.
|
|
35
29
|
* Uses the apiBaseHost from renderPayload if available, otherwise falls back to location.host.
|
|
@@ -37,7 +31,6 @@ const getApiBaseProxyPath = () =>
|
|
|
37
31
|
* @return {string} The base host string.
|
|
38
32
|
*/
|
|
39
33
|
const getBaseHost = () => (window.renderPayload?.apiBaseHost ? window.renderPayload.apiBaseHost : location.host);
|
|
40
|
-
|
|
41
34
|
/**
|
|
42
35
|
* Gets the base path for API requests.
|
|
43
36
|
* Constructs the path using proxyPath and apiBasePath from renderPayload or defaults.
|
|
@@ -47,10 +40,7 @@ const getBaseHost = () => (window.renderPayload?.apiBaseHost ? window.renderPayl
|
|
|
47
40
|
* @return {string} The constructed API base path.
|
|
48
41
|
*/
|
|
49
42
|
const getApiBasePath = (options) =>
|
|
50
|
-
`${
|
|
51
|
-
options?.proxyPath ? `/${options.proxyPath}/` : getApiBaseProxyPath() || getProxyPath()
|
|
52
|
-
}${window.renderPayload?.apiBasePath ? window.renderPayload.apiBasePath : 'api'}/`;
|
|
53
|
-
|
|
43
|
+
`${options?.proxyPath ? `/${options.proxyPath}/` : getApiBaseProxyPath() || getProxyPath()}${window.renderPayload?.apiBasePath ? window.renderPayload.apiBasePath : 'api'}/`;
|
|
54
44
|
/**
|
|
55
45
|
* Constructs the full API base URL for making requests.
|
|
56
46
|
* Combines protocol, host, base path, endpoint, and optional ID.
|
|
@@ -62,10 +52,7 @@ const getApiBasePath = (options) =>
|
|
|
62
52
|
* @return {string} The full API base URL.
|
|
63
53
|
*/
|
|
64
54
|
const getApiBaseUrl = (options = { id: '', endpoint: '', proxyPath: '' }) =>
|
|
65
|
-
`${location.protocol}//${getBaseHost()}${getApiBasePath(options)}${options?.endpoint ? options.endpoint : ''}${
|
|
66
|
-
options?.id ? `/${options.id}` : ''
|
|
67
|
-
}`;
|
|
68
|
-
|
|
55
|
+
`${location.protocol}//${getBaseHost()}${getApiBasePath(options)}${options?.endpoint ? options.endpoint : ''}${options?.id ? `/${options.id}` : ''}`;
|
|
69
56
|
/**
|
|
70
57
|
* Gets the base path for WebSocket connections.
|
|
71
58
|
* Constructs the socket.io path using the proxy path.
|
|
@@ -77,7 +64,6 @@ const getWsBasePath = () => {
|
|
|
77
64
|
if (proxyPath) return proxyPath !== '/' ? `${proxyPath}socket.io/` : '/socket.io/';
|
|
78
65
|
return getProxyPath() !== '/' ? `${getProxyPath()}socket.io/` : '/socket.io/';
|
|
79
66
|
};
|
|
80
|
-
|
|
81
67
|
/**
|
|
82
68
|
* Constructs the full WebSocket base URL for connections.
|
|
83
69
|
* Uses wss: for HTTPS and ws: for HTTP protocols.
|
|
@@ -89,10 +75,7 @@ const getWsBasePath = () => {
|
|
|
89
75
|
* @return {string} The full WebSocket base URL.
|
|
90
76
|
*/
|
|
91
77
|
const getWsBaseUrl = (options = { id: '', endpoint: '', wsBasePath: '' }) =>
|
|
92
|
-
`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${getBaseHost()}${
|
|
93
|
-
options?.wsBasePath !== undefined ? options.wsBasePath : getWsBasePath()
|
|
94
|
-
}${options?.endpoint ? options.endpoint : ''}${options?.id ? `/${options.id}` : ''}`;
|
|
95
|
-
|
|
78
|
+
`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${getBaseHost()}${options?.wsBasePath !== undefined ? options.wsBasePath : getWsBasePath()}${options?.endpoint ? options.endpoint : ''}${options?.id ? `/${options.id}` : ''}`;
|
|
96
79
|
/**
|
|
97
80
|
* Creates HTTP headers for API requests.
|
|
98
81
|
* Includes Authorization header with JWT token and Content-Type based on headerId.
|
|
@@ -102,18 +85,16 @@ const getWsBaseUrl = (options = { id: '', endpoint: '', wsBasePath: '' }) =>
|
|
|
102
85
|
*/
|
|
103
86
|
const headersFactory = (headerId = '') => {
|
|
104
87
|
const headers = {
|
|
105
|
-
Authorization: Auth.getJWT(),
|
|
88
|
+
Authorization: GuestService.getAuthorizationHeader() || Auth.getJWT(),
|
|
106
89
|
};
|
|
107
90
|
switch (headerId) {
|
|
108
91
|
case 'file':
|
|
109
92
|
return headers;
|
|
110
|
-
|
|
111
93
|
default:
|
|
112
94
|
headers['Content-Type'] = 'application/json';
|
|
113
95
|
return headers;
|
|
114
96
|
}
|
|
115
97
|
};
|
|
116
|
-
|
|
117
98
|
/**
|
|
118
99
|
* Prepares the request body payload for API requests.
|
|
119
100
|
* Returns FormData as-is, otherwise stringifies the body as JSON.
|
|
@@ -125,7 +106,6 @@ const payloadFactory = (body) => {
|
|
|
125
106
|
if (body instanceof FormData) return body;
|
|
126
107
|
return JSON.stringify(body);
|
|
127
108
|
};
|
|
128
|
-
|
|
129
109
|
/**
|
|
130
110
|
* Builds a URL with query parameters for pagination, filtering, and sorting.
|
|
131
111
|
* Supports AG Grid filterModel/sortModel as well as legacy simple sort params.
|
|
@@ -144,11 +124,9 @@ const payloadFactory = (body) => {
|
|
|
144
124
|
const buildQueryUrl = (baseUrl, options = {}) => {
|
|
145
125
|
const url = new URL(baseUrl);
|
|
146
126
|
const { page, limit, filterModel, sortModel, sort, asc, order } = options;
|
|
147
|
-
|
|
148
127
|
// Add pagination params
|
|
149
128
|
if (page !== undefined) url.searchParams.set('page', page);
|
|
150
129
|
if (limit !== undefined) url.searchParams.set('limit', limit);
|
|
151
|
-
|
|
152
130
|
// Add filter model (AG Grid format) - send as JSON string
|
|
153
131
|
if (filterModel) {
|
|
154
132
|
const filterStr = typeof filterModel === 'string' ? filterModel : JSON.stringify(filterModel);
|
|
@@ -156,7 +134,6 @@ const buildQueryUrl = (baseUrl, options = {}) => {
|
|
|
156
134
|
url.searchParams.set('filterModel', filterStr);
|
|
157
135
|
}
|
|
158
136
|
}
|
|
159
|
-
|
|
160
137
|
// Add sort model (AG Grid format) - send as JSON string
|
|
161
138
|
if (sortModel) {
|
|
162
139
|
const sortStr = typeof sortModel === 'string' ? sortModel : JSON.stringify(sortModel);
|
|
@@ -164,20 +141,17 @@ const buildQueryUrl = (baseUrl, options = {}) => {
|
|
|
164
141
|
url.searchParams.set('sortModel', sortStr);
|
|
165
142
|
}
|
|
166
143
|
}
|
|
167
|
-
|
|
168
144
|
// Add simple sort params for backwards compatibility
|
|
169
145
|
if (sort) url.searchParams.set('sort', sort);
|
|
170
146
|
if (asc !== undefined) url.searchParams.set('asc', asc);
|
|
171
147
|
if (order) url.searchParams.set('order', order);
|
|
172
|
-
|
|
173
148
|
return url;
|
|
174
149
|
};
|
|
175
|
-
|
|
176
150
|
/**
|
|
177
151
|
* Core Service object providing CRUD operations for the core API endpoint.
|
|
178
152
|
* @memberof CoreServiceClient
|
|
179
153
|
*/
|
|
180
|
-
|
|
154
|
+
class CoreService {
|
|
181
155
|
/**
|
|
182
156
|
* Performs a raw GET request to fetch content as text.
|
|
183
157
|
* @memberof CoreServiceClient.CoreService
|
|
@@ -185,7 +159,7 @@ const CoreService = {
|
|
|
185
159
|
* @param {string} [options.url=''] - The full URL to fetch.
|
|
186
160
|
* @return {Promise<string>} A promise that resolves with the response text.
|
|
187
161
|
*/
|
|
188
|
-
getRaw
|
|
162
|
+
static getRaw = (options = { url: '' }) =>
|
|
189
163
|
new Promise((resolve, reject) =>
|
|
190
164
|
fetch(options.url, {
|
|
191
165
|
method: 'GET',
|
|
@@ -201,8 +175,7 @@ const CoreService = {
|
|
|
201
175
|
logger.error(error);
|
|
202
176
|
return reject(error);
|
|
203
177
|
}),
|
|
204
|
-
)
|
|
205
|
-
|
|
178
|
+
);
|
|
206
179
|
/**
|
|
207
180
|
* Performs a POST request to create a new resource.
|
|
208
181
|
* @memberof CoreServiceClient.CoreService
|
|
@@ -211,7 +184,7 @@ const CoreService = {
|
|
|
211
184
|
* @param {Object} [options.body={}] - The request body payload.
|
|
212
185
|
* @return {Promise<Object>} A promise that resolves with the JSON response.
|
|
213
186
|
*/
|
|
214
|
-
post
|
|
187
|
+
static post = (options = { id: '', body: {} }) =>
|
|
215
188
|
new Promise((resolve, reject) =>
|
|
216
189
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
217
190
|
method: 'POST',
|
|
@@ -230,8 +203,7 @@ const CoreService = {
|
|
|
230
203
|
logger.error(error);
|
|
231
204
|
return reject(error);
|
|
232
205
|
}),
|
|
233
|
-
)
|
|
234
|
-
|
|
206
|
+
);
|
|
235
207
|
/**
|
|
236
208
|
* Performs a PUT request to update an existing resource.
|
|
237
209
|
* @memberof CoreServiceClient.CoreService
|
|
@@ -240,7 +212,7 @@ const CoreService = {
|
|
|
240
212
|
* @param {Object} [options.body={}] - The request body payload with updated data.
|
|
241
213
|
* @return {Promise<Object>} A promise that resolves with the JSON response.
|
|
242
214
|
*/
|
|
243
|
-
put
|
|
215
|
+
static put = (options = { id: '', body: {} }) =>
|
|
244
216
|
new Promise((resolve, reject) =>
|
|
245
217
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
246
218
|
method: 'PUT',
|
|
@@ -259,8 +231,7 @@ const CoreService = {
|
|
|
259
231
|
logger.error(error);
|
|
260
232
|
return reject(error);
|
|
261
233
|
}),
|
|
262
|
-
)
|
|
263
|
-
|
|
234
|
+
);
|
|
264
235
|
/**
|
|
265
236
|
* Performs a GET request to retrieve a resource.
|
|
266
237
|
* @memberof CoreServiceClient.CoreService
|
|
@@ -269,7 +240,7 @@ const CoreService = {
|
|
|
269
240
|
* @param {Object} [options.body={}] - Unused, kept for API consistency.
|
|
270
241
|
* @return {Promise<Object>} A promise that resolves with the JSON response.
|
|
271
242
|
*/
|
|
272
|
-
get
|
|
243
|
+
static get = (options = { id: '', body: {} }) =>
|
|
273
244
|
new Promise((resolve, reject) =>
|
|
274
245
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
275
246
|
method: 'GET',
|
|
@@ -287,8 +258,7 @@ const CoreService = {
|
|
|
287
258
|
logger.error(error);
|
|
288
259
|
return reject(error);
|
|
289
260
|
}),
|
|
290
|
-
)
|
|
291
|
-
|
|
261
|
+
);
|
|
292
262
|
/**
|
|
293
263
|
* Performs a DELETE request to remove a resource.
|
|
294
264
|
* @memberof CoreServiceClient.CoreService
|
|
@@ -297,7 +267,7 @@ const CoreService = {
|
|
|
297
267
|
* @param {Object} [options.body={}] - Optional request body payload.
|
|
298
268
|
* @return {Promise<Object>} A promise that resolves with the JSON response.
|
|
299
269
|
*/
|
|
300
|
-
delete
|
|
270
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
301
271
|
new Promise((resolve, reject) =>
|
|
302
272
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
303
273
|
method: 'DELETE',
|
|
@@ -316,16 +286,14 @@ const CoreService = {
|
|
|
316
286
|
logger.error(error);
|
|
317
287
|
return reject(error);
|
|
318
288
|
}),
|
|
319
|
-
)
|
|
320
|
-
}
|
|
321
|
-
|
|
289
|
+
);
|
|
290
|
+
}
|
|
322
291
|
/**
|
|
323
292
|
* Alias for getApiBaseUrl function.
|
|
324
293
|
* @memberof CoreServiceClient
|
|
325
294
|
* @type {Function}
|
|
326
295
|
*/
|
|
327
296
|
const ApiBase = getApiBaseUrl;
|
|
328
|
-
|
|
329
297
|
export {
|
|
330
298
|
CoreService,
|
|
331
299
|
headersFactory,
|