feat(trello): add trello integration (#1380)

This commit is contained in:
Rıdvan Akca
2023-10-24 16:13:08 +03:00
committed by GitHub
parent 627184f124
commit ee90422f56
15 changed files with 155 additions and 3 deletions

View File

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

View File

@@ -0,0 +1,3 @@
const authScope: string[] = ['read', 'write', 'account'];
export default authScope;

View File

@@ -0,0 +1,10 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
const getCurrentUser = async ($: IGlobalVariable): Promise<IJSONObject> => {
const response = await $.http.get('/1/members/me/');
const currentUser = response.data;
return currentUser;
};
export default getCurrentUser;