mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-01 04:08:16 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e897da1ef0 | ||
|
|
d7f205901b | ||
|
|
7212c5249c | ||
|
|
827c7b1bf1 | ||
|
|
8d89b747b4 | ||
|
|
4f18328603 | ||
|
|
a68d312447 | ||
|
|
7f677f0376 | ||
|
|
bb2c0ab23e | ||
|
|
feec48114c | ||
|
|
7bee8d83a9 | ||
|
|
84b2dbd178 | ||
|
|
36706ff3dd | ||
|
|
0164e6978a | ||
|
|
7d371926f5 | ||
|
|
75e9e97f04 | ||
|
|
b5f58b99fd | ||
|
|
503293439f | ||
|
|
eed57ff039 | ||
|
|
ef2a24a0c3 | ||
|
|
8a31e11445 | ||
|
|
2013e97e20 | ||
|
|
dd271205ba | ||
|
|
a1f9f14897 | ||
|
|
b7efa2f58d | ||
|
|
395e36581d | ||
|
|
97a54f9267 | ||
|
|
00b0e00bd0 | ||
|
|
9188536161 | ||
|
|
1ae8151184 | ||
|
|
3d77980dd2 | ||
|
|
849b979e63 | ||
|
|
28580782b1 | ||
|
|
fc784e2d6d | ||
|
|
c997e91912 | ||
|
|
22f493d48a | ||
|
|
035213824b |
@@ -1,4 +1,4 @@
|
||||
<p align="center">
|
||||
<image src="./assets/maestro.svg" style="width:10rem">
|
||||
<h1 align="center">Maestro</h1>
|
||||
</p>
|
||||
</p>
|
||||
Generated
+79
-7
@@ -17,8 +17,9 @@
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/microservices": "^8.4.3",
|
||||
"@nestjs/platform-express": "^8.4.3",
|
||||
"@nestjs/schedule": "^1.1.0",
|
||||
"@nestjs/swagger": "^5.2.1",
|
||||
"@victorradael/protospack": "^1.5.5",
|
||||
"@victorradael/protospack": "^1.6.5",
|
||||
"axios": "^0.25.0",
|
||||
"dotenv": "^14.2.0",
|
||||
"helmet": "^5.0.2",
|
||||
@@ -1580,6 +1581,20 @@
|
||||
"@nestjs/core": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/schedule": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/schedule/-/schedule-1.1.0.tgz",
|
||||
"integrity": "sha512-0QpbwClUildXqlyoaygG+aIQZNNMv31XDyQxX+Ob1zw/3I8+AVrDlBwZHQ+tlhIcJFR8aG+VTH8xwIjXwtS1UA==",
|
||||
"dependencies": {
|
||||
"cron": "1.8.2",
|
||||
"uuid": "8.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^6.10.11 || ^7.0.0 || ^8.0.0",
|
||||
"@nestjs/core": "^7.0.0 || ^8.0.0",
|
||||
"reflect-metadata": "^0.1.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/schematics": {
|
||||
"version": "8.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
||||
@@ -2344,9 +2359,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.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
||||
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
||||
"dependencies": {
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
@@ -3517,6 +3532,14 @@
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cron": {
|
||||
"version": "1.8.2",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz",
|
||||
"integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==",
|
||||
"dependencies": {
|
||||
"moment-timezone": "^0.5.x"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
@@ -6816,6 +6839,25 @@
|
||||
"mkdirp": "bin/cmd.js"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.29.3",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
|
||||
"integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/moment-timezone": {
|
||||
"version": "0.5.34",
|
||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz",
|
||||
"integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==",
|
||||
"dependencies": {
|
||||
"moment": ">= 2.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
@@ -10307,6 +10349,15 @@
|
||||
"tslib": "2.3.1"
|
||||
}
|
||||
},
|
||||
"@nestjs/schedule": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/schedule/-/schedule-1.1.0.tgz",
|
||||
"integrity": "sha512-0QpbwClUildXqlyoaygG+aIQZNNMv31XDyQxX+Ob1zw/3I8+AVrDlBwZHQ+tlhIcJFR8aG+VTH8xwIjXwtS1UA==",
|
||||
"requires": {
|
||||
"cron": "1.8.2",
|
||||
"uuid": "8.3.2"
|
||||
}
|
||||
},
|
||||
"@nestjs/schematics": {
|
||||
"version": "8.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
||||
@@ -10904,9 +10955,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.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
||||
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
||||
"requires": {
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
@@ -11845,6 +11896,14 @@
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cron": {
|
||||
"version": "1.8.2",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz",
|
||||
"integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==",
|
||||
"requires": {
|
||||
"moment-timezone": "^0.5.x"
|
||||
}
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
@@ -14375,6 +14434,19 @@
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.29.3",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
|
||||
"integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
|
||||
},
|
||||
"moment-timezone": {
|
||||
"version": "0.5.34",
|
||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz",
|
||||
"integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==",
|
||||
"requires": {
|
||||
"moment": ">= 2.9.0"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
|
||||
+2
-1
@@ -29,8 +29,9 @@
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/microservices": "^8.4.3",
|
||||
"@nestjs/platform-express": "^8.4.3",
|
||||
"@nestjs/schedule": "^1.1.0",
|
||||
"@nestjs/swagger": "^5.2.1",
|
||||
"@victorradael/protospack": "^1.5.5",
|
||||
"@victorradael/protospack": "^1.6.5",
|
||||
"axios": "^0.25.0",
|
||||
"dotenv": "^14.2.0",
|
||||
"helmet": "^5.0.2",
|
||||
|
||||
@@ -20,11 +20,11 @@ export class AuthClientService implements OnModuleInit {
|
||||
);
|
||||
}
|
||||
|
||||
async signIn({ username, password }: ILogin): Promise<any> {
|
||||
async signIn({ username, password, totp }: ILogin): Promise<any> {
|
||||
console.log('AuthClientService', 'SignIn');
|
||||
|
||||
const tokens = await new Promise((resolve, reject) => {
|
||||
this.authService.signIn({ username, password }).subscribe({
|
||||
this.authService.signIn({ username, password, totp }).subscribe({
|
||||
next(x) {
|
||||
resolve(x);
|
||||
},
|
||||
|
||||
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
export interface ILogin {
|
||||
username: string;
|
||||
password: string;
|
||||
totp: string;
|
||||
}
|
||||
|
||||
@@ -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 (a.id < b.id) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
resolve({ status: 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) {
|
||||
|
||||
@@ -10,7 +10,7 @@ export class TransformationsClientConfiguration {
|
||||
return {
|
||||
transport: Transport.GRPC,
|
||||
options: {
|
||||
url: process.env.TRFACTORY_URL,
|
||||
url: process.env.INFACTORY_URL,
|
||||
package: TransformationPackages,
|
||||
credentials: credentials.createSsl(),
|
||||
protoPath: TransformationProtoFilePath,
|
||||
|
||||
@@ -19,7 +19,9 @@ export class LoggerMiddleware implements NestMiddleware {
|
||||
const privateKey = process.env.JWT_PRIVATE_KEY;
|
||||
|
||||
const requiredMethod = request.method.trim();
|
||||
const requiredRoute = request.route.path.split('/')[1].trim();
|
||||
const requiredRoute = request.route.path.split('/')[1]
|
||||
? request.route.path.split('/')[1].trim()
|
||||
: '';
|
||||
|
||||
verify(idToken, privateKey, (err) => {
|
||||
if (err) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { AuthClientService } from 'src/clients/auth/client.service';
|
||||
interface ISignIn {
|
||||
username: string;
|
||||
password: string;
|
||||
totp: string;
|
||||
}
|
||||
|
||||
@Controller('auth')
|
||||
@@ -12,11 +13,11 @@ export class AuthController {
|
||||
constructor(private authClient: AuthClientService) {}
|
||||
|
||||
@Post()
|
||||
async signIn(@Body() { username, password }: ISignIn) {
|
||||
async signIn(@Body() { username, password, totp }: ISignIn) {
|
||||
console.log(`/auth`, 'SignIn');
|
||||
|
||||
const tokens = await this.authClient
|
||||
.signIn({ username, password })
|
||||
.signIn({ username, password, totp })
|
||||
.then((result) => result)
|
||||
.catch((err) => {
|
||||
throw new UnauthorizedException(err.message);
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { CatalogService } from './catalog.service';
|
||||
|
||||
@Controller('catalog')
|
||||
@@ -33,7 +41,7 @@ export class CatalogController {
|
||||
const { id } = params;
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.dataAppsOne(body, id);
|
||||
const res = await catalogService.dataAppsOne(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -56,64 +64,67 @@ export class CatalogController {
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.getOneDashboardMetabase(body, id);
|
||||
const res = await catalogService.getOneDashboardMetabase(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('table-metadata')
|
||||
async getAllTableMetadata(@Body() body) {
|
||||
async getAllTableMetadata(@Body() body, @Query() query) {
|
||||
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.getAllTableMetadata(body);
|
||||
|
||||
return res;
|
||||
if (!query) {
|
||||
const res = await catalogService.getAllTableMetadata(body);
|
||||
return res;
|
||||
} else {
|
||||
const res = await catalogService.getOneTableMetadata(body, query);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@Delete('table-metadata')
|
||||
@Delete('table-metadata/:id')
|
||||
async deleteOneTableMetadata(@Param() params, @Body() body) {
|
||||
const { id } = params;
|
||||
console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.deleteOneTableMetadata(body, id);
|
||||
const res = await catalogService.deleteOneTableMetadata(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Delete('column-metadata')
|
||||
@Delete('column-metadata/:id')
|
||||
async deleteOneColumnMetadata(@Param() params, @Body() body) {
|
||||
console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE');
|
||||
const { id } = params;
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.deleteOneColumnMetadata(body, id);
|
||||
const res = await catalogService.deleteOneColumnMetadata(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -129,6 +140,17 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('data-status')
|
||||
async createDataStatus(@Body() body) {
|
||||
console.log(`/catalog`, 'ON CREATE DATA STATUS ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.createDataStatus(body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('data-description')
|
||||
async getDataDescription(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
||||
@@ -140,6 +162,17 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Post('data-description')
|
||||
async createDataDescription(@Body() body) {
|
||||
console.log(`/catalog`, 'ON CREATE DATA DESCRIPTION ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.createDataDescription(body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('data-docs')
|
||||
async getDataDocs(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
||||
@@ -151,6 +184,17 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Post('data-docs')
|
||||
async createDataDocs(@Body() body) {
|
||||
console.log(`/catalog`, 'ON CREATE DATA DOCS ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.createDataDocs(body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('data-rating')
|
||||
async getDataRating(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||
@@ -162,18 +206,32 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('summary-rating/:id')
|
||||
async getSummaryRating(@Param() params, @Body() body) {
|
||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
||||
const { id } = params;
|
||||
@Post('data-rating')
|
||||
async createDataRating(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.getSummaryRating(id, body);
|
||||
const res = await catalogService.createDataRating(body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Get('summary-rating/:id')
|
||||
async getSummaryRating() {
|
||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
||||
//const { id } = params;
|
||||
|
||||
//const catalogService = new CatalogService();
|
||||
|
||||
//const res = await catalogService.getSummaryRating(id, body);
|
||||
|
||||
return {
|
||||
avg_rating: 0,
|
||||
rating_count: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@Get('data-comment')
|
||||
async getDataComment(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||
@@ -185,13 +243,24 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Post('data-comment')
|
||||
async createDataComment(@Body() body) {
|
||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.createDataComment(body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -225,7 +294,7 @@ export class CatalogController {
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.deleteTags(body, id);
|
||||
const res = await catalogService.deleteTags(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -252,14 +321,14 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Delete('table-tags')
|
||||
@Delete('table-tags/:id')
|
||||
async deleteTableTags(@Param() params, @Body() body) {
|
||||
console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE');
|
||||
const { id } = params;
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.deleteTableTags(body, id);
|
||||
const res = await catalogService.deleteTableTags(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -275,14 +344,14 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Delete('table-rules')
|
||||
@Delete('table-rules/:id')
|
||||
async deleteTableRules(@Param() params, @Body() body) {
|
||||
console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE');
|
||||
const { id } = params;
|
||||
|
||||
const catalogService = new CatalogService();
|
||||
|
||||
const res = await catalogService.deleteTableRules(body, id);
|
||||
const res = await catalogService.deleteTableRules(id, body);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,14 @@ class CatalogService {
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
||||
);
|
||||
console.log(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
||||
);
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -21,9 +23,12 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/`,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data_apps/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -33,9 +38,15 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/${id}/`,
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${nimbusUrl}/api/catalog/data_apps/${id}/`,
|
||||
);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -45,21 +56,37 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/`,
|
||||
`${nimbusUrl}/api/catalog/dashboard-metabase/`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getOneDashboardMetabase(body, id) {
|
||||
async getOneDashboardMetabase(id, body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/${id}`,
|
||||
`${nimbusUrl}/api/catalog/dashboard-metabase/${id}`,
|
||||
);
|
||||
console.log(data);
|
||||
|
||||
// const [, path] = data.iframe_url.split('.dadosfera');
|
||||
// const host = `httpss://metabase-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||
// data.iframe_url = host + path;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -69,8 +96,31 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-metadata/`,
|
||||
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getOneTableMetadata(body, params) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||
{ params: params },
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -81,20 +131,31 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-metadata/${id}`,
|
||||
`${nimbusUrl}/api/catalog/table-metadata/${id}`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getOneColumnMetadata(body) {
|
||||
async getOneColumnMetadata(body, params) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/`,
|
||||
`${nimbusUrl}/api/catalog/column-metadata/`,
|
||||
{ params: params },
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -105,21 +166,31 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/${id}/`,
|
||||
`${nimbusUrl}/api/catalog/column-metadata/${id}/`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getOneDataPreview(body) {
|
||||
async getOneDataPreview(body, params) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-preview/`, {
|
||||
params: params,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -129,8 +200,29 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-status/`,
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-status/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
async createDataStatus(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${nimbusUrl}/api/catalog/data-status/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -141,8 +233,31 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-description/`,
|
||||
`${nimbusUrl}/api/catalog/data-description/`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async createDataDescription(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${nimbusUrl}/api/catalog/data-description/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -153,8 +268,29 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-docs/`,
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-docs/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
async createDataDocs(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${nimbusUrl}/api/catalog/data-docs/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -165,8 +301,29 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-rating/`,
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-rating/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
async createDataRating(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${nimbusUrl}/api/catalog/data-rating/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -176,8 +333,14 @@ class CatalogService {
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/summary-rating/${id}`,
|
||||
`${nimbusUrl}/api/catalog/summary-rating/${id}`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -188,34 +351,62 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-comment/`,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-comment/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getDataReview(body) {
|
||||
async createDataComment(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${nimbusUrl}/api/catalog/data-comment/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
async getDataReview(body, params) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-review/`, {
|
||||
params: params,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
async createTags(body) {
|
||||
const customer =
|
||||
body.info.customer.toLowerCase() === 'dadosfera'
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
||||
body,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -225,10 +416,12 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
||||
body,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -238,8 +431,13 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/`,
|
||||
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
@@ -251,9 +449,12 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/${id}`,
|
||||
);
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.delete(`${nimbusUrl}/api/catalog/tags/${id}`);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -263,8 +464,13 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.post(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/`,
|
||||
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
@@ -276,8 +482,13 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/${id}`,
|
||||
`${nimbusUrl}/api/catalog/table-tags/${id}`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -288,8 +499,13 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.get(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-rules/`,
|
||||
`${nimbusUrl}/api/catalog/table-rules/`,
|
||||
body,
|
||||
);
|
||||
return data;
|
||||
@@ -301,8 +517,13 @@ class CatalogService {
|
||||
? ``
|
||||
: `-${body.info.customer.toLowerCase()}`;
|
||||
|
||||
const nimbusUrl =
|
||||
process.env.ENV === 'prd'
|
||||
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||
|
||||
const { data } = await axios.delete(
|
||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-rules/${id}`,
|
||||
`${nimbusUrl}/api/catalog/table-rules/${id}`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Body, HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import { Timeout } from '@nestjs/schedule';
|
||||
import { InputNewCreateRequest } from '@victorradael/protospack';
|
||||
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||
import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
||||
@@ -60,6 +61,7 @@ export class InputsService {
|
||||
}
|
||||
}
|
||||
|
||||
@Timeout(60000 * 10) // Timeout set for 10 minutes
|
||||
async testConnection(data) {
|
||||
try {
|
||||
const testConnectionInputResponse = await this.inputClient.testConnection(
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user