feat(giteaclient): add deleteRepo method to delete a repository via Gitea API
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# 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)
|
## 2026-02-28 - 1.1.0 - feat(orgs)
|
||||||
add organization and organization-repository APIs: getOrg, getOrgRepos, createOrg, createOrgRepo
|
add organization and organization-repository APIs: getOrg, getOrgRepos, createOrg, createOrgRepo
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@apiclient.xyz/gitea',
|
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.'
|
description: 'A TypeScript client for the Gitea API, providing easy access to repositories, organizations, secrets, and action runs.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,4 +258,15 @@ export class GiteaClient {
|
|||||||
public async cancelAction(ownerRepo: string, runId: number): Promise<void> {
|
public async cancelAction(ownerRepo: string, runId: number): Promise<void> {
|
||||||
await this.request('POST', `/api/v1/repos/${ownerRepo}/actions/runs/${runId}/cancel`);
|
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)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user