chore(frontend): fixed all eslint errors

This commit is contained in:
akhilmhdh
2023-01-17 21:06:14 +05:30
parent 9f82e2d836
commit cf7834bfc3
184 changed files with 6255 additions and 6117 deletions
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
integrationId: string;
@@ -16,26 +16,22 @@ interface Props {
}[];
}
const changeHerokuConfigVars = ({ integrationId, key, secrets }: Props) => {
return SecurityClient.fetchCall(
'/api/v1/integration/' + integrationId + '/sync',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
key,
secrets
})
}
).then(async (res) => {
if (res && res.status == 200) {
const changeHerokuConfigVars = ({ integrationId, key, secrets }: Props) =>
SecurityClient.fetchCall(`/api/v1/integration/${integrationId}/sync`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
key,
secrets
})
}).then(async (res) => {
if (res && res.status === 200) {
return res;
} else {
console.log('Failed to sync secrets to Heroku');
}
console.log('Failed to sync secrets to Heroku');
return undefined;
});
};
export default changeHerokuConfigVars;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
integrationId: string;
@@ -9,19 +9,18 @@ interface Props {
* @param {*} integrationId
* @returns
*/
const deleteIntegration = ({ integrationId }: Props) => {
return SecurityClient.fetchCall('/api/v1/integration/' + integrationId, {
const deleteIntegration = ({ integrationId }: Props) =>
SecurityClient.fetchCall(`/api/v1/integration/${integrationId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
}).then(async (res) => {
if (res && res.status == 200) {
if (res && res.status === 200) {
return (await res.json()).workspace;
} else {
console.log('Failed to delete an integration');
}
console.log('Failed to delete an integration');
return undefined;
});
};
export default deleteIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
integrationAuthId: string;
@@ -9,22 +9,18 @@ interface Props {
* @param {*} integrationAuthId
* @returns
*/
const deleteIntegrationAuth = ({ integrationAuthId }: Props) => {
return SecurityClient.fetchCall(
'/api/v1/integration-auth/' + integrationAuthId,
{
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
const deleteIntegrationAuth = ({ integrationAuthId }: Props) =>
SecurityClient.fetchCall(`/api/v1/integration-auth/${integrationAuthId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
).then(async (res) => {
if (res && res.status == 200) {
}).then(async (res) => {
if (res && res.status === 200) {
return res;
} else {
console.log('Failed to delete an integration authorization');
}
console.log('Failed to delete an integration authorization');
return undefined;
});
};
export default deleteIntegrationAuth;
@@ -1,25 +1,21 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
integrationAuthId: string;
}
const getIntegrationApps = ({ integrationAuthId }: Props) => {
return SecurityClient.fetchCall(
'/api/v1/integration-auth/' + integrationAuthId + '/apps',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
const getIntegrationApps = ({ integrationAuthId }: Props) =>
SecurityClient.fetchCall(`/api/v1/integration-auth/${integrationAuthId}/apps`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
).then(async (res) => {
if (res && res.status == 200) {
}).then(async (res) => {
if (res && 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');
return undefined;
});
};
export default getIntegrationApps;
@@ -1,21 +1,17 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
const getIntegrationOptions = () => {
return SecurityClient.fetchCall(
'/api/v1/integration-auth/integration-options',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
const getIntegrationOptions = () =>
SecurityClient.fetchCall('/api/v1/integration-auth/integration-options', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
).then(async (res) => {
if (res && res.status == 200) {
}).then(async (res) => {
if (res && res.status === 200) {
return (await res.json()).integrationOptions;
} else {
console.log('Failed to get (cloud) integration options');
}
console.log('Failed to get (cloud) integration options');
return undefined;
});
};
export default getIntegrationOptions;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
integrationId: string;
@@ -11,8 +11,8 @@ interface Props {
* @param {*} integrationId
* @returns
*/
const startIntegration = ({ integrationId, appName, environment }: Props) => {
return SecurityClient.fetchCall('/api/v1/integration/' + integrationId, {
const startIntegration = ({ integrationId, appName, environment }: Props) =>
SecurityClient.fetchCall(`/api/v1/integration/${integrationId}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
@@ -25,12 +25,11 @@ const startIntegration = ({ integrationId, appName, environment }: Props) => {
}
})
}).then(async (res) => {
if (res && res.status == 200) {
if (res && res.status === 200) {
return res;
} else {
console.log('Failed to start an integration');
}
console.log('Failed to start an integration');
return undefined;
});
};
export default startIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
workspaceId: string;
@@ -13,8 +13,8 @@ interface Props {
* @param {object} obj.integration - integration which a user is trying to turn on
* @returns
*/
const AuthorizeIntegration = ({ workspaceId, code, integration }: Props) => {
return SecurityClient.fetchCall('/api/v1/integration-auth/oauth-token', {
const AuthorizeIntegration = ({ workspaceId, code, integration }: Props) =>
SecurityClient.fetchCall('/api/v1/integration-auth/oauth-token', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -25,12 +25,11 @@ const AuthorizeIntegration = ({ workspaceId, code, integration }: Props) => {
integration
})
}).then(async (res) => {
if (res && res.status == 200) {
if (res && res.status === 200) {
return res;
} else {
console.log('Failed to authorize the integration');
}
console.log('Failed to authorize the integration');
return undefined;
});
};
export default AuthorizeIntegration;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
workspaceId: string;
@@ -9,22 +9,18 @@ interface Props {
* @param {*} workspaceId
* @returns
*/
const getWorkspaceAuthorizations = ({ workspaceId }: Props) => {
return SecurityClient.fetchCall(
'/api/v1/workspace/' + workspaceId + '/authorizations',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
const getWorkspaceAuthorizations = ({ workspaceId }: Props) =>
SecurityClient.fetchCall(`/api/v1/workspace/${workspaceId}/authorizations`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
).then(async (res) => {
if (res && res.status == 200) {
}).then(async (res) => {
if (res && res.status === 200) {
return (await res.json()).authorizations;
} else {
console.log('Failed to get project authorizations');
}
console.log('Failed to get project authorizations');
return undefined;
});
};
export default getWorkspaceAuthorizations;
@@ -1,4 +1,4 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface Props {
workspaceId: string;
@@ -9,22 +9,18 @@ interface Props {
* @param {*} workspaceId
* @returns
*/
const getWorkspaceIntegrations = ({ workspaceId }: Props) => {
return SecurityClient.fetchCall(
'/api/v1/workspace/' + workspaceId + '/integrations',
{
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
const getWorkspaceIntegrations = ({ workspaceId }: Props) =>
SecurityClient.fetchCall(`/api/v1/workspace/${workspaceId}/integrations`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
).then(async (res) => {
if (res && res.status == 200) {
}).then(async (res) => {
if (res && 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');
return undefined;
});
};
export default getWorkspaceIntegrations;
@@ -1,4 +1,4 @@
import SecurityClient from "~/utilities/SecurityClient";
import SecurityClient from '@app/components/utilities/SecurityClient';
/**
* This route starts the integration after teh default one if gonna set up.
@@ -6,7 +6,7 @@ import SecurityClient from "~/utilities/SecurityClient";
* [environment] to the integration [app] with active state [isActive]
* @param {Object} obj
* @param {String} obj.integrationId - id of integration
* @param {String} obj.app - name of app
* @param {String} obj.app - name of app
* @param {String} obj.environment - project environment to push secrets from
* @param {Boolean} obj.isActive - active state
* @param {String} obj.target - (optional) target (environment) for Vercel integration
@@ -14,47 +14,42 @@ import SecurityClient from "~/utilities/SecurityClient";
* @param {String} obj.siteId - (optional) app (site_id) for Netlify integration
* @returns
*/
const updateIntegration = ({
integrationId,
app,
const updateIntegration = ({
integrationId,
app,
environment,
isActive,
target,
context,
siteId
}: {
integrationId: string,
app: string,
environment: string,
isActive: boolean,
target: string | null,
context: string | null,
siteId: string | null
}) => {
return SecurityClient.fetchCall(
"/api/v1/integration/" + integrationId,
{
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
app,
environment,
isActive,
target,
context,
siteId
}),
}
).then(async (res) => {
if (res && res.status == 200) {
integrationId: string;
app: string;
environment: string;
isActive: boolean;
target: string | null;
context: string | null;
siteId: string | null;
}) =>
SecurityClient.fetchCall(`/api/v1/integration/${integrationId}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
app,
environment,
isActive,
target,
context,
siteId
})
}).then(async (res) => {
if (res && res.status === 200) {
return res;
} else {
console.log("Failed to start an integration");
}
console.log('Failed to start an integration');
return undefined;
});
};
export default updateIntegration;