mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
## About the changes - Refactored some E2E tests to use our APIs - Added test cases for project-specific segments - Added validation to check a project can access a specific segment - Fixed an OpenAPI schema that was missing segments ## Discussion points https://github.com/Unleash/unleash/pull/3339/files#r1140008992
32 lines
793 B
TypeScript
32 lines
793 B
TypeScript
import { UpsertSegmentSchema } from 'lib/openapi';
|
|
import { ISegment, IUser } from 'lib/types';
|
|
|
|
export interface ISegmentService {
|
|
updateStrategySegments: (
|
|
strategyId: string,
|
|
segmentIds: number[],
|
|
) => Promise<void>;
|
|
|
|
addToStrategy(id: number, strategyId: string): Promise<void>;
|
|
|
|
getByStrategy(strategyId: string): Promise<ISegment[]>;
|
|
|
|
get(id: number): Promise<ISegment>;
|
|
|
|
getActive(): Promise<ISegment[]>;
|
|
|
|
getAll(): Promise<ISegment[]>;
|
|
|
|
create(
|
|
data: UpsertSegmentSchema,
|
|
user: Partial<Pick<IUser, 'username' | 'email'>>,
|
|
): Promise<ISegment>;
|
|
|
|
delete(id: number, user: IUser): Promise<void>;
|
|
|
|
cloneStrategySegments(
|
|
sourceStrategyId: string,
|
|
targetStrategyId: string,
|
|
): Promise<void>;
|
|
}
|