FIX: maestro proxy urls

This commit is contained in:
marcos-silva-rodrigues
2026-02-02 14:25:13 -03:00
parent 8006867bc2
commit 878ec977b8
6 changed files with 158 additions and 34 deletions
@@ -1,5 +1,5 @@
export const STORAGE_EXPLORER_CONFIG = {
getUrl: (customerId: string): string => {
getUrl: (customerName: string): string => {
const urlTemplate = process.env.STORAGE_EXPLORER_API_URL;
if (!urlTemplate) {
throw new Error('STORAGE_EXPLORER_API_URL environment variable is not set');
@@ -7,7 +7,7 @@ export const STORAGE_EXPLORER_CONFIG = {
// Replace {customer_id} placeholder with actual customer ID
// For local: http://172.17.0.1:8000/api (no placeholder)
// For prod: https://storage-explorer-{customer_id}.stg.dadosfera.ai/api
return urlTemplate.replace('{customer_id}', customerId);
return urlTemplate.replace('{customer}', customerName);
},
timeout: parseInt(process.env.STORAGE_EXPLORER_TIMEOUT || '30000', 10),
};
@@ -28,7 +28,7 @@ export class StorageExplorerService {
}
// Get customer-specific storage-explorer URL
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_id);
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_name);
const url = new URL(`${baseUrl}${path}`);
// Add query params