diff --git a/types/gitlab.ts b/types/gitlab.ts index d93f761..21cc92a 100644 --- a/types/gitlab.ts +++ b/types/gitlab.ts @@ -1,59 +1,264 @@ export namespace Gitlab { + /* 定义错误接口 */ export interface Error { + /** + * 错误消息 + */ message: string } + /* 定义用户接口 */ export interface User { + /** + * 用户ID + */ id: number + /** + * 用户名 + */ username: string + /** + * 用户全名 + */ name: string + /** + * 用户状态 + */ state: string + /** + * 用户头像URL + */ avatar_url: string + /** + * 用户网页URL + */ web_url: string } + /* 定义项目详情接口 */ export interface ProjDetail { + /** + * 项目ID + */ id: number + /** + * 项目描述 + */ description: string + /** + * 项目名称 + */ name: string + /** + * 带命名空间的项目路径 + */ path_with_namespace: string + /** + * 项目网页URL + */ web_url: string + /** + * 项目头像URL(可选) + */ avatar_url?: any + /** + * 消息(可选) + */ message?: string } + /* 定义管道详情接口 */ export interface PipelineDetail { + /** + * 管道ID + */ id: number + /** + * 项目ID + */ project_id: number + /** + * 分支名 + */ ref: string + /** + * 状态 + */ status: string - web_url: "https://git.n.xiaomi.com/miai-fe/fe/ai-scene-review-fe/-/pipelines/7646046" + /** + * 管道网页URL + */ + web_url: string + /** + * 用户信息 + */ user: User + /** + * 开始时间 + */ started_at: string + /** + * 完成时间 + */ finished_at: string + /** + * 持续时间 + */ duration: number + /** + * 排队持续时间 + */ queued_duration: number + /** + * 消息(可选) + */ message?: string } + /* 定义管道接口 */ export interface Pipeline { + /** + * 管道ID + */ id: number + /** + * 项目ID + */ project_id: number + /** + * SHA值 + */ sha: string + /** + * 分支名 + */ ref: string + /** + * 状态 + */ status: string + /** + * 来源 + */ source: string + /** + * 创建时间 + */ created_at: string + /** + * 更新时间 + */ updated_at: string + /** + * 管道网页URL + */ web_url: string } + /* 定义徽章接口 */ export interface Badge { + /** + * 徽章ID + */ id: number + /** + * 徽章名称 + */ name: string + /** + * 链接URL + */ link_url: string + /** + * 图片URL + */ image_url: string + /** + * 渲染后的链接URL + */ rendered_link_url: string + /** + * 渲染后的图片URL + */ rendered_image_url: string + /** + * 类型(项目或组) + */ kind: "project" | "group" } + + /* 定义管道事件接口 */ + export interface PipelineEvent { + /** + * 对象属性,包含了构建的详细信息 + */ + object_attributes: { + /** + * 分支名 + */ + ref: string + /** + * 提交的SHA值 + */ + sha: string + /** + * 构建状态 + */ + status: string + /** + * 构建创建时间 + */ + created_at: string + /** + * 构建完成时间 + */ + finished_at: string + /** + * 构建持续时间,单位为秒 + */ + duration: number + } + /** + * 用户信息 + */ + user: { + /** + * 用户姓名 + */ + name: string + /** + * 用户名 + */ + username: string + } + /** + * 项目信息 + */ + project: { + /** + * 项目ID + */ + id: number + /** + * 项目的web URL + */ + web_url: string + /** + * 带命名空间的项目路径 + */ + path_with_namespace: string + } + /** + * 提交信息 + */ + commit: { + /** + * 提交的ID + */ + id: string + /** + * 提交的标题 + */ + title: string + } + } }