mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-27 19:00:05 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc108d43e3 | ||
|
|
f4a5f91cbb | ||
|
|
65f6f03e55 | ||
|
|
a54300f600 | ||
|
|
5ef85f79d3 | ||
|
|
a8a429977f | ||
|
|
692a9de0af | ||
|
|
7dc669ca44 | ||
|
|
e897da1ef0 | ||
|
|
b366e786ba | ||
|
|
24d56c7a58 | ||
|
|
d7f205901b | ||
|
|
7212c5249c | ||
|
|
827c7b1bf1 | ||
|
|
8d89b747b4 | ||
|
|
4f18328603 | ||
|
|
a68d312447 | ||
|
|
7f677f0376 | ||
|
|
bb2c0ab23e | ||
|
|
feec48114c | ||
|
|
7bee8d83a9 | ||
|
|
84b2dbd178 | ||
|
|
36706ff3dd | ||
|
|
0164e6978a | ||
|
|
7d371926f5 | ||
|
|
75e9e97f04 | ||
|
|
b5f58b99fd | ||
|
|
503293439f | ||
|
|
eed57ff039 |
@@ -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
+46
-9220
File diff suppressed because it is too large
Load Diff
+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.9",
|
"@victorradael/protospack": "1.7.4",
|
||||||
"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,11 +25,11 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async signIn({ username, password }: 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) => {
|
||||||
this.authService.signIn({ username, password }).subscribe({
|
this.authService.signIn({ username, password, totp }).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
@@ -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', 'resendeConfirmationCode');
|
||||||
|
|
||||||
|
const authResendConfirmationCodeRequestReturn = await new Promise(
|
||||||
|
(resolve, reject) => {
|
||||||
|
this.authService.resendeConfirmationCode({ 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
+7
-1
@@ -1,4 +1,10 @@
|
|||||||
export interface ILogin {
|
export interface ISignIn {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
totp: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IRefreshAccessToken {
|
||||||
|
username: string;
|
||||||
|
refreshToken: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,13 +191,13 @@ export class PipelinesClientService implements OnModuleInit {
|
|||||||
.subscribe({
|
.subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
const statusArray = x.status.sort((a, b) => {
|
const statusArray = x.status.sort((a, b) => {
|
||||||
if (Date.parse(a.updated_at) < Date.parse(b.updated_at)) {
|
if (a.id < b.id) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
resolve(statusArray);
|
resolve({ status: statusArray });
|
||||||
},
|
},
|
||||||
error(err) {
|
error(err) {
|
||||||
console.log('Observable Error');
|
console.log('Observable Error');
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -1,22 +1,43 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Controller('auth')
|
@Controller('auth')
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
constructor(private authClient: AuthClientService) {}
|
constructor(private authClient: AuthClientService) {}
|
||||||
|
|
||||||
|
// DEPRECADO!
|
||||||
@Post()
|
@Post()
|
||||||
async signIn(@Body() { username, password }: ISignIn) {
|
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) {
|
||||||
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);
|
||||||
@@ -24,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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,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');
|
||||||
@@ -151,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');
|
||||||
@@ -162,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');
|
||||||
@@ -185,15 +218,18 @@ export class CatalogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('summary-rating/:id')
|
@Get('summary-rating/:id')
|
||||||
async getSummaryRating(@Param() params, @Body() body) {
|
async getSummaryRating() {
|
||||||
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 catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getSummaryRating(id, body);
|
//const res = await catalogService.getSummaryRating(id, body);
|
||||||
|
|
||||||
return res;
|
return {
|
||||||
|
avg_rating: 0,
|
||||||
|
rating_count: 0,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('data-comment')
|
@Get('data-comment')
|
||||||
|
|||||||
@@ -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,8 +56,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/dashboard-metabase/`,
|
`${nimbusUrl}/api/catalog/dashboard-metabase/`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -57,13 +73,19 @@ 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/dashboard-metabase/${id}`,
|
process.env.ENV === 'prd'
|
||||||
);
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const [, path] = data.iframe_url.split('.dadosfera');
|
const { data } = await axios.get(
|
||||||
const host = `https://metabase-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
`${nimbusUrl}/api/catalog/dashboard-metabase/${id}`,
|
||||||
data.iframe_url = host + path;
|
);
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@@ -74,8 +96,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-metadata/`,
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -86,8 +113,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-metadata/`,
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
{ params: params },
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -99,8 +131,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-metadata/${id}`,
|
`${nimbusUrl}/api/catalog/table-metadata/${id}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -111,8 +148,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/column-metadata/`,
|
`${nimbusUrl}/api/catalog/column-metadata/`,
|
||||||
{ params: params },
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -124,8 +166,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/column-metadata/${id}/`,
|
`${nimbusUrl}/api/catalog/column-metadata/${id}/`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -136,10 +183,14 @@ 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-preview/`,
|
process.env.ENV === 'prd'
|
||||||
{ params: params },
|
? `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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,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;
|
||||||
}
|
}
|
||||||
@@ -161,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;
|
||||||
}
|
}
|
||||||
@@ -173,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;
|
||||||
}
|
}
|
||||||
@@ -185,9 +301,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-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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +316,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/data-rating/`,
|
`${nimbusUrl}/api/catalog/data-rating/`,
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -209,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;
|
||||||
}
|
}
|
||||||
@@ -221,9 +351,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-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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,8 +366,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/data-comment/`,
|
`${nimbusUrl}/api/catalog/data-comment/`,
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -246,10 +384,14 @@ 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-review/`,
|
process.env.ENV === 'prd'
|
||||||
{ params: params },
|
? `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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,10 +401,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,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;
|
||||||
@@ -298,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,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;
|
||||||
@@ -323,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;
|
||||||
}
|
}
|
||||||
@@ -335,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;
|
||||||
@@ -348,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