mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-25 09:20:05 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
503293439f | ||
|
|
eed57ff039 | ||
|
|
ef2a24a0c3 | ||
|
|
8a31e11445 | ||
|
|
2013e97e20 | ||
|
|
dd271205ba | ||
|
|
a1f9f14897 | ||
|
|
b7efa2f58d | ||
|
|
395e36581d | ||
|
|
97a54f9267 | ||
|
|
00b0e00bd0 | ||
|
|
9188536161 | ||
|
|
1ae8151184 | ||
|
|
3d77980dd2 | ||
|
|
fc784e2d6d |
Generated
+7
-7
@@ -18,7 +18,7 @@
|
|||||||
"@nestjs/microservices": "^8.4.3",
|
"@nestjs/microservices": "^8.4.3",
|
||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.5.5",
|
"@victorradael/protospack": "^1.6.1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
@@ -2344,9 +2344,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@victorradael/protospack": {
|
"node_modules/@victorradael/protospack": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.1.tgz",
|
||||||
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
|
"integrity": "sha512-GEW+NYaMNnuUZ4/WsNJGpi3dHAOXkbm4BQKFkT/Ij7P9vSelyx9RGqkrs5m0biAXfITWDHe8hjI4AbRQe6AMDw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
@@ -10904,9 +10904,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@victorradael/protospack": {
|
"@victorradael/protospack": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.1.tgz",
|
||||||
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
|
"integrity": "sha512-GEW+NYaMNnuUZ4/WsNJGpi3dHAOXkbm4BQKFkT/Ij7P9vSelyx9RGqkrs5m0biAXfITWDHe8hjI4AbRQe6AMDw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@
|
|||||||
"@nestjs/microservices": "^8.4.3",
|
"@nestjs/microservices": "^8.4.3",
|
||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.5.5",
|
"@victorradael/protospack": "^1.6.1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
|
|||||||
@@ -182,22 +182,31 @@ export class PipelinesClientService implements OnModuleInit {
|
|||||||
return logsPipelineResponse;
|
return logsPipelineResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPipelineStatus(data: IIdRequest) {
|
async getPipelineStatus(data) {
|
||||||
console.log('PipelinesClientService', 'GetPipelineStatus');
|
console.log('PipelinesClientService', 'GetPipelineStatus');
|
||||||
|
|
||||||
const statusPipelineResponse = await new Promise((resolve, reject) => {
|
const statusPipelineResponse = await new Promise((resolve, reject) => {
|
||||||
this.pipelineService.getPipelineStatus(data).subscribe({
|
this.pipelineService
|
||||||
next(x) {
|
.getPipelineStatus(objectSnakeToCamel(data))
|
||||||
resolve(x);
|
.subscribe({
|
||||||
},
|
next(x) {
|
||||||
error(err) {
|
const statusArray = x.status.sort((a, b) => {
|
||||||
console.log('Observable Error');
|
if (a.id < b.id) {
|
||||||
reject(err);
|
return 1;
|
||||||
},
|
} else {
|
||||||
complete() {
|
return -1;
|
||||||
console.log('done');
|
}
|
||||||
},
|
});
|
||||||
});
|
resolve({ status: statusArray });
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.then((res) => res)
|
.then((res) => res)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -214,6 +223,11 @@ export class PipelinesClientService implements OnModuleInit {
|
|||||||
.triggerPipeline(objectSnakeToCamel({ id, info }))
|
.triggerPipeline(objectSnakeToCamel({ id, info }))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
|
if (x.status == false) {
|
||||||
|
reject(
|
||||||
|
'This pipeline is not ready yet to execute, Try again later!',
|
||||||
|
);
|
||||||
|
}
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
error(err) {
|
error(err) {
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ export class CatalogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('column-metadata')
|
@Get('column-metadata')
|
||||||
async getOneColumnMetadata(@Body() body) {
|
async getOneColumnMetadata(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE');
|
console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneColumnMetadata(body);
|
const res = await catalogService.getOneColumnMetadata(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -119,12 +119,12 @@ export class CatalogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('data-preview')
|
@Get('data-preview')
|
||||||
async getOneDataPreview(@Body() body) {
|
async getOneDataPreview(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE');
|
console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneDataPreview(body);
|
const res = await catalogService.getOneDataPreview(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -219,12 +219,12 @@ export class CatalogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('data-review')
|
@Get('data-review')
|
||||||
async getDataReview(@Body() body) {
|
async getDataReview(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getDataReview(body);
|
const res = await catalogService.getDataReview(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ class CatalogService {
|
|||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
const { data } = await axios.get(
|
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
const nimbusUrl =
|
||||||
);
|
process.env.ENV === 'prd'
|
||||||
console.log(
|
? `https://nimbus${customer}.dadosfera.ai`
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
);
|
console.log(`${nimbusUrl}/api/catalog/all/`);
|
||||||
|
return 0;
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +63,11 @@ class CatalogService {
|
|||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/${id}`,
|
`${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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +108,7 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneColumnMetadata(body) {
|
async getOneColumnMetadata(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
@@ -108,6 +116,7 @@ class CatalogService {
|
|||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/`,
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/`,
|
||||||
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -124,7 +133,7 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneDataPreview(body) {
|
async getOneDataPreview(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
@@ -132,6 +141,7 @@ class CatalogService {
|
|||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
|
||||||
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -233,7 +243,7 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDataReview(body) {
|
async getDataReview(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
@@ -241,6 +251,7 @@ class CatalogService {
|
|||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
|
||||||
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user