refactor: rewrite http-client as functional

This commit is contained in:
Ali BARIN
2022-10-03 17:05:02 +02:00
parent 3b8a12810c
commit 52e4e09e85
6 changed files with 34 additions and 42 deletions

View File

@@ -4,19 +4,19 @@ import type {
IField,
IJSONObject,
} from '@automatisch/types';
import HttpClient from '../../helpers/http-client';
import createHttpClient, { IHttpClient } from '../../helpers/http-client';
import { URLSearchParams } from 'url';
export default class Authentication implements IAuthentication {
appData: IApp;
connectionData: IJSONObject;
scopes: string[] = ['read:org', 'repo', 'user'];
client: HttpClient;
client: IHttpClient;
constructor(appData: IApp, connectionData: IJSONObject) {
this.connectionData = connectionData;
this.appData = appData;
this.client = new HttpClient({ baseURL: 'https://github.com' });
this.client = createHttpClient({ baseURL: 'https://github.com' });
}
get oauthRedirectUrl(): string {