2021-09-27 13:35:32 +02:00
|
|
|
import { IFeatureStrategy } from './strategy';
|
2022-11-15 11:24:36 +01:00
|
|
|
import { ITag } from './tags';
|
2021-09-14 14:20:23 +02:00
|
|
|
|
2021-07-07 11:04:36 +02:00
|
|
|
export interface IFeatureToggleListItem {
|
|
|
|
type: string;
|
|
|
|
name: string;
|
2022-04-06 12:22:24 +02:00
|
|
|
stale?: boolean;
|
|
|
|
lastSeenAt?: string;
|
|
|
|
createdAt: string;
|
2021-07-07 11:04:36 +02:00
|
|
|
environments: IEnvironments[];
|
2022-11-15 11:24:36 +01:00
|
|
|
tags?: ITag[];
|
2022-12-01 13:10:42 +01:00
|
|
|
favorite?: boolean;
|
2021-07-07 11:04:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IEnvironments {
|
|
|
|
name: string;
|
|
|
|
enabled: boolean;
|
2023-01-20 18:09:01 +01:00
|
|
|
variantCount: number;
|
2023-08-08 11:32:33 +02:00
|
|
|
lastSeenAt: Date | null;
|
2021-07-07 11:04:36 +02:00
|
|
|
}
|
2021-09-14 14:20:23 +02:00
|
|
|
|
|
|
|
export interface IFeatureToggle {
|
|
|
|
stale: boolean;
|
|
|
|
archived: boolean;
|
2022-02-08 12:06:25 +01:00
|
|
|
enabled?: boolean;
|
|
|
|
createdAt: string;
|
|
|
|
lastSeenAt?: string;
|
2022-05-02 15:52:41 +02:00
|
|
|
description?: string;
|
2021-09-14 14:20:23 +02:00
|
|
|
environments: IFeatureEnvironment[];
|
|
|
|
name: string;
|
2022-12-02 08:16:03 +01:00
|
|
|
|
|
|
|
favorite: boolean;
|
2021-09-14 14:20:23 +02:00
|
|
|
project: string;
|
|
|
|
type: string;
|
|
|
|
variants: IFeatureVariant[];
|
2022-02-03 12:39:43 +01:00
|
|
|
impressionData: boolean;
|
2022-02-08 12:06:25 +01:00
|
|
|
strategies?: IFeatureStrategy[];
|
2021-09-14 14:20:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IFeatureEnvironment {
|
2021-10-15 12:49:14 +02:00
|
|
|
type: string;
|
2021-09-14 14:20:23 +02:00
|
|
|
name: string;
|
|
|
|
enabled: boolean;
|
2021-09-27 13:35:32 +02:00
|
|
|
strategies: IFeatureStrategy[];
|
2022-11-18 12:43:24 +01:00
|
|
|
variants?: IFeatureVariant[];
|
2023-08-08 11:32:33 +02:00
|
|
|
lastSeenAt?: Date;
|
2021-09-14 14:20:23 +02:00
|
|
|
}
|
|
|
|
|
2023-01-25 15:10:35 +01:00
|
|
|
export interface IFeatureEnvironmentWithCrEnabled extends IFeatureEnvironment {
|
|
|
|
crEnabled?: boolean;
|
|
|
|
}
|
|
|
|
|
2021-09-14 14:20:23 +02:00
|
|
|
export interface IFeatureVariant {
|
|
|
|
name: string;
|
|
|
|
stickiness: string;
|
|
|
|
weight: number;
|
2023-07-26 16:08:11 +02:00
|
|
|
weightType: 'fix' | 'variable';
|
2023-07-17 13:58:54 +02:00
|
|
|
overrides?: IOverride[];
|
2023-07-14 14:28:02 +02:00
|
|
|
payload?: IPayload;
|
|
|
|
}
|
|
|
|
|
2021-09-14 14:20:23 +02:00
|
|
|
export interface IOverride {
|
|
|
|
contextName: string;
|
|
|
|
values: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IPayload {
|
2022-03-01 13:22:47 +01:00
|
|
|
type: string;
|
2021-09-14 14:20:23 +02:00
|
|
|
value: string;
|
|
|
|
}
|
2021-10-13 10:20:34 +02:00
|
|
|
|
|
|
|
export interface IFeatureEnvironmentMetrics {
|
|
|
|
environment: string;
|
|
|
|
timestamp: string;
|
|
|
|
yes: number;
|
|
|
|
no: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IFeatureMetrics {
|
2022-02-25 10:55:39 +01:00
|
|
|
version?: number;
|
|
|
|
maturity?: string;
|
2022-02-18 09:51:10 +01:00
|
|
|
lastHourUsage: IFeatureEnvironmentMetrics[];
|
|
|
|
seenApplications: string[];
|
2021-10-13 10:20:34 +02:00
|
|
|
}
|
2022-02-21 13:47:54 +01:00
|
|
|
|
|
|
|
export interface IFeatureMetricsRaw {
|
|
|
|
featureName: string;
|
|
|
|
appName: string;
|
|
|
|
environment: string;
|
|
|
|
timestamp: string;
|
|
|
|
yes: number;
|
|
|
|
no: number;
|
2023-05-08 12:15:26 +02:00
|
|
|
variants: Record<string, number>;
|
2022-02-21 13:47:54 +01:00
|
|
|
}
|