UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.

32 lines (31 loc) 1.61 kB
import { IUnleashConfig, IUnleashServices, IUnleashStores } from '../types'; import { ProxyFeatureSchema, ProxyMetricsSchema } from '../openapi'; import ApiUser from '../types/api-user'; import { Context } from 'unleash-client'; import { FrontendSettings } from '../types/settings/frontend-settings'; declare type Config = Pick<IUnleashConfig, 'getLogger' | 'frontendApi' | 'frontendApiOrigins'>; declare type Stores = Pick<IUnleashStores, 'projectStore' | 'eventStore'>; declare type Services = Pick<IUnleashServices, 'featureToggleServiceV2' | 'segmentService' | 'clientMetricsServiceV2' | 'settingService'>; export declare class ProxyService { private readonly config; private readonly logger; private readonly stores; private readonly services; private readonly clients; private cachedFrontendSettings?; private timer; constructor(config: Config, stores: Stores, services: Services); getProxyFeatures(token: ApiUser, context: Context): Promise<ProxyFeatureSchema[]>; getAllProxyFeatures(token: ApiUser, context: Context): Promise<ProxyFeatureSchema[]>; registerProxyMetrics(token: ApiUser, metrics: ProxyMetricsSchema, ip: string): Promise<void>; private clientForProxyToken; private createClientForProxyToken; deleteClientForProxyToken(secret: string): void; stopAll(): void; private static assertExpectedTokenType; setFrontendSettings(value: FrontendSettings, createdBy: string): Promise<void>; private fetchFrontendSettings; getFrontendSettings(useCache?: boolean): Promise<FrontendSettings>; destroy(): void; } export {};