FEAT: inputs and transformation using protospack-v2

This commit is contained in:
Gabriel Rosa
2022-08-16 10:18:54 -03:00
parent 5f17a7106f
commit 6807b3e1a9
9 changed files with 343 additions and 331 deletions
+12 -6
View File
@@ -1,24 +1,30 @@
import { Input } from '@dadosfera/protospack-v2';
import { credentials } from '@grpc/grpc-js';
import {
ClientProviderOptions,
GrpcOptions,
Transport,
} from '@nestjs/microservices';
import { InputPackages, InputProtoFilePath } from 'protospack';
export class InputsGrpcClient {
public name = 'InputsGrpcClient';
public readonly name = 'InputsGrpcClient';
private config: GrpcOptions = {
transport: Transport.GRPC,
options: {
url: process.env.INFACTORY_URL,
package: InputPackages,
package: [
Input.ProtoPackages.WritePackage,
Input.ProtoPackages.ReadPackage,
],
credentials: process.env.LOCAL_ENV ? undefined : credentials.createSsl(),
protoPath: InputProtoFilePath,
protoPath: [
Input.ProtoPaths.WriteFilePath,
Input.ProtoPaths.ReadFilePath,
],
loader: {
keepCase: true,
enums: String,
objects: true,
arrays: true,
defaults: false,
},
},
};