-
-
Notifications
You must be signed in to change notification settings - Fork 297
/
GroupActivityAnalytics.ts
65 lines (59 loc) · 1.85 KB
/
GroupActivityAnalytics.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper } from '../infrastructure';
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export interface GroupAnalyticsIssuesCountSchema extends Record<string, unknown> {
issues_count: number;
}
export interface GroupAnalyticsMRsCountSchema extends Record<string, unknown> {
merge_requests_count: number;
}
export interface GroupAnalyticsNewMembersCountSchema extends Record<string, unknown> {
new_members_count: number;
}
export class GroupActivityAnalytics<C extends boolean = false> extends BaseResource<C> {
showIssuesCount<E extends boolean = false>(
groupPath: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<GroupAnalyticsIssuesCountSchema, C, E, void>> {
return RequestHelper.get<GroupAnalyticsIssuesCountSchema>()(
this,
'analytics/group_activity/issues_count',
{
searchParams: {
groupPath,
},
...options,
},
);
}
showMergeRequestsCount<E extends boolean = false>(
groupPath: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<GroupAnalyticsMRsCountSchema, C, E, void>> {
return RequestHelper.get<GroupAnalyticsMRsCountSchema>()(
this,
'analytics/group_activity/merge_requests_count',
{
searchParams: {
groupPath,
},
...options,
},
);
}
showNewMembersCount<E extends boolean = false>(
groupPath: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<GroupAnalyticsNewMembersCountSchema, C, E, void>> {
return RequestHelper.get<GroupAnalyticsNewMembersCountSchema>()(
this,
'analytics/group_activity/new_members_count',
{
searchParams: {
groupPath,
},
...options,
},
);
}
}