import type { AuthConfig, IdentifierConfig } from '@diia-inhouse/crypto'; import type { AppDbConfig, DatabaseAdapterType, PostgresDbConfig } from '@diia-inhouse/db'; import type { MetricsConfig as CustomMetricsConfig } from '@diia-inhouse/diia-metrics'; import type { QueueConnectionConfig } from '@diia-inhouse/diia-queue'; import type { FeatureConfig } from '@diia-inhouse/features'; import type { HealthCheckConfig } from '@diia-inhouse/healthcheck'; import type { RedisConfig } from '@diia-inhouse/redis'; import type { GenericObject, HttpMethod } from '@diia-inhouse/types'; import { GrpcClientConfig, GrpcServerConfig } from './grpc.js'; export type CorsConfig = { origins: string[]; methods: HttpMethod[]; allowedHeaders: string[]; exposedHeaders: string[]; credentials: boolean; maxAge: number; }; export interface TransporterConfig { type: string; options: Record; } export interface BalancingStrategy { strategy: string; strategyOptions: GenericObject; } export interface TracingConfig { zipkin: { isEnabled: boolean; baseURL: string; sendIntervalSec: number; }; } export interface MetricsConfig { moleculer?: { prometheus: { isEnabled: boolean; port?: number; path: string; }; }; custom?: CustomMetricsConfig; } export interface BaseConfig { listenTerminationSignals?: boolean; depsDir?: string; transporter?: TransporterConfig; app?: { [key: string]: unknown; externalBusTimeout?: number; }; cors?: CorsConfig; balancing?: BalancingStrategy; tracing?: TracingConfig; metrics?: MetricsConfig; isMoleculerEnabled?: boolean; store?: RedisConfig; /** @deprecated use store instead */ redis?: RedisConfig; rabbit?: QueueConnectionConfig; healthCheck?: HealthCheckConfig; databaseAdapter?: DatabaseAdapterType; db?: AppDbConfig; postgres?: PostgresDbConfig; auth?: AuthConfig; identifier?: IdentifierConfig; grpcServer?: GrpcServerConfig; grpcClient?: GrpcClientConfig; featureFlags?: FeatureConfig; }