FIX: Old Pipeline KeepCase

This commit is contained in:
Victor Radael
2022-09-02 20:15:15 -03:00
parent 85f79f14cd
commit 0deee0ef9c
9 changed files with 37 additions and 26 deletions
+4 -4
View File
@@ -16,10 +16,10 @@ export class ConnectionClientConfiguration {
ConnectionManager.ProtoPackages.WritePackage,
ConnectionManager.ProtoPackages.ReadPackage,
],
credentials:
process.env.LOCAL_ENV || process.env.ENV === 'local'
? undefined
: credentials.createSsl(),
// credentials:
// process.env.LOCAL_ENV || process.env.ENV === 'local'
// ? undefined
// : credentials.createSsl(),
protoPath: [
ConnectionManager.ProtoPaths.WriteFilePath,
ConnectionManager.ProtoPaths.ReadFilePath,
+4 -4
View File
@@ -16,10 +16,10 @@ export class ConnectorClientConfiguration {
ConnectorManager.ProtoPackages.WritePackage,
ConnectorManager.ProtoPackages.ReadPackage,
],
credentials:
process.env.LOCAL_ENV || process.env.ENV === 'local'
? undefined
: credentials.createSsl(),
// credentials:
// process.env.LOCAL_ENV || process.env.ENV === 'local'
// ? undefined
// : credentials.createSsl(),
protoPath: [
ConnectorManager.ProtoPaths.WriteFilePath,
ConnectorManager.ProtoPaths.ReadFilePath,
@@ -17,8 +17,8 @@ export class NetworkConfigGrpcClient {
NetworkConfig.ProtoPackages.ReadPackage,
NetworkConfig.ProtoPackages.WritePackage,
],
credentials:
process.env.ENV === 'local' ? undefined : credentials.createSsl(),
// credentials:
// process.env.ENV === 'local' ? undefined : credentials.createSsl(),
protoPath: [
NetworkConfig.ProtoPaths.ReadFilePath,
NetworkConfig.ProtoPaths.WriteFilePath,
+2 -2
View File
@@ -62,10 +62,10 @@ export class PipelinesClientService implements OnModuleInit {
return createPipelineResponse;
}
async findAll(data: IIdRequest) {
async findAll(data) {
this.logger.info('PipelinesClientService - FindAll');
const findAllPipelineResponse = await new Promise((resolve, reject) => {
this.pipelineService.FindAll(objectSnakeToCamel(data)).subscribe({
this.pipelineService.FindAll(data).subscribe({
next(x) {
resolve(x.pipelines);
},
+5 -4
View File
@@ -13,12 +13,13 @@ export class PipelinesClientConfiguration {
options: {
url: process.env.PIFACTORY_URL,
package: PipelinePackages,
credentials:
process.env.LOCAL_ENV || process.env.ENV === 'local'
? undefined
: credentials.createSsl(),
// credentials:
// process.env.LOCAL_ENV || process.env.ENV === 'local'
// ? undefined
// : credentials.createSsl(),
protoPath: PipelineProtoFilePath,
loader: {
keepCase: true,
enums: String,
objects: true,
arrays: true,
+11 -4
View File
@@ -14,6 +14,7 @@ import { AuthenticateCondition } from 'src/authentication/authentication.decorat
import { PERMISSIONS } from '../../authentication/permissions.enum';
import { PipelinesService } from './pipelines.service';
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
import { RequestUser, User } from 'src/authentication/user.decorator';
@ApiTags('Pipelines')
@Controller('pipelines')
@@ -110,14 +111,20 @@ export class PipelinesController {
}
@Get()
async findAll(@Body() data) {
async findAll(@User() user: RequestUser, @Body() data) {
this.logger.info(process.env.DEV_URL + `/pipeline ON Find All ROUTE`, {
user: data.info.user_id,
customer: data.info.customer,
user: user.user_id,
customer: user.customer_id,
});
const { customer_id, user_id, customer_name } = user;
const pipelineService = new PipelinesService(this.pipelinesClientService);
const response = await pipelineService.findAll(data);
const response = await pipelineService.findAll({
customer_name,
customer_id,
user_id,
});
return response;
}
+3 -1
View File
@@ -43,7 +43,9 @@ export class PipelinesService {
async findAll(data) {
try {
const findAllPipelineResponse = await this.pipelineClient.findAll(data);
const findAllPipelineResponse = await this.pipelineClient.findAll({
info: data,
});
const pipelines = objectCamelToSnake(findAllPipelineResponse);
pipelines.forEach((pipeline) => {
+5 -4
View File
@@ -16,12 +16,13 @@ export class PipelinesClientConfiguration {
options: {
url: process.env.PIFACTORY_URL,
package: [ProtoPackages.ReadPackage, ProtoPackages.WritePackage],
credentials:
process.env.LOCAL_ENV || process.env.ENV === 'local'
? undefined
: credentials.createSsl(),
// credentials:
// process.env.LOCAL_ENV || process.env.ENV === 'local'
// ? undefined
// : credentials.createSsl(),
protoPath: [ProtoPaths.ReadFilePath, ProtoPaths.WriteFilePath],
loader: {
keepCase: true,
enums: String,
objects: true,
arrays: true,
+1 -1
View File
File diff suppressed because one or more lines are too long