From 748f00d0ae389026895bf047379dfd266769556e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Mui=CC=81n=CC=83o=20Garci=CC=81a?= Date: Wed, 9 Jul 2025 13:10:14 +0200 Subject: [PATCH] Do not allow to configure authUrl Right now is always build from baseUrl --- src/api/types.ts | 1 - src/api/yepcodeApi.ts | 4 +--- tests/api/yepcodeApi.storage.test.ts | 3 +-- tests/storage/yepcodeStorage.test.ts | 3 +-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/api/types.ts b/src/api/types.ts index 30b0521..96df877 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1,7 +1,6 @@ import { Readable } from "stream"; export interface YepCodeApiConfig { - authUrl?: string; apiHost?: string; timeout?: number; accessToken?: string; diff --git a/src/api/yepcodeApi.ts b/src/api/yepcodeApi.ts index cbdca99..f376ae9 100644 --- a/src/api/yepcodeApi.ts +++ b/src/api/yepcodeApi.ts @@ -55,7 +55,6 @@ export class YepCodeApi { private apiHost: string; private clientId?: string; private clientSecret?: string; - private authUrl: string; private teamId?: string; private accessToken?: string; private timeout: number; @@ -127,7 +126,6 @@ export class YepCodeApi { if (!this.teamId) { this.initTeamId(); } - this.authUrl = finalConfig.authUrl ?? this.getAuthURL(); } getTeamId(): string { @@ -174,7 +172,7 @@ export class YepCodeApi { } try { - const response = await fetch(this.authUrl, { + const response = await fetch(this.getAuthURL(), { method: "POST", headers: { "x-api-token": diff --git a/tests/api/yepcodeApi.storage.test.ts b/tests/api/yepcodeApi.storage.test.ts index 8da751b..c7bbae1 100644 --- a/tests/api/yepcodeApi.storage.test.ts +++ b/tests/api/yepcodeApi.storage.test.ts @@ -9,7 +9,6 @@ const testFilePath = path.join(__dirname, testName); const downloadedFile = path.join(__dirname, "./downloaded_test.json"); const apiHost = process.env.YEPCODE_API_HOST; -const authUrl = process.env.YEPCODE_AUTH_URL; const apiToken = process.env.YEPCODE_API_TOKEN; let api: YepCodeApi; @@ -31,7 +30,7 @@ const verifyDownloadedFile = async ( describe.skip("YepCodeApi", () => { beforeAll(async () => { - api = new YepCodeApi({ apiHost, authUrl, apiToken }); + api = new YepCodeApi({ apiHost, apiToken }); }); afterEach(async () => { diff --git a/tests/storage/yepcodeStorage.test.ts b/tests/storage/yepcodeStorage.test.ts index 56e9720..c2330b5 100644 --- a/tests/storage/yepcodeStorage.test.ts +++ b/tests/storage/yepcodeStorage.test.ts @@ -9,7 +9,6 @@ const testFilePath = path.join(__dirname, testName); const downloadedFile = path.join(__dirname, "./downloaded_test.json"); const apiHost = process.env.YEPCODE_API_HOST; -const authUrl = process.env.YEPCODE_AUTH_URL; const apiToken = process.env.YEPCODE_API_TOKEN; let storage: YepCodeStorage; @@ -31,7 +30,7 @@ const verifyDownloadedFile = async ( describe.skip("YepCodeStorage", () => { beforeAll(async () => { - storage = new YepCodeStorage({ apiHost, authUrl, apiToken }); + storage = new YepCodeStorage({ apiHost, apiToken }); }); afterEach(async () => {