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(),
+2 -2
View File
@@ -18,7 +18,7 @@ import {
router.post(
'/',
body('workspaceId').exists().isString().trim(),
body('environment').exists().isString().trim().isIn(['dev', 'staging', 'prod', 'test']),
body('environment').exists().isString().trim(),
body('secrets')
.exists()
.custom((value) => {
@@ -73,7 +73,7 @@ router.post(
router.get(
'/',
query('workspaceId').exists().trim(),
query('environment').exists().trim().isIn(['dev', 'staging', 'prod', 'test']),
query('environment').exists().trim(),
validateRequest,
requireAuth({
acceptedAuthModes: ['jwt', 'serviceToken']