Repository: spaship/spaship
Pull request #1772 (2022-06-02 11:39:23)

feat(api) : file structure changed in api
<!--
Follow the steps to create the PR:

Subject: "feat/fix/docs(#issue_id): <PR Subject>"
Assignees: "Developers"
Projects: ""
-->

## Closes / Fixes / Resolves

<!-- Comman separated list of GitHub Issue ID(s) -->

## Explain the feature/fix

<!-- Provide a clear explaination of the feature/fix implemented -->

## Does this PR introduce a breaking change

<!-- Yes/No -->

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications here. -->

## Screenshot(s)

<!-- If applicable, add screenshots to help explain your problem. -->

<details>
<summary>View Screenshots</summary>

<!-- Add your screenshot(s) below this line -->

</details>

### Ready-for-merge Checklist

- [ ] Expected files: all files in this pull request are related to one feature request or issue (no stragglers)?
- [ ] Does the change have appropriate unit tests?
- [ ] Did you update or add any necessary documentation (README.md, WHY.md, etc.)?
- [ ] Was this feature demo'd and the design review approved?



Patch:
diff --git a/packages/api/app.js b/packages/api/app.js
index 3c24c0f6..781cfa8f 100644
--- a/packages/api/app.js
+++ b/packages/api/app.js
@@ -17,7 +17,6 @@ const config = require("./config");
 const routes = require("./routes");
 const swaggerDocument = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "openapi.yml"), "utf8"));
 const app = new express();
-const consumeSSE = require("./controllers/operatorServices/consumeEvent.js");
 app
   .use(bodyParser.json({ limit: "50mb" }))
   .use(bodyParser.urlencoded({ limit: "50mb", extended: true, parameterLimit: 50000 }))
diff --git a/packages/api/controllers/application.js b/packages/api/controllers/application.js
index 0109f60f..37a62e56 100644
--- a/packages/api/controllers/application.js
+++ b/packages/api/controllers/application.js
@@ -6,7 +6,6 @@ const Application = require("../models/application");
 const DeployError = require("../utils/errors/DeployError");
 const NotFoundError = require("../utils/errors/NotFoundError");
 const NotImplementedError = require("../utils/errors/NotImplementedError");
-const cliActivities = require("../models/cliActivities");
 const { getUserUUID } = require("../utils/requestUtil");
 const { uuid } = require("uuidv4");
 const jwt = require("jsonwebtoken");
diff --git a/packages/api/controllers/webProperties/analyzeRepository.js b/packages/api/controllers/deprecated/webProperties/analyzeRepository.js
similarity index 98%
rename from packages/api/controllers/webProperties/analyzeRepository.js
rename to packages/api/controllers/deprecated/webProperties/analyzeRepository.js
index ed1078f6..7f7c50c5 100644
--- a/packages/api/controllers/webProperties/analyzeRepository.js
+++ b/packages/api/controllers/deprecated/webProperties/analyzeRepository.js
@@ -2,7 +2,7 @@ const Git = require("nodegit");
 const path = require("path");
 const fs = require("fs");
 const { uuid } = require("uuidv4");
-const config = require("../../config");
+const config = require("../../../config");
 
 const delay = (millis) =>
   new Promise((resolve, reject) => {
diff --git a/packages/api/controllers/webProperties/getWebPropertyList.js b/packages/api/controllers/deprecated/webProperties/getWebPropertyList.js
similarity index 94%
rename from packages/api/controllers/webProperties/getWebPropertyList.js
rename to packages/api/controllers/deprecated/webProperties/getWebPropertyList.js
index 1f01400c..5b491de0 100644
--- a/packages/api/controllers/webProperties/getWebPropertyList.js
+++ b/packages/api/controllers/deprecated/webProperties/getWebPropertyList.js
@@ -1,4 +1,4 @@
-const webProperty = require("../../models/webProperty");
+const webProperty = require("../../../models/webProperty");
 
 const getWebPropertyList = async (req, res, next) => {
   try {
diff --git a/packages/api/controllers/webProperties/gitOperations.js b/packages/api/controllers/deprecated/webProperties/gitOperations.js
similarity index 99%
rename from packages/api/controllers/webProperties/gitOperations.js
rename to packages/api/controllers/deprecated/webProperties/gitOperations.js
index 28141f16..b74191fe 100644
--- a/packages/api/controllers/webProperties/gitOperations.js
+++ b/packages/api/controllers/deprecated/webProperties/gitOperations.js
@@ -4,7 +4,7 @@ const fs = require("fs");
 const { uuid } = require("uuidv4");
 const zip = require("zip-a-folder").zip;
 const saveWebProperty = require("./saveWebProperty");
-const config = require("../../config");
+const config = require("../../../config");
 
 const delay = (millis) =>
   new Promise((resolve, reject) => {
diff --git a/packages/api/controllers/deprecated/webProperties/saveWebProperty.js b/packages/api/controllers/deprecated/webProperties/saveWebProperty.js
new file mode 100644
index 00000000..d8c1f4b7
--- /dev/null
+++ b/packages/api/controllers/deprecated/webProperties/saveWebProperty.js
@@ -0,0 +1,100 @@
+const webProperty = require("../../../models/webProperty");
+const { uuid } = require("uuidv4");
+
+module.exports = async function saveWebProperty(req, res, next) {
+  if (getWebPropertyId(req)) {
+    const updatedResponse = await updateWebProperty(req);
+    return updatedResponse;
+  }
+  let webPropertyId = getGeneratedSpaConfigId();
+  let webPropertyRequest = createWebPropertyRequest(webPropertyId, req);
+  const createdResponse = await createWebProperty(webPropertyRequest);
+  return createdResponse;
+};
+
+async function createWebProperty(webPropertyRequest) {
+  try {
+    const saveResponse = await webPropertyRequest.save();
+    return saveResponse;
+  } catch (e) {
+    return { Error: e };
+  }
+}
+
+function getGeneratedSpaConfigId() {
+  return uuid();
+}
+
+function createWebPropertyRequest(id, req) {
+  const currentTime = new Date();
+  const webPropertyRequest = new webProperty({
+    webPropertyId: id,
+    webPropertyName: getWebPropertyName(req),
+    repositoryConfigs: getRepositoryConfigs(req),
+    isActive: true,
+    createdAt: currentTime,
+    updatedAt: currentTime,
+  });
+  return webPropertyRequest;
+}
+
+async function updateWebProperty(req) {
+  const requestWebPropertyId = getWebPropertyId(req);
+  const updateResponse = await webProperty.findOneAndUpdate(
+    { webPropertyId: requestWebPropertyId },
+    updateWebPropertyRequest(req),
+    (error, data) => {
+      if (error) {
+        console.log(error);
+      }
+    }
+  );
+  return updateResponse;
+}
+
+function updateWebPropertyRequest(req) {
+  const updateRequest = {
+    webPropertyName: getWebPropertyName(req),
+    repositoryConfigs: getRepositoryConfigs(req),
+    isActive: true,
+    updatedAt: new Date(),
+  };
+  return JSON.parse(JSON.stringify(updateRequest));
+}
+
+function getSpas(req, reqBody) {
+  return req.map((each) => ({
+    repositoryLink: each?.repositoryLink,
+    spaName: each?.webPropertyName,
+    contextPath: each?.contextPath,
+    env: each?.env,
+    ownerEmail: reqBody.body?.ownerEmail,
+    ownerName: reqBody.body?.ownerName,
+  }));
+}
+
+function getRepositoryConfigs(req) {
+  return req.body?.repositoryConfigs.map((each) => ({
+    repositoryLink: each?.repositoryLink,
+    branch: each?.branch,
+    gitToken: each.gitToken,
+    spas: getSpas(each.spas, req),
+  }));
+}
+
+function getWebPropertyId(req) {
+  const requestWebPropertyId = req?.body?.webPropertyId || "";
+  return requestWebPropertyId.toString();
+}
+
+function getGitToken(req) {
+  return req.body?.gitToken || "";
+}
+
+function getWebPropertyName(req) {
+  return req?.body?.webPropertyName || "";
+}
+
+function getIsActive(req) {
+  return req?.body?.isActive || false;
+}
diff --git a/packages/api/controllers/services/analyticsServiceAll.js b/packages/api/controllers/operatorServices/analytics/analyticsServiceAll.js
similarity index 93%
rename from packages/api/controllers/services/analyticsServiceAll.js
rename to packages/api/controllers/operatorServices/analytics/analyticsServiceAll.js
index 759a69b0..75b819f5 100644
--- a/packages/api/controllers/services/analyticsServiceAll.js
+++ b/packages/api/controllers/operatorServices/analytics/analyticsServiceAll.js
@@ -1,6 +1,6 @@
-const getCounts = require("../webPropertyServices/getCountDeployments");
-const getCountByEnvWeeklyChart = require("../webPropertyServices/getCountByEnvWeeklyChart");
-const getLatestActivities = require("../webPropertyServices/getLatestActivities");
+const getCounts = require("./utils/getCountDeployments");
+const getCountByEnvWeeklyChart = require("./utils/getCountByEnvWeeklyChart");
+const getLatestActivities = require("./utils/getLatestActivities");
 
 const analyticsServiceAll = async (req, res) => {
   try {
diff --git a/packages/api/controllers/services/analyticsServiceFilter.js b/packages/api/controllers/operatorServices/analytics/analyticsServiceFilter.js
similarity index 93%
rename from packages/api/controllers/services/analyticsServiceFilter.js
rename to packages/api/controllers/operatorServices/analytics/analyticsServiceFilter.js
index b307d4df..ba22bf1a 100644
--- a/packages/api/controllers/services/analyticsServiceFilter.js
+++ b/packages/api/controllers/operatorServices/analytics/analyticsServiceFilter.js
@@ -1,7 +1,7 @@
-const getTimeFrameForPropertyChart = require("../webPropertyServices/utils/getTimeFrameForPropertyChart");
-const getLatestActivities = require("../webPropertyServices/getLatestActivities");
-const getCountByEnvWeeklyChart = require("../webPropertyServices/getCountByEnvWeeklyChart");
-const getCounts = require("../webPropertyServices/getCountDeployments");
+const getTimeFrameForPropertyChart = require("./utils/getTimeFrameForPropertyChart");
+const getLatestActivities = require("./utils/getLatestActivities");
+const getCountByEnvWeeklyChart = require("./utils/getCountByEnvWeeklyChart");
+const getCounts = require("./utils/getCountDeployments");
 
 const analyticsServiceFilter = async (req, res) => {
   try {
diff --git a/packages/api/controllers/webPropertyServices/getCountByEnvWeeklyChart.js b/packages/api/controllers/operatorServices/analytics/utils/getCountByEnvWeeklyChart.js
similarity index 97%
rename from packages/api/controllers/webPropertyServices/getCountByEnvWeeklyChart.js
rename to packages/api/controllers/operatorServices/analytics/utils/getCountByEnvWeeklyChart.js
index 047eab4a..f16286f0 100644
--- a/packages/api/controllers/webPropertyServices/getCountByEnvWeeklyChart.js
+++ b/packages/api/controllers/operatorServices/analytics/utils/getCountByEnvWeeklyChart.js
@@ -1,4 +1,4 @@
-const chart = require("../../models/event");
+const chart = require("../../../../models/event");
 
 const getCountByEnvWeeklyChartService = async (matchRequest, groupRequest, projectRequest) => {
   try {
diff --git a/packages/api/controllers/webPropertyServices/getCountDeployments.js b/packages/api/controllers/operatorServices/analytics/utils/getCountDeployments.js
similarity index 92%
rename from packages/api/controllers/webPropertyServices/getCountDeployments.js
rename to packages/api/controllers/operatorServices/analytics/utils/getCountDeployments.js
index 331ddbe1..317d8558 100644
--- a/packages/api/controllers/webPropertyServices/getCountDeployments.js
+++ b/packages/api/controllers/operatorServices/analytics/utils/getCountDeployments.js
@@ -1,4 +1,4 @@
-const chart = require("../../models/event");
+const chart = require("../../../../models/event");
 
 const getCountService = async (matchRequest, groupRequest, projectRequest) => {
   try {
diff --git a/packages/api/controllers/webPropertyServices/utils/getTimeFrameForPropertyChart.js b/packages/api/controllers/operatorServices/analytics/utils/getTimeFrameForPropertyChart.js
similarity index 97%
rename from packages/api/controllers/webPropertyServices/utils/getTimeFrameForPropertyChart.js
rename to packages/api/controllers/operatorServices/analytics/utils/getTimeFrameForPropertyChart.js
index 218aaf17..bcb52fe3 100644
--- a/packages/api/controllers/webPropertyServices/utils/getTimeFrameForPropertyChart.js
+++ b/packages/api/controllers/operatorServices/analytics/utils/getTimeFrameForPropertyChart.js
@@ -1,4 +1,4 @@
-const chart = require("../../../models/eventTimeTrace");
+const chart = require("../../../../models/eventTimeTrace");
 
 const getTimeFrameForPropertyChart = async (req, res) => {
   res.send(await getTimeFrameForPropertyChartService(req.sanitize(req.params.propertyName)));
diff --git a/packages/api/controllers/operatorServices/consumeEvent.js b/packages/api/controllers/operatorServices/event/consumeEvent.js
similarity index 88%
rename from packages/api/controllers/operatorServices/consumeEvent.js
rename to packages/api/controllers/operatorServices/event/consumeEvent.js
index 07dcc96f..3eda62f9 100644
--- a/packages/api/controllers/operatorServices/consumeEvent.js
+++ b/packages/api/controllers/operatorServices/event/consumeEvent.js
@@ -1,9 +1,9 @@
-const event = require("../../models/event");
-const eventTimeTrace = require("../../models/eventTimeTrace");
-const webProperty = require("../../models/webProperty");
+const event = require("../../../models/event");
+const eventTimeTrace = require("../../../models/eventTimeTrace");
+const webProperty = require("../../../models/webProperty");
 const EventSource = require("eventsource");
 const { uuid } = require("uuidv4");
-const config = require("../../config");
+const config = require("../../../config");
 const source = new EventSource(config.get("sse:base_path"));
 const { log } = require("@spaship/common/lib/logging/pino");
 
diff --git a/packages/api/controllers/operatorServices/produceEvent.js b/packages/api/controllers/operatorServices/event/produceEvent.js
similarity index 97%
rename from packages/api/controllers/operatorServices/produceEvent.js
rename to packages/api/controllers/operatorServices/event/produceEvent.js
index 1124e76e..43e05ce7 100644
--- a/packages/api/controllers/operatorServices/produceEvent.js
+++ b/packages/api/controllers/operatorServices/event/produceEvent.js
@@ -1,5 +1,5 @@
 const EventSource = require("eventsource");
-const config = require("../../config");
+const config = require("../../../config");
 const { uuid } = require("uuidv4");
 const { log } = require("@spaship/common/lib/logging/pino");
 
diff --git a/packages/api/controllers/webProperties/getAliasList.js b/packages/api/controllers/operatorServices/operations/getAliasList.js
similarity index 90%
rename from packages/api/controllers/webProperties/getAliasList.js
rename to packages/api/controllers/operatorServices/operations/getAliasList.js
index 09781b2c..0fd325ca 100644
--- a/packages/api/controllers/webProperties/getAliasList.js
+++ b/packages/api/controllers/operatorServices/operations/getAliasList.js
@@ -1,4 +1,4 @@
-const alias = require("../../models/alias");
+const alias = require("../../../models/alias");
 
 module.exports = async function getAliasList(req, res, next) {
   try {
diff --git a/packages/api/controllers/webPropertyServices/utils/getPropertyDetails.js b/packages/api/controllers/operatorServices/operations/getPropertyList.js
similarity index 91%
rename from packages/api/controllers/webPropertyServices/utils/getPropertyDetails.js
rename to packages/api/controllers/operatorServices/operations/getPropertyList.js
index 032855c8..49bea924 100644
--- a/packages/api/controllers/webPropertyServices/utils/getPropertyDetails.js
+++ b/packages/api/controllers/operatorServices/operations/getPropertyList.js
@@ -1,6 +1,6 @@
 const application = require("../../../models/application");
 
-const getPropertyDetails = async (req, res, next) => {
+const getPropertyList = async (req, res, next) => {
   try {
     if (req?.params.propertyName && req?.params.spaName)
       res.status(200).json(
@@ -57,4 +57,4 @@ async function fetchSearchResultForSPA(props) {
   ]);
 }
 
-module.exports = { getPropertyDetails, getPropertyDetailsService };
+module.exports = {  getPropertyList, getPropertyDetailsService };
diff --git a/packages/api/controllers/webProperties/getSPAList.js b/packages/api/controllers/operatorServices/operations/getSPAList.js
similarity index 95%
rename from packages/api/controllers/webProperties/getSPAList.js
rename to packages/api/controllers/operatorServices/operations/getSPAList.js
index 6d1b63a3..9811783a 100644
--- a/packages/api/controllers/webProperties/getSPAList.js
+++ b/packages/api/controllers/operatorServices/operations/getSPAList.js
@@ -1,4 +1,4 @@
-const webProperty = require("../../models/webProperty");
+const webProperty = require("../../../models/webProperty");
 
 const getSPAList = async (req, res, next) => {
   try {
diff --git a/packages/api/controllers/webPropertyServices/utils/getSearchResultForSPA.js b/packages/api/controllers/operatorServices/operations/getSearchResultForSPA.js
similarity index 100%
rename from packages/api/controllers/webPropertyServices/utils/getSearchResultForSPA.js
rename to packages/api/controllers/operatorServices/operations/getSearchResultForSPA.js
diff --git a/packages/api/controllers/operatorServices/saveAlias.js b/packages/api/controllers/operatorServices/operations/saveAlias.js
similarity index 96%
rename from packages/api/controllers/operatorServices/saveAlias.js
rename to packages/api/controllers/operatorServices/operations/saveAlias.js
index 3079753a..6cf7f166 100644
--- a/packages/api/controllers/operatorServices/saveAlias.js
+++ b/packages/api/controllers/operatorServices/operations/saveAlias.js
@@ -1,6 +1,6 @@
-const alias = require("../../models/alias");
+const alias = require("../../../models/alias");
 const { uuid } = require("uuidv4");
-const ValidationError = require("../../utils/errors/ValidationError");
+const ValidationError = require("../../../utils/errors/ValidationError");
 
 module.exports = async function saveAlias(req, res, next) {
   console.log(req.body);
diff --git a/packages/api/controllers/operatorServices/saveEvent.js b/packages/api/controllers/operatorServices/operations/saveEvent.js
similarity index 94%
rename from packages/api/controllers/operatorServices/saveEvent.js
rename to packages/api/controllers/operatorServices/operations/saveEvent.js
index b9cd2c99..3a8ba788 100644
--- a/packages/api/controllers/operatorServices/saveEvent.js
+++ b/packages/api/controllers/operatorServices/operations/saveEvent.js
@@ -1,4 +1,4 @@
-const event = require('../../models/event')
+const event = require('../../../models/event')
 const { uuid } = require('uuidv4');
 const sse = require('../../notifications/sseProducer')
 
diff --git a/packages/api/controllers/webProperties/saveWebProperty.js b/packages/api/controllers/webProperties/saveWebProperty.js
deleted file mode 100644
index bc84cd2a..00000000
--- a/packages/api/controllers/webProperties/saveWebProperty.js
+++ /dev/null
@@ -1,99 +0,0 @@
-const webProperty = require('../../models/webProperty')
-const { uuid } = require('uuidv4');
-
-module.exports = async function saveWebProperty(req, res, next) {
-    if (getWebPropertyId(req)) {
-        const updatedResponse = await updateWebProperty(req);
-        return updatedResponse;
-    }
-    let webPropertyId = getGeneratedSpaConfigId();
-    let webPropertyRequest = createWebPropertyRequest(webPropertyId, req)
-    const createdResponse = await createWebProperty(webPropertyRequest);
-    return createdResponse;
-}
-
-async function createWebProperty(webPropertyRequest) {
-    try {
-        const saveResponse = await webPropertyRequest.save();
-        return saveResponse;
-    } catch (e) {
-        return { "Error": e };
-    }
-}
-
-function getGeneratedSpaConfigId() {
-    return uuid();
-}
-
-function createWebPropertyRequest(id, req) {
-    const currentTime = new Date();
-    const webPropertyRequest = new webProperty({
-        webPropertyId: id,
-        webPropertyName: getWebPropertyName(req),
-        repositoryConfigs: getRepositoryConfigs(req),
-        isActive: true,
-        createdAt: currentTime,
-        updatedAt: currentTime,
-    });
-    return webPropertyRequest;
-}
-
-async function updateWebProperty(req) {
-    const requestWebPropertyId=getWebPropertyId(req);
-    const updateResponse = await webProperty.findOneAndUpdate({ webPropertyId: requestWebPropertyId },
-        updateWebPropertyRequest(req),
-        (error, data) => {
-            if (error) {
-                console.log(error);
-            }
-        }
-    );
-    return updateResponse;
-}
-
-function updateWebPropertyRequest(req) {
-    const updateRequest = {
-        webPropertyName: getWebPropertyName(req),
-        repositoryConfigs: getRepositoryConfigs(req),
-        isActive: true,
-        updatedAt: new Date()
-    };
-    return JSON.parse(JSON.stringify(updateRequest));
-}
-
-function getSpas(req, reqBody) {
-    return req.map((each) => ({
-        repositoryLink: each?.repositoryLink,
-        spaName: each?.webPropertyName,
-        contextPath: each?.contextPath,
-        env: each?.env,
-        ownerEmail : reqBody.body?.ownerEmail,
-        ownerName: reqBody.body?.ownerName
-    }));
-}
-
-function getRepositoryConfigs(req) {
-    return req.body?.repositoryConfigs.map((each) => ({
-        repositoryLink: each?.repositoryLink,
-        branch: each?.branch,
-        gitToken: each.gitToken,
-        spas: getSpas(each.spas, req),
-    }));
-}
-
-function getWebPropertyId(req) {
-    const requestWebPropertyId = req?.body?.webPropertyId || ''
-    return requestWebPropertyId.toString();
-}
-
-function getGitToken(req) {
-    return req.body?.gitToken || '';
-}
-
-function getWebPropertyName(req) {
-    return req?.body?.webPropertyName || '';
-}
-
-function getIsActive(req) {
-    return req?.body?.isActive || false;
-}
diff --git a/packages/api/models/cliActivities.js b/packages/api/models/cliActivities.js
deleted file mode 100644
index 779c2476..00000000
--- a/packages/api/models/cliActivities.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const mongoose = require("mongoose");
-
-const cliActivities = new mongoose.Schema({
-  id: {
-    type: String,
-    required: true,
-  },
-  fileName: {
-    type: String,
-    required: false,
-  },
-  webProperty: {
-    type: String,
-    required: false,
-  },
-  description: {
-    type: String,
-    required: false,
-  },
-  isActive: {
-    type: Boolean,
-    required: false,
-  },
-  createdAt: {
-    type: Date,
-    required: false,
-  },
-  udpatedAt: {
-    type: Date,
-    required: false,
-  },
-});
-
-module.exports = mongoose.model("cliActivities", cliActivities);
\ No newline at end of file
diff --git a/packages/api/routes/event.js b/packages/api/routes/event.js
index c2d75e45..e87bad45 100644
--- a/packages/api/routes/event.js
+++ b/packages/api/routes/event.js
@@ -1,7 +1,7 @@
 const { Router } = require("express");
-const getSearchResultForSPA = require("../controllers/webPropertyServices/utils/getSearchResultForSPA");
-const analyticsServiceAll = require("../controllers/services/analyticsServiceAll");
-const analyticsServiceFilter = require("../controllers/services/analyticsServiceFilter");
+const getSearchResultForSPA = require("../controllers/operatorServices//operations/getSearchResultForSPA");
+const analyticsServiceAll = require("../controllers/operatorServices/analytics/analyticsServiceAll");
+const analyticsServiceFilter = require("../controllers/operatorServices/analytics/analyticsServiceFilter");
 
 const router = new Router();
 
diff --git a/packages/api/routes/webProperty.js b/packages/api/routes/webProperty.js
index e56e4626..f2af5dfe 100644
--- a/packages/api/routes/webProperty.js
+++ b/packages/api/routes/webProperty.js
@@ -1,12 +1,12 @@
 const { Router } = require("express");
-const produceEvent = require("../controllers/operatorServices/produceEvent");
-const analyzeRepository = require("../controllers/webProperties/analyzeRepository");
-const getSPAList = require("../controllers/webProperties/getSPAList");
-const getWebPropertyList = require("../controllers/webProperties/getWebPropertyList");
-const getAliasList = require("../controllers/webProperties/getAliasList");
-const gitOperations = require("../controllers/webProperties/gitOperations");
-const saveAlias = require("../controllers/operatorServices/saveAlias");
-const getPropertyDetails = require("../controllers/webPropertyServices/utils/getPropertyDetails");
+const produceEvent = require("../controllers/operatorServices/event/produceEvent");
+const analyzeRepository = require("../controllers/deprecated/webProperties/analyzeRepository");
+const getSPAList = require("../controllers/operatorServices/operations/getSPAList");
+const getWebPropertyList = require("../controllers/deprecated/webProperties/getWebPropertyList");
+const getAliasList = require("../controllers/operatorServices/operations/getAliasList");
+const gitOperations = require("../controllers/deprecated/webProperties/gitOperations");
+const saveAlias = require("../controllers/operatorServices/operations/saveAlias");
+const getPropertyList = require("../controllers/operatorServices/operations/getPropertyList");
 
 const router = new Router();
 
@@ -26,10 +26,10 @@ router.get("/alias/list", getAliasList);
 
 router.get("/alias/list/:propertyName", getAliasList);
 
-router.get("/get/applications", getPropertyDetails.getPropertyDetails);
+router.get("/get/applications", getPropertyList.getPropertyList);
 
-router.get("/get/applications/:propertyName", getPropertyDetails.getPropertyDetails);
+router.get("/get/applications/:propertyName", getPropertyList.getPropertyList);
 
-router.get("/get/applications/:propertyName/:spaName", getPropertyDetails.getPropertyDetails);
+router.get("/get/applications/:propertyName/:spaName", getPropertyList.getPropertyList);
 
 module.exports = router;
diff --git a/packages/api/services/deployService.js b/packages/api/services/deployService.js
index b512e126..44c36209 100644
--- a/packages/api/services/deployService.js
+++ b/packages/api/services/deployService.js
@@ -9,7 +9,6 @@ const fileService = require("./fileService");
 const alias = require("../models/alias");
 const os = require("os");
 const archiver = require("archiver");
-const cliActivities = require("../models/cliActivities");
 const { uuid } = require("uuidv4");
 const FormData = require("form-data");
 const axios = require("axios");


Test patch:
diff --git a/packages/api/controllers/webPropertyServices/getLatestActivities.js b/packages/api/controllers/operatorServices/analytics/utils/getLatestActivities.js
similarity index 96%
rename from packages/api/controllers/webPropertyServices/getLatestActivities.js
rename to packages/api/controllers/operatorServices/analytics/utils/getLatestActivities.js
index a6cb36f2..e7599dde 100644
--- a/packages/api/controllers/webPropertyServices/getLatestActivities.js
+++ b/packages/api/controllers/operatorServices/analytics/utils/getLatestActivities.js
@@ -1,4 +1,4 @@
-const chart = require("../../models/event");
+const chart = require("../../../../models/event");
 
 const getLatestActivitiesService = async (matchRequest, limitRequest, skipRequest) => {
   try {