/** * Type definitions for Gogs API responses */ export interface GogsUser { id: number; username: string; full_name: string; email: string; avatar_url: string; } export interface GogsRepository { id: number; owner: GogsUser; name?: string; full_name: string; description?: string; private: boolean; fork: boolean; html_url: string; clone_url: string; ssh_url: string; permissions?: { admin: boolean; push: boolean; pull: boolean; }; default_branch?: string; } export interface GogsSearchResponse { data: T[]; ok: boolean; } export interface GogsFileContent { type: 'file' | 'dir' | 'symlink' | 'submodule'; encoding?: string; size: number; name: string; path: string; content?: string; sha: string; url: string; git_url: string; html_url: string; download_url: string; target?: string; submodule_git_url?: string; } export interface GogsBranch { name: string; commit: { id: string; message: string; url: string; }; } export interface GogsCommit { sha: string; commit: { author: { name: string; email: string; date: string; }; committer: { name: string; email: string; date: string; }; message: string; }; author?: GogsUser; committer?: GogsUser; } export interface GogsConfig { serverUrl: string; accessToken?: string; } export interface GogsIssue { id: number; number: number; user: GogsUser; title: string; body: string; state: 'open' | 'closed'; comments: number; created_at: string; updated_at: string; labels?: GogsLabel[]; milestone?: GogsMilestone; assignee?: GogsUser; pull_request?: { html_url: string; diff_url: string; patch_url: string; }; } export interface GogsLabel { id: number; name: string; color: string; } export interface GogsMilestone { id: number; title: string; description: string; state: 'open' | 'closed'; open_issues: number; closed_issues: number; due_on?: string; } export interface GogsIssueComment { id: number; user: GogsUser; body: string; created_at: string; updated_at: string; } export interface GogsOrganization { id: number; username: string; full_name: string; avatar_url: string; description: string; website: string; location: string; } export interface GogsTeam { id: number; name: string; description: string; permission: 'owner' | 'read' | 'write'; } export interface GogsTreeEntry { path: string; mode: string; type: 'blob' | 'tree' | 'commit'; size: number; sha: string; url: string; } export interface GogsTree { sha: string; url: string; tree: GogsTreeEntry[]; }