mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-18 17:39:09 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dc669ca44 | ||
|
|
e897da1ef0 | ||
|
|
d7f205901b | ||
|
|
7212c5249c | ||
|
|
827c7b1bf1 | ||
|
|
8d89b747b4 | ||
|
|
4f18328603 | ||
|
|
a68d312447 | ||
|
|
7f677f0376 | ||
|
|
bb2c0ab23e | ||
|
|
feec48114c | ||
|
|
7bee8d83a9 | ||
|
|
84b2dbd178 | ||
|
|
36706ff3dd | ||
|
|
0164e6978a | ||
|
|
7d371926f5 | ||
|
|
75e9e97f04 | ||
|
|
b5f58b99fd | ||
|
|
503293439f | ||
|
|
eed57ff039 | ||
|
|
ef2a24a0c3 | ||
|
|
8a31e11445 | ||
|
|
2013e97e20 | ||
|
|
dd271205ba | ||
|
|
a1f9f14897 | ||
|
|
b7efa2f58d | ||
|
|
395e36581d | ||
|
|
97a54f9267 | ||
|
|
00b0e00bd0 | ||
|
|
9188536161 | ||
|
|
1ae8151184 | ||
|
|
3d77980dd2 | ||
|
|
849b979e63 | ||
|
|
28580782b1 | ||
|
|
fc784e2d6d | ||
|
|
c997e91912 | ||
|
|
22f493d48a | ||
|
|
035213824b | ||
|
|
1ffa9ade51 | ||
|
|
c91aa57344 | ||
|
|
077a95cdbd | ||
|
|
f39108772b | ||
|
|
cdd8beee8f | ||
|
|
14331ed229 | ||
|
|
5f3db0cb43 | ||
|
|
28f304c47c | ||
|
|
0c1b62b2aa | ||
|
|
13f7e9d812 | ||
|
|
841dcfef06 | ||
|
|
f41ddc1483 | ||
|
|
0a2c7c0a38 | ||
|
|
87f4c17ca2 | ||
|
|
a89625c1e6 | ||
|
|
44211d5658 | ||
|
|
d4e11b1935 | ||
|
|
5c5e940cf7 |
@@ -0,0 +1,7 @@
|
|||||||
|
Resources:
|
||||||
|
AWSEBAutoScalingLaunchConfiguration:
|
||||||
|
Properties:
|
||||||
|
MetadataOptions:
|
||||||
|
HttpEndpoint: enabled
|
||||||
|
HttpPutResponseHopLimit: 2
|
||||||
|
HttpTokens: required
|
||||||
@@ -23,19 +23,15 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
id: extract_environment
|
id: extract_environment
|
||||||
|
|
||||||
deploy:
|
semantic_release:
|
||||||
needs: extract_environment
|
runs-on: ubuntu-latest
|
||||||
runs-on:
|
outputs:
|
||||||
[self-hosted, '${{ needs.extract_environment.outputs.environment }}']
|
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
|
||||||
|
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Because Semantic Realese deleted the .npmrc file, it was necessary to insert two steps to backup the file.
|
|
||||||
- name: BKP .npmrc Step 1
|
|
||||||
run: |
|
|
||||||
cp .npmrc .npmrcbkp
|
|
||||||
|
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v2
|
uses: cycjimmy/semantic-release-action@v2
|
||||||
id: semantic
|
id: semantic
|
||||||
@@ -60,40 +56,43 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
# Because Semantic Realese deleted the .npmrc file, it was necessary to insert two steps to backup the file.
|
deploy:
|
||||||
- name: BKP .npmrc Step 2
|
needs: [extract_environment, semantic_release]
|
||||||
run: |
|
runs-on: [self-hosted, "${{ needs.extract_environment.outputs.environment }}"]
|
||||||
cp .npmrcbkp .npmrc
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Update Pip
|
- name: Update Pip
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
|
|
||||||
- name: Install Docker Compose
|
- name: Install Docker Compose
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install docker-compose --upgrade
|
python3 -m pip install docker-compose --upgrade
|
||||||
|
|
||||||
- name: Install AWS CLI
|
- name: Install AWS CLI
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install awscli --upgrade
|
python3 -m pip install awscli --upgrade
|
||||||
|
|
||||||
- name: Install AWS Elastic Beanstalk CLI
|
- name: Install AWS Elastic Beanstalk CLI
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install awsebcli --upgrade
|
python3 -m pip install awsebcli --upgrade
|
||||||
|
|
||||||
- name: Configure AWS Region
|
- name: Configure AWS Region
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
id: aws
|
id: aws
|
||||||
with:
|
with:
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
|
|
||||||
- name: Extract Environment
|
- name: Extract Environment
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
||||||
@@ -106,15 +105,15 @@ jobs:
|
|||||||
id: extract_environment
|
id: extract_environment
|
||||||
|
|
||||||
- name: Login to AWS ECR
|
- name: Login to AWS ECR
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
id: login_ecr
|
id: login_ecr
|
||||||
uses: aws-actions/amazon-ecr-login@v1
|
uses: aws-actions/amazon-ecr-login@v1
|
||||||
|
|
||||||
- name: Build, Tag, and Push Image to AWS ECR
|
- name: Build, Tag, and Push Image to AWS ECR
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
env:
|
env:
|
||||||
ENV: ${{ steps.extract_environment.outputs.result }}
|
ENV: ${{ steps.extract_environment.outputs.result }}
|
||||||
IMAGE_TAG: ${{ steps.semantic.outputs.new_release_version }}
|
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@@ -122,10 +121,10 @@ jobs:
|
|||||||
docker-compose -f build.docker-compose.yml push
|
docker-compose -f build.docker-compose.yml push
|
||||||
|
|
||||||
- name: Create ZIP file to Deploy AWS Beanstalk
|
- name: Create ZIP file to Deploy AWS Beanstalk
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
env:
|
env:
|
||||||
ENV: ${{ steps.extract_environment.outputs.result }}
|
ENV: ${{ steps.extract_environment.outputs.result }}
|
||||||
IMAGE_TAG: ${{ steps.semantic.outputs.new_release_version }}
|
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
|
||||||
run: |
|
run: |
|
||||||
sed -i -e "s/\${ENV}/$ENV/g" docker-compose.yml
|
sed -i -e "s/\${ENV}/$ENV/g" docker-compose.yml
|
||||||
@@ -134,13 +133,14 @@ jobs:
|
|||||||
zip deploy.zip docker-compose.yml -r .ebextensions
|
zip deploy.zip docker-compose.yml -r .ebextensions
|
||||||
|
|
||||||
- name: Deploy AWS Beanstalk
|
- name: Deploy AWS Beanstalk
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: needs.semantic_release.outputs.new_release_published == 'true'
|
||||||
env:
|
env:
|
||||||
ENV: ${{ steps.extract_environment.outputs.result }}
|
ENV: ${{ steps.extract_environment.outputs.result }}
|
||||||
AWS_REGION: us-east-1
|
AWS_REGION: us-east-1
|
||||||
APP_NAME: maestro
|
APP_NAME: maestro
|
||||||
run: |
|
run: |
|
||||||
eb use $APP_NAME-$ENV
|
eb use $APP_NAME-$ENV
|
||||||
|
echo -e "deploy:\n artifact: deploy.zip" >> .elasticbeanstalk/config.yml
|
||||||
eb deploy
|
eb deploy
|
||||||
|
|
||||||
- name: Remove Docker's Trash
|
- name: Remove Docker's Trash
|
||||||
|
|||||||
Generated
+102
-859
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -29,11 +29,11 @@
|
|||||||
"@nestjs/mapped-types": "*",
|
"@nestjs/mapped-types": "*",
|
||||||
"@nestjs/microservices": "^8.4.3",
|
"@nestjs/microservices": "^8.4.3",
|
||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "^1.5.5",
|
"@victorradael/protospack": "^1.6.5",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"grpc": "^1.24.11",
|
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"jwk-to-pem": "^2.0.5",
|
"jwk-to-pem": "^2.0.5",
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async signIn({ username, password }: ILogin): Promise<any> {
|
async signIn({ username, password, totp }: ILogin): Promise<any> {
|
||||||
console.log('AuthClientService', 'SignIn');
|
console.log('AuthClientService', 'SignIn');
|
||||||
|
|
||||||
const tokens = await new Promise((resolve, reject) => {
|
const tokens = await new Promise((resolve, reject) => {
|
||||||
this.authService.signIn({ username, password }).subscribe({
|
this.authService.signIn({ username, password, totp }).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
export interface ILogin {
|
export interface ILogin {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
totp: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { OnModuleInit, Inject } from '@nestjs/common';
|
import { OnModuleInit, Inject } from '@nestjs/common';
|
||||||
import { ClientGrpc } from '@nestjs/microservices';
|
import { ClientGrpc } from '@nestjs/microservices';
|
||||||
import { InputService } from '@victorradael/protospack';
|
import {
|
||||||
|
InputNewCreateRequest,
|
||||||
|
InputService,
|
||||||
|
TestConnectionGetColumnsRequest,
|
||||||
|
TestConnectionRequest,
|
||||||
|
} from '@victorradael/protospack';
|
||||||
import {
|
import {
|
||||||
objectCamelToSnake,
|
objectCamelToSnake,
|
||||||
objectSnakeToCamel,
|
objectSnakeToCamel,
|
||||||
} from 'src/utils/CaseConverter';
|
} from 'src/utils/CaseConverter';
|
||||||
import {
|
import { IIdRequest, UpdateInputRequest } from './interfaces';
|
||||||
ICreateInputRequest,
|
|
||||||
IIdRequest,
|
|
||||||
ITestConnectionRequest,
|
|
||||||
UpdateInputRequest,
|
|
||||||
} from './interfaces';
|
|
||||||
|
|
||||||
export class InputsClientService implements OnModuleInit {
|
export class InputsClientService implements OnModuleInit {
|
||||||
private inputService: InputService;
|
private inputService: InputService;
|
||||||
@@ -23,22 +23,24 @@ export class InputsClientService implements OnModuleInit {
|
|||||||
this.grpcClient.getService<InputService>('InputService');
|
this.grpcClient.getService<InputService>('InputService');
|
||||||
}
|
}
|
||||||
|
|
||||||
async create(createInputDto: ICreateInputRequest) {
|
async create(createInputDto: InputNewCreateRequest) {
|
||||||
console.log('InputClientService', 'Create');
|
console.log('InputClientService', 'Create');
|
||||||
|
|
||||||
const createInputResponse = await new Promise((resolve, reject) => {
|
const createInputResponse = await new Promise((resolve, reject) => {
|
||||||
this.inputService.Create(objectSnakeToCamel(createInputDto)).subscribe({
|
this.inputService
|
||||||
next(x) {
|
.NewCreate(objectSnakeToCamel(createInputDto))
|
||||||
resolve(objectCamelToSnake(x));
|
.subscribe({
|
||||||
},
|
next(x) {
|
||||||
error(err) {
|
resolve(objectCamelToSnake(x));
|
||||||
console.log('Observable Error');
|
},
|
||||||
reject(err);
|
error(err) {
|
||||||
},
|
console.log('Observable Error');
|
||||||
complete() {
|
reject(err);
|
||||||
console.log('done');
|
},
|
||||||
},
|
complete() {
|
||||||
});
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.then((res) => res)
|
.then((res) => res)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -147,10 +149,10 @@ export class InputsClientService implements OnModuleInit {
|
|||||||
return removeInputResponse;
|
return removeInputResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
async testConnection(data: ITestConnectionRequest) {
|
async testConnection(data: TestConnectionRequest) {
|
||||||
console.log('InputClientService', 'TestConnection');
|
console.log('InputClientService', 'TestConnection');
|
||||||
const testConnectionResponse = await new Promise((resolve, reject) => {
|
const testConnectionResponse = await new Promise((resolve, reject) => {
|
||||||
this.inputService.TestConnection(objectSnakeToCamel(data)).subscribe({
|
this.inputService.NewTestConnection(objectSnakeToCamel(data)).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(objectCamelToSnake(x));
|
resolve(objectCamelToSnake(x));
|
||||||
},
|
},
|
||||||
@@ -170,4 +172,28 @@ export class InputsClientService implements OnModuleInit {
|
|||||||
|
|
||||||
return testConnectionResponse;
|
return testConnectionResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getColumns(data: TestConnectionGetColumnsRequest) {
|
||||||
|
console.log('InputClientService', 'TestConnection/Get-Columns');
|
||||||
|
const getColumnsResponse = await new Promise((resolve, reject) => {
|
||||||
|
this.inputService.GetColumns(objectSnakeToCamel(data)).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 getColumnsResponse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,22 +182,31 @@ export class PipelinesClientService implements OnModuleInit {
|
|||||||
return logsPipelineResponse;
|
return logsPipelineResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPipelineStatus(data: IIdRequest) {
|
async getPipelineStatus(data) {
|
||||||
console.log('PipelinesClientService', 'GetPipelineStatus');
|
console.log('PipelinesClientService', 'GetPipelineStatus');
|
||||||
|
|
||||||
const statusPipelineResponse = await new Promise((resolve, reject) => {
|
const statusPipelineResponse = await new Promise((resolve, reject) => {
|
||||||
this.pipelineService.getPipelineStatus(data).subscribe({
|
this.pipelineService
|
||||||
next(x) {
|
.getPipelineStatus(objectSnakeToCamel(data))
|
||||||
resolve(x);
|
.subscribe({
|
||||||
},
|
next(x) {
|
||||||
error(err) {
|
const statusArray = x.status.sort((a, b) => {
|
||||||
console.log('Observable Error');
|
if (a.id < b.id) {
|
||||||
reject(err);
|
return 1;
|
||||||
},
|
} else {
|
||||||
complete() {
|
return -1;
|
||||||
console.log('done');
|
}
|
||||||
},
|
});
|
||||||
});
|
resolve({ status: statusArray });
|
||||||
|
},
|
||||||
|
error(err) {
|
||||||
|
console.log('Observable Error');
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
complete() {
|
||||||
|
console.log('done');
|
||||||
|
},
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.then((res) => res)
|
.then((res) => res)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -214,6 +223,11 @@ export class PipelinesClientService implements OnModuleInit {
|
|||||||
.triggerPipeline(objectSnakeToCamel({ id, info }))
|
.triggerPipeline(objectSnakeToCamel({ id, info }))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
|
if (x.status == false) {
|
||||||
|
reject(
|
||||||
|
'This pipeline is not ready yet to execute, Try again later!',
|
||||||
|
);
|
||||||
|
}
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
error(err) {
|
error(err) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class TransformationsClientConfiguration {
|
|||||||
return {
|
return {
|
||||||
transport: Transport.GRPC,
|
transport: Transport.GRPC,
|
||||||
options: {
|
options: {
|
||||||
url: process.env.TRFACTORY_URL,
|
url: process.env.INFACTORY_URL,
|
||||||
package: TransformationPackages,
|
package: TransformationPackages,
|
||||||
credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: TransformationProtoFilePath,
|
protoPath: TransformationProtoFilePath,
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ export class LoggerMiddleware implements NestMiddleware {
|
|||||||
const idToken = request.get('Dadosfera-User');
|
const idToken = request.get('Dadosfera-User');
|
||||||
const accessToken = request.get('Authorization');
|
const accessToken = request.get('Authorization');
|
||||||
const privateKey = process.env.JWT_PRIVATE_KEY;
|
const privateKey = process.env.JWT_PRIVATE_KEY;
|
||||||
|
let requiredRoute = '';
|
||||||
const requiredMethod = request.method.trim();
|
const requiredMethod = request.method.trim();
|
||||||
const requiredRoute = request.route.path.split('/')[1].trim();
|
if (request.route.path.split('/').length >= 2) {
|
||||||
|
requiredRoute = request.route.path.split('/')[1].trim();
|
||||||
|
}
|
||||||
|
|
||||||
verify(idToken, privateKey, (err) => {
|
verify(idToken, privateKey, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { AuthClientService } from 'src/clients/auth/client.service';
|
|||||||
interface ISignIn {
|
interface ISignIn {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
totp: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Controller('auth')
|
@Controller('auth')
|
||||||
@@ -12,11 +13,11 @@ export class AuthController {
|
|||||||
constructor(private authClient: AuthClientService) {}
|
constructor(private authClient: AuthClientService) {}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
async signIn(@Body() { username, password }: ISignIn) {
|
async signIn(@Body() { username, password, totp }: ISignIn) {
|
||||||
console.log(`/auth`, 'SignIn');
|
console.log(`/auth`, 'SignIn');
|
||||||
|
|
||||||
const tokens = await this.authClient
|
const tokens = await this.authClient
|
||||||
.signIn({ username, password })
|
.signIn({ username, password, totp })
|
||||||
.then((result) => result)
|
.then((result) => result)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new UnauthorizedException(err.message);
|
throw new UnauthorizedException(err.message);
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
import {
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Delete,
|
||||||
|
Get,
|
||||||
|
Param,
|
||||||
|
Post,
|
||||||
|
Query,
|
||||||
|
} from '@nestjs/common';
|
||||||
import { CatalogService } from './catalog.service';
|
import { CatalogService } from './catalog.service';
|
||||||
|
|
||||||
@Controller('catalog')
|
@Controller('catalog')
|
||||||
@@ -33,7 +41,7 @@ export class CatalogController {
|
|||||||
const { id } = params;
|
const { id } = params;
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.dataAppsOne(body, id);
|
const res = await catalogService.dataAppsOne(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -56,64 +64,67 @@ export class CatalogController {
|
|||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneDashboardMetabase(body, id);
|
const res = await catalogService.getOneDashboardMetabase(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('table-metadata')
|
@Get('table-metadata')
|
||||||
async getAllTableMetadata(@Body() body) {
|
async getAllTableMetadata(@Body() body, @Query() query) {
|
||||||
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
if (!query) {
|
||||||
const res = await catalogService.getAllTableMetadata(body);
|
const res = await catalogService.getAllTableMetadata(body);
|
||||||
|
return res;
|
||||||
return res;
|
} else {
|
||||||
|
const res = await catalogService.getOneTableMetadata(body, query);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-metadata')
|
@Delete('table-metadata/:id')
|
||||||
async deleteOneTableMetadata(@Param() params, @Body() body) {
|
async deleteOneTableMetadata(@Param() params, @Body() body) {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE');
|
console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteOneTableMetadata(body, id);
|
const res = await catalogService.deleteOneTableMetadata(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('column-metadata')
|
@Get('column-metadata')
|
||||||
async getOneColumnMetadata(@Body() body) {
|
async getOneColumnMetadata(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE');
|
console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneColumnMetadata(body);
|
const res = await catalogService.getOneColumnMetadata(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('column-metadata')
|
@Delete('column-metadata/:id')
|
||||||
async deleteOneColumnMetadata(@Param() params, @Body() body) {
|
async deleteOneColumnMetadata(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE');
|
console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteOneColumnMetadata(body, id);
|
const res = await catalogService.deleteOneColumnMetadata(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('data-preview')
|
@Get('data-preview')
|
||||||
async getOneDataPreview(@Body() body) {
|
async getOneDataPreview(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE');
|
console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getOneDataPreview(body);
|
const res = await catalogService.getOneDataPreview(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -129,6 +140,17 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('data-status')
|
||||||
|
async createDataStatus(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON CREATE DATA STATUS ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataStatus(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-description')
|
@Get('data-description')
|
||||||
async getDataDescription(@Body() body) {
|
async getDataDescription(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE');
|
||||||
@@ -140,6 +162,17 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('data-description')
|
||||||
|
async createDataDescription(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON CREATE DATA DESCRIPTION ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataDescription(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-docs')
|
@Get('data-docs')
|
||||||
async getDataDocs(@Body() body) {
|
async getDataDocs(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
console.log(`/catalog`, 'ON GET DATA DOCS ROUTE');
|
||||||
@@ -151,6 +184,17 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('data-docs')
|
||||||
|
async createDataDocs(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON CREATE DATA DOCS ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataDocs(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-rating')
|
@Get('data-rating')
|
||||||
async getDataRating(@Body() body) {
|
async getDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
@@ -162,18 +206,32 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('summary-rating/:id')
|
@Post('data-rating')
|
||||||
async getSummaryRating(@Param() params, @Body() body) {
|
async createDataRating(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
const { id } = params;
|
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getSummaryRating(id, body);
|
const res = await catalogService.createDataRating(body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('summary-rating/:id')
|
||||||
|
async getSummaryRating() {
|
||||||
|
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
||||||
|
//const { id } = params;
|
||||||
|
|
||||||
|
//const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
//const res = await catalogService.getSummaryRating(id, body);
|
||||||
|
|
||||||
|
return {
|
||||||
|
avg_rating: 0,
|
||||||
|
rating_count: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-comment')
|
@Get('data-comment')
|
||||||
async getDataComment(@Body() body) {
|
async getDataComment(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
@@ -185,13 +243,24 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('data-comment')
|
||||||
|
async createDataComment(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataComment(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-review')
|
@Get('data-review')
|
||||||
async getDataReview(@Body() body) {
|
async getDataReview(@Body() body, @Query() params) {
|
||||||
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.getDataReview(body);
|
const res = await catalogService.getDataReview(body, params);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -225,7 +294,7 @@ export class CatalogController {
|
|||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTags(body, id);
|
const res = await catalogService.deleteTags(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -252,14 +321,14 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-tags')
|
@Delete('table-tags/:id')
|
||||||
async deleteTableTags(@Param() params, @Body() body) {
|
async deleteTableTags(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE');
|
console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTableTags(body, id);
|
const res = await catalogService.deleteTableTags(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -275,14 +344,14 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-rules')
|
@Delete('table-rules/:id')
|
||||||
async deleteTableRules(@Param() params, @Body() body) {
|
async deleteTableRules(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE');
|
console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE');
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
const res = await catalogService.deleteTableRules(body, id);
|
const res = await catalogService.deleteTableRules(id, body);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ class CatalogService {
|
|||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
const { data } = await axios.get(
|
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
const nimbusUrl =
|
||||||
);
|
process.env.ENV === 'prd'
|
||||||
console.log(
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/all/`,
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
);
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,9 +23,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/`,
|
process.env.ENV === 'prd'
|
||||||
);
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data_apps/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,9 +38,15 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data_apps/${id}/`,
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(
|
||||||
|
`${nimbusUrl}/api/catalog/data_apps/${id}/`,
|
||||||
);
|
);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,21 +56,37 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/`,
|
`${nimbusUrl}/api/catalog/dashboard-metabase/`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneDashboardMetabase(body, id) {
|
async getOneDashboardMetabase(id, body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/dashboard-metabase/${id}`,
|
`${nimbusUrl}/api/catalog/dashboard-metabase/${id}`,
|
||||||
);
|
);
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
// const [, path] = data.iframe_url.split('.dadosfera');
|
||||||
|
// const host = `httpss://metabase-${body.info.customer.toLowerCase()}.dadosfera.ai`;
|
||||||
|
// data.iframe_url = host + path;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +96,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-metadata/`,
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async getOneTableMetadata(body, params) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(
|
||||||
|
`${nimbusUrl}/api/catalog/table-metadata/`,
|
||||||
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -81,20 +131,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const { data } = await axios.delete(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-metadata/${id}`,
|
`${nimbusUrl}/api/catalog/table-metadata/${id}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneColumnMetadata(body) {
|
async getOneColumnMetadata(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/`,
|
`${nimbusUrl}/api/catalog/column-metadata/`,
|
||||||
|
{ params: params },
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -105,21 +166,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const { data } = await axios.delete(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/column-metadata/${id}/`,
|
`${nimbusUrl}/api/catalog/column-metadata/${id}/`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOneDataPreview(body) {
|
async getOneDataPreview(body, params) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-preview/`,
|
process.env.ENV === 'prd'
|
||||||
);
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-preview/`, {
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,8 +200,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-status/`,
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-status/`);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async createDataStatus(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${nimbusUrl}/api/catalog/data-status/`,
|
||||||
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -141,8 +233,31 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-description/`,
|
`${nimbusUrl}/api/catalog/data-description/`,
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async createDataDescription(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${nimbusUrl}/api/catalog/data-description/`,
|
||||||
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -153,8 +268,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-docs/`,
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-docs/`);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async createDataDocs(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${nimbusUrl}/api/catalog/data-docs/`,
|
||||||
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -165,8 +301,29 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-rating/`,
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-rating/`);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async createDataRating(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${nimbusUrl}/api/catalog/data-rating/`,
|
||||||
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -176,8 +333,14 @@ class CatalogService {
|
|||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/summary-rating/${id}`,
|
`${nimbusUrl}/api/catalog/summary-rating/${id}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -188,34 +351,62 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-comment/`,
|
process.env.ENV === 'prd'
|
||||||
);
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-comment/`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDataReview(body) {
|
async createDataComment(body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-review/`,
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${nimbusUrl}/api/catalog/data-comment/`,
|
||||||
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getDataReview(body, params) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/data-review/`, {
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
async createTags(body) {
|
async createTags(body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.post(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
process.env.ENV === 'prd'
|
||||||
body,
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
);
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,10 +416,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/`,
|
process.env.ENV === 'prd'
|
||||||
body,
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
);
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(`${nimbusUrl}/api/catalog/tags/`, body);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,8 +431,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/`,
|
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -251,9 +449,12 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const nimbusUrl =
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/tags/${id}`,
|
process.env.ENV === 'prd'
|
||||||
);
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
|
const { data } = await axios.delete(`${nimbusUrl}/api/catalog/tags/${id}`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,8 +464,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.post(
|
const { data } = await axios.post(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/`,
|
`${nimbusUrl}/api/catalog/table-tags/`,
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -276,8 +482,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const { data } = await axios.delete(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-tags/${id}`,
|
`${nimbusUrl}/api/catalog/table-tags/${id}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -288,8 +499,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-rules/`,
|
`${nimbusUrl}/api/catalog/table-rules/`,
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
@@ -301,8 +517,13 @@ class CatalogService {
|
|||||||
? ``
|
? ``
|
||||||
: `-${body.info.customer.toLowerCase()}`;
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const nimbusUrl =
|
||||||
|
process.env.ENV === 'prd'
|
||||||
|
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
|
||||||
|
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
|
||||||
|
|
||||||
const { data } = await axios.delete(
|
const { data } = await axios.delete(
|
||||||
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-rules/${id}`,
|
`${nimbusUrl}/api/catalog/table-rules/${id}`,
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { InputsService } from './inputs.service';
|
import { InputsService } from './inputs.service';
|
||||||
import { InputsClientService } from 'src/clients/inputs/client.service';
|
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||||
import {
|
import { UpdateInputRequest } from 'src/clients/inputs/interfaces';
|
||||||
ICreateInputRequest,
|
import { InputNewCreateRequest } from '@victorradael/protospack';
|
||||||
UpdateInputRequest,
|
|
||||||
} from 'src/clients/inputs/interfaces';
|
|
||||||
|
|
||||||
@Controller('inputs')
|
@Controller('inputs')
|
||||||
export class InputsController {
|
export class InputsController {
|
||||||
@@ -28,8 +26,21 @@ export class InputsController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('/test-connection/get-columns')
|
||||||
|
async getColumns(@Body() data) {
|
||||||
|
console.log(
|
||||||
|
`/test-connection/get-columns`,
|
||||||
|
'ON TEST CONNECTION GET COLUMNS ROUTE',
|
||||||
|
);
|
||||||
|
|
||||||
|
const inputService = new InputsService(this.inputsClientService);
|
||||||
|
const response = await inputService.getColumns(data);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
async create(@Body() createInputDto: ICreateInputRequest) {
|
async create(@Body() createInputDto: InputNewCreateRequest) {
|
||||||
console.log(`/input`, 'ON CREATE ROUTE');
|
console.log(`/input`, 'ON CREATE ROUTE');
|
||||||
|
|
||||||
const inputService = new InputsService(this.inputsClientService);
|
const inputService = new InputsService(this.inputsClientService);
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
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 { InputsClientService } from 'src/clients/inputs/client.service';
|
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||||
import {
|
import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
||||||
ICreateInputRequest,
|
|
||||||
IIdRequest,
|
|
||||||
Info,
|
|
||||||
} from 'src/clients/inputs/interfaces';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class InputsService {
|
export class InputsService {
|
||||||
constructor(private inputClient: InputsClientService) {}
|
constructor(private inputClient: InputsClientService) {}
|
||||||
|
|
||||||
async create(@Body() data: ICreateInputRequest) {
|
async create(@Body() data: InputNewCreateRequest) {
|
||||||
try {
|
try {
|
||||||
const createInputResponse = await this.inputClient.create(data);
|
const createInputResponse = await this.inputClient.create(data);
|
||||||
|
|
||||||
@@ -63,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(
|
||||||
@@ -74,4 +73,15 @@ export class InputsService {
|
|||||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getColumns(data) {
|
||||||
|
try {
|
||||||
|
const testConnectionGetColumnsResponse =
|
||||||
|
await this.inputClient.getColumns(data);
|
||||||
|
|
||||||
|
return testConnectionGetColumnsResponse;
|
||||||
|
} catch (err) {
|
||||||
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import { PipelinesService } from './pipelines.service';
|
|||||||
export class PipelinesController {
|
export class PipelinesController {
|
||||||
constructor(private pipelinesClientService: PipelinesClientService) {}
|
constructor(private pipelinesClientService: PipelinesClientService) {}
|
||||||
|
|
||||||
@Get('start/:id')
|
@Post('start/:id')
|
||||||
async activate(@Param() params, @Body() body) {
|
async activate(@Param() params, @Body() body) {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
const { info } = body;
|
const { info } = body;
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
process.env.DEV_URL + `/transformation/start/${id}`,
|
process.env.DEV_URL + `/pipeline/start/${id}`,
|
||||||
'ON START PIPELINE ROUTE',
|
'ON START PIPELINE ROUTE',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user