171 lines
4.0 KiB
TypeScript
171 lines
4.0 KiB
TypeScript
// ---------------------------------------------------------------------------
|
|
// Common
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface ITestConnectionResult {
|
|
ok: boolean;
|
|
error?: string;
|
|
}
|
|
|
|
export interface IListOptions {
|
|
search?: string;
|
|
page?: number;
|
|
perPage?: number;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Action Run list options
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IActionRunListOptions extends IListOptions {
|
|
/** Filter by run status (waiting, running, success, failure, cancelled) */
|
|
status?: string;
|
|
/** Filter by head branch */
|
|
branch?: string;
|
|
/** Filter by trigger event (push, pull_request, schedule, workflow_dispatch, …) */
|
|
event?: string;
|
|
/** Filter by the user who triggered the run */
|
|
actor?: string;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Users
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaUser {
|
|
id: number;
|
|
login: string;
|
|
full_name: string;
|
|
email: string;
|
|
avatar_url: string;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Repositories
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaRepository {
|
|
id: number;
|
|
name: string;
|
|
full_name: string;
|
|
description: string;
|
|
default_branch: string;
|
|
html_url: string;
|
|
private: boolean;
|
|
topics: string[];
|
|
updated_at: string;
|
|
owner: {
|
|
id: number;
|
|
login: string;
|
|
avatar_url: string;
|
|
};
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Organizations
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaOrganization {
|
|
id: number;
|
|
name: string;
|
|
full_name: string;
|
|
description: string;
|
|
visibility: string;
|
|
repo_count: number;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Secrets
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaSecret {
|
|
name: string;
|
|
created_at: string;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Action Runs
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaActionRun {
|
|
id: number;
|
|
name: string;
|
|
workflow_id: string;
|
|
status: string;
|
|
conclusion: string;
|
|
head_branch: string;
|
|
head_sha: string;
|
|
html_url: string;
|
|
event: string;
|
|
run_number: number;
|
|
run_attempt: number;
|
|
run_duration: number;
|
|
created_at: string;
|
|
updated_at: string;
|
|
started_at: string;
|
|
actor: IGiteaUser;
|
|
trigger_actor: IGiteaUser;
|
|
repository: {
|
|
id: number;
|
|
name: string;
|
|
full_name: string;
|
|
html_url: string;
|
|
};
|
|
head_commit: {
|
|
id: string;
|
|
message: string;
|
|
timestamp: string;
|
|
};
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Action Run Jobs
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaActionRunJob {
|
|
id: number;
|
|
run_id: number;
|
|
name: string;
|
|
workflow_name: string;
|
|
head_branch: string;
|
|
head_sha: string;
|
|
status: string;
|
|
conclusion: string;
|
|
html_url: string;
|
|
run_duration: number;
|
|
started_at: string;
|
|
completed_at: string;
|
|
steps: IGiteaActionRunJobStep[];
|
|
labels: string[];
|
|
runner_id: number;
|
|
runner_name: string;
|
|
}
|
|
|
|
export interface IGiteaActionRunJobStep {
|
|
name: string;
|
|
number: number;
|
|
status: string;
|
|
conclusion: string;
|
|
started_at: string;
|
|
completed_at: string;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Branches & Tags
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface IGiteaBranch {
|
|
name: string;
|
|
commit: {
|
|
id: string;
|
|
};
|
|
}
|
|
|
|
export interface IGiteaTag {
|
|
name: string;
|
|
id: string;
|
|
commit: {
|
|
sha: string;
|
|
};
|
|
}
|