-
-
Notifications
You must be signed in to change notification settings - Fork 297
/
Experiments.ts
38 lines (35 loc) · 1.03 KB
/
Experiments.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper } from '../infrastructure';
import type {
BaseRequestOptions,
GitlabAPIResponse,
PaginationRequestOptions,
PaginationTypes,
} from '../infrastructure';
export interface ExperimentGateSchema {
key: string;
value: boolean | number;
}
export interface ExperimentSchema extends Record<string, unknown> {
key: string;
definition: {
name: string;
introduced_by_url: string;
rollout_issue_url: string;
milestone: string;
type: string;
group: string;
default_enabled: boolean;
};
current_status: {
state: string;
gates?: ExperimentGateSchema[];
};
}
export class Experiments<C extends boolean = false> extends BaseResource<C> {
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
options?: PaginationRequestOptions<P> & BaseRequestOptions<E>,
): Promise<GitlabAPIResponse<ExperimentSchema[], C, E, P>> {
return RequestHelper.get<ExperimentSchema[]>()(this, 'experiments', options);
}
}