Compare commits

...
9 Commits
5 changed files with 52 additions and 30 deletions
+7 -7
View File
@@ -18,7 +18,7 @@
"@nestjs/microservices": "^8.4.3",
"@nestjs/platform-express": "^8.4.3",
"@nestjs/swagger": "^5.2.1",
"@victorradael/protospack": "^1.5.5",
"@victorradael/protospack": "^1.5.9",
"axios": "^0.25.0",
"dotenv": "^14.2.0",
"helmet": "^5.0.2",
@@ -2344,9 +2344,9 @@
}
},
"node_modules/@victorradael/protospack": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
"version": "1.5.9",
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.9.tgz",
"integrity": "sha512-h96qwtRftVkZ0ftsahymnxO/bwCL8/bHvllyjTuhcLLmBj0fKG6q/nz5S9cFpq8OAEljehO+luNj388mZCF7Yg==",
"dependencies": {
"rxjs": "^7.5.5"
}
@@ -10904,9 +10904,9 @@
}
},
"@victorradael/protospack": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
"version": "1.5.9",
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.9.tgz",
"integrity": "sha512-h96qwtRftVkZ0ftsahymnxO/bwCL8/bHvllyjTuhcLLmBj0fKG6q/nz5S9cFpq8OAEljehO+luNj388mZCF7Yg==",
"requires": {
"rxjs": "^7.5.5"
}
+1 -1
View File
@@ -30,7 +30,7 @@
"@nestjs/microservices": "^8.4.3",
"@nestjs/platform-express": "^8.4.3",
"@nestjs/swagger": "^5.2.1",
"@victorradael/protospack": "^1.5.5",
"@victorradael/protospack": "^1.5.9",
"axios": "^0.25.0",
"dotenv": "^14.2.0",
"helmet": "^5.0.2",
+27 -13
View File
@@ -182,22 +182,31 @@ export class PipelinesClientService implements OnModuleInit {
return logsPipelineResponse;
}
async getPipelineStatus(data: IIdRequest) {
async getPipelineStatus(data) {
console.log('PipelinesClientService', 'GetPipelineStatus');
const statusPipelineResponse = await new Promise((resolve, reject) => {
this.pipelineService.getPipelineStatus(data).subscribe({
next(x) {
resolve(x);
},
error(err) {
console.log('Observable Error');
reject(err);
},
complete() {
console.log('done');
},
});
this.pipelineService
.getPipelineStatus(objectSnakeToCamel(data))
.subscribe({
next(x) {
const statusArray = x.status.sort((a, b) => {
if (Date.parse(a.updated_at) < Date.parse(b.updated_at)) {
return 1;
} else {
return -1;
}
});
resolve(statusArray);
},
error(err) {
console.log('Observable Error');
reject(err);
},
complete() {
console.log('done');
},
});
})
.then((res) => res)
.catch((err) => {
@@ -214,6 +223,11 @@ export class PipelinesClientService implements OnModuleInit {
.triggerPipeline(objectSnakeToCamel({ id, info }))
.subscribe({
next(x) {
if (x.status == false) {
reject(
'This pipeline is not ready yet to execute, Try again later!',
);
}
resolve(x);
},
error(err) {
+6 -6
View File
@@ -96,12 +96,12 @@ export class CatalogController {
}
@Get('column-metadata')
async getOneColumnMetadata(@Body() body) {
async getOneColumnMetadata(@Body() body, @Query() params) {
console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE');
const catalogService = new CatalogService();
const res = await catalogService.getOneColumnMetadata(body);
const res = await catalogService.getOneColumnMetadata(body, params);
return res;
}
@@ -119,12 +119,12 @@ export class CatalogController {
}
@Get('data-preview')
async getOneDataPreview(@Body() body) {
async getOneDataPreview(@Body() body, @Query() params) {
console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE');
const catalogService = new CatalogService();
const res = await catalogService.getOneDataPreview(body);
const res = await catalogService.getOneDataPreview(body, params);
return res;
}
@@ -219,12 +219,12 @@ export class CatalogController {
}
@Get('data-review')
async getDataReview(@Body() body) {
async getDataReview(@Body() body, @Query() params) {
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
const catalogService = new CatalogService();
const res = await catalogService.getDataReview(body);
const res = await catalogService.getDataReview(body, params);
return res;
}
+11 -3
View File
@@ -60,6 +60,11 @@ class CatalogService {
const { data } = await axios.get(
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/${id}`,
);
const [, path] = data.iframe_url.split('.dadosfera');
const host = `https://metabase-${body.info.customer.toLowerCase()}.dadosfera.ai`;
data.iframe_url = host + path;
return data;
}
@@ -100,7 +105,7 @@ class CatalogService {
return data;
}
async getOneColumnMetadata(body) {
async getOneColumnMetadata(body, params) {
const customer =
body.info.customer.toLowerCase() === 'dadosfera'
? ``
@@ -108,6 +113,7 @@ class CatalogService {
const { data } = await axios.get(
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/`,
{ params: params },
);
return data;
}
@@ -124,7 +130,7 @@ class CatalogService {
return data;
}
async getOneDataPreview(body) {
async getOneDataPreview(body, params) {
const customer =
body.info.customer.toLowerCase() === 'dadosfera'
? ``
@@ -132,6 +138,7 @@ class CatalogService {
const { data } = await axios.get(
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
{ params: params },
);
return data;
}
@@ -233,7 +240,7 @@ class CatalogService {
return data;
}
async getDataReview(body) {
async getDataReview(body, params) {
const customer =
body.info.customer.toLowerCase() === 'dadosfera'
? ``
@@ -241,6 +248,7 @@ class CatalogService {
const { data } = await axios.get(
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
{ params: params },
);
return data;
}