UNPKG

git-contribution-stats

Version:

Library to generate GitHub contribution reports for GitHub App installations

46 lines (45 loc) 1.15 kB
import { Logger } from "./logger"; export interface GitHubActivityConfig { app_id: number; private_key: string; days_to_look_back?: number; logger?: Logger; } export interface UserStat { name: string; user_id: string | null; total_commits: number; total_prs_opened: number; total_prs_closed: number; repo_contributions: RepoContribution[]; } export interface CommitInfo { id: string; message: string; date: string; } export interface RepoContribution { repo_name: string; commits: number; prs_opened: number; prs_closed: number; commit_details: CommitInfo[]; } export interface InstallationStats { installation_id: number; account: string; account_type: string; period_days: number; user_id: number; user_stats: UserStat[]; } export interface InstallationError { id: number; account: string; error: string; } export interface GitHubActivityResult { summary: string; detailed_results: (InstallationStats | InstallationError)[]; } export declare function generateGitHubReport(config: GitHubActivityConfig): Promise<GitHubActivityResult>;