underpost 2.8.872 → 2.8.873
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/.env.development +2 -1
- package/.env.production +2 -1
- package/.env.test +2 -1
- package/.github/workflows/ghpkg.ci.yml +1 -1
- package/.github/workflows/npmpkg.ci.yml +1 -1
- package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +2 -4
- package/README.md +22 -2
- package/bin/build.js +4 -0
- package/bin/deploy.js +4 -0
- package/cli.md +3 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +138 -0
- package/manifests/deployment/dd-test-development/proxy.yaml +26 -0
- package/package.json +5 -1
- package/src/api/core/core.router.js +2 -1
- package/src/api/default/default.controller.js +6 -1
- package/src/api/default/default.router.js +6 -2
- package/src/api/default/default.service.js +10 -1
- package/src/api/file/file.router.js +2 -1
- package/src/api/test/test.router.js +1 -1
- package/src/api/user/postman_collection.json +216 -0
- package/src/api/user/user.controller.js +25 -60
- package/src/api/user/user.model.js +29 -7
- package/src/api/user/user.router.js +6 -3
- package/src/api/user/user.service.js +80 -32
- package/src/cli/baremetal.js +33 -3
- package/src/cli/cloud-init.js +11 -0
- package/src/cli/deploy.js +5 -2
- package/src/cli/index.js +1 -0
- package/src/cli/lxd.js +7 -0
- package/src/cli/run.js +17 -5
- package/src/cli/ssh.js +20 -6
- package/src/client/components/core/AgGrid.js +28 -6
- package/src/client/components/core/Auth.js +98 -55
- package/src/client/components/core/LogIn.js +16 -23
- package/src/client/components/core/LogOut.js +5 -1
- package/src/client/components/core/Pagination.js +202 -9
- package/src/client/components/core/Router.js +30 -3
- package/src/client/components/core/SignUp.js +1 -2
- package/src/client/components/default/LogInDefault.js +0 -6
- package/src/client/components/default/LogOutDefault.js +0 -16
- package/src/client/services/core/core.service.js +5 -1
- package/src/client/services/default/default.management.js +115 -18
- package/src/client/services/default/default.service.js +9 -4
- package/src/client/services/user/user.management.js +6 -0
- package/src/client/services/user/user.service.js +11 -4
- package/src/index.js +24 -2
- package/src/runtime/lampp/Lampp.js +89 -2
- package/src/runtime/xampp/Xampp.js +48 -1
- package/src/server/auth.js +518 -155
- package/src/server/conf.js +19 -1
- package/src/server/runtime.js +62 -228
- package/src/server/ssr.js +85 -0
- package/src/server/valkey.js +2 -1
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -2,7 +2,7 @@ name: CD | Release deployment | remote ssh
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_run:
|
|
5
|
-
workflows: [
|
|
5
|
+
workflows: ["CI | Publish npm package"]
|
|
6
6
|
types:
|
|
7
7
|
- completed
|
|
8
8
|
|
|
@@ -34,6 +34,4 @@ jobs:
|
|
|
34
34
|
node bin run --dev pull
|
|
35
35
|
underpost run secret
|
|
36
36
|
underpost run underpost-config
|
|
37
|
-
underpost run ssh-deploy engine-
|
|
38
|
-
underpost run ssh-deploy engine-lampp
|
|
39
|
-
underpost run ssh-deploy engine-cyberia
|
|
37
|
+
underpost run ssh-deploy engine-test
|
package/README.md
CHANGED
|
@@ -31,6 +31,16 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
34
44
|
|
|
35
45
|
|
|
36
46
|
|
|
@@ -45,7 +55,7 @@
|
|
|
45
55
|
<!-- badges -->
|
|
46
56
|
|
|
47
57
|
|
|
48
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.8.873) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
49
59
|
|
|
50
60
|
|
|
51
61
|
<!-- end-badges -->
|
|
@@ -65,6 +75,16 @@
|
|
|
65
75
|
|
|
66
76
|
|
|
67
77
|
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
68
88
|
|
|
69
89
|
|
|
70
90
|
|
|
@@ -120,7 +140,7 @@ Run dev client server
|
|
|
120
140
|
npm run dev
|
|
121
141
|
```
|
|
122
142
|
<!-- -->
|
|
123
|
-
## underpost ci/cd cli v2.8.
|
|
143
|
+
## underpost ci/cd cli v2.8.873
|
|
124
144
|
|
|
125
145
|
### Usage: `underpost [options] [command]`
|
|
126
146
|
```
|
package/bin/build.js
CHANGED
|
@@ -191,6 +191,10 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
191
191
|
fs.copyFileSync(`./.github/workflows/${repoName}.ci.yml`, `${basePath}/.github/workflows/${repoName}.ci.yml`);
|
|
192
192
|
fs.copyFileSync(`./.github/workflows/${repoName}.cd.yml`, `${basePath}/.github/workflows/${repoName}.cd.yml`);
|
|
193
193
|
|
|
194
|
+
fs.copyFileSync(`./conf.${confName}.js`, `${basePath}/conf.js`);
|
|
195
|
+
fs.copyFileSync(`./manifests/deployment/${confName}-development/proxy.yaml`, `${basePath}/proxy.yaml`);
|
|
196
|
+
fs.copyFileSync(`./manifests/deployment/${confName}-development/deployment.yaml`, `${basePath}/deployment.yaml`);
|
|
197
|
+
|
|
194
198
|
if (fs.existsSync(`./src/ws/${confName.split('-')[1]}`)) {
|
|
195
199
|
fs.copySync(`./src/ws/${confName.split('-')[1]}`, `${basePath}/src/ws/${confName.split('-')[1]}`);
|
|
196
200
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -372,6 +372,7 @@ try {
|
|
|
372
372
|
shellExec(`node bin run kill 4002`);
|
|
373
373
|
shellExec(`node bin run kill 4003`);
|
|
374
374
|
shellExec(`npm run update-template`);
|
|
375
|
+
shellExec(`cd ../pwa-microservices-template && npm install`);
|
|
375
376
|
shellExec(`cd ../pwa-microservices-template && npm run build && timeout 5s npm run dev`, {
|
|
376
377
|
async: true,
|
|
377
378
|
});
|
|
@@ -448,6 +449,9 @@ try {
|
|
|
448
449
|
shellExec(
|
|
449
450
|
`node bin deploy --kubeadm --build-manifest --sync --info-router --replicas 1 --node ${node} dd production`,
|
|
450
451
|
);
|
|
452
|
+
shellExec(
|
|
453
|
+
`node bin deploy --kubeadm --build-manifest --sync --info-router --replicas 1 --node ${node} dd development `,
|
|
454
|
+
);
|
|
451
455
|
for (const deployId of fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(`,`)) {
|
|
452
456
|
fs.copySync(
|
|
453
457
|
`./engine-private/conf/${deployId}/build/development/deployment.yaml`,
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.873
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -298,6 +298,7 @@ Options:
|
|
|
298
298
|
secrets.
|
|
299
299
|
--replicas <replicas> Sets a custom number of replicas for
|
|
300
300
|
deployments.
|
|
301
|
+
--image <image> Sets a custom image for deployments.
|
|
301
302
|
--versions <deployment-versions> A comma-separated list of custom deployment
|
|
302
303
|
versions.
|
|
303
304
|
--traffic <traffic-versions> A comma-separated list of custom deployment
|
|
@@ -599,7 +600,7 @@ Options:
|
|
|
599
600
|
Runs a script from the specified path.
|
|
600
601
|
|
|
601
602
|
Arguments:
|
|
602
|
-
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api,
|
|
603
|
+
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api, sync, ls-deployments, monitor, db-client, promote, metrics, cluster, deploy, tf-vae-test, deploy-job.
|
|
603
604
|
path The absolute or relative directory path where the script is located.
|
|
604
605
|
|
|
605
606
|
Options:
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.8.873
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.8.873
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
name: dd-test-development-blue
|
|
6
|
+
labels:
|
|
7
|
+
app: dd-test-development-blue
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 1
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels:
|
|
12
|
+
app: dd-test-development-blue
|
|
13
|
+
template:
|
|
14
|
+
metadata:
|
|
15
|
+
labels:
|
|
16
|
+
app: dd-test-development-blue
|
|
17
|
+
spec:
|
|
18
|
+
containers:
|
|
19
|
+
- name: dd-test-development-blue
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.8.873
|
|
21
|
+
# resources:
|
|
22
|
+
# requests:
|
|
23
|
+
# memory: "96294Ki"
|
|
24
|
+
# cpu: "75m"
|
|
25
|
+
# limits:
|
|
26
|
+
# memory: "1540709Ki"
|
|
27
|
+
# cpu: "1200m"
|
|
28
|
+
command:
|
|
29
|
+
- /bin/sh
|
|
30
|
+
- -c
|
|
31
|
+
- >
|
|
32
|
+
npm install -g npm@11.2.0 &&
|
|
33
|
+
npm install -g underpost &&
|
|
34
|
+
underpost secret underpost --create-from-file /etc/config/.env.development &&
|
|
35
|
+
underpost start --build --run dd-test development
|
|
36
|
+
volumeMounts:
|
|
37
|
+
- name: config-volume
|
|
38
|
+
mountPath: /etc/config
|
|
39
|
+
volumes:
|
|
40
|
+
- name: config-volume
|
|
41
|
+
configMap:
|
|
42
|
+
name: underpost-config
|
|
43
|
+
---
|
|
44
|
+
apiVersion: v1
|
|
45
|
+
kind: Service
|
|
46
|
+
metadata:
|
|
47
|
+
name: dd-test-development-blue-service
|
|
48
|
+
spec:
|
|
49
|
+
selector:
|
|
50
|
+
app: dd-test-development-blue
|
|
51
|
+
ports:
|
|
52
|
+
- name: 'tcp-4021'
|
|
53
|
+
protocol: TCP
|
|
54
|
+
port: 4021
|
|
55
|
+
targetPort: 4021
|
|
56
|
+
- name: 'udp-4021'
|
|
57
|
+
protocol: UDP
|
|
58
|
+
port: 4021
|
|
59
|
+
targetPort: 4021
|
|
60
|
+
|
|
61
|
+
- name: 'tcp-4022'
|
|
62
|
+
protocol: TCP
|
|
63
|
+
port: 4022
|
|
64
|
+
targetPort: 4022
|
|
65
|
+
- name: 'udp-4022'
|
|
66
|
+
protocol: UDP
|
|
67
|
+
port: 4022
|
|
68
|
+
targetPort: 4022
|
|
69
|
+
type: LoadBalancer
|
|
70
|
+
---
|
|
71
|
+
apiVersion: apps/v1
|
|
72
|
+
kind: Deployment
|
|
73
|
+
metadata:
|
|
74
|
+
name: dd-test-development-green
|
|
75
|
+
labels:
|
|
76
|
+
app: dd-test-development-green
|
|
77
|
+
spec:
|
|
78
|
+
replicas: 1
|
|
79
|
+
selector:
|
|
80
|
+
matchLabels:
|
|
81
|
+
app: dd-test-development-green
|
|
82
|
+
template:
|
|
83
|
+
metadata:
|
|
84
|
+
labels:
|
|
85
|
+
app: dd-test-development-green
|
|
86
|
+
spec:
|
|
87
|
+
containers:
|
|
88
|
+
- name: dd-test-development-green
|
|
89
|
+
image: localhost/rockylinux9-underpost:v2.8.873
|
|
90
|
+
# resources:
|
|
91
|
+
# requests:
|
|
92
|
+
# memory: "96294Ki"
|
|
93
|
+
# cpu: "75m"
|
|
94
|
+
# limits:
|
|
95
|
+
# memory: "1540709Ki"
|
|
96
|
+
# cpu: "1200m"
|
|
97
|
+
command:
|
|
98
|
+
- /bin/sh
|
|
99
|
+
- -c
|
|
100
|
+
- >
|
|
101
|
+
npm install -g npm@11.2.0 &&
|
|
102
|
+
npm install -g underpost &&
|
|
103
|
+
underpost secret underpost --create-from-file /etc/config/.env.development &&
|
|
104
|
+
underpost start --build --run dd-test development
|
|
105
|
+
volumeMounts:
|
|
106
|
+
- name: config-volume
|
|
107
|
+
mountPath: /etc/config
|
|
108
|
+
volumes:
|
|
109
|
+
- name: config-volume
|
|
110
|
+
configMap:
|
|
111
|
+
name: underpost-config
|
|
112
|
+
---
|
|
113
|
+
apiVersion: v1
|
|
114
|
+
kind: Service
|
|
115
|
+
metadata:
|
|
116
|
+
name: dd-test-development-green-service
|
|
117
|
+
spec:
|
|
118
|
+
selector:
|
|
119
|
+
app: dd-test-development-green
|
|
120
|
+
ports:
|
|
121
|
+
- name: 'tcp-4021'
|
|
122
|
+
protocol: TCP
|
|
123
|
+
port: 4021
|
|
124
|
+
targetPort: 4021
|
|
125
|
+
- name: 'udp-4021'
|
|
126
|
+
protocol: UDP
|
|
127
|
+
port: 4021
|
|
128
|
+
targetPort: 4021
|
|
129
|
+
|
|
130
|
+
- name: 'tcp-4022'
|
|
131
|
+
protocol: TCP
|
|
132
|
+
port: 4022
|
|
133
|
+
targetPort: 4022
|
|
134
|
+
- name: 'udp-4022'
|
|
135
|
+
protocol: UDP
|
|
136
|
+
port: 4022
|
|
137
|
+
targetPort: 4022
|
|
138
|
+
type: LoadBalancer
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
apiVersion: projectcontour.io/v1
|
|
4
|
+
kind: HTTPProxy
|
|
5
|
+
metadata:
|
|
6
|
+
name: test.nexodev.org
|
|
7
|
+
spec:
|
|
8
|
+
virtualhost:
|
|
9
|
+
fqdn: test.nexodev.org
|
|
10
|
+
routes:
|
|
11
|
+
- conditions:
|
|
12
|
+
- prefix: /
|
|
13
|
+
enableWebsockets: true
|
|
14
|
+
services:
|
|
15
|
+
- name: dd-test-development-blue-service
|
|
16
|
+
port: 4021
|
|
17
|
+
weight: 100
|
|
18
|
+
|
|
19
|
+
- conditions:
|
|
20
|
+
- prefix: /peer
|
|
21
|
+
enableWebsockets: true
|
|
22
|
+
services:
|
|
23
|
+
- name: dd-test-development-blue-service
|
|
24
|
+
port: 4022
|
|
25
|
+
weight: 100
|
|
26
|
+
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "underpost",
|
|
5
|
-
"version": "2.8.
|
|
5
|
+
"version": "2.8.873",
|
|
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",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"colors": "^1.4.0",
|
|
64
64
|
"commander": "^12.1.0",
|
|
65
65
|
"compression": "^1.7.4",
|
|
66
|
+
"cookie-parser": "^1.4.7",
|
|
66
67
|
"cors": "^2.8.5",
|
|
67
68
|
"d3": "^7.9.0",
|
|
68
69
|
"dotenv": "^16.3.1",
|
|
@@ -70,9 +71,12 @@
|
|
|
70
71
|
"env-cmd": "^10.1.0",
|
|
71
72
|
"express": "^4.18.2",
|
|
72
73
|
"express-fileupload": "^1.4.3",
|
|
74
|
+
"express-rate-limit": "^8.1.0",
|
|
75
|
+
"express-slow-down": "^3.0.0",
|
|
73
76
|
"favicons": "^7.2.0",
|
|
74
77
|
"fs-extra": "^11.1.1",
|
|
75
78
|
"fullcalendar": "^6.1.15",
|
|
79
|
+
"helmet": "^8.1.0",
|
|
76
80
|
"html-minifier-terser": "^7.2.0",
|
|
77
81
|
"http-proxy-middleware": "^2.0.6",
|
|
78
82
|
"ignore-walk": "^6.0.4",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { adminGuard
|
|
1
|
+
import { adminGuard } from '../../server/auth.js';
|
|
2
2
|
import { loggerFactory } from '../../server/logger.js';
|
|
3
3
|
import { CoreController } from './core.controller.js';
|
|
4
4
|
import express from 'express';
|
|
@@ -7,6 +7,7 @@ const logger = loggerFactory(import.meta);
|
|
|
7
7
|
|
|
8
8
|
const CoreRouter = (options) => {
|
|
9
9
|
const router = express.Router();
|
|
10
|
+
const authMiddleware = options.authMiddleware;
|
|
10
11
|
router.post(`/:id`, authMiddleware, adminGuard, async (req, res) => await CoreController.post(req, res, options));
|
|
11
12
|
router.post(`/`, authMiddleware, adminGuard, async (req, res) => await CoreController.post(req, res, options));
|
|
12
13
|
router.get(`/:id`, authMiddleware, adminGuard, async (req, res) => await CoreController.get(req, res, options));
|
|
@@ -21,7 +21,12 @@ const DefaultController = {
|
|
|
21
21
|
},
|
|
22
22
|
get: async (req, res, options) => {
|
|
23
23
|
try {
|
|
24
|
-
const
|
|
24
|
+
const { page, limit } = req.query;
|
|
25
|
+
const result = await DefaultService.get(
|
|
26
|
+
{ ...req, query: { ...req.query, page: parseInt(page), limit: parseInt(limit) } },
|
|
27
|
+
res,
|
|
28
|
+
options,
|
|
29
|
+
);
|
|
25
30
|
return res.status(200).json({
|
|
26
31
|
status: 'success',
|
|
27
32
|
data: result,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { authMiddleware } from '../../server/auth.js';
|
|
2
1
|
import { loggerFactory } from '../../server/logger.js';
|
|
3
2
|
import { DefaultController } from './default.controller.js';
|
|
4
3
|
import express from 'express';
|
|
@@ -7,9 +6,14 @@ const logger = loggerFactory(import.meta);
|
|
|
7
6
|
|
|
8
7
|
const DefaultRouter = (options) => {
|
|
9
8
|
const router = express.Router();
|
|
9
|
+
const authMiddleware = options.authMiddleware;
|
|
10
10
|
router.post(`/:id`, async (req, res) => await DefaultController.post(req, res, options));
|
|
11
11
|
router.post(`/`, async (req, res) => await DefaultController.post(req, res, options));
|
|
12
|
-
router.get(
|
|
12
|
+
router.get(
|
|
13
|
+
`/:id`,
|
|
14
|
+
// authMiddleware,
|
|
15
|
+
async (req, res) => await DefaultController.get(req, res, options),
|
|
16
|
+
);
|
|
13
17
|
router.get(`/`, async (req, res) => await DefaultController.get(req, res, options));
|
|
14
18
|
router.put(`/:id`, async (req, res) => await DefaultController.put(req, res, options));
|
|
15
19
|
router.put(`/`, async (req, res) => await DefaultController.put(req, res, options));
|
|
@@ -13,7 +13,16 @@ const DefaultService = {
|
|
|
13
13
|
/** @type {import('./default.model.js').DefaultModel} */
|
|
14
14
|
const Default = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Default;
|
|
15
15
|
if (req.params.id) return await Default.findById(req.params.id);
|
|
16
|
-
|
|
16
|
+
const { query, page = 1, limit = 10, sort = { updatedAt: -1 } } = req.query;
|
|
17
|
+
const queryPayload = query ? JSON.parse(query) : {};
|
|
18
|
+
const skip = (page - 1) * limit;
|
|
19
|
+
const [data, total] = await Promise.all([
|
|
20
|
+
Default.find(queryPayload).sort(sort).limit(limit).skip(skip),
|
|
21
|
+
Default.countDocuments(queryPayload),
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
const totalPages = Math.ceil(total / limit);
|
|
25
|
+
return { data, total, page, totalPages };
|
|
17
26
|
},
|
|
18
27
|
put: async (req, res, options) => {
|
|
19
28
|
/** @type {import('./default.model.js').DefaultModel} */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { adminGuard
|
|
1
|
+
import { adminGuard } from '../../server/auth.js';
|
|
2
2
|
import { loggerFactory } from '../../server/logger.js';
|
|
3
3
|
import { FileController } from './file.controller.js';
|
|
4
4
|
import express from 'express';
|
|
@@ -6,6 +6,7 @@ const logger = loggerFactory(import.meta);
|
|
|
6
6
|
|
|
7
7
|
const FileRouter = (options) => {
|
|
8
8
|
const router = express.Router();
|
|
9
|
+
const authMiddleware = options.authMiddleware;
|
|
9
10
|
router.post(`/:id`, authMiddleware, async (req, res) => await FileController.post(req, res, options));
|
|
10
11
|
router.post(`/`, authMiddleware, async (req, res) => await FileController.post(req, res, options));
|
|
11
12
|
router.get(`/blob/:id`, async (req, res) => await FileController.get(req, res, options));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { authMiddleware } from '../../server/auth.js';
|
|
2
1
|
import { loggerFactory } from '../../server/logger.js';
|
|
3
2
|
import { TestController } from './test.controller.js';
|
|
4
3
|
import express from 'express';
|
|
@@ -7,6 +6,7 @@ const logger = loggerFactory(import.meta);
|
|
|
7
6
|
|
|
8
7
|
const TestRouter = (options) => {
|
|
9
8
|
const router = express.Router();
|
|
9
|
+
const authMiddleware = options.authMiddleware;
|
|
10
10
|
router.post(`/:id`, async (req, res) => await TestController.post(req, res, options));
|
|
11
11
|
router.post(`/`, authMiddleware, async (req, res) => await TestController.post(req, res, options));
|
|
12
12
|
router.get(`/:id`, async (req, res) => await TestController.get(req, res, options));
|