style: auto format whole project

This commit is contained in:
Ali BARIN
2022-11-05 23:57:33 +01:00
parent e338770e57
commit 475f24f661
199 changed files with 2421 additions and 1839 deletions

View File

@@ -13,7 +13,9 @@ export default async function createAuthData($: IGlobalVariable) {
scope: scopes.join(','),
});
const url = `${$.app.baseUrl}/login/oauth/authorize?${searchParams.toString()}`;
const url = `${
$.app.baseUrl
}/login/oauth/authorize?${searchParams.toString()}`;
await $.auth.set({
url,

View File

@@ -12,9 +12,10 @@ export default {
readOnly: true,
value: '{WEB_APP_URL}/app/github/connections/add',
placeholder: null,
description: 'When asked to input an OAuth callback or redirect URL in Github OAuth, enter the URL above.',
description:
'When asked to input an OAuth callback or redirect URL in Github OAuth, enter the URL above.',
docUrl: 'https://automatisch.io/docs/github#oauth-redirect-url',
clickToCopy: true
clickToCopy: true,
},
{
key: 'consumerKey',
@@ -26,7 +27,7 @@ export default {
placeholder: null,
description: null,
docUrl: 'https://automatisch.io/docs/github#client-id',
clickToCopy: false
clickToCopy: false,
},
{
key: 'consumerSecret',
@@ -38,8 +39,8 @@ export default {
placeholder: null,
description: null,
docUrl: 'https://automatisch.io/docs/github#client-secret',
clickToCopy: false
}
clickToCopy: false,
},
],
authenticationSteps: [
{
@@ -48,7 +49,7 @@ export default {
arguments: [
{
name: 'key',
value: '{key}'
value: '{key}',
},
{
name: 'formattedData',
@@ -56,15 +57,15 @@ export default {
properties: [
{
name: 'consumerKey',
value: '{fields.consumerKey}'
value: '{fields.consumerKey}',
},
{
name: 'consumerSecret',
value: '{fields.consumerSecret}'
}
]
}
]
value: '{fields.consumerSecret}',
},
],
},
],
},
{
type: 'mutation' as const,
@@ -72,9 +73,9 @@ export default {
arguments: [
{
name: 'id',
value: '{createConnection.id}'
}
]
value: '{createConnection.id}',
},
],
},
{
type: 'openWithPopup' as const,
@@ -82,9 +83,9 @@ export default {
arguments: [
{
name: 'url',
value: '{createAuthData.url}'
}
]
value: '{createAuthData.url}',
},
],
},
{
type: 'mutation' as const,
@@ -92,7 +93,7 @@ export default {
arguments: [
{
name: 'id',
value: '{createConnection.id}'
value: '{createConnection.id}',
},
{
name: 'formattedData',
@@ -100,11 +101,11 @@ export default {
properties: [
{
name: 'oauthVerifier',
value: '{openAuthPopup.code}'
}
]
}
]
value: '{openAuthPopup.code}',
},
],
},
],
},
{
type: 'mutation' as const,
@@ -112,10 +113,10 @@ export default {
arguments: [
{
name: 'id',
value: '{createConnection.id}'
}
]
}
value: '{createConnection.id}',
},
],
},
],
createAuthData,

View File

@@ -12,9 +12,10 @@ const verifyCredentials = async ($: IGlobalVariable) => {
},
{
headers: {
Accept: 'application/json'
}
});
Accept: 'application/json',
},
}
);
const data = response.data;

View File

@@ -1,11 +1,11 @@
import { TBeforeRequest } from "@automatisch/types";
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if (requestConfig.headers && $.auth.data?.accessToken) {
requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`
requestConfig.headers.Authorization = `Bearer ${$.auth.data.accessToken}`;
}
return requestConfig;
}
};
export default addAuthHeader;

View File

@@ -1,15 +1,17 @@
type TRepoOwnerAndRepo = {
repoOwner?: string;
repo?: string;
}
};
export default function getRepoOwnerAndRepo(repoFullName: string): TRepoOwnerAndRepo {
export default function getRepoOwnerAndRepo(
repoFullName: string
): TRepoOwnerAndRepo {
if (!repoFullName) return {};
const [repoOwner, repo] = repoFullName.split('/');
return {
repoOwner,
repo
repo,
};
}

View File

@@ -1,7 +1,4 @@
import listLabels from './list-labels';
import listRepos from './list-repos';
export default [
listLabels,
listRepos,
];
export default [listLabels, listRepos];

View File

@@ -7,10 +7,9 @@ export default {
key: 'listLabels',
async run($: IGlobalVariable) {
const {
repoOwner,
repo,
} = getRepoOwnerAndRepo($.step.parameters.repo as string);
const { repoOwner, repo } = getRepoOwnerAndRepo(
$.step.parameters.repo as string
);
if (!repo) return { data: [] };

View File

@@ -3,9 +3,4 @@ import newPullRequests from './new-pull-requests';
import newStargazers from './new-stargazers';
import newWatchers from './new-watchers';
export default [
newIssues,
newPullRequests,
newStargazers,
newWatchers,
];
export default [newIssues, newPullRequests, newStargazers, newWatchers];