From 5931e7e3aafaea4295d3a8973e1a282c0780be98 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Thu, 25 Jul 2024 06:39:29 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Gitlab=E7=AE=A1?= =?UTF-8?q?=E9=81=93=E4=BA=8B=E4=BB=B6=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/gitlab.ts | 207 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 206 insertions(+), 1 deletion(-) 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 + } + } }