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