underpost 2.8.64 → 2.8.67
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/extensions.json +3 -2
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +24 -4
- package/README.md +39 -2
- package/bin/deploy.js +1205 -131
- package/bin/file.js +8 -0
- package/bin/index.js +1 -233
- package/cli.md +451 -0
- package/docker-compose.yml +1 -1
- package/jsdoc.json +1 -1
- package/manifests/calico-custom-resources.yaml +25 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +1 -1
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/postgresql/service.yaml +10 -0
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/valkey/statefulset.yaml +6 -4
- package/package.json +3 -9
- package/src/api/user/user.service.js +13 -10
- package/src/cli/cluster.js +113 -11
- package/src/cli/db.js +18 -8
- package/src/cli/deploy.js +157 -58
- package/src/cli/fs.js +14 -3
- package/src/cli/image.js +0 -68
- package/src/cli/index.js +312 -0
- package/src/cli/monitor.js +170 -26
- package/src/cli/repository.js +5 -2
- package/src/client/components/core/Account.js +3 -3
- package/src/client/components/core/CalendarCore.js +0 -1
- package/src/client/components/core/Css.js +0 -1
- package/src/client/components/core/CssCore.js +2 -0
- package/src/client/components/core/EventsUI.js +1 -1
- package/src/client/components/core/JoyStick.js +2 -2
- package/src/client/components/core/Modal.js +1 -0
- package/src/client/components/core/RichText.js +1 -11
- package/src/index.js +9 -8
- package/src/mailer/MailerProvider.js +3 -0
- package/src/server/client-build.js +13 -0
- package/src/server/conf.js +48 -0
- package/src/server/dns.js +47 -17
- package/src/server/json-schema.js +77 -0
- package/src/server/peer.js +2 -2
- package/src/server/proxy.js +4 -4
- package/src/server/runtime.js +24 -9
- package/src/server/start.js +122 -0
- package/src/server/valkey.js +25 -11
package/src/server/valkey.js
CHANGED
|
@@ -5,12 +5,24 @@ import { loggerFactory } from './logger.js';
|
|
|
5
5
|
|
|
6
6
|
const logger = loggerFactory(import.meta);
|
|
7
7
|
|
|
8
|
+
const ValkeyInstances = {};
|
|
9
|
+
|
|
8
10
|
let valkeyEnabled = true;
|
|
9
11
|
|
|
10
12
|
const disableValkeyErrorMessage = 'valkey is not enabled';
|
|
11
13
|
|
|
12
14
|
const isValkeyEnable = () => valkeyEnabled;
|
|
13
15
|
|
|
16
|
+
const createValkeyConnection = async (
|
|
17
|
+
instance = { host: '', port: 0 },
|
|
18
|
+
valkeyServerConnectionOptions = { host: '', port: 0 },
|
|
19
|
+
) => {
|
|
20
|
+
ValkeyInstances[`${instance.host}${instance.path}`] = await ValkeyAPI.valkeyClientFactory(
|
|
21
|
+
valkeyServerConnectionOptions,
|
|
22
|
+
);
|
|
23
|
+
return ValkeyInstances[`${instance.host}${instance.path}`];
|
|
24
|
+
};
|
|
25
|
+
|
|
14
26
|
const selectDtoFactory = (payload, select) => {
|
|
15
27
|
const result = {};
|
|
16
28
|
for (const key of Object.keys(select)) {
|
|
@@ -19,10 +31,12 @@ const selectDtoFactory = (payload, select) => {
|
|
|
19
31
|
return result;
|
|
20
32
|
};
|
|
21
33
|
|
|
22
|
-
const valkeyClientFactory = async () => {
|
|
34
|
+
const valkeyClientFactory = async (options) => {
|
|
23
35
|
const valkey = new Valkey({
|
|
24
36
|
// port: 6379,
|
|
25
37
|
// host: 'service-valkey.default.svc.cluster.local',
|
|
38
|
+
port: options?.port ? options.port : undefined,
|
|
39
|
+
host: options?.port ? options.host : undefined,
|
|
26
40
|
retryStrategy: (attempt) => {
|
|
27
41
|
if (attempt === 1) {
|
|
28
42
|
valkey.disconnect();
|
|
@@ -46,12 +60,12 @@ const valkeyClientFactory = async () => {
|
|
|
46
60
|
return valkey;
|
|
47
61
|
};
|
|
48
62
|
|
|
49
|
-
const getValkeyObject = async (key = '') => {
|
|
63
|
+
const getValkeyObject = async (options = { host: '', port: 0 }, key = '') => {
|
|
50
64
|
if (!valkeyEnabled) {
|
|
51
65
|
logger.warn(disableValkeyErrorMessage + ' get', key);
|
|
52
66
|
return null;
|
|
53
67
|
}
|
|
54
|
-
const object = await
|
|
68
|
+
const object = await ValkeyInstances[`${options.host}${options.path}`].get(key);
|
|
55
69
|
try {
|
|
56
70
|
return JSON.parse(object);
|
|
57
71
|
} catch (error) {
|
|
@@ -60,19 +74,19 @@ const getValkeyObject = async (key = '') => {
|
|
|
60
74
|
}
|
|
61
75
|
};
|
|
62
76
|
|
|
63
|
-
const setValkeyObject = async (key = '', payload = {}) => {
|
|
77
|
+
const setValkeyObject = async (options = { host: '', port: 0 }, key = '', payload = {}) => {
|
|
64
78
|
if (!valkeyEnabled) throw new Error(disableValkeyErrorMessage);
|
|
65
|
-
return await
|
|
79
|
+
return await ValkeyInstances[`${options.host}${options.path}`].set(key, JSON.stringify(payload));
|
|
66
80
|
};
|
|
67
81
|
|
|
68
|
-
const updateValkeyObject = async (key = '', payload = {}) => {
|
|
82
|
+
const updateValkeyObject = async (options = { host: '', port: 0 }, key = '', payload = {}) => {
|
|
69
83
|
if (!valkeyEnabled) throw new Error(disableValkeyErrorMessage);
|
|
70
|
-
const object = await getValkeyObject(key
|
|
84
|
+
const object = await getValkeyObject(key);
|
|
71
85
|
object.updatedAt = new Date().toISOString();
|
|
72
|
-
return await
|
|
86
|
+
return await ValkeyInstances[`${options.host}${options.path}`].set(key, JSON.stringify({ ...object, ...payload }));
|
|
73
87
|
};
|
|
74
88
|
|
|
75
|
-
const valkeyObjectFactory = async (
|
|
89
|
+
const valkeyObjectFactory = async (options = { host: 'localhost', object: {} }, module = '') => {
|
|
76
90
|
if (!valkeyEnabled) throw new Error(disableValkeyErrorMessage);
|
|
77
91
|
const idoDate = new Date().toISOString();
|
|
78
92
|
options.object = options.object || {};
|
|
@@ -112,10 +126,9 @@ const ValkeyAPI = {
|
|
|
112
126
|
setValkeyObject,
|
|
113
127
|
valkeyObjectFactory,
|
|
114
128
|
updateValkeyObject,
|
|
129
|
+
createValkeyConnection,
|
|
115
130
|
};
|
|
116
131
|
|
|
117
|
-
const valkey = await ValkeyAPI.valkeyClientFactory();
|
|
118
|
-
|
|
119
132
|
export {
|
|
120
133
|
valkeyClientFactory,
|
|
121
134
|
selectDtoFactory,
|
|
@@ -124,5 +137,6 @@ export {
|
|
|
124
137
|
valkeyObjectFactory,
|
|
125
138
|
updateValkeyObject,
|
|
126
139
|
isValkeyEnable,
|
|
140
|
+
createValkeyConnection,
|
|
127
141
|
ValkeyAPI,
|
|
128
142
|
};
|