mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-09 20:19:07 +00:00
Merge branch 'on-tests' into ci/cd
This commit is contained in:
Generated
+7258
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { EnrichmentController } from './enrichment.controller';
|
||||
import { EnrichmentGrpcClientService } from './enrichment.service';
|
||||
import { EnrichmentsService } from './enrichment.service';
|
||||
|
||||
describe('EnrichmentController', () => {
|
||||
let controller: EnrichmentController;
|
||||
@@ -8,7 +8,7 @@ describe('EnrichmentController', () => {
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [EnrichmentController],
|
||||
providers: [EnrichmentGrpcClientService],
|
||||
providers: [EnrichmentsService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<EnrichmentController>(EnrichmentController);
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import { Controller, Delete, Get, OnModuleInit, Param, Post, Put } from '@nestjs/common';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
OnModuleInit,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { Client, ClientGrpc, Payload } from '@nestjs/microservices';
|
||||
import { EnrichmentGrpcClientService } from './enrichment.service';
|
||||
import { EnrichmentsService } from './enrichment.service';
|
||||
import { CreateEnrichmentDto } from './dto/create-enrichment.dto';
|
||||
import { UpdateEnrichmentDto } from './dto/update-enrichment.dto';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
@@ -10,16 +18,16 @@ import { GrpcClientConfiguration } from './config/grpc-client';
|
||||
@Controller('enrichment')
|
||||
export class EnrichmentController implements OnModuleInit {
|
||||
|
||||
|
||||
|
||||
@Client(GrpcClientConfiguration)
|
||||
private enrichmentServiceClient: ClientGrpc;
|
||||
|
||||
private enrichmentService: EnrichmentGrpcClientService;
|
||||
private enrichmentService: EnrichmentsService;
|
||||
|
||||
onModuleInit() {
|
||||
this.enrichmentService =
|
||||
this.enrichmentServiceClient.getService<EnrichmentGrpcClientService>('EnrichmentService');
|
||||
this.enrichmentServiceClient.getService<EnrichmentsService>(
|
||||
'EnrichmentService',
|
||||
);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@@ -38,7 +46,10 @@ export class EnrichmentController implements OnModuleInit {
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
update(@Param() id:string,@Payload() updateEnrichmentDto: UpdateEnrichmentDto) {
|
||||
update(
|
||||
@Param() id: string,
|
||||
@Payload() updateEnrichmentDto: UpdateEnrichmentDto,
|
||||
) {
|
||||
return this.enrichmentService.update(id, updateEnrichmentDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { EnrichmentGrpcClientService } from './enrichment.service';
|
||||
import { EnrichmentsService } from './enrichment.service';
|
||||
import { EnrichmentController } from './enrichment.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [EnrichmentController],
|
||||
providers: [EnrichmentGrpcClientService]
|
||||
providers: [EnrichmentsService],
|
||||
})
|
||||
export class EnrichmentModule {}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { EnrichmentService } from './enrichment.service';
|
||||
import { EnrichmentsService } from './enrichment.service';
|
||||
|
||||
describe('EnrichmentService', () => {
|
||||
let service: EnrichmentService;
|
||||
let service: EnrichmentsService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [EnrichmentService],
|
||||
providers: [EnrichmentsService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<EnrichmentService>(EnrichmentService);
|
||||
service = module.get<EnrichmentsService>(EnrichmentsService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CreateEnrichmentDto } from './dto/create-enrichment.dto';
|
||||
import { UpdateEnrichmentDto } from './dto/update-enrichment.dto';
|
||||
|
||||
@Injectable()
|
||||
export class EnrichmentGrpcClientService {
|
||||
export class EnrichmentsService {
|
||||
create(createEnrichmentDto: CreateEnrichmentDto) {
|
||||
return 'This action adds a new enrichment';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { OutputsController } from './outputs.controller';
|
||||
import { OutputGrpcClientService } from './outputs.service';
|
||||
import { OutputsService } from './outputs.service';
|
||||
|
||||
describe('OutputsController', () => {
|
||||
let controller: OutputsController;
|
||||
@@ -8,7 +8,7 @@ describe('OutputsController', () => {
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [OutputsController],
|
||||
providers: [OutputGrpcClientService],
|
||||
providers: [OutputsService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<OutputsController>(OutputsController);
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
import { Controller, Delete, Get, OnModuleInit, Param, Post, Put } from '@nestjs/common';
|
||||
import { Client, ClientGrpc, MessagePattern, Payload } from '@nestjs/microservices';
|
||||
import { OutputGrpcClientService } from './outputs.service';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
OnModuleInit,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
Client,
|
||||
ClientGrpc,
|
||||
MessagePattern,
|
||||
Payload,
|
||||
} from '@nestjs/microservices';
|
||||
import { OutputsService } from './outputs.service';
|
||||
import { CreateOutputDto } from './dto/create-output.dto';
|
||||
import { UpdateOutputDto } from './dto/update-output.dto';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { GrpcClientConfiguration } from './config/grpc-client';
|
||||
|
||||
@Controller('output')
|
||||
export class OutputsController implements OnModuleInit{
|
||||
|
||||
export class OutputsController implements OnModuleInit {
|
||||
@Client(GrpcClientConfiguration)
|
||||
private outputServiceClient: ClientGrpc;
|
||||
|
||||
private outputService: OutputGrpcClientService;
|
||||
private outputService: OutputsService;
|
||||
|
||||
onModuleInit() {
|
||||
this.outputService =
|
||||
this.outputServiceClient.getService<OutputGrpcClientService>('OutputService');
|
||||
this.outputServiceClient.getService<OutputsService>('OutputService');
|
||||
}
|
||||
@Post()
|
||||
create(@Payload() createOutputDto: CreateOutputDto) {
|
||||
@@ -34,7 +46,7 @@ export class OutputsController implements OnModuleInit{
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
update(@Param() id:string,@Payload() updateOutputDto: UpdateOutputDto) {
|
||||
update(@Param() id: string, @Payload() updateOutputDto: UpdateOutputDto) {
|
||||
return this.outputService.update(id, updateOutputDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { OutputGrpcClientService } from './outputs.service';
|
||||
import { OutputsService } from './outputs.service';
|
||||
import { OutputsController } from './outputs.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [OutputsController],
|
||||
providers: [OutputGrpcClientService]
|
||||
providers: [OutputsService],
|
||||
})
|
||||
export class OutputsModule {}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CreateOutputDto } from './dto/create-output.dto';
|
||||
import { UpdateOutputDto } from './dto/update-output.dto';
|
||||
|
||||
@Injectable()
|
||||
export class OutputGrpcClientService {
|
||||
export class OutputsService {
|
||||
create(createOutputDto: CreateOutputDto) {
|
||||
return 'This action adds a new output';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { PipelinesController } from './pipelines.controller';
|
||||
import { PipelineGrpcClientService } from './pipelines.service';
|
||||
import { PipelinesService } from './pipelines.service';
|
||||
|
||||
describe('PipelinesController', () => {
|
||||
let controller: PipelinesController;
|
||||
@@ -8,7 +8,7 @@ describe('PipelinesController', () => {
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [PipelinesController],
|
||||
providers: [PipelineGrpcClientService],
|
||||
providers: [PipelinesService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<PipelinesController>(PipelinesController);
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
import { Controller, Delete, Get, OnModuleInit, Param, Post, Put } from '@nestjs/common';
|
||||
import { Client, ClientGrpc, MessagePattern, Payload } from '@nestjs/microservices';
|
||||
import { PipelineGrpcClientService } from './pipelines.service';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
OnModuleInit,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
Client,
|
||||
ClientGrpc,
|
||||
MessagePattern,
|
||||
Payload,
|
||||
} from '@nestjs/microservices';
|
||||
import { PipelinesService } from './pipelines.service';
|
||||
import { CreatePipelineDto } from './dto/create-pipeline.dto';
|
||||
import { UpdatePipelineDto } from './dto/update-pipeline.dto';
|
||||
import { GrpcClientConfiguration } from './config/grpc-client';
|
||||
|
||||
@Controller('pipeline')
|
||||
export class PipelinesController implements OnModuleInit{
|
||||
|
||||
export class PipelinesController implements OnModuleInit {
|
||||
|
||||
@Client(GrpcClientConfiguration)
|
||||
private pipelineServiceClient: ClientGrpc;
|
||||
|
||||
private pipelineService: PipelineGrpcClientService;
|
||||
private pipelineService: PipelinesService;
|
||||
|
||||
onModuleInit() {
|
||||
this.pipelineService =
|
||||
this.pipelineServiceClient.getService<PipelineGrpcClientService>('PipelineService');
|
||||
this.pipelineServiceClient.getService<PipelinesService>(
|
||||
'PipelineService',
|
||||
);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@@ -34,21 +50,21 @@ export class PipelinesController implements OnModuleInit{
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
update(@Param() id:string,@Payload() updatePipelineDto: UpdatePipelineDto) {
|
||||
update(@Param() id: string, @Payload() updatePipelineDto: UpdatePipelineDto) {
|
||||
return this.pipelineService.update(id, updatePipelineDto);
|
||||
}
|
||||
|
||||
@Delete()
|
||||
remove(@Param() id:string) {
|
||||
remove(@Param() id: string) {
|
||||
return this.pipelineService.remove(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
getPipelineLogsMessages(@Param() id:string,@Payload() details:string){
|
||||
return this.pipelineService.getPipelineLogsMessages(id,details);
|
||||
getPipelineLogsMessages(@Param() id: string, @Payload() details: string) {
|
||||
return this.pipelineService.getPipelineLogsMessages(id, details);
|
||||
}
|
||||
|
||||
getPipelineStatus(id:string){
|
||||
return this.pipelineService.getPipelineStatus(id)
|
||||
getPipelineStatus(id: string) {
|
||||
return this.pipelineService.getPipelineStatus(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PipelineGrpcClientService } from './pipelines.service';
|
||||
import { PipelinesService } from './pipelines.service';
|
||||
import { PipelinesController } from './pipelines.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [PipelinesController],
|
||||
providers: [PipelineGrpcClientService]
|
||||
providers: [PipelinesService],
|
||||
})
|
||||
export class PipelinesModule {}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CreatePipelineDto } from './dto/create-pipeline.dto';
|
||||
import { UpdatePipelineDto } from './dto/update-pipeline.dto';
|
||||
|
||||
@Injectable()
|
||||
export class PipelineGrpcClientService {
|
||||
export class PipelinesService {
|
||||
create(createPipelineDto: CreatePipelineDto) {
|
||||
return 'This action adds a new pipeline';
|
||||
}
|
||||
@@ -24,11 +24,11 @@ export class PipelineGrpcClientService {
|
||||
return `This action removes a #${id} pipeline`;
|
||||
}
|
||||
|
||||
getPipelineLogsMessages(id:string,details:string){
|
||||
getPipelineLogsMessages(id: string, details: string) {
|
||||
return `This action perfoms a getLogMessages on #${id} pipeline`;
|
||||
}
|
||||
|
||||
getPipelineStatus(id:string){
|
||||
getPipelineStatus(id: string) {
|
||||
return `This action performs a getStatus on #${id} pipeline`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { TransformationsController } from './transformations.controller';
|
||||
import { TransformationGrpcClientService } from './transformations.service';
|
||||
import { TransformationsService } from './transformations.service';
|
||||
|
||||
describe('TransformationsController', () => {
|
||||
let controller: TransformationsController;
|
||||
@@ -8,10 +8,12 @@ describe('TransformationsController', () => {
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [TransformationsController],
|
||||
providers: [TransformationGrpcClientService],
|
||||
providers: [TransformationsService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<TransformationsController>(TransformationsController);
|
||||
controller = module.get<TransformationsController>(
|
||||
TransformationsController,
|
||||
);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
import { Controller, Delete, Get, OnModuleInit, Param, Post, Put } from '@nestjs/common';
|
||||
import { Client, ClientGrpc, MessagePattern, Payload } from '@nestjs/microservices';
|
||||
import { TransformationGrpcClientService } from './transformations.service';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
OnModuleInit,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
Client,
|
||||
ClientGrpc,
|
||||
MessagePattern,
|
||||
Payload,
|
||||
} from '@nestjs/microservices';
|
||||
import { TransformationsService } from './transformations.service';
|
||||
import { CreateTransformationDto } from './dto/create-transformation.dto';
|
||||
import { UpdateTransformationDto } from './dto/update-transformation.dto';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
@@ -12,17 +25,22 @@ export class TransformationsController implements OnModuleInit {
|
||||
@Client(GrpcClientConfiguration)
|
||||
private transformationServiceClient: ClientGrpc;
|
||||
|
||||
private transformationService: TransformationGrpcClientService;
|
||||
private transformationService: TransformationsService;
|
||||
|
||||
onModuleInit() {
|
||||
this.transformationService =
|
||||
this.transformationServiceClient.getService<TransformationGrpcClientService>('TransformationService');
|
||||
this.transformationServiceClient.getService<TransformationsService>(
|
||||
'TransformationService',
|
||||
);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Payload() createTransformationDto: CreateTransformationDto[]) {
|
||||
|
||||
return createTransformationDto.map( transf => this.transformationService.create(transf))
|
||||
return createTransformationDto.map((transf) =>
|
||||
this.transformationService.create(transf),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Get()
|
||||
@@ -36,7 +54,10 @@ export class TransformationsController implements OnModuleInit {
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
update(@Param() id:string,@Payload() updateTransformationDto: UpdateTransformationDto) {
|
||||
update(
|
||||
@Param() id: string,
|
||||
@Payload() updateTransformationDto: UpdateTransformationDto,
|
||||
) {
|
||||
return this.transformationService.update(id, updateTransformationDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CreateTransformationDto } from './dto/create-transformation.dto';
|
||||
import { UpdateTransformationDto } from './dto/update-transformation.dto';
|
||||
|
||||
@Injectable()
|
||||
export class TransformationGrpcClientService {
|
||||
export class TransformationsService {
|
||||
create(createTransformationDto: CreateTransformationDto) {
|
||||
return 'This action adds a new transformation';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user