mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-23 21:09:08 +00:00
REFACTOR: Att Functions + Alpha Clients connection
This commit is contained in:
@@ -109,3 +109,9 @@ jobs:
|
|||||||
eb use $APP_NAME-$ENV
|
eb use $APP_NAME-$ENV
|
||||||
echo -e "deploy:\n artifact: deploy.zip" >> .elasticbeanstalk/config.yml
|
echo -e "deploy:\n artifact: deploy.zip" >> .elasticbeanstalk/config.yml
|
||||||
eb deploy
|
eb deploy
|
||||||
|
|
||||||
|
- name: Remove Docker's Trash
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
docker system prune
|
||||||
|
docker rmi -f $(docker images -aq)
|
||||||
Generated
+10503
-1579
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -30,7 +30,7 @@
|
|||||||
"@nestjs/microservices": "^8.4.0",
|
"@nestjs/microservices": "^8.4.0",
|
||||||
"@nestjs/platform-express": "^8.4.0",
|
"@nestjs/platform-express": "^8.4.0",
|
||||||
"@nestjs/swagger": "^5.1.5",
|
"@nestjs/swagger": "^5.1.5",
|
||||||
"@victorradael/protospack": "^1.2.8",
|
"@victorradael/protospack": "^1.3.1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"grpc": "^1.24.11",
|
"grpc": "^1.24.11",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export class InputsClientConfiguration {
|
|||||||
options: {
|
options: {
|
||||||
url: process.env.INFACTORY_URL,
|
url: process.env.INFACTORY_URL,
|
||||||
package: 'input',
|
package: 'input',
|
||||||
// credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: InputProtofile,
|
protoPath: InputProtofile,
|
||||||
loader: {
|
loader: {
|
||||||
enums: String,
|
enums: String,
|
||||||
|
|||||||
@@ -105,11 +105,9 @@ export class InputsClientService implements OnModuleInit {
|
|||||||
|
|
||||||
async update(updateInputDTO:UpdateInputRequest) {
|
async update(updateInputDTO:UpdateInputRequest) {
|
||||||
console.log('InputClientService', 'Update');
|
console.log('InputClientService', 'Update');
|
||||||
console.log(updateInputDTO)
|
|
||||||
const updateInputResponse = await new Promise((resolve, reject) => {
|
const updateInputResponse = await new Promise((resolve, reject) => {
|
||||||
this.inputService.Update(updateInputDTO).subscribe({
|
this.inputService.Update(updateInputDTO).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
console.log(x)
|
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
error(err) {
|
error(err) {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -30,7 +30,7 @@ interface Cron {
|
|||||||
|
|
||||||
export interface ICreateInputRequest {
|
export interface ICreateInputRequest {
|
||||||
|
|
||||||
cron: Cron;
|
cron: string;
|
||||||
name: string;
|
name: string;
|
||||||
plugin: string;
|
plugin: string;
|
||||||
values: Values;
|
values: Values;
|
||||||
@@ -43,7 +43,7 @@ export interface IIdRequest{
|
|||||||
|
|
||||||
interface UpdateInputRequest {
|
interface UpdateInputRequest {
|
||||||
id: string;
|
id: string;
|
||||||
cron: Cron;
|
cron: string;
|
||||||
name: string;
|
name: string;
|
||||||
plugin: string;
|
plugin: string;
|
||||||
values: Values;
|
values: Values;
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ export class OutputsClientConfiguration {
|
|||||||
return {
|
return {
|
||||||
transport: Transport.GRPC,
|
transport: Transport.GRPC,
|
||||||
options: {
|
options: {
|
||||||
url: process.env.OUTFACTORY_URL,
|
url: process.env.OTFACTORY_URL,
|
||||||
package: 'output',
|
package: 'output',
|
||||||
// credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: OutputProtofile,
|
protoPath: OutputProtofile,
|
||||||
loader: {
|
loader: {
|
||||||
enums: String,
|
enums: String,
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
Controller,
|
Controller,
|
||||||
Delete,
|
|
||||||
Get,
|
|
||||||
Inject,
|
Inject,
|
||||||
OnModuleInit,
|
OnModuleInit
|
||||||
Param,
|
|
||||||
Post,
|
|
||||||
Put,
|
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
ClientGrpc,
|
ClientGrpc,
|
||||||
@@ -33,7 +28,7 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
console.log('OutputClientService', 'Create');
|
console.log('OutputClientService', 'Create');
|
||||||
|
|
||||||
const createOutputResponse = await new Promise((resolve, reject) => {
|
const createOutputResponse = await new Promise((resolve, reject) => {
|
||||||
this.outputService.create(createOutputDto).subscribe({
|
this.outputService.Create(createOutputDto).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
@@ -51,9 +46,8 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
const convertedItem = objectCamelToSnake(createOutputResponse["item"])
|
const convertedItem = objectCamelToSnake(createOutputResponse["output"])
|
||||||
createOutputResponse["item"] = convertedItem
|
createOutputResponse["output"] = convertedItem
|
||||||
|
|
||||||
return createOutputResponse;
|
return createOutputResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +55,7 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
console.log('OutputClientService', 'FindAll');
|
console.log('OutputClientService', 'FindAll');
|
||||||
|
|
||||||
const findAllOutputResponse = await new Promise((resolve, reject) => {
|
const findAllOutputResponse = await new Promise((resolve, reject) => {
|
||||||
this.outputService.findAll({}).subscribe({
|
this.outputService.FindAll({}).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
@@ -90,7 +84,7 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
console.log('OutputClientService', 'FindOne');
|
console.log('OutputClientService', 'FindOne');
|
||||||
|
|
||||||
const findOneOutputResponse = await new Promise((resolve, reject) => {
|
const findOneOutputResponse = await new Promise((resolve, reject) => {
|
||||||
this.outputService.findOne({id}).subscribe({
|
this.outputService.FindOne({id}).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
@@ -117,7 +111,7 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
console.log('OutputClientService', 'Update');
|
console.log('OutputClientService', 'Update');
|
||||||
|
|
||||||
const updateOutputResponse = await new Promise((resolve, reject) => {
|
const updateOutputResponse = await new Promise((resolve, reject) => {
|
||||||
this.outputService.update(updateOutPutDTO).subscribe({
|
this.outputService.Update(updateOutPutDTO).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
@@ -142,7 +136,7 @@ export class OutputsClientService implements OnModuleInit {
|
|||||||
console.log('OutputClientService', 'Remove');
|
console.log('OutputClientService', 'Remove');
|
||||||
|
|
||||||
const removeOutputResponse = await new Promise((resolve, reject) => {
|
const removeOutputResponse = await new Promise((resolve, reject) => {
|
||||||
this.outputService.remove({id}).subscribe({
|
this.outputService.Remove({id}).subscribe({
|
||||||
next(x) {
|
next(x) {
|
||||||
resolve(x);
|
resolve(x);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class PipelinesClientConfiguration {
|
|||||||
options: {
|
options: {
|
||||||
url: process.env.PIFACTORY_URL,
|
url: process.env.PIFACTORY_URL,
|
||||||
package: 'pipeline',
|
package: 'pipeline',
|
||||||
// credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: PipelineProtofile,
|
protoPath: PipelineProtofile,
|
||||||
loader: {
|
loader: {
|
||||||
enums: String,
|
enums: String,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class TransformationsClientConfiguration {
|
|||||||
options: {
|
options: {
|
||||||
url: process.env.TRFACTORY_URL,
|
url: process.env.TRFACTORY_URL,
|
||||||
package: 'transformation',
|
package: 'transformation',
|
||||||
// credentials: credentials.createSsl(),
|
credentials: credentials.createSsl(),
|
||||||
protoPath: TransformationProtofile,
|
protoPath: TransformationProtofile,
|
||||||
loader: {
|
loader: {
|
||||||
enums: String,
|
enums: String,
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ApiTags } from '@nestjs/swagger';
|
import { ApiTags } from '@nestjs/swagger';
|
||||||
import { TransformationsServiceInterface } from '@victorradael/protospack';
|
import { TransformationsServiceInterface } from '@victorradael/protospack';
|
||||||
import { ICreateTransformationElement, ICreateTransformationsRequest, IdRequest, IUpdateTransformationRequest } from './interfaces';
|
import { objectCamelToSnake } from 'src/utils/CaseConverter';
|
||||||
|
import { Transformation, ICreateTransformationsRequest, IdRequest, IUpdateTransformationRequest } from './interfaces';
|
||||||
|
|
||||||
@Controller('transformation')
|
@Controller('transformation')
|
||||||
export class TransformationsClientService implements OnModuleInit {
|
export class TransformationsClientService implements OnModuleInit {
|
||||||
@@ -54,7 +55,12 @@ export class TransformationsClientService implements OnModuleInit {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
return createTransformationResponse;
|
|
||||||
|
const convertedTransforms = createTransformationResponse["transformations"].map((tr)=>{
|
||||||
|
return objectCamelToSnake(tr)
|
||||||
|
})
|
||||||
|
|
||||||
|
return {transformations:convertedTransforms};
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAll() {
|
async findAll() {
|
||||||
@@ -78,8 +84,10 @@ export class TransformationsClientService implements OnModuleInit {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
|
const convertedTransforms = findAllTransformationResponse["transformations"].map((tr)=>{
|
||||||
return findAllTransformationResponse;
|
return objectCamelToSnake(tr)
|
||||||
|
})
|
||||||
|
return {transformations:convertedTransforms};
|
||||||
}
|
}
|
||||||
|
|
||||||
async findOne({id}: IdRequest) {
|
async findOne({id}: IdRequest) {
|
||||||
@@ -104,7 +112,7 @@ export class TransformationsClientService implements OnModuleInit {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
return findOneTransformationResponse;
|
return objectCamelToSnake(findOneTransformationResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(updateTransformationDTO: IUpdateTransformationRequest) {
|
async update(updateTransformationDTO: IUpdateTransformationRequest) {
|
||||||
@@ -129,7 +137,7 @@ export class TransformationsClientService implements OnModuleInit {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
return updateTransformationResponse;
|
return objectCamelToSnake(updateTransformationResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove({id}: IdRequest) {
|
async remove({id}: IdRequest) {
|
||||||
@@ -154,6 +162,6 @@ export class TransformationsClientService implements OnModuleInit {
|
|||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
return removeTransformationResponse;
|
return objectCamelToSnake(removeTransformationResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-15
@@ -1,15 +1,18 @@
|
|||||||
export interface ICreateTransformationsRequest {
|
export interface ICreateTransformationsRequest {
|
||||||
transformations: ICreateTransformationElement[];
|
transformations: Transformation[];
|
||||||
}
|
}
|
||||||
interface Param {
|
interface Param {
|
||||||
base_column?: string;
|
base_column: string;
|
||||||
column_name?: string;
|
column_name: string;
|
||||||
n_digits?: number;
|
n_digits: number;
|
||||||
start_index?: number;
|
start_index: number;
|
||||||
randbelow?: number;
|
randbelow: number;
|
||||||
const?: string;
|
const: string;
|
||||||
}
|
}
|
||||||
export interface ICreateTransformationElement {
|
interface Transformation {
|
||||||
|
created_at: string;
|
||||||
|
id: string;
|
||||||
|
client_id: string;
|
||||||
type: string;
|
type: string;
|
||||||
params: Param[];
|
params: Param[];
|
||||||
input_source: string;
|
input_source: string;
|
||||||
@@ -21,11 +24,5 @@ export interface IdRequest{
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IUpdateTransformationRequest {
|
export interface IUpdateTransformationRequest {
|
||||||
created_at?: string;
|
transformation: Transformation;
|
||||||
id?: string;
|
|
||||||
client_id?: string;
|
|
||||||
params: Param[];
|
|
||||||
type?: string;
|
|
||||||
input_source?: string;
|
|
||||||
table?: string;
|
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ export class HealthController {
|
|||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
check() {
|
check() {
|
||||||
|
console.log(`/health`, 'check');
|
||||||
return this.healthService.check();
|
return this.healthService.check();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ export class TransformationsService {
|
|||||||
async update(id:string, data){
|
async update(id:string, data){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
data.transformation["id"] = id
|
||||||
const updateTransformationResponse = await this.transformationClient.update({id,...data});
|
const updateTransformationResponse = await this.transformationClient.update({...data});
|
||||||
|
|
||||||
return updateTransformationResponse
|
return updateTransformationResponse
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user