@intranefr/superbackend 1.5.2 → 1.6.3
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/cookies.txt +6 -0
- package/cookies1.txt +6 -0
- package/cookies2.txt +6 -0
- package/cookies3.txt +6 -0
- package/cookies4.txt +5 -0
- package/cookies_old.txt +5 -0
- package/cookies_old_test.txt +6 -0
- package/cookies_super.txt +5 -0
- package/cookies_super_test.txt +6 -0
- package/cookies_test.txt +6 -0
- package/index.js +9 -0
- package/manage.js +745 -0
- package/package.json +6 -2
- package/plugins/core-waiting-list-migration/README.md +118 -0
- package/plugins/core-waiting-list-migration/index.js +438 -0
- package/plugins/global-settings-presets/index.js +20 -0
- package/plugins/hello-cli/index.js +17 -0
- package/plugins/ui-components-seeder/components/suiAlert.js +212 -0
- package/plugins/ui-components-seeder/components/suiToast.js +186 -0
- package/plugins/ui-components-seeder/index.js +31 -0
- package/public/js/admin-ui-components-preview.js +281 -0
- package/public/js/admin-ui-components.js +408 -0
- package/public/js/llm-provider-model-picker.js +193 -0
- package/public/test-iframe-fix.html +63 -0
- package/public/test-iframe.html +14 -0
- package/src/admin/endpointRegistry.js +68 -0
- package/src/controllers/admin.controller.js +36 -10
- package/src/controllers/adminAgents.controller.js +37 -0
- package/src/controllers/adminDataCleanup.controller.js +45 -0
- package/src/controllers/adminLlm.controller.js +19 -8
- package/src/controllers/adminLogin.controller.js +269 -0
- package/src/controllers/adminMarkdowns.controller.js +157 -0
- package/src/controllers/adminPlugins.controller.js +55 -0
- package/src/controllers/adminRegistry.controller.js +106 -0
- package/src/controllers/adminScripts.controller.js +138 -0
- package/src/controllers/adminStats.controller.js +4 -4
- package/src/controllers/adminTelegram.controller.js +72 -0
- package/src/controllers/markdowns.controller.js +42 -0
- package/src/controllers/registry.controller.js +32 -0
- package/src/controllers/waitingList.controller.js +52 -74
- package/src/helpers/mongooseHelper.js +6 -6
- package/src/helpers/scriptBase.js +2 -2
- package/src/middleware/auth.js +71 -1
- package/src/middleware/rbac.js +62 -0
- package/src/middleware.js +584 -176
- package/src/models/Agent.js +105 -0
- package/src/models/AgentMessage.js +82 -0
- package/src/models/GlobalSetting.js +11 -1
- package/src/models/Markdown.js +75 -0
- package/src/models/ScriptRun.js +8 -0
- package/src/models/TelegramBot.js +42 -0
- package/src/models/UiComponent.js +2 -0
- package/src/models/User.js +1 -1
- package/src/routes/admin.routes.js +3 -3
- package/src/routes/adminAgents.routes.js +13 -0
- package/src/routes/adminAssets.routes.js +11 -11
- package/src/routes/adminBlog.routes.js +2 -2
- package/src/routes/adminBlogAi.routes.js +2 -2
- package/src/routes/adminBlogAutomation.routes.js +2 -2
- package/src/routes/adminCache.routes.js +2 -2
- package/src/routes/adminConsoleManager.routes.js +2 -2
- package/src/routes/adminCrons.routes.js +2 -2
- package/src/routes/adminDataCleanup.routes.js +26 -0
- package/src/routes/adminDbBrowser.routes.js +2 -2
- package/src/routes/adminEjsVirtual.routes.js +2 -2
- package/src/routes/adminFeatureFlags.routes.js +6 -6
- package/src/routes/adminHeadless.routes.js +2 -2
- package/src/routes/adminHealthChecks.routes.js +2 -2
- package/src/routes/adminI18n.routes.js +2 -2
- package/src/routes/adminJsonConfigs.routes.js +8 -8
- package/src/routes/adminLlm.routes.js +8 -7
- package/src/routes/adminLogin.routes.js +23 -0
- package/src/routes/adminMarkdowns.routes.js +10 -0
- package/src/routes/adminMigration.routes.js +12 -12
- package/src/routes/adminPages.routes.js +2 -2
- package/src/routes/adminPlugins.routes.js +15 -0
- package/src/routes/adminProxy.routes.js +2 -2
- package/src/routes/adminRateLimits.routes.js +8 -8
- package/src/routes/adminRbac.routes.js +2 -2
- package/src/routes/adminRegistry.routes.js +24 -0
- package/src/routes/adminScripts.routes.js +6 -3
- package/src/routes/adminSeoConfig.routes.js +10 -10
- package/src/routes/adminTelegram.routes.js +14 -0
- package/src/routes/adminTerminals.routes.js +2 -2
- package/src/routes/adminUiComponents.routes.js +2 -2
- package/src/routes/adminUploadNamespaces.routes.js +7 -7
- package/src/routes/blogInternal.routes.js +2 -2
- package/src/routes/experiments.routes.js +2 -2
- package/src/routes/formsAdmin.routes.js +6 -6
- package/src/routes/globalSettings.routes.js +8 -8
- package/src/routes/internalExperiments.routes.js +2 -2
- package/src/routes/markdowns.routes.js +16 -0
- package/src/routes/notificationAdmin.routes.js +7 -7
- package/src/routes/orgAdmin.routes.js +16 -16
- package/src/routes/pages.routes.js +3 -3
- package/src/routes/registry.routes.js +11 -0
- package/src/routes/stripeAdmin.routes.js +12 -12
- package/src/routes/userAdmin.routes.js +7 -7
- package/src/routes/waitingListAdmin.routes.js +2 -2
- package/src/routes/workflows.routes.js +3 -3
- package/src/services/agent.service.js +546 -0
- package/src/services/agentHistory.service.js +345 -0
- package/src/services/agentTools.service.js +578 -0
- package/src/services/dataCleanup.service.js +286 -0
- package/src/services/jsonConfigs.service.js +284 -10
- package/src/services/llm.service.js +219 -6
- package/src/services/markdowns.service.js +522 -0
- package/src/services/plugins.service.js +348 -0
- package/src/services/registry.service.js +452 -0
- package/src/services/scriptsRunner.service.js +328 -37
- package/src/services/telegram.service.js +130 -0
- package/src/services/uiComponents.service.js +180 -0
- package/src/services/waitingListJson.service.js +401 -0
- package/src/utils/rbac/rightsRegistry.js +118 -0
- package/test-access.js +63 -0
- package/test-iframe-fix.html +63 -0
- package/test-iframe.html +14 -0
- package/views/admin-403.ejs +92 -0
- package/views/admin-agents.ejs +273 -0
- package/views/admin-coolify-deploy.ejs +8 -8
- package/views/admin-dashboard-home.ejs +52 -2
- package/views/admin-dashboard.ejs +179 -7
- package/views/admin-data-cleanup.ejs +357 -0
- package/views/admin-experiments.ejs +1 -1
- package/views/admin-login.ejs +286 -0
- package/views/admin-markdowns.ejs +905 -0
- package/views/admin-plugins-system.ejs +223 -0
- package/views/admin-scripts.ejs +221 -4
- package/views/admin-telegram.ejs +269 -0
- package/views/admin-ui-components.ejs +82 -402
- package/views/admin-users.ejs +207 -11
- package/views/partials/dashboard/nav-items.ejs +5 -0
- package/views/partials/llm-provider-model-picker.ejs +0 -161
- package/analysis-only.skill +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
const express = require("express");
|
|
2
2
|
const router = express.Router();
|
|
3
|
-
const {
|
|
3
|
+
const { adminSessionAuth } = require("../middleware/auth");
|
|
4
4
|
const adminLlmController = require("../controllers/adminLlm.controller");
|
|
5
5
|
const rateLimiter = require("../services/rateLimiter.service");
|
|
6
6
|
|
|
7
|
-
router.get("/config",
|
|
8
|
-
router.
|
|
9
|
-
router.
|
|
10
|
-
router.
|
|
11
|
-
router.
|
|
12
|
-
router.get("/
|
|
7
|
+
router.get("/config", adminSessionAuth, adminLlmController.getConfig);
|
|
8
|
+
router.get("/providers", adminSessionAuth, adminLlmController.listProviders);
|
|
9
|
+
router.post("/config", adminSessionAuth, rateLimiter.limit("llmConfigLimiter"), adminLlmController.saveConfig);
|
|
10
|
+
router.get("/openrouter/models", adminSessionAuth, adminLlmController.listOpenRouterModels);
|
|
11
|
+
router.post("/prompts/:key/test", adminSessionAuth, rateLimiter.limit("llmConfigLimiter"), adminLlmController.testPrompt);
|
|
12
|
+
router.get("/audit", adminSessionAuth, adminLlmController.listAudit);
|
|
13
|
+
router.get("/costs", adminSessionAuth, adminLlmController.listCosts);
|
|
13
14
|
|
|
14
15
|
module.exports = router;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
const adminLoginController = require('../controllers/adminLogin.controller');
|
|
4
|
+
const { auditMiddleware } = require('../services/auditLogger');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Admin Login Routes
|
|
8
|
+
* Handles both basic auth and IAM authentication through a unified login form
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Serve login page
|
|
12
|
+
router.get('/login', auditMiddleware('admin.login.view', { entityType: 'AdminSession' }), adminLoginController.getLogin);
|
|
13
|
+
|
|
14
|
+
// Process login (supports both basic auth and IAM)
|
|
15
|
+
router.post('/login', auditMiddleware('admin.login.attempt', { entityType: 'AdminSession' }), adminLoginController.postLogin);
|
|
16
|
+
|
|
17
|
+
// Logout and clear session
|
|
18
|
+
router.post('/logout', auditMiddleware('admin.logout', { entityType: 'AdminSession' }), adminLoginController.postLogout);
|
|
19
|
+
|
|
20
|
+
// API endpoint to check authentication status
|
|
21
|
+
router.get('/auth-status', adminLoginController.getAuthStatus);
|
|
22
|
+
|
|
23
|
+
module.exports = router;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
|
+
|
|
5
|
+
const adminMarkdownsController = require('../controllers/adminMarkdowns.controller');
|
|
6
|
+
|
|
7
|
+
router.use(adminSessionAuth);
|
|
8
|
+
router.post('/validate-path', adminSessionAuth, adminMarkdownsController.validatePath);
|
|
9
|
+
|
|
10
|
+
module.exports = router;
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const { auditMiddleware } = require('../services/auditLogger');
|
|
6
6
|
|
|
7
7
|
const adminMigrationController = require('../controllers/adminMigration.controller');
|
|
8
8
|
|
|
9
9
|
router.get(
|
|
10
10
|
'/environments',
|
|
11
|
-
|
|
11
|
+
adminSessionAuth,
|
|
12
12
|
adminMigrationController.listEnvironments,
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
router.get(
|
|
16
16
|
'/environments/:envKey',
|
|
17
|
-
|
|
17
|
+
adminSessionAuth,
|
|
18
18
|
adminMigrationController.getEnvironment,
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
router.get(
|
|
22
22
|
'/models',
|
|
23
|
-
|
|
23
|
+
adminSessionAuth,
|
|
24
24
|
adminMigrationController.listModels,
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
router.get(
|
|
28
28
|
'/models/:modelName/schema',
|
|
29
|
-
|
|
29
|
+
adminSessionAuth,
|
|
30
30
|
adminMigrationController.getModelSchema,
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
router.post(
|
|
34
34
|
'/preview',
|
|
35
|
-
|
|
35
|
+
adminSessionAuth,
|
|
36
36
|
adminMigrationController.preview,
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
router.post(
|
|
40
40
|
'/environments',
|
|
41
|
-
|
|
41
|
+
adminSessionAuth,
|
|
42
42
|
auditMiddleware('admin.migration.environments.upsert', { entityType: 'GlobalSetting' }),
|
|
43
43
|
adminMigrationController.upsertEnvironment,
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
router.delete(
|
|
47
47
|
'/environments/:envKey',
|
|
48
|
-
|
|
48
|
+
adminSessionAuth,
|
|
49
49
|
auditMiddleware('admin.migration.environments.delete', { entityType: 'GlobalSetting' }),
|
|
50
50
|
adminMigrationController.deleteEnvironment,
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
router.post(
|
|
54
54
|
'/test-connection',
|
|
55
|
-
|
|
55
|
+
adminSessionAuth,
|
|
56
56
|
auditMiddleware('admin.migration.test_connection', { entityType: 'Migration' }),
|
|
57
57
|
adminMigrationController.testConnection,
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
router.post(
|
|
61
61
|
'/test-assets',
|
|
62
|
-
|
|
62
|
+
adminSessionAuth,
|
|
63
63
|
auditMiddleware('admin.migration.test_assets', { entityType: 'Migration' }),
|
|
64
64
|
adminMigrationController.testAssetsTarget,
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
router.post(
|
|
68
68
|
'/test-assets-copy',
|
|
69
|
-
|
|
69
|
+
adminSessionAuth,
|
|
70
70
|
auditMiddleware('admin.migration.test_assets_copy', { entityType: 'Migration' }),
|
|
71
71
|
adminMigrationController.testAssetsCopyKey,
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
router.post(
|
|
75
75
|
'/run',
|
|
76
|
-
|
|
76
|
+
adminSessionAuth,
|
|
77
77
|
auditMiddleware('admin.migration.run', { entityType: 'Migration' }),
|
|
78
78
|
adminMigrationController.runMigration,
|
|
79
79
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
|
-
const {
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
4
|
const controller = require('../controllers/adminPages.controller');
|
|
5
5
|
const adminBlockDefinitionsController = require('../controllers/adminBlockDefinitions.controller');
|
|
6
6
|
const adminBlockDefinitionsAiController = require('../controllers/adminBlockDefinitionsAi.controller');
|
|
@@ -8,7 +8,7 @@ const adminContextBlockDefinitionsController = require('../controllers/adminCont
|
|
|
8
8
|
const adminPagesContextBlocksAiController = require('../controllers/adminPagesContextBlocksAi.controller');
|
|
9
9
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
10
10
|
|
|
11
|
-
router.use(
|
|
11
|
+
router.use(adminSessionAuth);
|
|
12
12
|
|
|
13
13
|
router.get('/collections', controller.listCollections);
|
|
14
14
|
router.get('/collections/:id', controller.getCollection);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
|
+
const controller = require('../controllers/adminPlugins.controller');
|
|
5
|
+
|
|
6
|
+
const router = express.Router();
|
|
7
|
+
|
|
8
|
+
router.use(adminSessionAuth);
|
|
9
|
+
|
|
10
|
+
router.get('/', controller.list);
|
|
11
|
+
router.post('/:id/enable', controller.enable);
|
|
12
|
+
router.post('/:id/disable', controller.disable);
|
|
13
|
+
router.post('/:id/install', controller.install);
|
|
14
|
+
|
|
15
|
+
module.exports = router;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const controller = require('../controllers/adminProxy.controller');
|
|
6
6
|
|
|
7
|
-
router.use(
|
|
7
|
+
router.use(adminSessionAuth);
|
|
8
8
|
|
|
9
9
|
router.get('/entries', controller.list);
|
|
10
10
|
router.get('/entries/:id', controller.get);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const adminRateLimitsController = require('../controllers/adminRateLimits.controller');
|
|
6
6
|
|
|
7
|
-
router.get('/',
|
|
8
|
-
router.get('/config',
|
|
9
|
-
router.put('/config',
|
|
10
|
-
router.get('/metrics',
|
|
7
|
+
router.get('/', adminSessionAuth, adminRateLimitsController.list);
|
|
8
|
+
router.get('/config', adminSessionAuth, adminRateLimitsController.getConfig);
|
|
9
|
+
router.put('/config', adminSessionAuth, adminRateLimitsController.updateConfig);
|
|
10
|
+
router.get('/metrics', adminSessionAuth, adminRateLimitsController.getMetrics);
|
|
11
11
|
|
|
12
|
-
router.post('/bulk-enabled',
|
|
12
|
+
router.post('/bulk-enabled', adminSessionAuth, adminRateLimitsController.bulkEnabled);
|
|
13
13
|
|
|
14
|
-
router.put('/:id',
|
|
15
|
-
router.post('/:id/reset',
|
|
14
|
+
router.put('/:id', adminSessionAuth, adminRateLimitsController.updateLimiter);
|
|
15
|
+
router.post('/:id/reset', adminSessionAuth, adminRateLimitsController.resetLimiter);
|
|
16
16
|
|
|
17
17
|
module.exports = router;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const controller = require('../controllers/adminRbac.controller');
|
|
6
6
|
|
|
7
|
-
router.use(
|
|
7
|
+
router.use(adminSessionAuth);
|
|
8
8
|
|
|
9
9
|
router.get('/rights', controller.listRights);
|
|
10
10
|
router.get('/users', controller.searchUsers);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
|
+
const controller = require('../controllers/adminRegistry.controller');
|
|
5
|
+
|
|
6
|
+
const router = express.Router();
|
|
7
|
+
|
|
8
|
+
router.use(adminSessionAuth);
|
|
9
|
+
|
|
10
|
+
router.get('/', controller.listRegistries);
|
|
11
|
+
router.post('/', controller.createRegistry);
|
|
12
|
+
router.get('/:id', controller.getRegistry);
|
|
13
|
+
router.put('/:id', controller.updateRegistry);
|
|
14
|
+
router.delete('/:id', controller.deleteRegistry);
|
|
15
|
+
|
|
16
|
+
router.get('/:id/items', controller.listItems);
|
|
17
|
+
router.post('/:id/items', controller.upsertItem);
|
|
18
|
+
router.put('/:id/items/:itemId', controller.upsertItem);
|
|
19
|
+
router.delete('/:id/items/:itemId', controller.deleteItem);
|
|
20
|
+
|
|
21
|
+
router.post('/:id/tokens', controller.createToken);
|
|
22
|
+
router.delete('/:id/tokens/:tokenId', controller.deleteToken);
|
|
23
|
+
|
|
24
|
+
module.exports = router;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const controller = require('../controllers/adminScripts.controller');
|
|
6
6
|
|
|
7
|
-
router.use(
|
|
7
|
+
router.use(adminSessionAuth);
|
|
8
8
|
|
|
9
9
|
router.get('/', controller.listScripts);
|
|
10
10
|
router.post('/', controller.createScript);
|
|
11
11
|
router.get('/runs', controller.listRuns);
|
|
12
12
|
router.get('/runs/:runId', controller.getRun);
|
|
13
|
-
router.get('/runs/:runId/stream', controller.
|
|
13
|
+
router.get('/runs/:runId/stream', controller.streamRunLogs);
|
|
14
|
+
router.get('/runs/:runId/programmatic-output', controller.getProgrammaticOutput);
|
|
15
|
+
router.get('/runs/:runId/full-output', controller.getFullOutput);
|
|
16
|
+
router.get('/runs/:runId/download', controller.downloadOutput);
|
|
14
17
|
|
|
15
18
|
router.get('/:id', controller.getScript);
|
|
16
19
|
router.put('/:id', controller.updateScript);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const adminSeoConfigController = require('../controllers/adminSeoConfig.controller');
|
|
6
6
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
7
7
|
|
|
8
|
-
router.get('/',
|
|
9
|
-
router.put('/',
|
|
8
|
+
router.get('/', adminSessionAuth, adminSeoConfigController.get);
|
|
9
|
+
router.put('/', adminSessionAuth, adminSeoConfigController.update);
|
|
10
10
|
|
|
11
11
|
// SEO Config helpers
|
|
12
|
-
router.get('/ai/views',
|
|
13
|
-
router.post('/ai/generate-entry',
|
|
14
|
-
router.post('/ai/improve-entry',
|
|
15
|
-
router.post('/pages/apply-entry',
|
|
12
|
+
router.get('/ai/views', adminSessionAuth, adminSeoConfigController.seoConfigAiListViews);
|
|
13
|
+
router.post('/ai/generate-entry', adminSessionAuth, rateLimiter.limit('seoAiLimiter'), adminSeoConfigController.seoConfigAiGenerateEntry);
|
|
14
|
+
router.post('/ai/improve-entry', adminSessionAuth, rateLimiter.limit('seoAiLimiter'), adminSeoConfigController.seoConfigAiImproveEntry);
|
|
15
|
+
router.post('/pages/apply-entry', adminSessionAuth, adminSeoConfigController.seoConfigApplyEntry);
|
|
16
16
|
|
|
17
|
-
router.put('/og/svg',
|
|
18
|
-
router.post('/og/generate-png',
|
|
19
|
-
router.post('/ai/edit-svg',
|
|
17
|
+
router.put('/og/svg', adminSessionAuth, adminSeoConfigController.updateOgSvg);
|
|
18
|
+
router.post('/og/generate-png', adminSessionAuth, rateLimiter.limit('seoAiLimiter'), adminSeoConfigController.generateOgPng);
|
|
19
|
+
router.post('/ai/edit-svg', adminSessionAuth, rateLimiter.limit('seoAiLimiter'), adminSeoConfigController.aiEditSvg);
|
|
20
20
|
|
|
21
21
|
module.exports = router;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
const adminTelegramController = require('../controllers/adminTelegram.controller');
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
|
+
|
|
6
|
+
router.use(adminSessionAuth);
|
|
7
|
+
|
|
8
|
+
router.get('/', adminTelegramController.listBots);
|
|
9
|
+
router.post('/', adminTelegramController.createBot);
|
|
10
|
+
router.put('/:id', adminTelegramController.updateBot);
|
|
11
|
+
router.delete('/:id', adminTelegramController.deleteBot);
|
|
12
|
+
router.post('/:id/toggle', adminTelegramController.toggleBot);
|
|
13
|
+
|
|
14
|
+
module.exports = router;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const controller = require('../controllers/adminTerminals.controller');
|
|
6
6
|
|
|
7
|
-
router.use(
|
|
7
|
+
router.use(adminSessionAuth);
|
|
8
8
|
|
|
9
9
|
router.post('/sessions', controller.createSession);
|
|
10
10
|
router.get('/sessions', controller.listSessions);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const adminUiComponentsController = require('../controllers/adminUiComponents.controller');
|
|
6
6
|
const adminUiComponentsAiController = require('../controllers/adminUiComponentsAi.controller');
|
|
7
7
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
8
8
|
|
|
9
|
-
router.use(
|
|
9
|
+
router.use(adminSessionAuth);
|
|
10
10
|
|
|
11
11
|
router.get('/projects', adminUiComponentsController.listProjects);
|
|
12
12
|
router.post('/projects', adminUiComponentsController.createProject);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
|
-
const {
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
4
|
const adminUploadNamespacesController = require('../controllers/adminUploadNamespaces.controller');
|
|
5
5
|
|
|
6
|
-
router.get('/',
|
|
7
|
-
router.get('/summary',
|
|
8
|
-
router.get('/:key',
|
|
9
|
-
router.post('/',
|
|
10
|
-
router.put('/:key',
|
|
11
|
-
router.delete('/:key',
|
|
6
|
+
router.get('/', adminSessionAuth, adminUploadNamespacesController.listNamespaces);
|
|
7
|
+
router.get('/summary', adminSessionAuth, adminUploadNamespacesController.getNamespacesSummary);
|
|
8
|
+
router.get('/:key', adminSessionAuth, adminUploadNamespacesController.getNamespace);
|
|
9
|
+
router.post('/', adminSessionAuth, adminUploadNamespacesController.createNamespace);
|
|
10
|
+
router.put('/:key', adminSessionAuth, adminUploadNamespacesController.updateNamespace);
|
|
11
|
+
router.delete('/:key', adminSessionAuth, adminUploadNamespacesController.deleteNamespace);
|
|
12
12
|
|
|
13
13
|
module.exports = router;
|
|
@@ -2,11 +2,11 @@ const express = require('express');
|
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
4
|
const controller = require('../controllers/blogInternal.controller');
|
|
5
|
-
const {
|
|
5
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
6
6
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
7
7
|
|
|
8
8
|
router.use(express.json({ limit: '1mb' }));
|
|
9
|
-
router.use(
|
|
9
|
+
router.use(adminSessionAuth);
|
|
10
10
|
|
|
11
11
|
router.post('/blog/automation/run', rateLimiter.limit('blogAiLimiter'), controller.runAutomation);
|
|
12
12
|
router.post('/blog/publish-scheduled/run', controller.publishScheduled);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
6
6
|
|
|
7
7
|
const controller = require('../controllers/experiments.controller');
|
|
8
8
|
|
|
9
9
|
router.use(express.json({ limit: '1mb' }));
|
|
10
|
-
router.use(
|
|
10
|
+
router.use(adminSessionAuth);
|
|
11
11
|
|
|
12
12
|
router.get(
|
|
13
13
|
'/:code/assignment',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
|
-
const {
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
4
|
const formsController = require('../controllers/forms.controller');
|
|
5
5
|
const asyncHandler = require('../utils/asyncHandler');
|
|
6
6
|
|
|
7
|
-
router.get('/',
|
|
8
|
-
router.delete('/:id',
|
|
9
|
-
router.get('/definitions',
|
|
10
|
-
router.post('/definitions',
|
|
11
|
-
router.delete('/definitions/:id',
|
|
7
|
+
router.get('/', adminSessionAuth, asyncHandler(formsController.adminList));
|
|
8
|
+
router.delete('/:id', adminSessionAuth, asyncHandler(formsController.deleteSubmission));
|
|
9
|
+
router.get('/definitions', adminSessionAuth, asyncHandler(formsController.getForms));
|
|
10
|
+
router.post('/definitions', adminSessionAuth, asyncHandler(formsController.saveForm));
|
|
11
|
+
router.delete('/definitions/:id', adminSessionAuth, asyncHandler(formsController.deleteForm));
|
|
12
12
|
|
|
13
13
|
module.exports = router;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
|
-
const {
|
|
3
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
4
4
|
const globalSettingsController = require('../controllers/globalSettings.controller');
|
|
5
5
|
|
|
6
6
|
// Public route (no auth)
|
|
7
7
|
router.get('/public', globalSettingsController.getPublicSettings);
|
|
8
8
|
|
|
9
|
-
// Protected routes (
|
|
10
|
-
router.get('/',
|
|
9
|
+
// Protected routes (Session Auth)
|
|
10
|
+
router.get('/', adminSessionAuth, globalSettingsController.getAllSettings);
|
|
11
11
|
// more specific path before :key catch-all
|
|
12
|
-
router.get('/:key/reveal',
|
|
13
|
-
router.get('/:key',
|
|
14
|
-
router.put('/:key',
|
|
15
|
-
router.post('/',
|
|
16
|
-
router.delete('/:key',
|
|
12
|
+
router.get('/:key/reveal', adminSessionAuth, globalSettingsController.revealSetting);
|
|
13
|
+
router.get('/:key', adminSessionAuth, globalSettingsController.getSetting);
|
|
14
|
+
router.put('/:key', adminSessionAuth, globalSettingsController.updateSetting);
|
|
15
|
+
router.post('/', adminSessionAuth, globalSettingsController.createSetting);
|
|
16
|
+
router.delete('/:key', adminSessionAuth, globalSettingsController.deleteSetting);
|
|
17
17
|
|
|
18
18
|
module.exports = router;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const rateLimiter = require('../services/rateLimiter.service');
|
|
6
6
|
|
|
7
7
|
const controller = require('../controllers/internalExperiments.controller');
|
|
8
8
|
|
|
9
9
|
router.use(express.json({ limit: '1mb' }));
|
|
10
|
-
router.use(
|
|
10
|
+
router.use(adminSessionAuth);
|
|
11
11
|
|
|
12
12
|
router.post('/experiments/aggregate/run', rateLimiter.limit('experimentsInternalAggLimiter'), controller.runAggregation);
|
|
13
13
|
router.post('/experiments/retention/run', rateLimiter.limit('experimentsInternalRetentionLimiter'), controller.runRetention);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
|
|
4
|
+
const markdownsController = require('../controllers/markdowns.controller');
|
|
5
|
+
|
|
6
|
+
// JSON versions (more specific first)
|
|
7
|
+
router.get('/:category/:group_code/:slug/json', markdownsController.getByPath);
|
|
8
|
+
router.get('/:category/:slug/json', markdownsController.getByPath);
|
|
9
|
+
|
|
10
|
+
// Raw versions
|
|
11
|
+
router.get('/:category/:group_code/:slug', markdownsController.getByPath);
|
|
12
|
+
router.get('/:category/:slug', markdownsController.getByPath); // No group_code
|
|
13
|
+
|
|
14
|
+
router.get('/search', markdownsController.search);
|
|
15
|
+
|
|
16
|
+
module.exports = router;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const notificationAdminController = require('../controllers/notificationAdmin.controller');
|
|
6
6
|
const asyncHandler = require('../utils/asyncHandler');
|
|
7
7
|
|
|
8
|
-
router.get('/stats',
|
|
9
|
-
router.get('/',
|
|
10
|
-
router.post('/send',
|
|
11
|
-
router.post('/broadcast',
|
|
12
|
-
router.delete('/:id',
|
|
13
|
-
router.post('/:id/retry-email',
|
|
8
|
+
router.get('/stats', adminSessionAuth, asyncHandler(notificationAdminController.getNotificationStats));
|
|
9
|
+
router.get('/', adminSessionAuth, asyncHandler(notificationAdminController.listNotifications));
|
|
10
|
+
router.post('/send', adminSessionAuth, asyncHandler(notificationAdminController.sendNotification));
|
|
11
|
+
router.post('/broadcast', adminSessionAuth, asyncHandler(notificationAdminController.broadcastNotification));
|
|
12
|
+
router.delete('/:id', adminSessionAuth, asyncHandler(notificationAdminController.deleteNotification));
|
|
13
|
+
router.post('/:id/retry-email', adminSessionAuth, asyncHandler(notificationAdminController.retryEmailNotification));
|
|
14
14
|
|
|
15
15
|
module.exports = router;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
const orgAdminController = require('../controllers/orgAdmin.controller');
|
|
6
6
|
const asyncHandler = require('../utils/asyncHandler');
|
|
7
7
|
|
|
8
|
-
router.get('/',
|
|
9
|
-
router.post('/',
|
|
10
|
-
router.get('/:orgId',
|
|
11
|
-
router.put('/:orgId',
|
|
12
|
-
router.patch('/:orgId/disable',
|
|
13
|
-
router.patch('/:orgId/enable',
|
|
14
|
-
router.delete('/:orgId',
|
|
8
|
+
router.get('/', adminSessionAuth, asyncHandler(orgAdminController.listOrgs));
|
|
9
|
+
router.post('/', adminSessionAuth, asyncHandler(orgAdminController.createOrganization));
|
|
10
|
+
router.get('/:orgId', adminSessionAuth, asyncHandler(orgAdminController.getOrg));
|
|
11
|
+
router.put('/:orgId', adminSessionAuth, asyncHandler(orgAdminController.updateOrganization));
|
|
12
|
+
router.patch('/:orgId/disable', adminSessionAuth, asyncHandler(orgAdminController.disableOrganization));
|
|
13
|
+
router.patch('/:orgId/enable', adminSessionAuth, asyncHandler(orgAdminController.enableOrganization));
|
|
14
|
+
router.delete('/:orgId', adminSessionAuth, asyncHandler(orgAdminController.deleteOrganization));
|
|
15
15
|
|
|
16
|
-
router.get('/:orgId/members',
|
|
17
|
-
router.post('/:orgId/members',
|
|
18
|
-
router.patch('/:orgId/members/:memberId',
|
|
19
|
-
router.delete('/:orgId/members/:memberId',
|
|
16
|
+
router.get('/:orgId/members', adminSessionAuth, asyncHandler(orgAdminController.listMembers));
|
|
17
|
+
router.post('/:orgId/members', adminSessionAuth, asyncHandler(orgAdminController.addMember));
|
|
18
|
+
router.patch('/:orgId/members/:memberId', adminSessionAuth, asyncHandler(orgAdminController.updateMember));
|
|
19
|
+
router.delete('/:orgId/members/:memberId', adminSessionAuth, asyncHandler(orgAdminController.removeMember));
|
|
20
20
|
|
|
21
|
-
router.get('/:orgId/invites',
|
|
22
|
-
router.post('/:orgId/invites',
|
|
23
|
-
router.delete('/:orgId/invites/:inviteId',
|
|
24
|
-
router.post('/:orgId/invites/:inviteId/resend',
|
|
21
|
+
router.get('/:orgId/invites', adminSessionAuth, asyncHandler(orgAdminController.listInvites));
|
|
22
|
+
router.post('/:orgId/invites', adminSessionAuth, asyncHandler(orgAdminController.createInvite));
|
|
23
|
+
router.delete('/:orgId/invites/:inviteId', adminSessionAuth, asyncHandler(orgAdminController.revokeInvite));
|
|
24
|
+
router.post('/:orgId/invites/:inviteId/resend', adminSessionAuth, asyncHandler(orgAdminController.resendInvite));
|
|
25
25
|
|
|
26
26
|
module.exports = router;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const router = express.Router();
|
|
3
3
|
const pagesService = require('../services/pages.service');
|
|
4
|
-
const {
|
|
4
|
+
const { adminSessionAuth } = require('../middleware/auth');
|
|
5
5
|
|
|
6
6
|
router.get('*', async (req, res, next) => {
|
|
7
7
|
try {
|
|
@@ -14,11 +14,11 @@ router.get('*', async (req, res, next) => {
|
|
|
14
14
|
|
|
15
15
|
if (draft) {
|
|
16
16
|
let nextCalled = false;
|
|
17
|
-
|
|
17
|
+
adminSessionAuth(req, res, () => {
|
|
18
18
|
nextCalled = true;
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
// If
|
|
21
|
+
// If adminSessionAuth did not call next(), it likely ended the response.
|
|
22
22
|
if (!nextCalled) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
|
|
3
|
+
const controller = require('../controllers/registry.controller');
|
|
4
|
+
const rateLimiter = require('../services/rateLimiter.service');
|
|
5
|
+
|
|
6
|
+
const router = express.Router();
|
|
7
|
+
|
|
8
|
+
router.get('/:id/auth', rateLimiter.limit('openRegistryAuthLimiter'), controller.auth);
|
|
9
|
+
router.get('/:id/list', rateLimiter.limit('openRegistryListLimiter'), controller.list);
|
|
10
|
+
|
|
11
|
+
module.exports = router;
|