1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-04 11:17:02 +02:00
unleash.unleash/frontend/src/interfaces/strategy.ts
Fredrik Strand Oseberg 978674e33a
feat: update strategy segments with edit / create strategy (#2420)
* Refactors how we add / edit segments to make it more ergonomic to work with in regards to change requests
2022-11-16 15:35:39 +01:00

62 lines
1.3 KiB
TypeScript

import { Operator } from 'constants/operators';
export interface IFeatureStrategy {
id: string;
strategyName?: string;
name: string;
constraints: IConstraint[];
parameters: IFeatureStrategyParameters;
featureName?: string;
projectId?: string;
environment?: string;
segments?: number[];
}
export interface IFeatureStrategyParameters {
[key: string]: string | number | undefined;
}
export interface IFeatureStrategyPayload {
id?: string;
name?: string;
constraints: IConstraint[];
parameters: IFeatureStrategyParameters;
segments?: number[];
}
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;
}