mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-19 23:29:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dc669ca44 | ||
|
|
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 |
Generated
+79
-7
@@ -17,8 +17,9 @@
|
|||||||
"@nestjs/mapped-types": "*",
|
"@nestjs/mapped-types": "*",
|
||||||
"@nestjs/microservices": "^8.4.3",
|
"@nestjs/microservices": "^8.4.3",
|
||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.5.5",
|
"@victorradael/protospack": "^1.6.5",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
@@ -1580,6 +1581,20 @@
|
|||||||
"@nestjs/core": "^8.0.0"
|
"@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": {
|
"node_modules/@nestjs/schematics": {
|
||||||
"version": "8.0.8",
|
"version": "8.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
||||||
@@ -2344,9 +2359,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@victorradael/protospack": {
|
"node_modules/@victorradael/protospack": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.5",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
||||||
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
|
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
@@ -3517,6 +3532,14 @@
|
|||||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||||
"dev": true
|
"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": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
@@ -6816,6 +6839,25 @@
|
|||||||
"mkdirp": "bin/cmd.js"
|
"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": {
|
"node_modules/ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
@@ -10307,6 +10349,15 @@
|
|||||||
"tslib": "2.3.1"
|
"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": {
|
"@nestjs/schematics": {
|
||||||
"version": "8.0.8",
|
"version": "8.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-8.0.8.tgz",
|
||||||
@@ -10904,9 +10955,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@victorradael/protospack": {
|
"@victorradael/protospack": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.5",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
||||||
"integrity": "sha512-5yGW/EuZDY9N56CVMXJW1IrBkkv6KpalBepu0LLQvM5Y+Pr8lwY2i1p/1rlsjHo6Gk1RODKuWSXAL870jQEAdg==",
|
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
@@ -11845,6 +11896,14 @@
|
|||||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||||
"dev": true
|
"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": {
|
"cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
@@ -14375,6 +14434,19 @@
|
|||||||
"minimist": "^1.2.5"
|
"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": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
|||||||
+2
-1
@@ -29,8 +29,9 @@
|
|||||||
"@nestjs/mapped-types": "*",
|
"@nestjs/mapped-types": "*",
|
||||||
"@nestjs/microservices": "^8.4.3",
|
"@nestjs/microservices": "^8.4.3",
|
||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.5.5",
|
"@victorradael/protospack": "^1.6.5",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"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');
|
console.log('AuthClientService', 'SignIn');
|
||||||
|
|
||||||
const tokens = await new Promise((resolve, reject) => {
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
this.authService.signIn({ username, password }).subscribe({
|
this.authService.signIn({ username, password, totp }).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
export interface ILogin {
|
export interface ILogin {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
totp: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class TransformationsClientConfiguration {
|
|||||||
return {
|
return {
|
||||||
transport: Transport.GRPC,
|
transport: Transport.GRPC,
|
||||||
options: {
|
options: {
|
||||||
url: process.env.TRFACTORY_URL,
|
url: process.env.INFACTORY_URL,
|
||||||
package: TransformationPackages,
|
package: TransformationPackages,
|
||||||
credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: TransformationProtoFilePath,
|
protoPath: TransformationProtoFilePath,
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ export class LoggerMiddleware implements NestMiddleware {
|
|||||||
const idToken = request.get('Dadosfera-User');
|
const idToken = request.get('Dadosfera-User');
|
||||||
const accessToken = request.get('Authorization');
|
const accessToken = request.get('Authorization');
|
||||||
const privateKey = process.env.JWT_PRIVATE_KEY;
|
const privateKey = process.env.JWT_PRIVATE_KEY;
|
||||||
|
let requiredRoute = '';
|
||||||
const requiredMethod = request.method.trim();
|
const requiredMethod = request.method.trim();
|
||||||
const requiredRoute = request.route.path.split('/')[1].trim();
|
if (request.route.path.split('/').length >= 2) {
|
||||||
|
requiredRoute = request.route.path.split('/')[1].trim();
|
||||||
|
}
|
||||||
|
|
||||||
verify(idToken, privateKey, (err) => {
|
verify(idToken, privateKey, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { AuthClientService } from 'src/clients/auth/client.service';
|
|||||||
interface ISignIn {
|
interface ISignIn {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
totp: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Controller('auth')
|
@Controller('auth')
|
||||||
@@ -12,11 +13,11 @@ export class AuthController {
|
|||||||
constructor(private authClient: AuthClientService) {}
|
constructor(private authClient: AuthClientService) {}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
async signIn(@Body() { username, password }: ISignIn) {
|
async signIn(@Body() { username, password, totp }: ISignIn) {
|
||||||
console.log(`/auth`, 'SignIn');
|
console.log(`/auth`, 'SignIn');
|
||||||
|
|
||||||
const tokens = await this.authClient
|
const tokens = await this.authClient
|
||||||
.signIn({ username, password })
|
.signIn({ username, password, totp })
|
||||||
.then((result) => result)
|
.then((result) => result)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new UnauthorizedException(err.message);
|
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';
|
import { CatalogService } from './catalog.service';
|
||||||
|
|
||||||
@Controller('catalog')
|
@Controller('catalog')
|
||||||
@@ -33,7 +41,7 @@ export class CatalogController {
|
|||||||
const { id } = params;
|
const { id } = params;
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.dataAppsOne(body, id);
|
const res = await catalogService.dataAppsOne(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -56,64 +64,67 @@ export class CatalogController {
|
|||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneDashboardMetabase(body, id);
|
const res = await catalogService.getOneDashboardMetabase(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('table-metadata')
|
@Get('table-metadata')
|
||||||
async getAllTableMetadata(@Body() body) {
|
async getAllTableMetadata(@Body() body, @Query() query) {
|
||||||
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
if (!query) {
|
||||||
const res = await catalogService.getAllTableMetadata(body);
|
const res = await catalogService.getAllTableMetadata(body);
|
||||||
|
return res;
|
||||||
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) {
|
async deleteOneTableMetadata(@Param() params, @Body() body) {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE');
|
console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteOneTableMetadata(body, id);
|
const res = await catalogService.deleteOneTableMetadata(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('column-metadata')
|
@Delete('column-metadata/:id')
|
||||||
async deleteOneColumnMetadata(@Param() params, @Body() body) {
|
async deleteOneColumnMetadata(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE');
|
console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteOneColumnMetadata(body, id);
|
const res = await catalogService.deleteOneColumnMetadata(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
}
|
}
|
||||||
@@ -129,6 +140,17 @@ export class CatalogController {
|
|||||||
return res;
|
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')
|
@Get('data-description')
|
||||||
async getDataDescription(@Body() body) {
|
async getDataDescription(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
||||||
@@ -140,6 +162,17 @@ export class CatalogController {
|
|||||||
return res;
|
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')
|
@Get('data-docs')
|
||||||
async getDataDocs(@Body() body) {
|
async getDataDocs(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
||||||
@@ -151,6 +184,17 @@ export class CatalogController {
|
|||||||
return res;
|
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')
|
@Get('data-rating')
|
||||||
async getDataRating(@Body() body) {
|
async getDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
@@ -162,18 +206,32 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('summary-rating/:id')
|
@Post('data-rating')
|
||||||
async getSummaryRating(@Param() params, @Body() body) {
|
async createDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
const { id } = params;
|
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getSummaryRating(id, body);
|
const res = await catalogService.createDataRating(body);
|
||||||
|
|
||||||
return res;
|
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')
|
@Get('data-comment')
|
||||||
async getDataComment(@Body() body) {
|
async getDataComment(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
@@ -185,13 +243,24 @@ export class CatalogController {
|
|||||||
return res;
|
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')
|
@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;
|
||||||
}
|
}
|
||||||
@@ -225,7 +294,7 @@ export class CatalogController {
|
|||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTags(body, id);
|
const res = await catalogService.deleteTags(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -252,14 +321,14 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-tags')
|
@Delete('table-tags/:id')
|
||||||
async deleteTableTags(@Param() params, @Body() body) {
|
async deleteTableTags(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE');
|
console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTableTags(body, id);
|
const res = await catalogService.deleteTableTags(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -275,14 +344,14 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-rules')
|
@Delete('table-rules/:id')
|
||||||
async deleteTableRules(@Param() params, @Body() body) {
|
async deleteTableRules(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE');
|
console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTableRules(body, id);
|
const res = await catalogService.deleteTableRules(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ 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-${body.info.customer.toLowerCase()}.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`;
|
||||||
);
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,9 +23,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,9 +38,15 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/${id}/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,21 +56,37 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneDashboardMetabase(body, id) {
|
async getOneDashboardMetabase(id, body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +96,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -81,20 +131,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneColumnMetadata(body) {
|
async getOneColumnMetadata(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -105,21 +166,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneDataPreview(body) {
|
async getOneDataPreview(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,8 +200,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-status/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -141,8 +233,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -153,8 +268,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-docs/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -165,8 +301,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-rating/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -176,8 +333,14 @@ class CatalogService {
|
|||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -188,34 +351,62 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-comment/`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDataReview(body) {
|
async createDataComment(body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
|
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;
|
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) {
|
async createTags(body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.post(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
process.env.ENV === 'prd'
|
||||||
body,
|
? `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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,10 +416,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
process.env.ENV === 'prd'
|
||||||
body,
|
? `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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,8 +431,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -251,9 +449,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/${id}`,
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,8 +464,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -276,8 +482,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -288,8 +499,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -301,8 +517,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${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(
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Body, HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
import { Body, HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||||
|
import { Timeout } from '@nestjs/schedule';
|
||||||
import { InputNewCreateRequest } from '@victorradael/protospack';
|
import { InputNewCreateRequest } from '@victorradael/protospack';
|
||||||
import { InputsClientService } from 'src/clients/inputs/client.service';
|
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||||
import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
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) {
|
async testConnection(data) {
|
||||||
try {
|
try {
|
||||||
const testConnectionInputResponse = await this.inputClient.testConnection(
|
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