unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
39 lines • 2.4 kB
TypeScript
import type { SdkContextSchema } from '../../openapi/spec/sdk-context-schema.js';
import type { IUnleashServices } from '../../services/index.js';
import { ALL } from '../../types/models/api-token.js';
import type { PlaygroundFeatureSchema } from '../../openapi/spec/playground-feature-schema.js';
import type { ISegmentReadModel, IUnleashConfig } from '../../types/index.js';
import type { EvaluatedPlaygroundStrategy } from '../../features/playground/feature-evaluator/client.js';
import type { AdvancedPlaygroundFeatureSchema, playgroundStrategyEvaluation } from '../../openapi/index.js';
import type { AdvancedPlaygroundEnvironmentFeatureSchema } from '../../openapi/spec/advanced-playground-environment-feature-schema.js';
export type AdvancedPlaygroundEnvironmentFeatureEvaluationResult = Omit<AdvancedPlaygroundEnvironmentFeatureSchema, 'strategies'> & {
strategies: {
result: boolean | typeof playgroundStrategyEvaluation.unknownResult;
data: EvaluatedPlaygroundStrategy[];
};
};
export type AdvancedPlaygroundFeatureEvaluationResult = Omit<AdvancedPlaygroundFeatureSchema, 'environments'> & {
environments: Record<string, AdvancedPlaygroundEnvironmentFeatureEvaluationResult[]>;
};
export type PlaygroundFeatureEvaluationResult = Omit<PlaygroundFeatureSchema, 'strategies'> & {
strategies: {
result: boolean | typeof playgroundStrategyEvaluation.unknownResult;
data: EvaluatedPlaygroundStrategy[];
};
};
export declare class PlaygroundService {
private readonly logger;
private readonly featureToggleService;
private readonly flagResolver;
private readonly privateProjectChecker;
private readonly segmentReadModel;
constructor(config: IUnleashConfig, { featureToggleService, privateProjectChecker, }: Pick<IUnleashServices, 'featureToggleService' | 'privateProjectChecker'>, segmentReadModel: ISegmentReadModel);
evaluateAdvancedQuery(projects: typeof ALL | string[], environments: string[], context: SdkContextSchema, userId: number): Promise<{
result: AdvancedPlaygroundFeatureEvaluationResult[];
invalidContextProperties: string[];
}>;
private evaluate;
private resolveFeatures;
evaluateQuery(projects: typeof ALL | string[], environment: string, context: SdkContextSchema): Promise<PlaygroundFeatureEvaluationResult[]>;
}
//# sourceMappingURL=playground-service.d.ts.map