unleash-server
Version:
Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.
37 lines (36 loc) • 1.96 kB
TypeScript
import { IApplication } from './models';
import { IUnleashStores } from '../../types/stores';
import { IUnleashConfig } from '../../types/option';
import { IClientApplication } from '../../types/stores/client-applications-store';
import { IApplicationQuery } from '../../types/query';
import { IClientApp } from '../../types/model';
import { PartialSome } from '../../types/partial';
export default class ClientInstanceService {
apps: {};
logger: any;
seenClients: Record<string, IClientApp>;
private timers;
private clientMetricsStoreV2;
private strategyStore;
private featureToggleStore;
private clientApplicationsStore;
private clientInstanceStore;
private eventStore;
private bulkInterval;
private announcementInterval;
private serverOption;
readonly prometheusApi: any;
constructor({ clientMetricsStoreV2, strategyStore, featureToggleStore, clientInstanceStore, clientApplicationsStore, eventStore, }: Pick<IUnleashStores, 'clientMetricsStoreV2' | 'strategyStore' | 'featureToggleStore' | 'clientApplicationsStore' | 'clientInstanceStore' | 'eventStore'>, { getLogger, prometheusApi, server, }: Pick<IUnleashConfig, 'getLogger' | 'prometheusApi' | 'server'>, bulkInterval?: number, announcementInterval?: number);
registerInstance(data: PartialSome<IClientApp, 'instanceId'>, clientIp: string): Promise<void>;
registerClient(data: PartialSome<IClientApp, 'instanceId'>, clientIp: string): Promise<void>;
announceUnannounced(): Promise<void>;
clientKey(client: IClientApp): string;
bulkAdd(): Promise<void>;
getApplications(query: IApplicationQuery): Promise<IClientApplication[]>;
getApplication(appName: string): Promise<IApplication>;
deleteApplication(appName: string): Promise<void>;
createApplication(input: IApplication): Promise<void>;
private toEpoch;
getRPSForPath(path: string, hoursToQuery: number): Promise<any>;
destroy(): void;
}