import { EventStoreModuleOptions , EventStoreOptionsFactory , } from '@juicycleff/nestjs-event-store' ; import { Injectable } from '@nestjs/common' ; @ Injectable ( ) export class EventStoreConfigService implements EventStoreOptionsFactory { createEventStoreOptions ( ) { return { type : 'event-store' , tcpEndpoint : { host : process . env . EVENT_STORE_HOSTNAME , port : parseInt ( process . env . EVENT_STORE_TCP_PORT ) , } , options : { maxRetries : 1000 , maxReconnections : 1000 , reconnectionDelay : 1000 , heartbeatInterval : 1000 , heartbeatTimeout : 1000 , defaultUserCredentials : { password : process . env . EVENT_STORE_CREDENTIALS_PASSWORD , username : process . env . EVENT_STORE_CREDENTIALS_USERNAME , } , } , } ; } }