From 5423039f89fe40a61c06100c5b4e50c2a9f8ed36 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sat, 28 Feb 2026 11:13:36 +0000 Subject: [PATCH] feat(giteaclient): add deleteRepo method to delete a repository via Gitea API --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/gitea.classes.giteaclient.ts | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b120813..5f18f52 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-02-28 - 1.2.0 - feat(giteaclient) +add deleteRepo method to delete a repository via Gitea API + +- Implements deleteRepo(owner: string, repo: string): Promise +- Uses DELETE /api/v1/repos/{owner}/{repo} and encodes owner and repo with encodeURIComponent + ## 2026-02-28 - 1.1.0 - feat(orgs) add organization and organization-repository APIs: getOrg, getOrgRepos, createOrg, createOrgRepo diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 34a0869..cc38b43 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiclient.xyz/gitea', - version: '1.1.0', + version: '1.2.0', description: 'A TypeScript client for the Gitea API, providing easy access to repositories, organizations, secrets, and action runs.' } diff --git a/ts/gitea.classes.giteaclient.ts b/ts/gitea.classes.giteaclient.ts index 301fca0..2910cff 100644 --- a/ts/gitea.classes.giteaclient.ts +++ b/ts/gitea.classes.giteaclient.ts @@ -258,4 +258,15 @@ export class GiteaClient { public async cancelAction(ownerRepo: string, runId: number): Promise { await this.request('POST', `/api/v1/repos/${ownerRepo}/actions/runs/${runId}/cancel`); } + + // --------------------------------------------------------------------------- + // Repository Deletion + // --------------------------------------------------------------------------- + + public async deleteRepo(owner: string, repo: string): Promise { + await this.request( + 'DELETE', + `/api/v1/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, + ); + } }