@underpostnet/underpost 2.8.5 → 2.8.7

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.
Files changed (109) hide show
  1. package/.github/workflows/ghpkg.yml +1 -1
  2. package/.github/workflows/npmpkg.yml +1 -1
  3. package/.github/workflows/pwa-microservices-template.page.yml +1 -1
  4. package/.vscode/extensions.json +3 -2
  5. package/.vscode/settings.json +6 -0
  6. package/CHANGELOG.md +44 -0
  7. package/Dockerfile +9 -10
  8. package/README.md +39 -2
  9. package/bin/build.js +31 -6
  10. package/bin/deploy.js +1404 -202
  11. package/bin/file.js +8 -0
  12. package/bin/hwt.js +0 -10
  13. package/bin/index.js +1 -187
  14. package/bin/util.js +0 -7
  15. package/bin/vs.js +1 -0
  16. package/cli.md +451 -0
  17. package/conf.js +0 -2
  18. package/docker-compose.yml +1 -1
  19. package/jsdoc.json +1 -1
  20. package/manifests/calico-custom-resources.yaml +25 -0
  21. package/manifests/deployment/adminer/deployment.yaml +32 -0
  22. package/manifests/deployment/adminer/kustomization.yaml +7 -0
  23. package/manifests/deployment/adminer/service.yaml +13 -0
  24. package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
  25. package/manifests/deployment/fastapi/backend-service.yml +19 -0
  26. package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
  27. package/manifests/deployment/fastapi/frontend-service.yml +15 -0
  28. package/manifests/deployment/kafka/deployment.yaml +69 -0
  29. package/manifests/kind-config-dev.yaml +12 -0
  30. package/manifests/kubeadm-calico-config.yaml +119 -0
  31. package/manifests/mongodb/kustomization.yaml +2 -2
  32. package/manifests/mongodb-4.4/kustomization.yaml +7 -0
  33. package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
  34. package/manifests/postgresql/configmap.yaml +9 -0
  35. package/manifests/postgresql/kustomization.yaml +10 -0
  36. package/manifests/postgresql/pv.yaml +15 -0
  37. package/manifests/postgresql/pvc.yaml +13 -0
  38. package/manifests/{core/underpost-engine-headless-service.yaml → postgresql/service.yaml} +3 -3
  39. package/manifests/postgresql/statefulset.yaml +37 -0
  40. package/manifests/valkey/statefulset.yaml +6 -4
  41. package/package.json +10 -14
  42. package/src/api/default/default.service.js +1 -1
  43. package/src/api/user/user.service.js +14 -11
  44. package/src/cli/cluster.js +298 -63
  45. package/src/cli/cron.js +39 -8
  46. package/src/cli/db.js +118 -44
  47. package/src/cli/deploy.js +312 -102
  48. package/src/cli/env.js +9 -3
  49. package/src/cli/fs.js +161 -0
  50. package/src/cli/image.js +45 -104
  51. package/src/cli/index.js +312 -0
  52. package/src/cli/monitor.js +236 -0
  53. package/src/cli/repository.js +26 -2
  54. package/src/cli/script.js +25 -1
  55. package/src/cli/test.js +39 -4
  56. package/src/client/components/core/Account.js +28 -24
  57. package/src/client/components/core/Blockchain.js +1 -1
  58. package/src/client/components/core/CalendarCore.js +14 -73
  59. package/src/client/components/core/CommonJs.js +54 -2
  60. package/src/client/components/core/Css.js +0 -1
  61. package/src/client/components/core/CssCore.js +10 -4
  62. package/src/client/components/core/Docs.js +1 -2
  63. package/src/client/components/core/EventsUI.js +3 -3
  64. package/src/client/components/core/FileExplorer.js +86 -78
  65. package/src/client/components/core/Input.js +4 -2
  66. package/src/client/components/core/JoyStick.js +2 -2
  67. package/src/client/components/core/LoadingAnimation.js +3 -12
  68. package/src/client/components/core/LogIn.js +3 -3
  69. package/src/client/components/core/LogOut.js +1 -1
  70. package/src/client/components/core/Modal.js +44 -14
  71. package/src/client/components/core/Panel.js +26 -66
  72. package/src/client/components/core/PanelForm.js +22 -15
  73. package/src/client/components/core/Recover.js +3 -3
  74. package/src/client/components/core/RichText.js +1 -11
  75. package/src/client/components/core/Router.js +3 -1
  76. package/src/client/components/core/SignUp.js +2 -2
  77. package/src/client/components/default/RoutesDefault.js +3 -2
  78. package/src/client/services/core/core.service.js +15 -10
  79. package/src/client/services/default/default.management.js +45 -38
  80. package/src/client/ssr/Render.js +6 -1
  81. package/src/client/ssr/body/CacheControl.js +2 -3
  82. package/src/client/sw/default.sw.js +3 -3
  83. package/src/db/mongo/MongooseDB.js +17 -1
  84. package/src/index.js +25 -1
  85. package/src/mailer/MailerProvider.js +3 -0
  86. package/src/runtime/lampp/Dockerfile +65 -0
  87. package/src/server/backup.js +3 -3
  88. package/src/server/client-build.js +45 -23
  89. package/src/server/client-formatted.js +2 -1
  90. package/src/server/conf.js +110 -16
  91. package/src/server/dns.js +74 -43
  92. package/src/server/downloader.js +0 -8
  93. package/src/server/json-schema.js +77 -0
  94. package/src/server/network.js +7 -122
  95. package/src/server/peer.js +2 -2
  96. package/src/server/proxy.js +4 -4
  97. package/src/server/runtime.js +40 -12
  98. package/src/server/start.js +122 -0
  99. package/src/server/valkey.js +25 -11
  100. package/test/api.test.js +0 -8
  101. package/manifests/core/kustomization.yaml +0 -11
  102. package/manifests/core/underpost-engine-backup-access.yaml +0 -16
  103. package/manifests/core/underpost-engine-backup-pv-pvc.yaml +0 -22
  104. package/manifests/core/underpost-engine-mongodb-backup-cronjob.yaml +0 -40
  105. package/manifests/core/underpost-engine-mongodb-configmap.yaml +0 -26
  106. package/manifests/core/underpost-engine-statefulset.yaml +0 -91
  107. package/manifests/valkey/underpost-engine-valkey-service.yaml +0 -17
  108. package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +0 -39
  109. /package/manifests/{core/underpost-engine-pv-pvc.yaml → mongodb-4.4/pv-pvc.yaml} +0 -0
@@ -0,0 +1,54 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: react-frontend
5
+ labels:
6
+ app: react-frontend
7
+ spec:
8
+ replicas: 2
9
+ selector:
10
+ matchLabels:
11
+ app: react-frontend
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: react-frontend
16
+ spec:
17
+ containers:
18
+ - name: react-frontend-container
19
+ image: localhost/fastapi-frontend:latest
20
+ imagePullPolicy: IfNotPresent
21
+
22
+ ports:
23
+ - containerPort: 80
24
+ name: http-web
25
+
26
+ env:
27
+ - name: VITE_FASTAPI_URL
28
+ value: '/api'
29
+
30
+ livenessProbe:
31
+ httpGet:
32
+ path: /
33
+ port: 80
34
+ initialDelaySeconds: 5
35
+ periodSeconds: 10
36
+ timeoutSeconds: 3
37
+ failureThreshold: 3
38
+
39
+ readinessProbe:
40
+ httpGet:
41
+ path: /
42
+ port: 80
43
+ initialDelaySeconds: 3
44
+ periodSeconds: 5
45
+ timeoutSeconds: 3
46
+ failureThreshold: 3
47
+
48
+ resources:
49
+ requests:
50
+ cpu: 100m
51
+ memory: 128Mi
52
+ limits:
53
+ cpu: 500m
54
+ memory: 512Mi
@@ -0,0 +1,15 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: react-frontend-service
5
+ labels:
6
+ app: react-frontend
7
+ spec:
8
+ selector:
9
+ app: react-frontend
10
+ ports:
11
+ - protocol: TCP
12
+ port: 80
13
+ targetPort: 80
14
+ name: http-web
15
+ type: ClusterIP
@@ -0,0 +1,69 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: kafka
5
+ namespace: kafka
6
+ labels:
7
+ app: kafka-app
8
+ spec:
9
+ serviceName: kafka-svc
10
+ replicas: 3
11
+ selector:
12
+ matchLabels:
13
+ app: kafka-app
14
+ template:
15
+ metadata:
16
+ labels:
17
+ app: kafka-app
18
+ spec:
19
+ containers:
20
+ - name: kafka-container
21
+ image: doughgle/kafka-kraft
22
+ ports:
23
+ - containerPort: 9092
24
+ - containerPort: 9093
25
+ env:
26
+ - name: REPLICAS
27
+ value: '3'
28
+ - name: SERVICE
29
+ value: kafka-svc
30
+ - name: NAMESPACE
31
+ value: kafka
32
+ - name: SHARE_DIR
33
+ value: /mnt/kafka
34
+ - name: CLUSTER_ID
35
+ value: bXktY2x1c3Rlci0xMjM0NQ==
36
+ - name: DEFAULT_REPLICATION_FACTOR
37
+ value: '3'
38
+ - name: DEFAULT_MIN_INSYNC_REPLICAS
39
+ value: '2'
40
+ volumeMounts:
41
+ - name: data
42
+ mountPath: /mnt/kafka
43
+ volumeClaimTemplates:
44
+ - metadata:
45
+ name: data
46
+ spec:
47
+ accessModes:
48
+ - 'ReadWriteOnce'
49
+ resources:
50
+ requests:
51
+ storage: '1Gi'
52
+ ---
53
+ apiVersion: v1
54
+ kind: Service
55
+ metadata:
56
+ name: kafka-svc
57
+ namespace: kafka
58
+ labels:
59
+ app: kafka-app
60
+ spec:
61
+ type: NodePort
62
+ ports:
63
+ - name: '9092'
64
+ port: 9092
65
+ protocol: TCP
66
+ targetPort: 9092
67
+ nodePort: 30092
68
+ selector:
69
+ app: kafka-app
@@ -0,0 +1,12 @@
1
+ kind: Cluster
2
+ apiVersion: kind.x-k8s.io/v1alpha4
3
+ nodes:
4
+ - role: control-plane
5
+ - role: worker
6
+ # extraPortMappings:
7
+ # - containerPort: 80
8
+ # hostPort: 80
9
+ # listenAddress: '0.0.0.0'
10
+ # - containerPort: 443
11
+ # hostPort: 443
12
+ # listenAddress: '0.0.0.0'
@@ -0,0 +1,119 @@
1
+ # This consolidated YAML file contains configurations for:
2
+ # 1. Calico Installation (Installation and APIServer resources)
3
+ # 2. A permissive Egress NetworkPolicy for the 'default' namespace
4
+ #
5
+ # These are standard Kubernetes resources that can be applied directly using 'kubectl apply'.
6
+ # The kubeadm-specific ClusterConfiguration and InitConfiguration have been removed
7
+ # as they are only processed by the 'kubeadm init' command, not 'kubectl apply'.
8
+
9
+ # --- Calico Installation: Base configuration for Calico ---
10
+ # For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation
11
+ apiVersion: operator.tigera.io/v1
12
+ kind: Installation
13
+ metadata:
14
+ name: default
15
+ spec:
16
+ # Configures Calico networking.
17
+ calicoNetwork:
18
+ # Note: The ipPools section cannot be modified post-install.
19
+ ipPools:
20
+ - blockSize: 26
21
+ cidr: 192.168.0.0/16
22
+ encapsulation: VXLANCrossSubnet
23
+ natOutgoing: Enabled
24
+ nodeSelector: all()
25
+
26
+ ---
27
+ # This section configures the Calico API server.
28
+ # For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer
29
+ apiVersion: operator.tigera.io/v1
30
+ kind: APIServer
31
+ metadata:
32
+ name: default
33
+ spec: {}
34
+
35
+ ---
36
+ # This consolidated NetworkPolicy file ensures that all pods in the specified namespaces
37
+ # have unrestricted egress (outbound) access.
38
+ # This is useful for troubleshooting or for environments where strict egress control
39
+ # is not immediately required for these system/default namespaces.
40
+
41
+ ---
42
+ # Policy for the 'default' namespace
43
+ apiVersion: networking.k8s.io/v1
44
+ kind: NetworkPolicy
45
+ metadata:
46
+ name: allow-all-egress-default-namespace
47
+ namespace: default # This policy applies to the 'default' namespace
48
+ spec:
49
+ podSelector: {} # Selects all pods in this namespace
50
+ policyTypes:
51
+ - Egress
52
+ egress:
53
+ - to:
54
+ - ipBlock:
55
+ cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
56
+
57
+ ---
58
+ # Policy for the 'kube-system' namespace
59
+ apiVersion: networking.k8s.io/v1
60
+ kind: NetworkPolicy
61
+ metadata:
62
+ name: allow-all-egress-kube-system-namespace
63
+ namespace: kube-system # This policy applies to the 'kube-system' namespace
64
+ spec:
65
+ podSelector: {} # Selects all pods in this namespace
66
+ policyTypes:
67
+ - Egress
68
+ egress:
69
+ - to:
70
+ - ipBlock:
71
+ cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
72
+
73
+ ---
74
+ # Policy for the 'kube-node-lease' namespace
75
+ apiVersion: networking.k8s.io/v1
76
+ kind: NetworkPolicy
77
+ metadata:
78
+ name: allow-all-egress-kube-node-lease-namespace
79
+ namespace: kube-node-lease # This policy applies to the 'kube-node-lease' namespace
80
+ spec:
81
+ podSelector: {} # Selects all pods in this namespace
82
+ policyTypes:
83
+ - Egress
84
+ egress:
85
+ - to:
86
+ - ipBlock:
87
+ cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
88
+
89
+ ---
90
+ # Policy for the 'kube-public' namespace
91
+ apiVersion: networking.k8s.io/v1
92
+ kind: NetworkPolicy
93
+ metadata:
94
+ name: allow-all-egress-kube-public-namespace
95
+ namespace: kube-public # This policy applies to the 'kube-public' namespace
96
+ spec:
97
+ podSelector: {} # Selects all pods in this namespace
98
+ policyTypes:
99
+ - Egress
100
+ egress:
101
+ - to:
102
+ - ipBlock:
103
+ cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
104
+
105
+ ---
106
+ # Policy for the 'tigera-operator' namespace
107
+ apiVersion: networking.k8s.io/v1
108
+ kind: NetworkPolicy
109
+ metadata:
110
+ name: allow-all-egress-tigera-operator-namespace
111
+ namespace: tigera-operator # This policy applies to the 'tigera-operator' namespace
112
+ spec:
113
+ podSelector: {} # Selects all pods in this namespace
114
+ policyTypes:
115
+ - Egress
116
+ egress:
117
+ - to:
118
+ - ipBlock:
119
+ cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
@@ -7,5 +7,5 @@ resources:
7
7
  - headless-service.yaml
8
8
  - statefulset.yaml
9
9
  - backup-pv-pvc.yaml
10
- - backup-cronjob.yaml
11
- - backup-access.yaml
10
+ # - backup-cronjob.yaml
11
+ # - backup-access.yaml
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k core/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv-pvc.yaml
7
+ - service-deployment.yaml
@@ -0,0 +1,63 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: mongodb-deployment
5
+ namespace: default
6
+ spec:
7
+ selector:
8
+ matchLabels:
9
+ app: mongodb
10
+ replicas: 1
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ hostname: mongo
17
+ containers:
18
+ - name: mongodb
19
+ image: mongo:4.4
20
+ command: ['mongod', '--replSet', 'rs0', '--bind_ip_all']
21
+ # -- bash
22
+ # mongo
23
+ # use admin
24
+ # rs.initiate()
25
+ ports:
26
+ - containerPort: 27017
27
+
28
+ volumeMounts:
29
+ - name: mongo-persistent-storage
30
+ mountPath: /data/db
31
+
32
+ # resources:
33
+ # requests:
34
+ # memory: '500Mi'
35
+ # cpu: '500m'
36
+ volumes:
37
+ - name: mongo-persistent-storage
38
+ persistentVolumeClaim:
39
+ claimName: mongodb-pvc
40
+
41
+ ---
42
+ apiVersion: v1
43
+ kind: Service
44
+ metadata:
45
+ name: mongodb-service
46
+ namespace: default
47
+ spec:
48
+ clusterIP: None
49
+ selector:
50
+ app: mongodb
51
+ ports:
52
+ - protocol: TCP
53
+ port: 27017
54
+ # targetPort: 27017
55
+ # type: ClusterIP
56
+
57
+ # rs.initiate();
58
+ # use admin;
59
+ # rs.initiate({ _id: "rs0", members: [ { _id: 0, host: "127.0.0.1:27017" } ] })
60
+ # db.createUser({user: "your_user",pwd: "your_password", roles: [{role: "userAdminAnyDatabase", db: "admin" },{ role: "readWriteAnyDatabase", db: "admin" }]});
61
+ # cfg = rs.conf();
62
+ # cfg.members[0].host = "127.0.0.1:27027";
63
+ # rs.reconfig(cfg);
@@ -0,0 +1,9 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: postgres-config
5
+ labels:
6
+ app: postgres
7
+ data:
8
+ POSTGRES_DB: postgresdb
9
+ POSTGRES_USER: admin
@@ -0,0 +1,10 @@
1
+ ---
2
+ # kubectl apply -k postgresql/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv.yaml
7
+ - pvc.yaml
8
+ - configmap.yaml
9
+ - statefulset.yaml
10
+ - service.yaml
@@ -0,0 +1,15 @@
1
+ kind: PersistentVolume
2
+ apiVersion: v1
3
+ metadata:
4
+ name: postgres-pv-volume
5
+ labels:
6
+ type: local
7
+ app: postgres
8
+ spec:
9
+ storageClassName: manual
10
+ capacity:
11
+ storage: 5Gi
12
+ accessModes:
13
+ - ReadWriteMany
14
+ hostPath:
15
+ path: '/mnt/data'
@@ -0,0 +1,13 @@
1
+ kind: PersistentVolumeClaim
2
+ apiVersion: v1
3
+ metadata:
4
+ name: postgres-pv-claim
5
+ labels:
6
+ app: postgres
7
+ spec:
8
+ storageClassName: manual
9
+ accessModes:
10
+ - ReadWriteMany
11
+ resources:
12
+ requests:
13
+ storage: 5Gi
@@ -1,10 +1,10 @@
1
1
  apiVersion: v1
2
2
  kind: Service
3
3
  metadata:
4
- name: mongodb-service
4
+ name: postgres-service
5
5
  spec:
6
6
  clusterIP: None
7
7
  selector:
8
- app: mongodb
8
+ app: postgres
9
9
  ports:
10
- - port: 27017
10
+ - port: 5432
@@ -0,0 +1,37 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: postgres
5
+ spec:
6
+ serviceName: postgres
7
+ replicas: 3
8
+ selector:
9
+ matchLabels:
10
+ app: postgres
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: postgres
15
+ spec:
16
+ containers:
17
+ - name: postgres
18
+ image: postgres:latest
19
+ imagePullPolicy: Never
20
+ ports:
21
+ - containerPort: 5432
22
+ envFrom:
23
+ - configMapRef:
24
+ name: postgres-config
25
+ env:
26
+ - name: POSTGRES_PASSWORD
27
+ valueFrom:
28
+ secretKeyRef:
29
+ name: postgres-secret
30
+ key: password
31
+ volumeMounts:
32
+ - mountPath: /var/lib/postgresql/data
33
+ name: postgredb
34
+ volumes:
35
+ - name: postgredb
36
+ persistentVolumeClaim:
37
+ claimName: postgres-pv-claim
@@ -1,4 +1,3 @@
1
- ---
2
1
  apiVersion: apps/v1
3
2
  kind: StatefulSet
4
3
  metadata:
@@ -15,9 +14,14 @@ spec:
15
14
  labels:
16
15
  app: service-valkey
17
16
  spec:
17
+ # Prevent automatic token mounting if you're not using the default ServiceAccount
18
+ automountServiceAccountToken: false
19
+
18
20
  containers:
19
21
  - name: service-valkey
20
- image: docker.io/valkey/valkey:latest
22
+ image: valkey/valkey:latest
23
+ # Ensure you pull only if not present (Never will error if missing)
24
+ imagePullPolicy: Never
21
25
  env:
22
26
  - name: TZ
23
27
  value: Europe/Zurich
@@ -35,5 +39,3 @@ spec:
35
39
  failureThreshold: 2
36
40
  periodSeconds: 30
37
41
  timeoutSeconds: 5
38
- restartPolicy: Always
39
- automountServiceAccountToken: false
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "@underpostnet/underpost",
5
- "version": "2.8.5",
5
+ "version": "2.8.7",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -10,6 +10,8 @@
10
10
  "pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine",
11
11
  "dev": "env-cmd -f .env.development node src/client.dev default",
12
12
  "dev-img": "env-cmd -f .env.development node src/server",
13
+ "prod-img": "env-cmd -f .env.production node src/server",
14
+ "monitor": "pm2 start bin/deploy.js --name monitor -- monitor",
13
15
  "dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
14
16
  "dev-client": "env-cmd -f .env.development node src/client.dev",
15
17
  "proxy": "node src/proxy proxy",
@@ -56,9 +58,11 @@
56
58
  "ag-grid-community": "31.0.0",
57
59
  "axios": "^1.5.1",
58
60
  "chai": "^5.1.0",
61
+ "clean-jsdoc-theme": "^4.3.0",
59
62
  "cli-progress": "^3.12.0",
60
63
  "cli-spinners": "^3.0.0",
61
64
  "clipboardy": "^4.0.0",
65
+ "cloudinary": "^2.5.1",
62
66
  "color": "^4.2.3",
63
67
  "colors": "^1.4.0",
64
68
  "commander": "^12.1.0",
@@ -86,6 +90,7 @@
86
90
  "log-update": "^6.0.0",
87
91
  "mariadb": "^3.2.2",
88
92
  "marked": "^12.0.2",
93
+ "mocha": "^10.8.2",
89
94
  "mongoose": "^8.9.5",
90
95
  "morgan": "^1.10.0",
91
96
  "nodemailer": "^6.9.9",
@@ -94,6 +99,7 @@
94
99
  "peer": "^1.0.2",
95
100
  "peerjs": "^1.5.2",
96
101
  "pixi.js": "7.4.2",
102
+ "plantuml": "^0.0.2",
97
103
  "prom-client": "^15.1.2",
98
104
  "public-ip": "^6.0.1",
99
105
  "read": "^2.1.0",
@@ -105,25 +111,15 @@
105
111
  "socket.io": "^4.8.0",
106
112
  "sortablejs": "^1.15.0",
107
113
  "split-file": "^2.3.0",
114
+ "swagger-autogen": "^2.23.7",
108
115
  "swagger-ui-express": "^5.0.0",
109
116
  "systeminformation": "^5.23.7",
110
117
  "uglify-js": "^3.17.4",
111
118
  "validator": "^13.11.0",
112
119
  "vanilla-jsoneditor": "^2.3.2",
113
- "winston": "^3.11.0",
114
- "clean-jsdoc-theme": "^4.3.0",
115
- "easy-json-schema": "^0.0.2-beta",
116
- "mocha": "^10.8.2",
117
- "plantuml": "^0.0.2",
118
- "swagger-autogen": "^2.23.7"
119
- },
120
- "devDependencies": {
121
- "clean-jsdoc-theme": "^4.3.0",
122
- "easy-json-schema": "^0.0.2-beta",
123
- "mocha": "^10.8.2",
124
- "plantuml": "^0.0.2",
125
- "swagger-autogen": "^2.23.7"
120
+ "winston": "^3.11.0"
126
121
  },
122
+ "devDependencies": {},
127
123
  "publishConfig": {
128
124
  "provenance": true,
129
125
  "access": "public",
@@ -24,7 +24,7 @@ const DefaultService = {
24
24
  /** @type {import('./default.model.js').DefaultModel} */
25
25
  const Default = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Default;
26
26
  if (req.params.id) return await Default.findByIdAndDelete(req.params.id);
27
- else return await await Default.deleteMany();
27
+ else return await Default.deleteMany();
28
28
  },
29
29
  };
30
30
 
@@ -225,8 +225,8 @@ const UserService = {
225
225
  } else throw new Error('invalid email or password');
226
226
 
227
227
  case 'guest': {
228
- const user = await ValkeyAPI.valkeyObjectFactory('user', options);
229
- await ValkeyAPI.setValkeyObject(user.email, user);
228
+ const user = await ValkeyAPI.valkeyObjectFactory(options, 'user');
229
+ await ValkeyAPI.setValkeyObject(options, user.email, user);
230
230
  return {
231
231
  token: hashJWT({ user: UserDto.auth.payload(user) }),
232
232
  user: selectDtoFactory(user, UserDto.select.get()),
@@ -325,15 +325,18 @@ const UserService = {
325
325
  return await User.find().select(UserDto.select.getAll());
326
326
 
327
327
  case 'auth': {
328
- const user = (await ValkeyAPI.getValkeyObject(req.auth.user.email))
329
- ? await ValkeyAPI.getValkeyObject(req.auth.user.email)
330
- : await User.findOne({
331
- _id: req.auth.user._id,
332
- });
328
+ let user;
329
+ if (req.auth.user._id.match('guest')) {
330
+ user = await ValkeyAPI.getValkeyObject(options, req.auth.user.email);
331
+ if (!user) throw new Error('guest user expired');
332
+ } else
333
+ user = await User.findOne({
334
+ _id: req.auth.user._id,
335
+ });
333
336
 
334
337
  const file = await File.findOne({ _id: user.profileImageId });
335
338
 
336
- if (!file && !(await ValkeyAPI.getValkeyObject(req.auth.user.email))) {
339
+ if (!file && !(await ValkeyAPI.getValkeyObject(options, req.auth.user.email))) {
337
340
  await User.findByIdAndUpdate(
338
341
  user._id,
339
342
  { profileImageId: await getDefaultProfileImageId(File) },
@@ -342,8 +345,8 @@ const UserService = {
342
345
  },
343
346
  );
344
347
  }
345
- return (await ValkeyAPI.getValkeyObject(req.auth.user.email))
346
- ? selectDtoFactory(await ValkeyAPI.getValkeyObject(req.auth.user.email), UserDto.select.get())
348
+ return (await ValkeyAPI.getValkeyObject(options, req.auth.user.email))
349
+ ? selectDtoFactory(await ValkeyAPI.getValkeyObject(options, req.auth.user.email), UserDto.select.get())
347
350
  : await User.findOne({
348
351
  _id: req.auth.user._id,
349
352
  }).select(UserDto.select.get());
@@ -378,7 +381,7 @@ const UserService = {
378
381
  switch (user.role) {
379
382
  case 'admin': {
380
383
  if (req.params.id) return await User.findByIdAndDelete(req.params.id);
381
- else return await await User.deleteMany();
384
+ else return await User.deleteMany();
382
385
  }
383
386
  default:
384
387
  if (req.auth.user._id !== req.params.id) throw new Error(`Invalid token user id`);