mirror of
https://github.com/dadosfera/maestro.git
synced 2026-12-05 03:20:06 +00:00
Compare commits
9
Commits
v1.5.2
...
v1.6.0-alpha.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e21c308f6 | ||
|
|
c8aeb7f3db | ||
|
|
b9453b11cf | ||
|
|
a69752332e | ||
|
|
09c7cc79ee | ||
|
|
a8a429977f | ||
|
|
692a9de0af | ||
|
|
b366e786ba | ||
|
|
24d56c7a58 |
@@ -38,7 +38,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
semantic_version: 16
|
semantic_version: 16
|
||||||
extra_plugins: |
|
extra_plugins: |
|
||||||
@saithodev/semantic-release-backmerge
|
|
||||||
conventional-changelog-eslint
|
conventional-changelog-eslint
|
||||||
branches: |
|
branches: |
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -26,18 +26,6 @@
|
|||||||
"preset": "eslint"
|
"preset": "eslint"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
|
||||||
"@saithodev/semantic-release-backmerge",
|
|
||||||
{
|
|
||||||
"branches": [
|
|
||||||
{ "from": "main", "to": "alpha" },
|
|
||||||
{ "from": "main", "to": "beta" }
|
|
||||||
],
|
|
||||||
"backmergeStrategy": "merge",
|
|
||||||
"clearWorkspace": true,
|
|
||||||
"restoreWorkspace": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@semantic-release/npm",
|
"@semantic-release/npm",
|
||||||
"@semantic-release/github"
|
"@semantic-release/github"
|
||||||
]
|
]
|
||||||
|
|||||||
Generated
+7
-7
@@ -19,7 +19,7 @@
|
|||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/schedule": "^1.1.0",
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.6.5",
|
"@victorradael/protospack": "^1.8.0",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
@@ -2359,9 +2359,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@victorradael/protospack": {
|
"node_modules/@victorradael/protospack": {
|
||||||
"version": "1.6.5",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.8.0.tgz",
|
||||||
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
"integrity": "sha512-vixXFliu7hPtJshGyxyekXBMsY1VCDo6WKu+aDKGHxAvd1cSG46UjAOYvYX5yPL4/J6fD//C4mdEYNW9l5TLvQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
@@ -10955,9 +10955,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@victorradael/protospack": {
|
"@victorradael/protospack": {
|
||||||
"version": "1.6.5",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-1.8.0.tgz",
|
||||||
"integrity": "sha512-WuRHsvjyprZTrA+L/LmuR0x4d/GLxO/rprQAMqQ5PzZmMViMQSrN6IGX6umJKHImLhVeRkNEGsysjAxHc4V12Q==",
|
"integrity": "sha512-vixXFliu7hPtJshGyxyekXBMsY1VCDo6WKu+aDKGHxAvd1cSG46UjAOYvYX5yPL4/J6fD//C4mdEYNW9l5TLvQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/schedule": "^1.1.0",
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.6.5",
|
"@victorradael/protospack": "^1.8.0",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ import { OnModuleInit, Inject } from '@nestjs/common';
|
|||||||
import { ClientGrpc } from '@nestjs/microservices';
|
import { ClientGrpc } from '@nestjs/microservices';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
AuthConfirmationRequest,
|
||||||
|
AuthDisableTotpMfaRequest,
|
||||||
|
AuthEnableTotpMfaRequest,
|
||||||
|
AuthResendConfirmationCodeRequest,
|
||||||
AuthServiceInterface,
|
AuthServiceInterface,
|
||||||
|
AuthVerifyTotpMfaRequest,
|
||||||
DucServicesNames,
|
DucServicesNames,
|
||||||
} from '@victorradael/protospack';
|
} from '@victorradael/protospack';
|
||||||
|
|
||||||
import { ILogin } from './interfaces';
|
import { ISignIn, IRefreshAccessToken } from './interfaces';
|
||||||
|
|
||||||
export class AuthClientService implements OnModuleInit {
|
export class AuthClientService implements OnModuleInit {
|
||||||
private authService: AuthServiceInterface;
|
private authService: AuthServiceInterface;
|
||||||
@@ -20,7 +25,7 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async signIn({ username, password, totp }: ILogin): Promise<any> {
|
async signIn({ username, password, totp }: ISignIn): Promise<any> {
|
||||||
console.log('AuthClientService', 'SignIn');
|
console.log('AuthClientService', 'SignIn');
|
||||||
|
|
||||||
const tokens = await new Promise((resolve, reject) => {
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
@@ -43,4 +48,171 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
});
|
});
|
||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async enableTotpMFA({
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
}: AuthEnableTotpMfaRequest): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'enableTotpMFA');
|
||||||
|
|
||||||
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
|
this.authService.enableTotpMfa({ username, password }).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
async disableTotpMFA({
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
totp,
|
||||||
|
}: AuthDisableTotpMfaRequest): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'disableTotpMFA');
|
||||||
|
|
||||||
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
|
this.authService.disableTotpMfa({ username, password, totp }).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
async verifyTotp({
|
||||||
|
username,
|
||||||
|
accessToken,
|
||||||
|
totp,
|
||||||
|
}: AuthVerifyTotpMfaRequest): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'disableTotpMFA');
|
||||||
|
|
||||||
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
|
this.authService.verifyTotp({ username, accessToken, totp }).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
async confirmRegister({
|
||||||
|
username,
|
||||||
|
code,
|
||||||
|
}: AuthConfirmationRequest): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'confirmRegister');
|
||||||
|
|
||||||
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
|
this.authService.confirmRegister({ username, code }).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
async resendeConfirmationCode({
|
||||||
|
username,
|
||||||
|
}: AuthResendConfirmationCodeRequest): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'resendConfirmationCode');
|
||||||
|
|
||||||
|
const authResendConfirmationCodeRequestReturn = await new Promise(
|
||||||
|
(resolve, reject) => {
|
||||||
|
this.authService.resendConfirmationCode({ username }).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return authResendConfirmationCodeRequestReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
async refreshAccessToken({
|
||||||
|
username,
|
||||||
|
refreshToken,
|
||||||
|
}: IRefreshAccessToken): Promise<any> {
|
||||||
|
console.log('AuthClientService', 'RefreshAccessToken');
|
||||||
|
|
||||||
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
|
this.authService
|
||||||
|
.refreshAccessToken({ username, refreshToken })
|
||||||
|
.subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(x);
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+6
-1
@@ -1,5 +1,10 @@
|
|||||||
export interface ILogin {
|
export interface ISignIn {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
totp: string;
|
totp: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IRefreshAccessToken {
|
||||||
|
username: string;
|
||||||
|
refreshToken: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { OnModuleInit, Inject } from '@nestjs/common';
|
import { OnModuleInit, Inject } from '@nestjs/common';
|
||||||
import { ClientGrpc } from '@nestjs/microservices';
|
import { ClientGrpc } from '@nestjs/microservices';
|
||||||
import {
|
import {
|
||||||
|
InputCreateS3Request,
|
||||||
InputNewCreateRequest,
|
InputNewCreateRequest,
|
||||||
InputService,
|
InputService,
|
||||||
TestConnectionGetColumnsRequest,
|
TestConnectionGetColumnsRequest,
|
||||||
@@ -50,6 +51,31 @@ export class InputsClientService implements OnModuleInit {
|
|||||||
return createInputResponse;
|
return createInputResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async createS3Inputs(createInputDto: InputCreateS3Request) {
|
||||||
|
console.log('InputClientService', 'Create');
|
||||||
|
|
||||||
|
const createInputResponse = await new Promise((resolve, reject) => {
|
||||||
|
this.inputService.CreateS3(objectSnakeToCamel(createInputDto)).subscribe({
|
||||||
|
next(x) {
|
||||||
|
resolve(objectCamelToSnake(x));
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then((res) => res)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new Error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return createInputResponse;
|
||||||
|
}
|
||||||
|
|
||||||
async findOne(data: IIdRequest) {
|
async findOne(data: IIdRequest) {
|
||||||
console.log('InputClientService', 'FindOne');
|
console.log('InputClientService', 'FindOne');
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export class LoggerMiddleware implements NestMiddleware {
|
|||||||
const jwtDecoded: any = decode(idToken);
|
const jwtDecoded: any = decode(idToken);
|
||||||
|
|
||||||
const permissions = jwtDecoded.user.permissions;
|
const permissions = jwtDecoded.user.permissions;
|
||||||
|
|
||||||
const clienId = jwtDecoded.user.customerId;
|
const clienId = jwtDecoded.user.customerId;
|
||||||
const customer = jwtDecoded.user.customer;
|
const customer = jwtDecoded.user.customer;
|
||||||
const userId = jwtDecoded.user.id;
|
const userId = jwtDecoded.user.id;
|
||||||
@@ -38,16 +39,20 @@ export class LoggerMiddleware implements NestMiddleware {
|
|||||||
await verifyToken(accessToken);
|
await verifyToken(accessToken);
|
||||||
|
|
||||||
let havePermission = false;
|
let havePermission = false;
|
||||||
permissions.forEach((permission) => {
|
const permission = permissions.find((permission) => {
|
||||||
permission = permission.split('/');
|
permission = permission.split('/');
|
||||||
const method = permission[0].trim();
|
const method = permission[0].trim();
|
||||||
const route = permission[1].trim();
|
const route = permission[1].trim();
|
||||||
|
|
||||||
if (method === requiredMethod && route === requiredRoute) {
|
if (method === requiredMethod && route === requiredRoute) {
|
||||||
havePermission = true;
|
return permission;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (permission) {
|
||||||
|
havePermission = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (havePermission) {
|
if (havePermission) {
|
||||||
request.body.info = {
|
request.body.info = {
|
||||||
customer_id: clienId,
|
customer_id: clienId,
|
||||||
|
|||||||
@@ -1,18 +1,38 @@
|
|||||||
import { Body, Controller, Post, UnauthorizedException } from '@nestjs/common';
|
import {
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Headers,
|
||||||
|
Post,
|
||||||
|
UnauthorizedException,
|
||||||
|
} from '@nestjs/common';
|
||||||
|
import {
|
||||||
|
AuthEnableTotpMfaRequest,
|
||||||
|
AuthVerifyTotpMfaRequest,
|
||||||
|
} from '@victorradael/protospack';
|
||||||
|
|
||||||
import { AuthClientService } from 'src/clients/auth/client.service';
|
import { AuthClientService } from 'src/clients/auth/client.service';
|
||||||
|
import { ISignIn, IRefreshAccessToken } from 'src/clients/auth/interfaces';
|
||||||
interface ISignIn {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
totp: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Controller('auth')
|
@Controller('auth')
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
constructor(private authClient: AuthClientService) {}
|
constructor(private authClient: AuthClientService) {}
|
||||||
|
|
||||||
|
// DEPRECADO!
|
||||||
@Post()
|
@Post()
|
||||||
|
async signIn_old(@Body() body: ISignIn) {
|
||||||
|
console.log(`/auth`, 'SignIn_old');
|
||||||
|
|
||||||
|
return this.signIn(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('login')
|
||||||
|
async signIn_login(@Body() body: ISignIn) {
|
||||||
|
console.log(`/auth`, 'SignIn_login');
|
||||||
|
|
||||||
|
return this.signIn(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('sign-in')
|
||||||
async signIn(@Body() { username, password, totp }: ISignIn) {
|
async signIn(@Body() { username, password, totp }: ISignIn) {
|
||||||
console.log(`/auth`, 'SignIn');
|
console.log(`/auth`, 'SignIn');
|
||||||
|
|
||||||
@@ -25,4 +45,56 @@ export class AuthController {
|
|||||||
|
|
||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('refresh-access-token')
|
||||||
|
async refreshAccessToken(
|
||||||
|
@Body() { username, refreshToken }: IRefreshAccessToken,
|
||||||
|
) {
|
||||||
|
console.log(`/auth`, 'RefreshAccessToken');
|
||||||
|
|
||||||
|
const accessToken = await this.authClient
|
||||||
|
.refreshAccessToken({ username, refreshToken })
|
||||||
|
.then((result) => result)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new UnauthorizedException(err.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('enable-totp')
|
||||||
|
async enableTotpMFA(
|
||||||
|
@Body() { username, password }: AuthEnableTotpMfaRequest,
|
||||||
|
) {
|
||||||
|
console.log(`/auth`, 'enable-totp');
|
||||||
|
|
||||||
|
const enableTotpResponse = await this.authClient
|
||||||
|
.enableTotpMFA({ username, password })
|
||||||
|
.then((result) => result)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new UnauthorizedException(err.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
return enableTotpResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('verify-totp')
|
||||||
|
async verifyTotp(
|
||||||
|
@Body() body: AuthVerifyTotpMfaRequest,
|
||||||
|
@Headers() headers,
|
||||||
|
): Promise<any> {
|
||||||
|
console.log(`/auth`, 'enable-totp');
|
||||||
|
|
||||||
|
const { username, totp } = body;
|
||||||
|
const { Authorization } = headers;
|
||||||
|
|
||||||
|
const enableTotpResponse = await this.authClient
|
||||||
|
.verifyTotp({ username, totp, accessToken: Authorization })
|
||||||
|
.then((result) => result)
|
||||||
|
.catch((err) => {
|
||||||
|
throw new UnauthorizedException(err.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
return enableTotpResponse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,7 @@ export class CatalogController {
|
|||||||
async catalogAll(@Body() body) {
|
async catalogAll(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CATALOG ALL ROUTE');
|
console.log(`/catalog`, 'ON CATALOG ALL ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.catalogAll(body);
|
||||||
|
|
||||||
const res = await catalogService.catalogAll(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -28,9 +26,7 @@ export class CatalogController {
|
|||||||
async dataAppsAll(@Body() body) {
|
async dataAppsAll(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON FIND ALL DATA APPS ROUTE');
|
console.log(`/catalog`, 'ON FIND ALL DATA APPS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.dataAppsAll(body);
|
||||||
|
|
||||||
const res = await catalogService.dataAppsAll(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -39,9 +35,8 @@ export class CatalogController {
|
|||||||
async dataAppsOne(@Param() params, @Body() body) {
|
async dataAppsOne(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON FIND ONE DATA APP ROUTE');
|
console.log(`/catalog`, 'ON FIND ONE DATA APP ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
const catalogService = new CatalogService();
|
|
||||||
|
|
||||||
const res = await catalogService.dataAppsOne(id, body);
|
const res = await this.catalogService.dataAppsOne(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -50,9 +45,7 @@ export class CatalogController {
|
|||||||
async getAllDashboardMetabase(@Body() body) {
|
async getAllDashboardMetabase(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET ALL DASHBOARDS METABASE ROUTE');
|
console.log(`/catalog`, 'ON GET ALL DASHBOARDS METABASE ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getAllDashboardMetabase(body);
|
||||||
|
|
||||||
const res = await catalogService.getAllDashboardMetabase(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -62,9 +55,7 @@ export class CatalogController {
|
|||||||
const { id } = params;
|
const { id } = params;
|
||||||
console.log(`/catalog`, 'ON GET ONE DASHBOARD METABASE ROUTE');
|
console.log(`/catalog`, 'ON GET ONE DASHBOARD METABASE ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getOneDashboardMetabase(id, body);
|
||||||
|
|
||||||
const res = await catalogService.getOneDashboardMetabase(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -73,12 +64,11 @@ export class CatalogController {
|
|||||||
async getAllTableMetadata(@Body() body, @Query() query) {
|
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();
|
|
||||||
if (!query) {
|
if (!query) {
|
||||||
const res = await catalogService.getAllTableMetadata(body);
|
const res = await this.catalogService.getAllTableMetadata(body);
|
||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
const res = await catalogService.getOneTableMetadata(body, query);
|
const res = await this.catalogService.getOneTableMetadata(body, query);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,9 +78,7 @@ export class CatalogController {
|
|||||||
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 res = await this.catalogService.deleteOneTableMetadata(id, body);
|
||||||
|
|
||||||
const res = await catalogService.deleteOneTableMetadata(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -99,9 +87,7 @@ export class CatalogController {
|
|||||||
async getOneColumnMetadata(@Body() body, @Query() params) {
|
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 res = await this.catalogService.getOneColumnMetadata(body, params);
|
||||||
|
|
||||||
const res = await catalogService.getOneColumnMetadata(body, params);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -111,9 +97,7 @@ export class CatalogController {
|
|||||||
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 res = await this.catalogService.deleteOneColumnMetadata(id, body);
|
||||||
|
|
||||||
const res = await catalogService.deleteOneColumnMetadata(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -122,9 +106,7 @@ export class CatalogController {
|
|||||||
async getOneDataPreview(@Body() body, @Query() params) {
|
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 res = await this.catalogService.getOneDataPreview(body, params);
|
||||||
|
|
||||||
const res = await catalogService.getOneDataPreview(body, params);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -133,9 +115,7 @@ export class CatalogController {
|
|||||||
async getDataStatus(@Body() body) {
|
async getDataStatus(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA STATUS ROUTE');
|
console.log(`/catalog`, 'ON GET DATA STATUS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getDataStatus(body);
|
||||||
|
|
||||||
const res = await catalogService.getDataStatus(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -144,9 +124,7 @@ export class CatalogController {
|
|||||||
async createDataStatus(@Body() body) {
|
async createDataStatus(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE DATA STATUS ROUTE');
|
console.log(`/catalog`, 'ON CREATE DATA STATUS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createDataStatus(body);
|
||||||
|
|
||||||
const res = await catalogService.createDataStatus(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -155,9 +133,7 @@ export class CatalogController {
|
|||||||
async getDataDescription(@Body() body) {
|
async getDataDescription(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getDataDescription(body);
|
||||||
|
|
||||||
const res = await catalogService.getDataDescription(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -166,9 +142,7 @@ export class CatalogController {
|
|||||||
async createDataDescription(@Body() body) {
|
async createDataDescription(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE DATA DESCRIPTION ROUTE');
|
console.log(`/catalog`, 'ON CREATE DATA DESCRIPTION ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createDataDescription(body);
|
||||||
|
|
||||||
const res = await catalogService.createDataDescription(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -177,9 +151,7 @@ export class CatalogController {
|
|||||||
async getDataDocs(@Body() body) {
|
async getDataDocs(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getDataDocs(body);
|
||||||
|
|
||||||
const res = await catalogService.getDataDocs(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -188,9 +160,7 @@ export class CatalogController {
|
|||||||
async createDataDocs(@Body() body) {
|
async createDataDocs(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE DATA DOCS ROUTE');
|
console.log(`/catalog`, 'ON CREATE DATA DOCS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createDataDocs(body);
|
||||||
|
|
||||||
const res = await catalogService.createDataDocs(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -199,9 +169,7 @@ export class CatalogController {
|
|||||||
async getDataRating(@Body() body) {
|
async getDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getDataRating(body);
|
||||||
|
|
||||||
const res = await catalogService.getDataRating(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -210,9 +178,7 @@ export class CatalogController {
|
|||||||
async createDataRating(@Body() body) {
|
async createDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createDataRating(body);
|
||||||
|
|
||||||
const res = await catalogService.createDataRating(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -222,9 +188,9 @@ export class CatalogController {
|
|||||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
||||||
//const { id } = params;
|
//const { id } = params;
|
||||||
|
|
||||||
//const catalogService = new CatalogService();
|
//
|
||||||
|
|
||||||
//const res = await catalogService.getSummaryRating(id, body);
|
//const res = await this.catalogService.getSummaryRating(id, body);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
avg_rating: 0,
|
avg_rating: 0,
|
||||||
@@ -236,9 +202,7 @@ export class CatalogController {
|
|||||||
async getDataComment(@Body() body) {
|
async getDataComment(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getDataComment(body);
|
||||||
|
|
||||||
const res = await catalogService.getDataComment(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -247,9 +211,7 @@ export class CatalogController {
|
|||||||
async createDataComment(@Body() body) {
|
async createDataComment(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createDataComment(body);
|
||||||
|
|
||||||
const res = await catalogService.createDataComment(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -258,9 +220,7 @@ export class CatalogController {
|
|||||||
async getDataReview(@Body() body, @Query() params) {
|
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 res = await this.catalogService.getDataReview(body, params);
|
||||||
|
|
||||||
const res = await catalogService.getDataReview(body, params);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -269,9 +229,7 @@ export class CatalogController {
|
|||||||
async createTags(@Body() body) {
|
async createTags(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE TAG ROUTE');
|
console.log(`/catalog`, 'ON CREATE TAG ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createTags(body);
|
||||||
|
|
||||||
const res = await catalogService.createTags(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -280,9 +238,7 @@ export class CatalogController {
|
|||||||
async findAllTags(@Body() body) {
|
async findAllTags(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON FIND ALL TAGS ROUTE');
|
console.log(`/catalog`, 'ON FIND ALL TAGS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.findAllTags(body);
|
||||||
|
|
||||||
const res = await catalogService.findAllTags(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -292,9 +248,7 @@ export class CatalogController {
|
|||||||
console.log(`/catalog`, 'ON DELETE TAG ROUTE');
|
console.log(`/catalog`, 'ON DELETE TAG ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.deleteTags(id, body);
|
||||||
|
|
||||||
const res = await catalogService.deleteTags(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -303,9 +257,7 @@ export class CatalogController {
|
|||||||
async createTableTags(@Body() body) {
|
async createTableTags(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE TABLE TAG ROUTE');
|
console.log(`/catalog`, 'ON CREATE TABLE TAG ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.createTableTags(body);
|
||||||
|
|
||||||
const res = await catalogService.createTableTags(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -314,9 +266,7 @@ export class CatalogController {
|
|||||||
async getAllTableTags(@Body() body) {
|
async getAllTableTags(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET ALL TABLE TAGS ROUTE');
|
console.log(`/catalog`, 'ON GET ALL TABLE TAGS ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.findAllTableTags(body);
|
||||||
|
|
||||||
const res = await catalogService.findAllTableTags(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -326,9 +276,7 @@ export class CatalogController {
|
|||||||
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 res = await this.catalogService.deleteTableTags(id, body);
|
||||||
|
|
||||||
const res = await catalogService.deleteTableTags(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -337,9 +285,7 @@ export class CatalogController {
|
|||||||
async getTableRules(@Body() body) {
|
async getTableRules(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET TABLE RULES ROUTE');
|
console.log(`/catalog`, 'ON GET TABLE RULES ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const res = await this.catalogService.getTableRules(body);
|
||||||
|
|
||||||
const res = await catalogService.getTableRules(body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -349,9 +295,7 @@ export class CatalogController {
|
|||||||
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 res = await this.catalogService.deleteTableRules(id, body);
|
||||||
|
|
||||||
const res = await catalogService.deleteTableRules(id, body);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,12 @@ import axios from 'axios';
|
|||||||
|
|
||||||
class CatalogService {
|
class CatalogService {
|
||||||
async catalogAll(body) {
|
async catalogAll(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||||
|
|
||||||
@@ -18,30 +15,24 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async dataAppsAll(body) {
|
async dataAppsAll(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data_apps/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async dataAppsOne(id, body) {
|
async dataAppsOne(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data_apps/${id}/`,
|
`${nimbusUrl}/api/catalog/data_apps/${id}/`,
|
||||||
@@ -51,16 +42,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAllDashboardMetabase(body) {
|
async getAllDashboardMetabase(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/dashboard-metabase/`,
|
`${nimbusUrl}/api/catalog/dashboard-metabase/`,
|
||||||
);
|
);
|
||||||
@@ -68,16 +55,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getOneDashboardMetabase(id, body) {
|
async getOneDashboardMetabase(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/dashboard-metabase/${id}`,
|
`${nimbusUrl}/api/catalog/dashboard-metabase/${id}`,
|
||||||
);
|
);
|
||||||
@@ -91,16 +74,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAllTableMetadata(body) {
|
async getAllTableMetadata(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-metadata/`,
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
);
|
);
|
||||||
@@ -108,16 +87,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getOneTableMetadata(body, params) {
|
async getOneTableMetadata(body, params) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-metadata/`,
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
{ params: params },
|
{ params: params },
|
||||||
@@ -126,16 +101,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteOneTableMetadata(id, body) {
|
async deleteOneTableMetadata(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-metadata/${id}`,
|
`${nimbusUrl}/api/catalog/table-metadata/${id}`,
|
||||||
);
|
);
|
||||||
@@ -143,16 +114,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getOneColumnMetadata(body, params) {
|
async getOneColumnMetadata(body, params) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/column-metadata/`,
|
`${nimbusUrl}/api/catalog/column-metadata/`,
|
||||||
{ params: params },
|
{ params: params },
|
||||||
@@ -161,16 +128,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteOneColumnMetadata(id, body) {
|
async deleteOneColumnMetadata(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/column-metadata/${id}/`,
|
`${nimbusUrl}/api/catalog/column-metadata/${id}/`,
|
||||||
);
|
);
|
||||||
@@ -178,16 +141,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getOneDataPreview(body, params) {
|
async getOneDataPreview(body, params) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`, {
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-preview/`, {
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
@@ -195,31 +154,23 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataStatus(body) {
|
async getDataStatus(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-status/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createDataStatus(body) {
|
async createDataStatus(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-status/`,
|
`${nimbusUrl}/api/catalog/data-status/`,
|
||||||
body,
|
body,
|
||||||
@@ -228,16 +179,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataDescription(body) {
|
async getDataDescription(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-description/`,
|
`${nimbusUrl}/api/catalog/data-description/`,
|
||||||
);
|
);
|
||||||
@@ -245,16 +192,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createDataDescription(body) {
|
async createDataDescription(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-description/`,
|
`${nimbusUrl}/api/catalog/data-description/`,
|
||||||
body,
|
body,
|
||||||
@@ -263,31 +206,23 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataDocs(body) {
|
async getDataDocs(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-docs/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createDataDocs(body) {
|
async createDataDocs(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-docs/`,
|
`${nimbusUrl}/api/catalog/data-docs/`,
|
||||||
body,
|
body,
|
||||||
@@ -296,31 +231,23 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataRating(body) {
|
async getDataRating(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-rating/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createDataRating(body) {
|
async createDataRating(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-rating/`,
|
`${nimbusUrl}/api/catalog/data-rating/`,
|
||||||
body,
|
body,
|
||||||
@@ -329,16 +256,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getSummaryRating(id, body) {
|
async getSummaryRating(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/summary-rating/${id}`,
|
`${nimbusUrl}/api/catalog/summary-rating/${id}`,
|
||||||
);
|
);
|
||||||
@@ -346,31 +269,23 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataComment(body) {
|
async getDataComment(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-comment/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createDataComment(body) {
|
async createDataComment(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/data-comment/`,
|
`${nimbusUrl}/api/catalog/data-comment/`,
|
||||||
body,
|
body,
|
||||||
@@ -379,16 +294,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDataReview(body, params) {
|
async getDataReview(body, params) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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/`, {
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-review/`, {
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
@@ -396,46 +307,34 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createTags(body) {
|
async createTags(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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);
|
const { data } = await axios.post(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAllTags(body) {
|
async findAllTags(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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);
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAllTableTags(body) {
|
async findAllTableTags(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-tags/`,
|
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||||
body,
|
body,
|
||||||
@@ -444,31 +343,23 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteTags(id, body) {
|
async deleteTags(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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}`);
|
const { data } = await axios.delete(`${nimbusUrl}/api/catalog/tags/${id}`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createTableTags(body) {
|
async createTableTags(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-tags/`,
|
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||||
body,
|
body,
|
||||||
@@ -477,16 +368,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteTableTags(id, body) {
|
async deleteTableTags(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-tags/${id}`,
|
`${nimbusUrl}/api/catalog/table-tags/${id}`,
|
||||||
);
|
);
|
||||||
@@ -494,16 +381,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTableRules(body) {
|
async getTableRules(body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-rules/`,
|
`${nimbusUrl}/api/catalog/table-rules/`,
|
||||||
body,
|
body,
|
||||||
@@ -512,16 +395,12 @@ class CatalogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteTableRules(id, body) {
|
async deleteTableRules(id, body) {
|
||||||
const customer =
|
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
if (process.env.ENV !== 'prd') {
|
||||||
? ``
|
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
process.env.ENV
|
||||||
|
}.dadosfera.ai`;
|
||||||
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(
|
||||||
`${nimbusUrl}/api/catalog/table-rules/${id}`,
|
`${nimbusUrl}/api/catalog/table-rules/${id}`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Body, HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
import { Body, HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||||
import { Timeout } from '@nestjs/schedule';
|
import { Timeout } from '@nestjs/schedule';
|
||||||
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';
|
||||||
|
|
||||||
@@ -8,11 +7,19 @@ import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
|||||||
export class InputsService {
|
export class InputsService {
|
||||||
constructor(private inputClient: InputsClientService) {}
|
constructor(private inputClient: InputsClientService) {}
|
||||||
|
|
||||||
async create(@Body() data: InputNewCreateRequest) {
|
async create(@Body() data) {
|
||||||
try {
|
try {
|
||||||
const createInputResponse = await this.inputClient.create(data);
|
if (
|
||||||
|
data.plugin == 'csv' ||
|
||||||
return createInputResponse;
|
data.plugin == 'json' ||
|
||||||
|
data.plugin == 'parquet'
|
||||||
|
) {
|
||||||
|
const createInputResponse = await this.inputClient.createS3Inputs(data);
|
||||||
|
return createInputResponse;
|
||||||
|
} else {
|
||||||
|
const createInputResponse = await this.inputClient.create(data);
|
||||||
|
return createInputResponse;
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user