From cbb9f364ae70fb5f7a1599eb067efae9d55948ab Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sat, 28 Feb 2026 11:13:53 +0000 Subject: [PATCH] feat(gitlabclient): add deleteProject method to delete a project using GitLab API DELETE /api/v4/projects/:id --- changelog.md | 7 +++++++ ts/00_commitinfo_data.ts | 2 +- ts/gitlab.classes.gitlabclient.ts | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 819ab96..adbfc84 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-02-28 - 2.2.0 - feat(gitlabclient) +add deleteProject method to delete a project using GitLab API DELETE /api/v4/projects/:id + +- Adds GitlabClient.deleteProject(projectId: number | string): Promise. +- Implements DELETE /api/v4/projects/:id and URL-encodes the projectId. +- Non-breaking API addition — bump minor version. + ## 2026-02-28 - 2.1.0 - feat(gitlab) add group- and project-management methods to GitLab client diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 2f0f963..042cc66 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiclient.xyz/gitlab', - version: '2.1.0', + version: '2.2.0', description: 'A TypeScript client for the GitLab API, providing easy access to projects, groups, CI/CD variables, and pipelines.' } diff --git a/ts/gitlab.classes.gitlabclient.ts b/ts/gitlab.classes.gitlabclient.ts index 85b4684..9cf78cf 100644 --- a/ts/gitlab.classes.gitlabclient.ts +++ b/ts/gitlab.classes.gitlabclient.ts @@ -368,4 +368,15 @@ export class GitLabClient { `/api/v4/projects/${encodeURIComponent(projectId)}/pipelines/${pipelineId}/cancel`, ); } + + // --------------------------------------------------------------------------- + // Project Deletion + // --------------------------------------------------------------------------- + + public async deleteProject(projectId: number | string): Promise { + await this.request( + 'DELETE', + `/api/v4/projects/${encodeURIComponent(projectId)}`, + ); + } }