import * as grpc from '@grpc/grpc-js'; import { LoadBalancerMode } from './LoadBalancerMode.js'; /** * Authentication mode for Chronicle connection. */ export declare enum AuthenticationMode { ClientCredentials = "ClientCredentials", ApiKey = "ApiKey" } /** * Represents a server address with host and port. */ export interface ChronicleServerAddress { host: string; port: number; } /** * Builder for constructing Chronicle connection strings. */ export declare class ChronicleConnectionStringBuilder { private static readonly _defaultPort; private static readonly _usernameKey; private static readonly _passwordKey; private static readonly _schemeKey; private static readonly _apiKeyKey; private static readonly _disableTlsKey; private static readonly _skipTlsValidationKey; private static readonly _certificatePathKey; private static readonly _certificatePasswordKey; private static readonly _loadBalancerKey; private static readonly _srvNameServerKey; private readonly _properties; private _hosts; constructor(connectionString?: string); get hosts(): ChronicleServerAddress[]; set hosts(value: ChronicleServerAddress[]); /** * Convenience accessor for the first host in {@link hosts}. Setting it collapses the * configuration to that single host, discarding any others previously set via * {@link hosts} - the same "single server" reset a plain host/port connection string * implies. */ get host(): string; set host(value: string); /** * Convenience accessor for the first host's port in {@link hosts}. Setting it collapses * the configuration to that single host, discarding any others previously set via * {@link hosts}. */ get port(): number; set port(value: number); get username(): string | undefined; set username(value: string | undefined); get password(): string | undefined; set password(value: string | undefined); get scheme(): string; set scheme(value: string); /** * Whether the connection string uses the DNS SRV lookup scheme (`chronicle+srv://`). * Compared case-insensitively, matching {@link scheme}'s own parsing. */ get isSrv(): boolean; get authenticationMode(): AuthenticationMode; get apiKey(): string | undefined; set apiKey(value: string | undefined); get disableTls(): boolean; set disableTls(value: boolean); /** * Whether TLS certificate validation is skipped for the gRPC channel and OAuth token * requests. Distinct from {@link disableTls}, which controls whether TLS is used at * all. Defaults to `true` - set to `false` to require full certificate validation * whenever TLS is on. */ get skipTlsValidation(): boolean; set skipTlsValidation(value: boolean); get certificatePath(): string | undefined; set certificatePath(value: string | undefined); get certificatePassword(): string | undefined; set certificatePassword(value: string | undefined); /** * The strategy used to select one address from {@link hosts} (or the addresses * resolved from a `chronicle+srv://` host) on every connect/reconnect attempt. * Defaults to {@link LoadBalancerMode.LeastConnections}. */ get loadBalancer(): LoadBalancerMode; set loadBalancer(value: LoadBalancerMode); /** * The `host[:port]` DNS name server used to resolve `chronicle+srv://` SRV records. * Defaults to port 53 when no port is given. Undefined uses the system default * resolver. */ get srvNameServer(): string | undefined; set srvNameServer(value: string | undefined); build(): string; private parseConnectionString; private parseUrl; } /** * Represents a Chronicle connection string. */ export declare class ChronicleConnectionString { static readonly DEVELOPMENT_CLIENT = "chronicle-dev-client"; static readonly DEVELOPMENT_CLIENT_SECRET = "chronicle-dev-secret"; static readonly Default: ChronicleConnectionString; static readonly Development: ChronicleConnectionString; private readonly _builder; private readonly _serverAddresses; constructor(connectionString: string); /** * The connection string's scheme, either `chronicle` or `chronicle+srv`. */ get scheme(): string; /** * Whether the connection string uses the DNS SRV lookup scheme (`chronicle+srv://`). */ get isSrv(): boolean; /** * Convenience accessor for the first entry in {@link serverAddresses}, for callers * that only ever expect a single server address. */ get serverAddress(): ChronicleServerAddress; /** * All server addresses parsed from a multi-host `chronicle://` connection string. * For `chronicle+srv://` connection strings, this holds the single SRV lookup host, * not the resolved addresses - resolve those via {@link ChronicleServerAddressResolver}. */ get serverAddresses(): ChronicleServerAddress[]; get username(): string | undefined; get password(): string | undefined; get authenticationMode(): AuthenticationMode; get apiKey(): string | undefined; get disableTls(): boolean; /** * Whether TLS certificate validation is skipped. See * {@link ChronicleConnectionStringBuilder.skipTlsValidation}. */ get skipTlsValidation(): boolean; get certificatePath(): string | undefined; get certificatePassword(): string | undefined; /** * The strategy used to select one server address on every connect/reconnect attempt. */ get loadBalancer(): LoadBalancerMode; /** * The `host[:port]` DNS name server used to resolve `chronicle+srv://` SRV records. */ get srvNameServer(): string | undefined; withCredentials(username: string, password: string): ChronicleConnectionString; withApiKey(apiKey: string): ChronicleConnectionString; createCredentials(): grpc.ChannelCredentials; toString(): string; } //# sourceMappingURL=ChronicleConnectionString.d.ts.map