mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-09 16:44:48 +00:00
34 lines
879 B
TypeScript
34 lines
879 B
TypeScript
import {
|
|
ClientProviderOptions,
|
|
GrpcOptions,
|
|
Transport,
|
|
} from '@nestjs/microservices';
|
|
import { credentials } from '@grpc/grpc-js';
|
|
import { Transformation } from '@dadosfera/protospack-v2';
|
|
|
|
export class TransformationsClientConfiguration {
|
|
public name = 'TransformationsClientConfiguration';
|
|
private config: GrpcOptions = {
|
|
transport: Transport.GRPC,
|
|
options: {
|
|
url: process.env.INFACTORY_URL,
|
|
package: [Transformation.ProtoPackages.WritePackage],
|
|
credentials:
|
|
process.env.LOCAL_ENV || process.env.ENV === 'local'
|
|
? undefined
|
|
: credentials.createSsl(),
|
|
protoPath: [Transformation.ProtoPaths.WriteFilePath],
|
|
loader: {
|
|
enums: String,
|
|
objects: true,
|
|
arrays: true,
|
|
},
|
|
},
|
|
};
|
|
|
|
providerOptions: ClientProviderOptions = {
|
|
name: this.name,
|
|
...this.config,
|
|
};
|
|
}
|