-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathProductAnalytics.ts
49 lines (45 loc) · 1.58 KB
/
ProductAnalytics.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
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper, endpoint } from '../infrastructure';
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export class ProductAnalytics<C extends boolean = false> extends BaseResource<C> {
allFunnels<E extends boolean = false>(
projectId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<Record<string, unknown>, C, E, void>> {
return RequestHelper.get<Record<string, unknown>>()(
this,
endpoint`projects/${projectId}/product_analytics/funnels`,
options,
);
}
load<E extends boolean = false>(
projectId: string | number,
options?: { includeToken?: boolean } & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<void, C, E, void>> {
return RequestHelper.post<void>()(
this,
endpoint`projects/${projectId}/product_analytics/request/load`,
options,
);
}
dryRun<E extends boolean = false>(
projectId: string | number,
options?: { includeToken?: boolean } & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<void, C, E, void>> {
return RequestHelper.post<void>()(
this,
endpoint`projects/${projectId}/product_analytics/request/dry-run`,
options,
);
}
showMetadata<E extends boolean = false>(
projectId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<void, C, E, void>> {
return RequestHelper.get<void>()(
this,
endpoint`projects/${projectId}/product_analytics/request/meta`,
options,
);
}
}