import { ClientsProviderAsyncOptions, GrpcOptions, Transport, } from '@nestjs/microservices'; import { PipelinePackages, PipelineProtoFilePath } from 'protospack'; import { credentials } from '@grpc/grpc-js'; export class PipelinesClientConfiguration { public name = 'PipelinesClientConfiguration'; private config: GrpcOptions = { transport: Transport.GRPC, options: { url: process.env.PIFACTORY_URL, package: PipelinePackages, credentials: process.env.LOCAL_ENV || process.env.ENV === 'local' ? undefined : credentials.createSsl(), protoPath: PipelineProtoFilePath, loader: { keepCase: true, enums: String, defaults: false, }, }, }; providerOptions: ClientsProviderAsyncOptions = { name: this.name, ...this.config, }; }