mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-12 21:29:08 +00:00
FIX: storage service dns
This commit is contained in:
@@ -6,7 +6,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
|
||||
// For prod: https://storage-explorer-{customer_id}.dadosfera.ai/api
|
||||
return urlTemplate.replace('{customer}', customerName);
|
||||
},
|
||||
timeout: parseInt(process.env.STORAGE_EXPLORER_TIMEOUT || '30000', 10),
|
||||
|
||||
@@ -47,13 +47,13 @@ export class StorageExplorerController {
|
||||
async validateTableName(
|
||||
@Body() body: any,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'POST',
|
||||
'/tables/validate-name',
|
||||
user,
|
||||
token,
|
||||
|
||||
body,
|
||||
);
|
||||
}
|
||||
@@ -64,13 +64,13 @@ export class StorageExplorerController {
|
||||
async createTable(
|
||||
@Body() body: any,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'POST',
|
||||
'/tables/',
|
||||
user,
|
||||
token,
|
||||
|
||||
body,
|
||||
);
|
||||
}
|
||||
@@ -81,13 +81,13 @@ export class StorageExplorerController {
|
||||
async listTables(
|
||||
@Query('page') page: number,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
'/tables/',
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ page },
|
||||
);
|
||||
@@ -99,13 +99,12 @@ export class StorageExplorerController {
|
||||
async getTable(
|
||||
@Param('tableId') tableId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/tables/${tableId}`,
|
||||
user,
|
||||
token
|
||||
);
|
||||
}
|
||||
|
||||
@@ -116,13 +115,13 @@ export class StorageExplorerController {
|
||||
@Param('tableId') tableId: string,
|
||||
@Param('datasetId') datasetId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'POST',
|
||||
`/tables/${tableId}/datasets/${datasetId}`,
|
||||
user,
|
||||
token
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,13 +131,13 @@ export class StorageExplorerController {
|
||||
async getTableDatasets(
|
||||
@Param('tableId') tableId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/tables/${tableId}/datasets`,
|
||||
user,
|
||||
token
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -148,13 +147,13 @@ export class StorageExplorerController {
|
||||
async getTableSchema(
|
||||
@Param('tableId') tableId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/tables/${tableId}/schema`,
|
||||
user,
|
||||
token
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,13 +164,12 @@ export class StorageExplorerController {
|
||||
@Param('tableId') tableId: string,
|
||||
@Param('datasetId') datasetId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'POST',
|
||||
`/tables/${tableId}/validate-compatibility/${datasetId}`,
|
||||
user,
|
||||
token
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -186,13 +184,13 @@ export class StorageExplorerController {
|
||||
@Param('datasetId') datasetId: string,
|
||||
@Query('limit') limit: number,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/datasets/${datasetId}/preview`,
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ limit },
|
||||
);
|
||||
@@ -205,13 +203,13 @@ export class StorageExplorerController {
|
||||
@Param('datasetId') datasetId: string,
|
||||
@Query('force_refresh') forceRefresh: boolean,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/datasets/${datasetId}/schema`,
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ force_refresh: forceRefresh },
|
||||
);
|
||||
@@ -223,13 +221,13 @@ export class StorageExplorerController {
|
||||
async listDatasetsByUpload(
|
||||
@Param('uploadId') uploadId: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
`/datasets/upload/${uploadId}`,
|
||||
user,
|
||||
token
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -240,13 +238,13 @@ export class StorageExplorerController {
|
||||
@Param('datasetId') datasetId: string,
|
||||
@Body() body: any,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'PUT',
|
||||
`/datasets/${datasetId}/refresh-schema`,
|
||||
user,
|
||||
token,
|
||||
|
||||
body,
|
||||
);
|
||||
}
|
||||
@@ -263,13 +261,13 @@ export class StorageExplorerController {
|
||||
@Query('limit') limit: number,
|
||||
@Query('folder_path') folderPath: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
'/storage/uploads/history',
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ page, limit, folder_path: folderPath },
|
||||
);
|
||||
@@ -281,13 +279,13 @@ export class StorageExplorerController {
|
||||
async browseStorage(
|
||||
@Query('path') path: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
'/storage/browse',
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ path },
|
||||
);
|
||||
@@ -302,7 +300,7 @@ export class StorageExplorerController {
|
||||
@UploadedFiles() files: Array<Express.Multer.File>,
|
||||
@Body('folder_path') folderPath: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
// Create FormData to forward files to storage-explorer API
|
||||
const formData = new FormData();
|
||||
@@ -326,7 +324,7 @@ export class StorageExplorerController {
|
||||
'POST',
|
||||
'/storage/upload/batch',
|
||||
user,
|
||||
token,
|
||||
|
||||
formData,
|
||||
);
|
||||
}
|
||||
@@ -337,13 +335,13 @@ export class StorageExplorerController {
|
||||
async createFolder(
|
||||
@Body() body: any,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'POST',
|
||||
'/storage/folder/create',
|
||||
user,
|
||||
token,
|
||||
|
||||
body,
|
||||
);
|
||||
}
|
||||
@@ -354,13 +352,13 @@ export class StorageExplorerController {
|
||||
async downloadFile(
|
||||
@Query('file_path') filePath: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
'/storage/download',
|
||||
user,
|
||||
token,
|
||||
|
||||
undefined,
|
||||
{ file_path: filePath },
|
||||
);
|
||||
@@ -372,13 +370,12 @@ export class StorageExplorerController {
|
||||
async getFileMetadata(
|
||||
@Query('file_path') filePath: string,
|
||||
@User() user: RequestUser,
|
||||
@Headers('Authorization') token: string
|
||||
|
||||
) {
|
||||
return this.storageExplorerService.proxy(
|
||||
'GET',
|
||||
'/storage/metadata',
|
||||
user,
|
||||
token,
|
||||
undefined,
|
||||
{ file_path: filePath },
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@ export class StorageExplorerService {
|
||||
method: string,
|
||||
path: string,
|
||||
user: RequestUser,
|
||||
token: string,
|
||||
body?: any,
|
||||
query?: Record<string, any>
|
||||
): Promise<any> {
|
||||
@@ -42,7 +41,6 @@ export class StorageExplorerService {
|
||||
}
|
||||
|
||||
const headers: Record<string, string> = {
|
||||
'Authorization': token,
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user