feat(#31): implemented ui for multi env and integrated api with backend

fix(#31): fixed all v2 release conflict
This commit is contained in:
akhilmhdh
2023-01-11 23:12:05 +05:30
parent 9116bf3344
commit 84700308f5
23 changed files with 1051 additions and 851 deletions
+14 -11
View File
@@ -1,4 +1,4 @@
import express from 'express';
import express, { Response, Request } from 'express';
const router = express.Router();
import { body, param } from 'express-validator';
import { environmentController } from '../../controllers/v2';
@@ -7,14 +7,15 @@ import {
requireWorkspaceAuth,
validateRequest,
} from '../../middleware';
import { ADMIN, MEMBER, COMPLETED, GRANTED } from '../../variables';
import { ADMIN, MEMBER } from '../../variables';
router.post(
'/:workspaceId',
requireAuth,
'/:workspaceId/environments',
requireAuth({
acceptedAuthModes: ['jwt'],
}),
requireWorkspaceAuth({
acceptedRoles: [ADMIN, MEMBER],
acceptedStatuses: [COMPLETED, GRANTED],
}),
param('workspaceId').exists().trim(),
body('environmentSlug').exists().trim(),
@@ -24,11 +25,12 @@ router.post(
);
router.put(
'/:workspaceId',
requireAuth,
'/:workspaceId/environments',
requireAuth({
acceptedAuthModes: ['jwt'],
}),
requireWorkspaceAuth({
acceptedRoles: [ADMIN, MEMBER],
acceptedStatuses: [COMPLETED, GRANTED],
}),
param('workspaceId').exists().trim(),
body('environmentSlug').exists().trim(),
@@ -39,11 +41,12 @@ router.put(
);
router.delete(
'/:workspaceId',
requireAuth,
'/:workspaceId/environments',
requireAuth({
acceptedAuthModes: ['jwt'],
}),
requireWorkspaceAuth({
acceptedRoles: [ADMIN],
acceptedStatuses: [GRANTED],
}),
param('workspaceId').exists().trim(),
body('environmentSlug').exists().trim(),