ref(frontend): update to absolute import

This commit is contained in:
이강준
2022-11-26 18:19:41 +09:00
parent 001df70e26
commit 22c184840c
73 changed files with 2029 additions and 1287 deletions
@@ -1,24 +1,26 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
const changeHerokuConfigVars = ({ integrationId, key, secrets }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration/" + integrationId + "/sync", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
key,
secrets,
})
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration/" + integrationId + "/sync",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
key,
secrets,
}),
}
).then(async (res) => {
if (res.status == 200) {
return res;
} else {
console.log('Failed to sync secrets to Heroku');
console.log("Failed to sync secrets to Heroku");
}
})
});
};
export default changeHerokuConfigVars;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
@@ -7,19 +7,21 @@ import { PATH } from "../../../const";
* @returns
*/
const deleteIntegration = ({ integrationId }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration/" + integrationId, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration/" + integrationId,
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
}
).then(async (res) => {
if (res.status == 200) {
return (await res.json()).workspace;
} else {
console.log('Failed to delete an integration');
console.log("Failed to delete an integration");
}
})
});
};
export default deleteIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
@@ -7,19 +7,21 @@ import { PATH } from "../../../const";
* @returns
*/
const deleteIntegrationAuth = ({ integrationAuthId }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration-auth/" + integrationAuthId, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration-auth/" + integrationAuthId,
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
}
).then(async (res) => {
if (res.status == 200) {
return res;
} else {
console.log('Failed to delete an integration authorization');
console.log("Failed to delete an integration authorization");
}
})
});
};
export default deleteIntegrationAuth;
@@ -1,20 +1,22 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
const getIntegrationApps = ({ integrationAuthId }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration-auth/" + integrationAuthId + "/apps", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration-auth/" + integrationAuthId + "/apps",
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
}
).then(async (res) => {
if (res.status == 200) {
return (await res.json()).apps;
} else {
console.log('Failed to get available apps for an integration');
console.log("Failed to get available apps for an integration");
}
})
});
};
export default getIntegrationApps;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
const getIntegrations = () => {
@@ -7,14 +7,13 @@ const getIntegrations = () => {
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
}).then(async (res) => {
if (res.status == 200) {
return (await res.json()).integrations;
} else {
console.log('Failed to get project integrations');
console.log("Failed to get project integrations");
}
})
});
};
export default getIntegrations;
@@ -1,32 +1,34 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
* This route starts the integration after teh default one if gonna set up.
* This route starts the integration after teh default one if gonna set up.
* @param {*} integrationId
* @returns
*/
const startIntegration = ({ integrationId, appName, environment }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration/" + integrationId, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"update": {
app: appName,
environment,
isActive: true
}
})
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration/" + integrationId,
{
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
update: {
app: appName,
environment,
isActive: true,
},
}),
}
).then(async (res) => {
if (res.status == 200) {
return res;
} else {
console.log('Failed to start an integration');
console.log("Failed to start an integration");
}
})
});
};
export default startIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
@@ -7,24 +7,26 @@ import { PATH } from "../../../const";
* @returns
*/
const AuthorizeIntegration = ({ workspaceId, code, integration }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/integration-auth/oauth-token", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
workspaceId,
code,
integration
}),
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/integration-auth/oauth-token",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
workspaceId,
code,
integration,
}),
}
).then(async (res) => {
if (res.status == 200) {
return res;
} else {
console.log('Failed to authorize the integration');
console.log("Failed to authorize the integration");
}
})
});
};
export default AuthorizeIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
@@ -7,19 +7,21 @@ import { PATH } from "../../../const";
* @returns
*/
const getWorkspaceAuthorizations = ({ workspaceId }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/workspace/" + workspaceId + "/authorizations", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/workspace/" + workspaceId + "/authorizations",
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
}
).then(async (res) => {
if (res.status == 200) {
return (await res.json()).authorizations;
} else {
console.log('Failed to get project authorizations');
console.log("Failed to get project authorizations");
}
})
});
};
export default getWorkspaceAuthorizations;
@@ -1,4 +1,4 @@
import SecurityClient from "../../../components/utilities/SecurityClient";
import SecurityClient from "~/utilities/SecurityClient";
import { PATH } from "../../../const";
/**
@@ -7,19 +7,21 @@ import { PATH } from "../../../const";
* @returns
*/
const getWorkspaceIntegrations = ({ workspaceId }) => {
return SecurityClient.fetchCall(PATH + "/api/v1/workspace/" + workspaceId + "/integrations", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
})
.then(async res => {
return SecurityClient.fetchCall(
PATH + "/api/v1/workspace/" + workspaceId + "/integrations",
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
}
).then(async (res) => {
if (res.status == 200) {
return (await res.json()).integrations;
} else {
console.log('Failed to get the project integrations');
console.log("Failed to get the project integrations");
}
})
});
};
export default getWorkspaceIntegrations;