unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
48 lines • 2.98 kB
TypeScript
import type { IApplication, IApplicationOverview } from './models.js';
import type { IUnleashStores } from '../../../types/stores.js';
import type { IUnleashConfig } from '../../../types/option.js';
import type { IClientApplications, IClientApplicationsSearchParams } from '../../../types/stores/client-applications-store.js';
import type { IClientApp, IFrontendClientApp } from '../../../types/model.js';
import type { IPrivateProjectChecker } from '../../private-project/privateProjectCheckerType.js';
import type { Logger } from '../../../logger.js';
import type { OutdatedSdksSchema } from '../../../openapi/spec/outdated-sdks-schema.js';
import type { ClientMetricsSchema, PartialSome } from '../../../server-impl.js';
export default class ClientInstanceService {
apps: {};
logger: Logger;
seenClients: Record<string, IClientApp>;
private clientMetricsStoreV2;
private strategyStore;
private featureToggleStore;
private clientApplicationsStore;
private clientInstanceStore;
private eventStore;
private privateProjectChecker;
private flagResolver;
private eventBus;
constructor({ clientMetricsStoreV2, strategyStore, featureToggleStore, clientInstanceStore, clientApplicationsStore, eventStore, }: Pick<IUnleashStores, 'clientMetricsStoreV2' | 'strategyStore' | 'featureToggleStore' | 'clientApplicationsStore' | 'clientInstanceStore' | 'eventStore'>, { getLogger, flagResolver, eventBus, }: Pick<IUnleashConfig, 'getLogger' | 'flagResolver' | 'eventBus'>, privateProjectChecker: IPrivateProjectChecker);
private updateSeenClient;
registerInstance(data: Pick<ClientMetricsSchema, 'appName' | 'instanceId' | 'environment'>, clientIp: string): Promise<void>;
registerFrontendClient(data: IFrontendClientApp): void;
registerBackendClient(data: PartialSome<IClientApp, 'instanceId'>, clientIp: string): Promise<void>;
announceUnannounced(): Promise<void>;
clientKey(client: IClientApp): string;
bulkAdd(): Promise<void>;
getApplications(query: IClientApplicationsSearchParams, userId: number): Promise<IClientApplications>;
getApplication(appName: string): Promise<IApplication>;
getApplicationOverview(appName: string, userId: number): Promise<IApplicationOverview>;
getRecentApplicationEnvironmentInstances(appName: string, environment: string): Promise<{
instanceId: string;
clientIp: string | undefined;
sdkVersion: string | undefined;
lastSeen: Date | undefined;
}[]>;
deleteApplication(appName: string): Promise<void>;
createApplication(input: IApplication): Promise<void>;
removeOldInstances(): Promise<void>;
removeInactiveApplications(): Promise<number>;
getOutdatedSdks(): Promise<OutdatedSdksSchema['sdks']>;
getOutdatedSdksByProject(projectId: string): Promise<OutdatedSdksSchema['sdks']>;
usesSdkOlderThan(sdkName: string, sdkVersion: string): Promise<boolean>;
}
//# sourceMappingURL=instance-service.d.ts.map