feat(connection-test): refresh connection catalog cache

This commit is contained in:
iruy-fr
2026-07-31 16:33:15 -03:00
parent 84d64424ca
commit 9d0f449eeb
6 changed files with 264 additions and 3 deletions
@@ -27,9 +27,19 @@ export class ConnectionsApiService {
method: string,
path: string,
user: RequestUser,
body?: any,
query?: Record<string, string>,
): Promise<any> {
const baseUrl = CONNECTIONS_API_CONFIG.getUrl();
const url = new URL(`${baseUrl}${path}`);
if (query) {
Object.entries(query).forEach(([key, value]) => {
if (value !== undefined && value !== null) {
url.searchParams.set(key, String(value));
}
});
}
const headers: Record<string, string> = {
host: url.hostname,
'content-type': 'application/json',
@@ -45,8 +55,9 @@ export class ConnectionsApiService {
protocol: url.protocol,
hostname: url.hostname,
port: url.port ? parseInt(url.port, 10) : undefined,
path: url.pathname,
path: url.pathname + url.search,
headers,
body: body ? JSON.stringify(body) : undefined,
};
try {
@@ -55,6 +66,7 @@ export class ConnectionsApiService {
method: method as Method,
url: url.href,
headers: signedRequest.headers as Record<string, string>,
data: body,
timeout: CONNECTIONS_API_CONFIG.timeout,
validateStatus: () => true,
});