From 039c8b4e10096a1c5036d01087d56443da636078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Sat, 13 Jan 2024 01:56:41 +0100 Subject: [PATCH] Add some Gitlab types --- types/Gitlab/GitlabCommit.ts | 17 +++++++++++++++++ types/Gitlab/GitlabMilestone.ts | 19 +++++++++++++++++++ types/Gitlab/GitlabRelease.ts | 29 +++++++++++++++++++++++++++++ types/Gitlab/GitlabRoute.ts | 1 + 4 files changed, 66 insertions(+) create mode 100644 types/Gitlab/GitlabCommit.ts create mode 100644 types/Gitlab/GitlabMilestone.ts create mode 100644 types/Gitlab/GitlabRelease.ts diff --git a/types/Gitlab/GitlabCommit.ts b/types/Gitlab/GitlabCommit.ts new file mode 100644 index 0000000..5f94c2e --- /dev/null +++ b/types/Gitlab/GitlabCommit.ts @@ -0,0 +1,17 @@ +interface GitlabCommit { + id: string; + short_id: string; + created_at: string; + parent_ids: Array<string>; + title: string; + message: string; + author_name: string; + author_email: string; + authored_date: string; + committer_name: string; + committer_email: string; + committed_date: string; +} + + +export default GitlabCommit; \ No newline at end of file diff --git a/types/Gitlab/GitlabMilestone.ts b/types/Gitlab/GitlabMilestone.ts new file mode 100644 index 0000000..a7285cd --- /dev/null +++ b/types/Gitlab/GitlabMilestone.ts @@ -0,0 +1,19 @@ +interface GitlabMilestone { + id: number; + iid: number; + project_id: number; + title: string; + description: string; + state: string; + created_at: string; + updated_at: string; + due_date: string; + start_date: string; + web_url: string; + issue_stats: { + total: number; closed: number; + }; +} + + +export default GitlabMilestone; \ No newline at end of file diff --git a/types/Gitlab/GitlabRelease.ts b/types/Gitlab/GitlabRelease.ts new file mode 100644 index 0000000..a7c68d7 --- /dev/null +++ b/types/Gitlab/GitlabRelease.ts @@ -0,0 +1,29 @@ +import GitlabUser from './GitlabUser'; +import GitlabCommit from './GitlabCommit'; +import GitlabMilestone from './GitlabMilestone'; + + +interface GitlabRelease { + tag_name: string; + description: string; + created_at: string; + released_at: string; + author: GitlabUser; + commit: GitlabCommit; + milestones: Array<GitlabMilestone>; + commit_path: string; + tag_path: string; + assets: { + count: number; sources: Array<{ + format: string; url: string; + }>; links: Array<{ + id: number; name: string; url: string; link_type: string; + }>; evidence_file_path: string; + }; + evidences: Array<{ + sha: string; filepath: string; collected_at: string; + }>; +} + + +export default GitlabRelease; \ No newline at end of file diff --git a/types/Gitlab/GitlabRoute.ts b/types/Gitlab/GitlabRoute.ts index 76c3a80..bdeccc6 100644 --- a/types/Gitlab/GitlabRoute.ts +++ b/types/Gitlab/GitlabRoute.ts @@ -9,6 +9,7 @@ enum GitlabRoute { REPOSITORY_FORK = '/projects/{{id}}/fork', REPOSITORY_MEMBER_ADD = '/projects/{{id}}/members', REPOSITORY_MEMBERS_GET = '/projects/{{id}}/members/all', + REPOSITORY_RELEASES_GET = '/projects/{{id}}/releases', REPOSITORY_BADGES_ADD = '/projects/{{id}}/badges', REPOSITORY_VARIABLES_ADD = '/projects/{{id}}/variables', REPOSITORY_BRANCHES_PROTECT = '/projects/{{id}}/protected_branches', -- GitLab