1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/interfaces/strategy.ts
2023-07-17 13:58:54 +02:00

69 lines
1.5 KiB
TypeScript

import { Operator } from 'constants/operators';
import { IFeatureVariant } from './featureToggle';
export interface IFeatureStrategy {
id: string;
strategyName?: string;
name: string;
title?: string;
constraints: IConstraint[];
parameters: IFeatureStrategyParameters;
variants?: IFeatureVariant[];
featureName?: string;
projectId?: string;
environment?: string;
segments?: number[];
disabled?: boolean;
}
export interface IFeatureStrategyParameters {
[key: string]: string | number | undefined;
}
export interface IFeatureStrategyPayload {
id?: string;
name?: string;
title?: string;
constraints: IConstraint[];
parameters: IFeatureStrategyParameters;
variants?: IFeatureVariant[];
segments?: number[];
disabled?: boolean;
}
export interface IStrategy {
name: string;
displayName: string;
editable: boolean;
deprecated: boolean;
description: string;
parameters: IStrategyParameter[];
}
export interface IStrategyParameter {
name: string;
description: string;
required: boolean;
type: string;
}
export interface IStrategyPayload {
name: string;
description: string;
parameters: IStrategyParameter[];
}
export interface IConstraint {
inverted?: boolean;
values?: string[];
value?: string;
caseInsensitive?: boolean;
operator: Operator;
contextName: string;
}
export interface IFeatureStrategySortOrder {
id: string;
sortOrder: number;
}