@andrebuzeli/git-mcp 2.27.3 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +306 -306
- package/dist/client.js +298 -298
- package/dist/config.d.ts +310 -310
- package/dist/config.js +392 -392
- package/dist/index.d.ts +22 -22
- package/dist/index.js +89 -89
- package/dist/providers/base-provider.d.ts +160 -156
- package/dist/providers/base-provider.d.ts.map +1 -1
- package/dist/providers/base-provider.js +274 -260
- package/dist/providers/base-provider.js.map +1 -1
- package/dist/providers/error-handler.d.ts +50 -50
- package/dist/providers/error-handler.js +175 -175
- package/dist/providers/gitea-provider.d.ts +97 -97
- package/dist/providers/gitea-provider.js +1001 -1001
- package/dist/providers/github-provider.d.ts +104 -104
- package/dist/providers/github-provider.js +1234 -1234
- package/dist/providers/index.d.ts +12 -12
- package/dist/providers/index.js +40 -40
- package/dist/providers/provider-factory.d.ts +74 -74
- package/dist/providers/provider-factory.js +311 -311
- package/dist/providers/types.d.ts +318 -298
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +6 -6
- package/dist/server.d.ts +76 -76
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +306 -357
- package/dist/server.js.map +1 -1
- package/dist/tools/gh-actions.d.ts +252 -252
- package/dist/tools/gh-actions.js +389 -389
- package/dist/tools/gh-analytics.d.ts +263 -263
- package/dist/tools/gh-analytics.js +401 -401
- package/dist/tools/gh-code-review.d.ts +304 -304
- package/dist/tools/gh-code-review.js +512 -512
- package/dist/tools/gh-codespaces.d.ts +138 -138
- package/dist/tools/gh-codespaces.js +282 -282
- package/dist/tools/gh-deployments.d.ts +300 -300
- package/dist/tools/gh-deployments.js +367 -367
- package/dist/tools/gh-gists.d.ts +174 -174
- package/dist/tools/gh-gists.js +321 -321
- package/dist/tools/gh-projects.d.ts +205 -205
- package/dist/tools/gh-projects.js +358 -358
- package/dist/tools/gh-security.d.ts +274 -274
- package/dist/tools/gh-security.js +395 -395
- package/dist/tools/gh-sync.d.ts +213 -213
- package/dist/tools/gh-sync.js +378 -378
- package/dist/tools/gh-workflows.d.ts +290 -290
- package/dist/tools/gh-workflows.js +432 -432
- package/dist/tools/git-archive.d.ts +165 -165
- package/dist/tools/git-archive.js +233 -233
- package/dist/tools/git-branches.d.ts +430 -430
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +627 -530
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-bundle.d.ts +171 -171
- package/dist/tools/git-bundle.js +241 -241
- package/dist/tools/git-cherry-pick.d.ts +158 -158
- package/dist/tools/git-cherry-pick.js +224 -224
- package/dist/tools/git-commits.d.ts +485 -485
- package/dist/tools/git-commits.d.ts.map +1 -1
- package/dist/tools/git-commits.js +735 -625
- package/dist/tools/git-commits.js.map +1 -1
- package/dist/tools/git-config.d.ts +140 -140
- package/dist/tools/git-config.js +268 -268
- package/dist/tools/git-files.d.ts +486 -486
- package/dist/tools/git-files.js +607 -607
- package/dist/tools/git-issues.d.ts +571 -571
- package/dist/tools/git-issues.d.ts.map +1 -1
- package/dist/tools/git-issues.js +740 -693
- package/dist/tools/git-issues.js.map +1 -1
- package/dist/tools/git-pulls.d.ts +694 -694
- package/dist/tools/git-pulls.js +732 -732
- package/dist/tools/git-rebase.d.ts +137 -137
- package/dist/tools/git-rebase.js +213 -213
- package/dist/tools/git-releases.d.ts +487 -487
- package/dist/tools/git-releases.js +557 -557
- package/dist/tools/git-remote.d.ts +138 -138
- package/dist/tools/git-remote.js +274 -274
- package/dist/tools/git-repositories.d.ts +483 -483
- package/dist/tools/git-repositories.js +640 -640
- package/dist/tools/git-reset.d.ts +130 -130
- package/dist/tools/git-reset.js +223 -223
- package/dist/tools/git-revert.d.ts +149 -149
- package/dist/tools/git-revert.js +198 -198
- package/dist/tools/git-stash.d.ts +140 -140
- package/dist/tools/git-stash.js +269 -269
- package/dist/tools/git-submodule.d.ts +152 -152
- package/dist/tools/git-submodule.js +289 -289
- package/dist/tools/git-sync.d.ts +178 -166
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +312 -117
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +411 -411
- package/dist/tools/git-tags.js +485 -485
- package/dist/tools/git-webhooks.d.ts +470 -482
- package/dist/tools/git-webhooks.d.ts.map +1 -1
- package/dist/tools/git-webhooks.js +543 -555
- package/dist/tools/git-webhooks.js.map +1 -1
- package/dist/tools/git-worktree.d.ts +159 -159
- package/dist/tools/git-worktree.js +269 -269
- package/dist/tools/repositories.d.ts +405 -405
- package/dist/tools/repositories.js +569 -569
- package/dist/tools/users.d.ts +372 -372
- package/dist/tools/users.js +499 -499
- package/dist/tools/validator.d.ts +170 -170
- package/dist/tools/validator.js +194 -194
- package/dist/tools/version-control.d.ts +136 -136
- package/dist/tools/version-control.js +164 -164
- package/dist/utils/terminal-controller.d.ts +80 -80
- package/dist/utils/terminal-controller.js +345 -345
- package/dist/utils/user-detection.d.ts +24 -24
- package/dist/utils/user-detection.js +53 -53
- package/package.json +59 -59
package/dist/client.d.ts
CHANGED
|
@@ -1,307 +1,307 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cliente HTTP para API Gitea
|
|
3
|
-
*
|
|
4
|
-
* RESPONSABILIDADES:
|
|
5
|
-
* - Comunicação com API REST do Gitea
|
|
6
|
-
* - Gerenciamento de autenticação
|
|
7
|
-
* - Tratamento de requisições HTTP
|
|
8
|
-
* - Logging e debug de operações
|
|
9
|
-
*
|
|
10
|
-
* ARQUITETURA:
|
|
11
|
-
* - Cliente Axios configurável
|
|
12
|
-
* - Interceptors para logging
|
|
13
|
-
* - Tratamento centralizado de erros
|
|
14
|
-
* - Timeout configurável
|
|
15
|
-
*
|
|
16
|
-
* RECOMENDAÇÕES:
|
|
17
|
-
* - Configure timeout adequado para sua rede
|
|
18
|
-
* - Use HTTPS em produção
|
|
19
|
-
* - Rotacione tokens periodicamente
|
|
20
|
-
* - Monitore rate limits da API
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Interface para repositório Gitea
|
|
24
|
-
*
|
|
25
|
-
* PROPRIEDADES:
|
|
26
|
-
* - id: Identificador único do repositório
|
|
27
|
-
* - name: Nome do repositório
|
|
28
|
-
* - full_name: Nome completo (owner/repo)
|
|
29
|
-
* - description: Descrição do repositório
|
|
30
|
-
* - private: Se é privado ou público
|
|
31
|
-
* - fork: Se é um fork de outro repositório
|
|
32
|
-
* - html_url: URL para visualização web
|
|
33
|
-
* - clone_url: URL para clone HTTP
|
|
34
|
-
* - ssh_url: URL para clone SSH
|
|
35
|
-
* - default_branch: Branch padrão
|
|
36
|
-
* - created_at: Data de criação
|
|
37
|
-
* - updated_at: Data da última atualização
|
|
38
|
-
*/
|
|
39
|
-
export interface GiteaRepository {
|
|
40
|
-
id: number;
|
|
41
|
-
name: string;
|
|
42
|
-
full_name: string;
|
|
43
|
-
description: string;
|
|
44
|
-
private: boolean;
|
|
45
|
-
fork: boolean;
|
|
46
|
-
html_url: string;
|
|
47
|
-
clone_url: string;
|
|
48
|
-
ssh_url: string;
|
|
49
|
-
default_branch: string;
|
|
50
|
-
created_at: string;
|
|
51
|
-
updated_at: string;
|
|
52
|
-
}
|
|
53
|
-
export interface GiteaBranch {
|
|
54
|
-
name: string;
|
|
55
|
-
commit: {
|
|
56
|
-
id: string;
|
|
57
|
-
message: string;
|
|
58
|
-
author: {
|
|
59
|
-
name: string;
|
|
60
|
-
email: string;
|
|
61
|
-
date: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export interface GiteaFile {
|
|
66
|
-
name: string;
|
|
67
|
-
path: string;
|
|
68
|
-
sha: string;
|
|
69
|
-
size: number;
|
|
70
|
-
url: string;
|
|
71
|
-
html_url: string;
|
|
72
|
-
git_url: string;
|
|
73
|
-
download_url: string;
|
|
74
|
-
type: 'file' | 'dir';
|
|
75
|
-
content?: string;
|
|
76
|
-
encoding?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface GiteaCommit {
|
|
79
|
-
sha: string;
|
|
80
|
-
commit: {
|
|
81
|
-
message: string;
|
|
82
|
-
author: {
|
|
83
|
-
name: string;
|
|
84
|
-
email: string;
|
|
85
|
-
date: string;
|
|
86
|
-
};
|
|
87
|
-
committer: {
|
|
88
|
-
name: string;
|
|
89
|
-
email: string;
|
|
90
|
-
date: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
author: {
|
|
94
|
-
login: string;
|
|
95
|
-
avatar_url: string;
|
|
96
|
-
};
|
|
97
|
-
html_url: string;
|
|
98
|
-
}
|
|
99
|
-
export interface GiteaIssue {
|
|
100
|
-
id: number;
|
|
101
|
-
number: number;
|
|
102
|
-
title: string;
|
|
103
|
-
body: string;
|
|
104
|
-
state: 'open' | 'closed';
|
|
105
|
-
user: {
|
|
106
|
-
login: string;
|
|
107
|
-
avatar_url: string;
|
|
108
|
-
};
|
|
109
|
-
labels: Array<{
|
|
110
|
-
name: string;
|
|
111
|
-
color: string;
|
|
112
|
-
}>;
|
|
113
|
-
created_at: string;
|
|
114
|
-
updated_at: string;
|
|
115
|
-
html_url: string;
|
|
116
|
-
}
|
|
117
|
-
export interface GiteaPullRequest {
|
|
118
|
-
id: number;
|
|
119
|
-
number: number;
|
|
120
|
-
title: string;
|
|
121
|
-
body: string;
|
|
122
|
-
state: 'open' | 'closed' | 'merged';
|
|
123
|
-
user: {
|
|
124
|
-
login: string;
|
|
125
|
-
avatar_url: string;
|
|
126
|
-
};
|
|
127
|
-
head: {
|
|
128
|
-
ref: string;
|
|
129
|
-
sha: string;
|
|
130
|
-
};
|
|
131
|
-
base: {
|
|
132
|
-
ref: string;
|
|
133
|
-
sha: string;
|
|
134
|
-
};
|
|
135
|
-
mergeable: boolean;
|
|
136
|
-
merged: boolean;
|
|
137
|
-
created_at: string;
|
|
138
|
-
updated_at: string;
|
|
139
|
-
html_url: string;
|
|
140
|
-
}
|
|
141
|
-
export interface GiteaRelease {
|
|
142
|
-
id: number;
|
|
143
|
-
tag_name: string;
|
|
144
|
-
name: string;
|
|
145
|
-
body: string;
|
|
146
|
-
draft: boolean;
|
|
147
|
-
prerelease: boolean;
|
|
148
|
-
created_at: string;
|
|
149
|
-
published_at: string;
|
|
150
|
-
html_url: string;
|
|
151
|
-
tarball_url: string;
|
|
152
|
-
zipball_url: string;
|
|
153
|
-
}
|
|
154
|
-
export interface GiteaTag {
|
|
155
|
-
name: string;
|
|
156
|
-
commit: {
|
|
157
|
-
sha: string;
|
|
158
|
-
url: string;
|
|
159
|
-
};
|
|
160
|
-
zipball_url: string;
|
|
161
|
-
tarball_url: string;
|
|
162
|
-
}
|
|
163
|
-
export interface GiteaUser {
|
|
164
|
-
id: number;
|
|
165
|
-
login: string;
|
|
166
|
-
full_name: string;
|
|
167
|
-
email: string;
|
|
168
|
-
avatar_url: string;
|
|
169
|
-
website: string;
|
|
170
|
-
location: string;
|
|
171
|
-
bio: string;
|
|
172
|
-
public_repos: number;
|
|
173
|
-
followers: number;
|
|
174
|
-
following: number;
|
|
175
|
-
created_at: string;
|
|
176
|
-
}
|
|
177
|
-
export interface GiteaWebhook {
|
|
178
|
-
id: number;
|
|
179
|
-
type: string;
|
|
180
|
-
config: {
|
|
181
|
-
url: string;
|
|
182
|
-
content_type: string;
|
|
183
|
-
secret?: string;
|
|
184
|
-
};
|
|
185
|
-
events: string[];
|
|
186
|
-
active: boolean;
|
|
187
|
-
created_at: string;
|
|
188
|
-
updated_at: string;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Cliente principal para API Gitea
|
|
192
|
-
*
|
|
193
|
-
* RESPONSABILIDADES:
|
|
194
|
-
* - Configuração do cliente HTTP
|
|
195
|
-
* - Gerenciamento de autenticação
|
|
196
|
-
* - Implementação de todos os endpoints
|
|
197
|
-
* - Tratamento de erros e respostas
|
|
198
|
-
*
|
|
199
|
-
* ARQUITETURA:
|
|
200
|
-
* - Cliente Axios configurado
|
|
201
|
-
* - Headers de autenticação automáticos
|
|
202
|
-
* - Base URL configurável
|
|
203
|
-
* - Timeout configurável
|
|
204
|
-
*
|
|
205
|
-
* RECOMENDAÇÕES:
|
|
206
|
-
* - Use apenas uma instância por aplicação
|
|
207
|
-
* - Configure interceptors para logging
|
|
208
|
-
* - Trate erros de autenticação adequadamente
|
|
209
|
-
* - Monitore uso da API
|
|
210
|
-
*/
|
|
211
|
-
export declare class GiteaClient {
|
|
212
|
-
private axios;
|
|
213
|
-
private baseURL;
|
|
214
|
-
private providerFactory;
|
|
215
|
-
constructor();
|
|
216
|
-
/**
|
|
217
|
-
* Método helper para chamadas da API
|
|
218
|
-
*
|
|
219
|
-
* FUNCIONALIDADE:
|
|
220
|
-
* - Executa requisições HTTP para API Gitea
|
|
221
|
-
* - Trata erros de forma uniforme
|
|
222
|
-
* - Formata mensagens de erro
|
|
223
|
-
* - Suporta todos os métodos HTTP
|
|
224
|
-
*
|
|
225
|
-
* PARÂMETROS:
|
|
226
|
-
* - method: Método HTTP (GET, POST, PUT, DELETE, PATCH)
|
|
227
|
-
* - url: Endpoint da API
|
|
228
|
-
* - data: Dados para envio (opcional)
|
|
229
|
-
*
|
|
230
|
-
* TRATAMENTO DE ERROS:
|
|
231
|
-
* - Erros HTTP: formata com status e mensagem
|
|
232
|
-
* - Erros de rede: propaga erro original
|
|
233
|
-
* - Timeout: captura e formata adequadamente
|
|
234
|
-
*
|
|
235
|
-
* RECOMENDAÇÕES:
|
|
236
|
-
* - Use para todas as chamadas da API
|
|
237
|
-
* - Trate erros específicos por status
|
|
238
|
-
* - Implemente retry para erros temporários
|
|
239
|
-
*/
|
|
240
|
-
private request;
|
|
241
|
-
getRepositories(username?: string, page?: number, limit?: number): Promise<GiteaRepository[]>;
|
|
242
|
-
getRepository(owner: string, repo: string): Promise<GiteaRepository>;
|
|
243
|
-
createRepository(data: any): Promise<GiteaRepository>;
|
|
244
|
-
updateRepository(owner: string, repo: string, data: any): Promise<GiteaRepository>;
|
|
245
|
-
deleteRepository(owner: string, repo: string): Promise<void>;
|
|
246
|
-
forkRepository(owner: string, repo: string, organization?: string): Promise<GiteaRepository>;
|
|
247
|
-
searchRepositories(query: string, page?: number, limit?: number): Promise<{
|
|
248
|
-
data: GiteaRepository[];
|
|
249
|
-
}>;
|
|
250
|
-
getBranches(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaBranch[]>;
|
|
251
|
-
getBranch(owner: string, repo: string, branch: string): Promise<GiteaBranch>;
|
|
252
|
-
createBranch(owner: string, repo: string, branchName: string, fromBranch: string): Promise<GiteaBranch>;
|
|
253
|
-
deleteBranch(owner: string, repo: string, branch: string): Promise<void>;
|
|
254
|
-
getFile(owner: string, repo: string, path: string, ref?: string): Promise<GiteaFile>;
|
|
255
|
-
getDirectoryContents(owner: string, repo: string, path?: string, ref?: string): Promise<GiteaFile[]>;
|
|
256
|
-
createFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
257
|
-
updateFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
258
|
-
deleteFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
259
|
-
getCommits(owner: string, repo: string, page?: number, limit?: number, sha?: string): Promise<GiteaCommit[]>;
|
|
260
|
-
getCommit(owner: string, repo: string, sha: string): Promise<GiteaCommit>;
|
|
261
|
-
getIssues(owner: string, repo: string, state?: string, page?: number, limit?: number): Promise<GiteaIssue[]>;
|
|
262
|
-
getIssue(owner: string, repo: string, index: number): Promise<GiteaIssue>;
|
|
263
|
-
createIssue(owner: string, repo: string, data: any): Promise<GiteaIssue>;
|
|
264
|
-
updateIssue(owner: string, repo: string, index: number, data: any): Promise<GiteaIssue>;
|
|
265
|
-
createIssueComment(owner: string, repo: string, index: number, body: string): Promise<any>;
|
|
266
|
-
getPullRequests(owner: string, repo: string, state?: string, page?: number, limit?: number): Promise<GiteaPullRequest[]>;
|
|
267
|
-
getPullRequest(owner: string, repo: string, index: number): Promise<GiteaPullRequest>;
|
|
268
|
-
createPullRequest(owner: string, repo: string, data: any): Promise<GiteaPullRequest>;
|
|
269
|
-
updatePullRequest(owner: string, repo: string, index: number, data: any): Promise<GiteaPullRequest>;
|
|
270
|
-
mergePullRequest(owner: string, repo: string, index: number, data: any): Promise<any>;
|
|
271
|
-
getReleases(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaRelease[]>;
|
|
272
|
-
getRelease(owner: string, repo: string, id: number): Promise<GiteaRelease>;
|
|
273
|
-
getLatestRelease(owner: string, repo: string): Promise<GiteaRelease>;
|
|
274
|
-
createRelease(owner: string, repo: string, data: any): Promise<GiteaRelease>;
|
|
275
|
-
updateRelease(owner: string, repo: string, id: number, data: any): Promise<GiteaRelease>;
|
|
276
|
-
deleteRelease(owner: string, repo: string, id: number): Promise<void>;
|
|
277
|
-
getTags(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaTag[]>;
|
|
278
|
-
createTag(owner: string, repo: string, data: any): Promise<any>;
|
|
279
|
-
deleteTag(owner: string, repo: string, tag: string): Promise<void>;
|
|
280
|
-
getCurrentUser(): Promise<GiteaUser>;
|
|
281
|
-
getUser(username: string): Promise<GiteaUser>;
|
|
282
|
-
searchUsers(query: string, page?: number, limit?: number): Promise<{
|
|
283
|
-
data: GiteaUser[];
|
|
284
|
-
}>;
|
|
285
|
-
getUserOrganizations(username: string): Promise<any[]>;
|
|
286
|
-
getWebhooks(owner: string, repo: string): Promise<GiteaWebhook[]>;
|
|
287
|
-
getWebhook(owner: string, repo: string, id: number): Promise<GiteaWebhook>;
|
|
288
|
-
createWebhook(owner: string, repo: string, data: any): Promise<GiteaWebhook>;
|
|
289
|
-
updateWebhook(owner: string, repo: string, id: number, data: any): Promise<GiteaWebhook>;
|
|
290
|
-
deleteWebhook(owner: string, repo: string, id: number): Promise<void>;
|
|
291
|
-
testWebhook(owner: string, repo: string, id: number): Promise<any>;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Instância global do cliente Gitea
|
|
295
|
-
*
|
|
296
|
-
* USO:
|
|
297
|
-
* - import { giteaClient } from './client.js';
|
|
298
|
-
* - const repos = await giteaClient.getRepositories();
|
|
299
|
-
*
|
|
300
|
-
* RECOMENDAÇÕES:
|
|
301
|
-
* - Use esta instância para todas as operações
|
|
302
|
-
* - Não crie novas instâncias
|
|
303
|
-
* - Configure antes de usar
|
|
304
|
-
* - Monitore uso e performance
|
|
305
|
-
*/
|
|
306
|
-
export declare const giteaClient: GiteaClient;
|
|
1
|
+
/**
|
|
2
|
+
* Cliente HTTP para API Gitea
|
|
3
|
+
*
|
|
4
|
+
* RESPONSABILIDADES:
|
|
5
|
+
* - Comunicação com API REST do Gitea
|
|
6
|
+
* - Gerenciamento de autenticação
|
|
7
|
+
* - Tratamento de requisições HTTP
|
|
8
|
+
* - Logging e debug de operações
|
|
9
|
+
*
|
|
10
|
+
* ARQUITETURA:
|
|
11
|
+
* - Cliente Axios configurável
|
|
12
|
+
* - Interceptors para logging
|
|
13
|
+
* - Tratamento centralizado de erros
|
|
14
|
+
* - Timeout configurável
|
|
15
|
+
*
|
|
16
|
+
* RECOMENDAÇÕES:
|
|
17
|
+
* - Configure timeout adequado para sua rede
|
|
18
|
+
* - Use HTTPS em produção
|
|
19
|
+
* - Rotacione tokens periodicamente
|
|
20
|
+
* - Monitore rate limits da API
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Interface para repositório Gitea
|
|
24
|
+
*
|
|
25
|
+
* PROPRIEDADES:
|
|
26
|
+
* - id: Identificador único do repositório
|
|
27
|
+
* - name: Nome do repositório
|
|
28
|
+
* - full_name: Nome completo (owner/repo)
|
|
29
|
+
* - description: Descrição do repositório
|
|
30
|
+
* - private: Se é privado ou público
|
|
31
|
+
* - fork: Se é um fork de outro repositório
|
|
32
|
+
* - html_url: URL para visualização web
|
|
33
|
+
* - clone_url: URL para clone HTTP
|
|
34
|
+
* - ssh_url: URL para clone SSH
|
|
35
|
+
* - default_branch: Branch padrão
|
|
36
|
+
* - created_at: Data de criação
|
|
37
|
+
* - updated_at: Data da última atualização
|
|
38
|
+
*/
|
|
39
|
+
export interface GiteaRepository {
|
|
40
|
+
id: number;
|
|
41
|
+
name: string;
|
|
42
|
+
full_name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
private: boolean;
|
|
45
|
+
fork: boolean;
|
|
46
|
+
html_url: string;
|
|
47
|
+
clone_url: string;
|
|
48
|
+
ssh_url: string;
|
|
49
|
+
default_branch: string;
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
}
|
|
53
|
+
export interface GiteaBranch {
|
|
54
|
+
name: string;
|
|
55
|
+
commit: {
|
|
56
|
+
id: string;
|
|
57
|
+
message: string;
|
|
58
|
+
author: {
|
|
59
|
+
name: string;
|
|
60
|
+
email: string;
|
|
61
|
+
date: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface GiteaFile {
|
|
66
|
+
name: string;
|
|
67
|
+
path: string;
|
|
68
|
+
sha: string;
|
|
69
|
+
size: number;
|
|
70
|
+
url: string;
|
|
71
|
+
html_url: string;
|
|
72
|
+
git_url: string;
|
|
73
|
+
download_url: string;
|
|
74
|
+
type: 'file' | 'dir';
|
|
75
|
+
content?: string;
|
|
76
|
+
encoding?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface GiteaCommit {
|
|
79
|
+
sha: string;
|
|
80
|
+
commit: {
|
|
81
|
+
message: string;
|
|
82
|
+
author: {
|
|
83
|
+
name: string;
|
|
84
|
+
email: string;
|
|
85
|
+
date: string;
|
|
86
|
+
};
|
|
87
|
+
committer: {
|
|
88
|
+
name: string;
|
|
89
|
+
email: string;
|
|
90
|
+
date: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
author: {
|
|
94
|
+
login: string;
|
|
95
|
+
avatar_url: string;
|
|
96
|
+
};
|
|
97
|
+
html_url: string;
|
|
98
|
+
}
|
|
99
|
+
export interface GiteaIssue {
|
|
100
|
+
id: number;
|
|
101
|
+
number: number;
|
|
102
|
+
title: string;
|
|
103
|
+
body: string;
|
|
104
|
+
state: 'open' | 'closed';
|
|
105
|
+
user: {
|
|
106
|
+
login: string;
|
|
107
|
+
avatar_url: string;
|
|
108
|
+
};
|
|
109
|
+
labels: Array<{
|
|
110
|
+
name: string;
|
|
111
|
+
color: string;
|
|
112
|
+
}>;
|
|
113
|
+
created_at: string;
|
|
114
|
+
updated_at: string;
|
|
115
|
+
html_url: string;
|
|
116
|
+
}
|
|
117
|
+
export interface GiteaPullRequest {
|
|
118
|
+
id: number;
|
|
119
|
+
number: number;
|
|
120
|
+
title: string;
|
|
121
|
+
body: string;
|
|
122
|
+
state: 'open' | 'closed' | 'merged';
|
|
123
|
+
user: {
|
|
124
|
+
login: string;
|
|
125
|
+
avatar_url: string;
|
|
126
|
+
};
|
|
127
|
+
head: {
|
|
128
|
+
ref: string;
|
|
129
|
+
sha: string;
|
|
130
|
+
};
|
|
131
|
+
base: {
|
|
132
|
+
ref: string;
|
|
133
|
+
sha: string;
|
|
134
|
+
};
|
|
135
|
+
mergeable: boolean;
|
|
136
|
+
merged: boolean;
|
|
137
|
+
created_at: string;
|
|
138
|
+
updated_at: string;
|
|
139
|
+
html_url: string;
|
|
140
|
+
}
|
|
141
|
+
export interface GiteaRelease {
|
|
142
|
+
id: number;
|
|
143
|
+
tag_name: string;
|
|
144
|
+
name: string;
|
|
145
|
+
body: string;
|
|
146
|
+
draft: boolean;
|
|
147
|
+
prerelease: boolean;
|
|
148
|
+
created_at: string;
|
|
149
|
+
published_at: string;
|
|
150
|
+
html_url: string;
|
|
151
|
+
tarball_url: string;
|
|
152
|
+
zipball_url: string;
|
|
153
|
+
}
|
|
154
|
+
export interface GiteaTag {
|
|
155
|
+
name: string;
|
|
156
|
+
commit: {
|
|
157
|
+
sha: string;
|
|
158
|
+
url: string;
|
|
159
|
+
};
|
|
160
|
+
zipball_url: string;
|
|
161
|
+
tarball_url: string;
|
|
162
|
+
}
|
|
163
|
+
export interface GiteaUser {
|
|
164
|
+
id: number;
|
|
165
|
+
login: string;
|
|
166
|
+
full_name: string;
|
|
167
|
+
email: string;
|
|
168
|
+
avatar_url: string;
|
|
169
|
+
website: string;
|
|
170
|
+
location: string;
|
|
171
|
+
bio: string;
|
|
172
|
+
public_repos: number;
|
|
173
|
+
followers: number;
|
|
174
|
+
following: number;
|
|
175
|
+
created_at: string;
|
|
176
|
+
}
|
|
177
|
+
export interface GiteaWebhook {
|
|
178
|
+
id: number;
|
|
179
|
+
type: string;
|
|
180
|
+
config: {
|
|
181
|
+
url: string;
|
|
182
|
+
content_type: string;
|
|
183
|
+
secret?: string;
|
|
184
|
+
};
|
|
185
|
+
events: string[];
|
|
186
|
+
active: boolean;
|
|
187
|
+
created_at: string;
|
|
188
|
+
updated_at: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Cliente principal para API Gitea
|
|
192
|
+
*
|
|
193
|
+
* RESPONSABILIDADES:
|
|
194
|
+
* - Configuração do cliente HTTP
|
|
195
|
+
* - Gerenciamento de autenticação
|
|
196
|
+
* - Implementação de todos os endpoints
|
|
197
|
+
* - Tratamento de erros e respostas
|
|
198
|
+
*
|
|
199
|
+
* ARQUITETURA:
|
|
200
|
+
* - Cliente Axios configurado
|
|
201
|
+
* - Headers de autenticação automáticos
|
|
202
|
+
* - Base URL configurável
|
|
203
|
+
* - Timeout configurável
|
|
204
|
+
*
|
|
205
|
+
* RECOMENDAÇÕES:
|
|
206
|
+
* - Use apenas uma instância por aplicação
|
|
207
|
+
* - Configure interceptors para logging
|
|
208
|
+
* - Trate erros de autenticação adequadamente
|
|
209
|
+
* - Monitore uso da API
|
|
210
|
+
*/
|
|
211
|
+
export declare class GiteaClient {
|
|
212
|
+
private axios;
|
|
213
|
+
private baseURL;
|
|
214
|
+
private providerFactory;
|
|
215
|
+
constructor();
|
|
216
|
+
/**
|
|
217
|
+
* Método helper para chamadas da API
|
|
218
|
+
*
|
|
219
|
+
* FUNCIONALIDADE:
|
|
220
|
+
* - Executa requisições HTTP para API Gitea
|
|
221
|
+
* - Trata erros de forma uniforme
|
|
222
|
+
* - Formata mensagens de erro
|
|
223
|
+
* - Suporta todos os métodos HTTP
|
|
224
|
+
*
|
|
225
|
+
* PARÂMETROS:
|
|
226
|
+
* - method: Método HTTP (GET, POST, PUT, DELETE, PATCH)
|
|
227
|
+
* - url: Endpoint da API
|
|
228
|
+
* - data: Dados para envio (opcional)
|
|
229
|
+
*
|
|
230
|
+
* TRATAMENTO DE ERROS:
|
|
231
|
+
* - Erros HTTP: formata com status e mensagem
|
|
232
|
+
* - Erros de rede: propaga erro original
|
|
233
|
+
* - Timeout: captura e formata adequadamente
|
|
234
|
+
*
|
|
235
|
+
* RECOMENDAÇÕES:
|
|
236
|
+
* - Use para todas as chamadas da API
|
|
237
|
+
* - Trate erros específicos por status
|
|
238
|
+
* - Implemente retry para erros temporários
|
|
239
|
+
*/
|
|
240
|
+
private request;
|
|
241
|
+
getRepositories(username?: string, page?: number, limit?: number): Promise<GiteaRepository[]>;
|
|
242
|
+
getRepository(owner: string, repo: string): Promise<GiteaRepository>;
|
|
243
|
+
createRepository(data: any): Promise<GiteaRepository>;
|
|
244
|
+
updateRepository(owner: string, repo: string, data: any): Promise<GiteaRepository>;
|
|
245
|
+
deleteRepository(owner: string, repo: string): Promise<void>;
|
|
246
|
+
forkRepository(owner: string, repo: string, organization?: string): Promise<GiteaRepository>;
|
|
247
|
+
searchRepositories(query: string, page?: number, limit?: number): Promise<{
|
|
248
|
+
data: GiteaRepository[];
|
|
249
|
+
}>;
|
|
250
|
+
getBranches(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaBranch[]>;
|
|
251
|
+
getBranch(owner: string, repo: string, branch: string): Promise<GiteaBranch>;
|
|
252
|
+
createBranch(owner: string, repo: string, branchName: string, fromBranch: string): Promise<GiteaBranch>;
|
|
253
|
+
deleteBranch(owner: string, repo: string, branch: string): Promise<void>;
|
|
254
|
+
getFile(owner: string, repo: string, path: string, ref?: string): Promise<GiteaFile>;
|
|
255
|
+
getDirectoryContents(owner: string, repo: string, path?: string, ref?: string): Promise<GiteaFile[]>;
|
|
256
|
+
createFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
257
|
+
updateFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
258
|
+
deleteFile(owner: string, repo: string, path: string, data: any): Promise<any>;
|
|
259
|
+
getCommits(owner: string, repo: string, page?: number, limit?: number, sha?: string): Promise<GiteaCommit[]>;
|
|
260
|
+
getCommit(owner: string, repo: string, sha: string): Promise<GiteaCommit>;
|
|
261
|
+
getIssues(owner: string, repo: string, state?: string, page?: number, limit?: number): Promise<GiteaIssue[]>;
|
|
262
|
+
getIssue(owner: string, repo: string, index: number): Promise<GiteaIssue>;
|
|
263
|
+
createIssue(owner: string, repo: string, data: any): Promise<GiteaIssue>;
|
|
264
|
+
updateIssue(owner: string, repo: string, index: number, data: any): Promise<GiteaIssue>;
|
|
265
|
+
createIssueComment(owner: string, repo: string, index: number, body: string): Promise<any>;
|
|
266
|
+
getPullRequests(owner: string, repo: string, state?: string, page?: number, limit?: number): Promise<GiteaPullRequest[]>;
|
|
267
|
+
getPullRequest(owner: string, repo: string, index: number): Promise<GiteaPullRequest>;
|
|
268
|
+
createPullRequest(owner: string, repo: string, data: any): Promise<GiteaPullRequest>;
|
|
269
|
+
updatePullRequest(owner: string, repo: string, index: number, data: any): Promise<GiteaPullRequest>;
|
|
270
|
+
mergePullRequest(owner: string, repo: string, index: number, data: any): Promise<any>;
|
|
271
|
+
getReleases(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaRelease[]>;
|
|
272
|
+
getRelease(owner: string, repo: string, id: number): Promise<GiteaRelease>;
|
|
273
|
+
getLatestRelease(owner: string, repo: string): Promise<GiteaRelease>;
|
|
274
|
+
createRelease(owner: string, repo: string, data: any): Promise<GiteaRelease>;
|
|
275
|
+
updateRelease(owner: string, repo: string, id: number, data: any): Promise<GiteaRelease>;
|
|
276
|
+
deleteRelease(owner: string, repo: string, id: number): Promise<void>;
|
|
277
|
+
getTags(owner: string, repo: string, page?: number, limit?: number): Promise<GiteaTag[]>;
|
|
278
|
+
createTag(owner: string, repo: string, data: any): Promise<any>;
|
|
279
|
+
deleteTag(owner: string, repo: string, tag: string): Promise<void>;
|
|
280
|
+
getCurrentUser(): Promise<GiteaUser>;
|
|
281
|
+
getUser(username: string): Promise<GiteaUser>;
|
|
282
|
+
searchUsers(query: string, page?: number, limit?: number): Promise<{
|
|
283
|
+
data: GiteaUser[];
|
|
284
|
+
}>;
|
|
285
|
+
getUserOrganizations(username: string): Promise<any[]>;
|
|
286
|
+
getWebhooks(owner: string, repo: string): Promise<GiteaWebhook[]>;
|
|
287
|
+
getWebhook(owner: string, repo: string, id: number): Promise<GiteaWebhook>;
|
|
288
|
+
createWebhook(owner: string, repo: string, data: any): Promise<GiteaWebhook>;
|
|
289
|
+
updateWebhook(owner: string, repo: string, id: number, data: any): Promise<GiteaWebhook>;
|
|
290
|
+
deleteWebhook(owner: string, repo: string, id: number): Promise<void>;
|
|
291
|
+
testWebhook(owner: string, repo: string, id: number): Promise<any>;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Instância global do cliente Gitea
|
|
295
|
+
*
|
|
296
|
+
* USO:
|
|
297
|
+
* - import { giteaClient } from './client.js';
|
|
298
|
+
* - const repos = await giteaClient.getRepositories();
|
|
299
|
+
*
|
|
300
|
+
* RECOMENDAÇÕES:
|
|
301
|
+
* - Use esta instância para todas as operações
|
|
302
|
+
* - Não crie novas instâncias
|
|
303
|
+
* - Configure antes de usar
|
|
304
|
+
* - Monitore uso e performance
|
|
305
|
+
*/
|
|
306
|
+
export declare const giteaClient: GiteaClient;
|
|
307
307
|
//# sourceMappingURL=client.d.ts.map
|