mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
Adding extensive typing support Unified browser and Node.JS implementations Adding support of Gitlab API 16.0
24 lines
791 B
TypeScript
24 lines
791 B
TypeScript
import { BaseResource } from '@gitbeaker/requester-utils';
|
|
import { RequestHelper, endpoint } from '../infrastructure';
|
|
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
|
|
|
|
export interface ProjectStatisticSchema extends Record<string, unknown> {
|
|
fetches: {
|
|
total: number;
|
|
days: { count: number; date: string }[];
|
|
};
|
|
}
|
|
|
|
export class ProjectStatistics<C extends boolean = false> extends BaseResource<C> {
|
|
show<E extends boolean = false>(
|
|
projectId: string | number,
|
|
options?: Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<ProjectStatisticSchema, C, E, void>> {
|
|
return RequestHelper.get<ProjectStatisticSchema>()(
|
|
this,
|
|
endpoint`projects/${projectId}/statistics`,
|
|
options as Sudo & ShowExpanded<E>,
|
|
);
|
|
}
|
|
}
|