2 Commits

Author SHA1 Message Date
1f41870be1 v1.2.0 2026-02-28 11:13:36 +00:00
5423039f89 feat(giteaclient): add deleteRepo method to delete a repository via Gitea API 2026-02-28 11:13:36 +00:00
4 changed files with 19 additions and 2 deletions

View File

@@ -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<void>
- 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

View File

@@ -1,6 +1,6 @@
{
"name": "@apiclient.xyz/gitea",
"version": "1.1.0",
"version": "1.2.0",
"private": false,
"description": "A TypeScript client for the Gitea API, providing easy access to repositories, organizations, secrets, and action runs.",
"main": "dist_ts/index.js",

View File

@@ -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.'
}

View File

@@ -258,4 +258,15 @@ export class GiteaClient {
public async cancelAction(ownerRepo: string, runId: number): Promise<void> {
await this.request('POST', `/api/v1/repos/${ownerRepo}/actions/runs/${runId}/cancel`);
}
// ---------------------------------------------------------------------------
// Repository Deletion
// ---------------------------------------------------------------------------
public async deleteRepo(owner: string, repo: string): Promise<void> {
await this.request(
'DELETE',
`/api/v1/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`,
);
}
}