@underpostnet/underpost 2.8.1 → 2.8.31

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 (53) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/ghpkg.yml +4 -4
  3. package/.vscode/extensions.json +8 -71
  4. package/CHANGELOG.md +55 -3
  5. package/Dockerfile +22 -36
  6. package/README.md +0 -27
  7. package/bin/deploy.js +57 -17
  8. package/bin/file.js +30 -2
  9. package/bin/index.js +2 -13
  10. package/bin/ssl.js +19 -11
  11. package/bin/vs.js +3 -2
  12. package/conf.js +9 -0
  13. package/docker-compose.yml +1 -1
  14. package/manifests/mariadb/config.yaml +10 -0
  15. package/manifests/mariadb/kustomization.yaml +9 -0
  16. package/manifests/mariadb/pv.yaml +12 -0
  17. package/manifests/mariadb/pvc.yaml +10 -0
  18. package/manifests/mariadb/secret.yaml +8 -0
  19. package/manifests/mariadb/service.yaml +10 -0
  20. package/manifests/mariadb/statefulset.yaml +55 -0
  21. package/manifests/test/mongo-express.yaml +60 -0
  22. package/manifests/test/phpmyadmin.yaml +54 -0
  23. package/manifests/test/underpost-engine-mongodb-configmap.yaml +26 -0
  24. package/manifests/test/underpost-engine-pod.yaml +108 -0
  25. package/manifests/underpost-engine-backup-access.yaml +16 -0
  26. package/manifests/underpost-engine-backup-pv-pvc.yaml +22 -0
  27. package/manifests/underpost-engine-headless-service.yaml +10 -0
  28. package/manifests/underpost-engine-mongodb-backup-cronjob.yaml +40 -0
  29. package/manifests/underpost-engine-pv-pvc.yaml +23 -0
  30. package/manifests/underpost-engine-statefulset.yaml +91 -0
  31. package/manifests/valkey/kustomization.yaml +7 -0
  32. package/manifests/valkey/underpost-engine-valkey-service.yaml +17 -0
  33. package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +39 -0
  34. package/package.json +12 -4
  35. package/src/api/user/user.model.js +9 -1
  36. package/src/api/user/user.service.js +1 -1
  37. package/src/client/components/core/CalendarCore.js +112 -49
  38. package/src/client/components/core/CommonJs.js +125 -19
  39. package/src/client/components/core/CssCore.js +6 -0
  40. package/src/client/components/core/DropDown.js +5 -1
  41. package/src/client/components/core/Input.js +17 -3
  42. package/src/client/components/core/Modal.js +5 -0
  43. package/src/client/components/core/Panel.js +81 -24
  44. package/src/client/components/core/PanelForm.js +4 -18
  45. package/src/client/components/core/Translate.js +30 -8
  46. package/src/db/mongo/MongooseDB.js +13 -1
  47. package/src/index.js +1 -1
  48. package/src/server/conf.js +2 -2
  49. package/src/server/process.js +25 -2
  50. package/src/server/ssl.js +1 -1
  51. package/src/server/valkey.js +2 -0
  52. package/startup.cjs +12 -0
  53. package/startup.js +0 -11
@@ -0,0 +1,8 @@
1
+ apiVersion: v1
2
+ kind: Secret
3
+ metadata:
4
+ name: mariadb-secret
5
+ type: Opaque
6
+ data:
7
+ password:
8
+ username:
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: mariadb
5
+ spec:
6
+ ports:
7
+ - port: 3306
8
+ targetPort: 3306
9
+ selector:
10
+ app: mariadb
@@ -0,0 +1,55 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: mariadb-statefulset
5
+ spec:
6
+ serviceName: mariadb
7
+ replicas: 1
8
+ selector:
9
+ matchLabels:
10
+ app: mariadb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mariadb
15
+ spec:
16
+ containers:
17
+ - name: mariadb
18
+ image: mariadb:latest
19
+ env:
20
+ - name: MYSQL_ROOT_PASSWORD
21
+ valueFrom:
22
+ secretKeyRef:
23
+ name: mariadb-secret
24
+ key: password
25
+ # - name: MYSQL_PASSWORD
26
+ # valueFrom:
27
+ # secretKeyRef:
28
+ # name: mariadb-secret
29
+ # key: password
30
+ # - name: MYSQL_USER
31
+ # valueFrom:
32
+ # secretKeyRef:
33
+ # name: mariadb-secret
34
+ # key: username
35
+ # - name: MYSQL_DATABASE
36
+ # value: default
37
+ ports:
38
+ - containerPort: 3306
39
+ volumeMounts:
40
+ - mountPath: /var/lib/mysql
41
+ name: mariadb-storage
42
+ # - mountPath: /etc/mysql/conf.d
43
+ # name: config-volume
44
+ # volumes:
45
+ # - name: config-volume
46
+ # configMap:
47
+ # name: mariadb-config
48
+ volumeClaimTemplates:
49
+ - metadata:
50
+ name: mariadb-storage
51
+ spec:
52
+ accessModes: ['ReadWriteOnce']
53
+ resources:
54
+ requests:
55
+ storage: 1Gi
@@ -0,0 +1,60 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: mongo-express
5
+ labels:
6
+ app: mongo-express
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: mongo-express
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: mongo-express
16
+ spec:
17
+ containers:
18
+ - name: mongo-express
19
+ image: mongo-express
20
+ ports:
21
+ - containerPort: 8081
22
+ env:
23
+ - name: ME_CONFIG_MONGODB_ADMINUSERNAME
24
+ valueFrom:
25
+ secretKeyRef:
26
+ name: mongodb-secret
27
+ key: username
28
+ - name: ME_CONFIG_MONGODB_ADMINPASSWORD
29
+ valueFrom:
30
+ secretKeyRef:
31
+ name: mongodb-secret
32
+ key: password
33
+ - name: ME_CONFIG_BASICAUTH_USERNAME
34
+ valueFrom:
35
+ secretKeyRef:
36
+ name: mongodb-secret
37
+ key: username
38
+ - name: ME_CONFIG_BASICAUTH_PASSWORD
39
+ valueFrom:
40
+ secretKeyRef:
41
+ name: mongodb-secret
42
+ key: password
43
+ - name: ME_CONFIG_MONGODB_SERVER
44
+ value: 'mongodb-0.mongodb-service'
45
+ - name: ME_CONFIG_MONGODB_ENABLE_ADMIN
46
+ value: 'true'
47
+ - name: ME_CONFIG_MONGODB_PORT
48
+ value: '27017'
49
+ ---
50
+ apiVersion: v1
51
+ kind: Service
52
+ metadata:
53
+ name: mongo-express-service
54
+ spec:
55
+ selector:
56
+ app: mongo-express
57
+ ports:
58
+ - protocol: TCP
59
+ port: 8081
60
+ targetPort: 8081
@@ -0,0 +1,54 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: phpmyadmin-deployment
5
+ labels:
6
+ app: phpmyadmin
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: phpmyadmin
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: phpmyadmin
16
+ spec:
17
+ containers:
18
+ - name: phpmyadmin
19
+ image: phpmyadmin/phpmyadmin
20
+ ports:
21
+ - containerPort: 80
22
+ env:
23
+ - name: PMA_HOST
24
+ value: 'mariadb'
25
+ - name: PMA_PORT
26
+ value: '3306'
27
+ - name: PMA_USER
28
+ valueFrom:
29
+ secretKeyRef:
30
+ name: mariadb-secret
31
+ key: username
32
+ - name: PMA_PASSWORD
33
+ valueFrom:
34
+ secretKeyRef:
35
+ name: mariadb-secret
36
+ key: password
37
+ - name: UPLOAD_LIMIT
38
+ value: '300M'
39
+ - name: PMA_ARBITRARY
40
+ value: '1'
41
+ ---
42
+ apiVersion: v1
43
+ kind: Service
44
+ metadata:
45
+ name: phpmyadmin-service
46
+ spec:
47
+ type: NodePort
48
+ selector:
49
+ app: phpmyadmin
50
+ ports:
51
+ - protocol: TCP
52
+ nodePort: 31008
53
+ port: 80
54
+ targetPort: 80
@@ -0,0 +1,26 @@
1
+ # origin conf: /etc/mongod.conf
2
+ apiVersion: v1
3
+ kind: ConfigMap
4
+ metadata:
5
+ name: mongodb-config-file
6
+ namespace: default
7
+ data:
8
+ mongod.conf: |
9
+ storage:
10
+ dbPath: /data/db
11
+ systemLog:
12
+ destination: file
13
+ logAppend: true
14
+ path: /var/log/mongodb/mongod.log
15
+ replication:
16
+ replSetName: rs0
17
+ net:
18
+ bindIp: 127.0.0.1
19
+ port: 27017
20
+ processManagement:
21
+ fork: true
22
+ setParameter:
23
+ enableLocalhostAuthBypass: false
24
+ security:
25
+ authorization: enabled
26
+ keyFile: /etc/mongodb-keyfile
@@ -0,0 +1,108 @@
1
+ apiVersion: v1
2
+ kind: Pod
3
+ metadata:
4
+ annotations:
5
+ engine.version: 2.8.1
6
+ kompose.cmd: kompose convert
7
+ kompose.version: 1.35.0 (9532ceef3)
8
+ labels:
9
+ io.kompose.service: underpost-engine
10
+ name: underpost-engine
11
+ spec:
12
+ containers:
13
+ - image: localhost/underpost-engine:v2.8.31
14
+ imagePullPolicy: Never
15
+ name: underpost-engine
16
+ ports:
17
+ - containerPort: 22
18
+ protocol: TCP
19
+ - containerPort: 22
20
+ protocol: UDP
21
+ - containerPort: 4013
22
+ protocol: TCP
23
+ - containerPort: 4013
24
+ protocol: UDP
25
+ - containerPort: 4014
26
+ protocol: TCP
27
+ - containerPort: 4014
28
+ protocol: UDP
29
+ - containerPort: 4015
30
+ protocol: TCP
31
+ - containerPort: 4015
32
+ protocol: UDP
33
+ - containerPort: 4016
34
+ protocol: TCP
35
+ - containerPort: 4016
36
+ protocol: UDP
37
+ - containerPort: 4017
38
+ protocol: TCP
39
+ - containerPort: 4017
40
+ protocol: UDP
41
+ - containerPort: 4018
42
+ protocol: TCP
43
+ - containerPort: 4018
44
+ protocol: UDP
45
+ - containerPort: 4019
46
+ protocol: TCP
47
+ - containerPort: 4019
48
+ protocol: UDP
49
+ - containerPort: 4020
50
+ protocol: TCP
51
+ - containerPort: 4020
52
+ protocol: UDP
53
+ - containerPort: 4021
54
+ protocol: TCP
55
+ - containerPort: 4021
56
+ protocol: UDP
57
+ - containerPort: 4022
58
+ protocol: TCP
59
+ - containerPort: 4022
60
+ protocol: UDP
61
+ - containerPort: 4023
62
+ protocol: TCP
63
+ - containerPort: 4023
64
+ protocol: UDP
65
+ - containerPort: 4024
66
+ protocol: TCP
67
+ - containerPort: 4024
68
+ protocol: UDP
69
+ - containerPort: 4025
70
+ protocol: TCP
71
+ - containerPort: 4025
72
+ protocol: UDP
73
+ - containerPort: 4026
74
+ protocol: TCP
75
+ - containerPort: 4026
76
+ protocol: UDP
77
+ - containerPort: 4027
78
+ protocol: TCP
79
+ - containerPort: 4027
80
+ protocol: UDP
81
+ - containerPort: 4028
82
+ protocol: TCP
83
+ - containerPort: 4028
84
+ protocol: UDP
85
+ - containerPort: 4029
86
+ protocol: TCP
87
+ - containerPort: 4029
88
+ protocol: UDP
89
+ - containerPort: 4030
90
+ protocol: TCP
91
+ - containerPort: 4030
92
+ protocol: UDP
93
+ - containerPort: 4031
94
+ protocol: TCP
95
+ - containerPort: 4031
96
+ protocol: UDP
97
+ - containerPort: 4032
98
+ protocol: TCP
99
+ - containerPort: 4032
100
+ protocol: UDP
101
+ resources:
102
+ limits:
103
+ cpu: '2'
104
+ memory: '419430300'
105
+ requests:
106
+ cpu: 250m
107
+ memory: '20971520'
108
+ restartPolicy: OnFailure
@@ -0,0 +1,16 @@
1
+ apiVersion: v1
2
+ kind: Pod
3
+ metadata:
4
+ name: backup-access
5
+ spec:
6
+ containers:
7
+ - name: busybox
8
+ image: busybox
9
+ command: ['sh', '-c', 'sleep 3600']
10
+ volumeMounts:
11
+ - name: backup-storage
12
+ mountPath: /backup
13
+ volumes:
14
+ - name: backup-storage
15
+ persistentVolumeClaim:
16
+ claimName: backup-pvc
@@ -0,0 +1,22 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: backup-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ hostPath:
11
+ path: /mnt/backup
12
+ ---
13
+ apiVersion: v1
14
+ kind: PersistentVolumeClaim
15
+ metadata:
16
+ name: backup-pvc
17
+ spec:
18
+ accessModes:
19
+ - ReadWriteOnce
20
+ resources:
21
+ requests:
22
+ storage: 5Gi
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: mongodb-service
5
+ spec:
6
+ clusterIP: None
7
+ selector:
8
+ app: mongodb
9
+ ports:
10
+ - port: 27017
@@ -0,0 +1,40 @@
1
+ apiVersion: batch/v1
2
+ kind: CronJob
3
+ metadata:
4
+ name: mongodb-backup
5
+ spec:
6
+ schedule: '*/5 * * * *' # Runs backup every five minutes
7
+ jobTemplate:
8
+ spec:
9
+ template:
10
+ spec:
11
+ containers:
12
+ - name: mongodump
13
+ image: docker.io/library/mongo:latest
14
+ command:
15
+ - sh
16
+ - -c
17
+ - |
18
+ # Perform backup
19
+ mongodump -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
20
+ # Remove backups older than 7 days
21
+ find /backup -type d -mtime +7 -exec rm -rf {} +
22
+ volumeMounts:
23
+ - name: backup-storage
24
+ mountPath: /backup
25
+ env:
26
+ - name: MONGO_INITDB_ROOT_USERNAME
27
+ valueFrom:
28
+ secretKeyRef:
29
+ name: mongodb-secret
30
+ key: username
31
+ - name: MONGO_INITDB_ROOT_PASSWORD
32
+ valueFrom:
33
+ secretKeyRef:
34
+ name: mongodb-secret
35
+ key: password
36
+ restartPolicy: Never
37
+ volumes:
38
+ - name: backup-storage
39
+ persistentVolumeClaim:
40
+ claimName: backup-pvc
@@ -0,0 +1,23 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: mongodb-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ hostPath:
11
+ path: /data/mongodb
12
+ ---
13
+ apiVersion: v1
14
+ kind: PersistentVolumeClaim
15
+ metadata:
16
+ name: mongodb-pvc
17
+ spec:
18
+ storageClassName: ''
19
+ accessModes:
20
+ - ReadWriteOnce
21
+ resources:
22
+ requests:
23
+ storage: 5Gi
@@ -0,0 +1,91 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: mongodb # Specifies the name of the statefulset
5
+ spec:
6
+ serviceName: 'mongodb-service' # Specifies the service to use
7
+ replicas: 2
8
+ selector:
9
+ matchLabels:
10
+ app: mongodb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ containers:
17
+ - name: mongodb
18
+ image: docker.io/library/mongo:latest
19
+ command:
20
+ - mongod
21
+ - '--replSet'
22
+ - 'rs0'
23
+ # - '--config'
24
+ # - '-f'
25
+ # - '/etc/mongod.conf'
26
+ # - '--auth'
27
+ # - '--clusterAuthMode'
28
+ # - 'keyFile'
29
+ # - '--keyFile'
30
+ # - '/etc/mongodb-keyfile'
31
+ # - '--interleave'
32
+ # - 'all'
33
+ # - '--wiredTigerCacheSizeGB'
34
+ # - '0.25'
35
+ # - '--setParameter'
36
+ # - 'authenticationMechanisms=SCRAM-SHA-1'
37
+ # - '--fork'
38
+ - '--logpath'
39
+ - '/var/log/mongodb/mongod.log'
40
+ - '--bind_ip_all'
41
+ ports:
42
+ - containerPort: 27017
43
+ volumeMounts:
44
+ - name: mongodb-storage
45
+ mountPath: /data/db
46
+ - name: keyfile
47
+ mountPath: /etc/mongodb-keyfile
48
+ readOnly: true
49
+ # - name: mongodb-configuration-file
50
+ # mountPath: /etc/mongod.conf
51
+ # subPath: mongod.conf
52
+ # readOnly: true
53
+ # - name: mongodb-config
54
+ # mountPath: /config
55
+ env:
56
+ - name: MONGO_INITDB_ROOT_USERNAME
57
+ valueFrom:
58
+ secretKeyRef:
59
+ name: mongodb-secret
60
+ key: username
61
+ - name: MONGO_INITDB_ROOT_PASSWORD
62
+ valueFrom:
63
+ secretKeyRef:
64
+ name: mongodb-secret
65
+ key: password
66
+ resources:
67
+ requests:
68
+ cpu: '100m'
69
+ memory: '256Mi'
70
+ limits:
71
+ cpu: '500m'
72
+ memory: '512Mi'
73
+ volumes:
74
+ - name: keyfile
75
+ secret:
76
+ secretName: mongodb-keyfile
77
+ defaultMode: 0400
78
+ # - name: mongodb-configuration-file
79
+ # configMap:
80
+ # name: mongodb-config-file
81
+ # - name: mongodb-config
82
+ # configMap:
83
+ # name: mongodb-config
84
+ volumeClaimTemplates:
85
+ - metadata:
86
+ name: mongodb-storage
87
+ spec:
88
+ accessModes: ['ReadWriteOnce']
89
+ resources:
90
+ requests:
91
+ storage: 5Gi
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k valkey/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - underpost-engine-valkey-service.yaml
7
+ - underpost-engine-valkey-statefulset.yaml
@@ -0,0 +1,17 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: Service
4
+ metadata:
5
+ name: service-valkey
6
+ namespace: default
7
+ spec:
8
+ ports:
9
+ - port: 6379
10
+ targetPort: 6379
11
+ selector:
12
+ app: service-valkey
13
+ ipFamilyPolicy: PreferDualStack
14
+ ipFamilies:
15
+ - IPv4
16
+ # - IPv6
17
+ type: ClusterIP
@@ -0,0 +1,39 @@
1
+ ---
2
+ apiVersion: apps/v1
3
+ kind: StatefulSet
4
+ metadata:
5
+ name: service-valkey
6
+ namespace: default
7
+ spec:
8
+ serviceName: service-valkey
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: service-valkey
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: service-valkey
17
+ spec:
18
+ containers:
19
+ - name: service-valkey
20
+ image: docker.io/valkey/valkey:latest
21
+ env:
22
+ - name: TZ
23
+ value: Europe/Zurich
24
+ ports:
25
+ - containerPort: 6379
26
+ startupProbe:
27
+ tcpSocket:
28
+ port: 6379
29
+ failureThreshold: 30
30
+ periodSeconds: 5
31
+ timeoutSeconds: 5
32
+ livenessProbe:
33
+ tcpSocket:
34
+ port: 6379
35
+ failureThreshold: 2
36
+ periodSeconds: 30
37
+ timeoutSeconds: 5
38
+ restartPolicy: Always
39
+ automountServiceAccountToken: false
package/package.json CHANGED
@@ -2,16 +2,16 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "@underpostnet/underpost",
5
- "version": "2.8.1",
5
+ "version": "2.8.31",
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",
9
9
  "pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine && pm2 logs",
10
10
  "ssl": "env-cmd -f .env.production node bin/ssl",
11
11
  "pm2-delete": "pm2 delete engine",
12
- "build": "node bin/deploy build-full-client",
12
+ "build": "node bin/deploy build-full-client && node bin/deploy fix-deps",
13
13
  "build-production": "env-cmd -f .env.production node bin/deploy build-full-client",
14
- "dev": "env-cmd -f .env.development node src/client.dev",
14
+ "dev": "env-cmd -f .env.development node src/client.dev default",
15
15
  "dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
16
16
  "docs": "jsdoc -c jsdoc.json",
17
17
  "backup": "node bin/db default.net/ export",
@@ -53,19 +53,25 @@
53
53
  "homepage": "https://github.com/underpostnet/pwa-microservices-template#readme",
54
54
  "dependencies": {
55
55
  "@fortawesome/fontawesome-free": "^6.4.2",
56
+ "@fullcalendar/rrule": "^6.1.15",
57
+ "@google/generative-ai": "^0.21.0",
56
58
  "@loadingio/css-spinner": "^2.0.2",
57
59
  "@neodrag/vanilla": "^2.0.3",
60
+ "@nomiclabs/hardhat-ethers": "^2.2.3",
61
+ "@nomiclabs/hardhat-etherscan": "^3.1.8",
62
+ "@nomiclabs/hardhat-waffle": "^2.0.6",
63
+ "@openzeppelin/contracts": "^5.0.2",
58
64
  "adm-zip": "^0.5.10",
59
65
  "ag-grid-community": "31.0.0",
60
66
  "axios": "^1.5.1",
61
67
  "chai": "^5.1.0",
62
68
  "cli-progress": "^3.12.0",
63
69
  "cli-spinners": "^3.0.0",
70
+ "clipboardy": "^4.0.0",
64
71
  "color": "^4.2.3",
65
72
  "colors": "^1.4.0",
66
73
  "commander": "^12.1.0",
67
74
  "compression": "^1.7.4",
68
- "copy-paste": "^1.5.3",
69
75
  "cors": "^2.8.5",
70
76
  "d3": "^7.9.0",
71
77
  "deepmerge": "^4.3.1",
@@ -106,6 +112,7 @@
106
112
  "prom-client": "^15.1.2",
107
113
  "public-ip": "^6.0.1",
108
114
  "read": "^2.1.0",
115
+ "rrule": "^2.8.1",
109
116
  "sharp": "^0.32.5",
110
117
  "shelljs": "^0.8.5",
111
118
  "simple-git": "^3.26.0",
@@ -125,6 +132,7 @@
125
132
  "devDependencies": {
126
133
  "clean-jsdoc-theme": "^4.3.0",
127
134
  "easy-json-schema": "^0.0.2-beta",
135
+ "hardhat": "^2.22.13",
128
136
  "mocha": "^10.4.0",
129
137
  "plantuml": "^0.0.2",
130
138
  "swagger-autogen": "^2.23.7"
@@ -26,7 +26,11 @@ const UserSchema = new Schema(
26
26
  profileImageId: { type: Schema.Types.ObjectId, ref: 'File' },
27
27
  phoneNumbers: [
28
28
  {
29
- type: { type: String, enum: ['office', 'home', 'private'], number: { type: String } },
29
+ type: {
30
+ type: String,
31
+ enum: ['office', 'home', 'private'],
32
+ },
33
+ number: { type: String },
30
34
  },
31
35
  ],
32
36
  publicKey: {
@@ -58,6 +62,10 @@ const UserDto = {
58
62
  },
59
63
  },
60
64
  auth: {
65
+ // TODO: -> set login device, location, ip, fingerprint
66
+ // and validate on authorization middleware
67
+ // -> dynamic refresh 100 tokens per session with 12h interval
68
+ // -> back secret per user, registrarion user model -> secret: { type: String }
61
69
  payload: (user) => ({ _id: user._id.toString(), role: user.role, email: user.email }),
62
70
  },
63
71
  };