@andrebuzeli/git-mcp 2.28.1 → 2.28.2

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.
Files changed (154) hide show
  1. package/dist/client.d.ts +306 -306
  2. package/dist/client.js +298 -298
  3. package/dist/config.d.ts +310 -310
  4. package/dist/config.js +392 -392
  5. package/dist/index.d.ts +22 -22
  6. package/dist/index.js +89 -89
  7. package/dist/providers/base-provider.d.ts +160 -160
  8. package/dist/providers/base-provider.js +274 -274
  9. package/dist/providers/error-handler.d.ts +50 -50
  10. package/dist/providers/error-handler.js +175 -175
  11. package/dist/providers/gitea-provider.d.ts +97 -97
  12. package/dist/providers/gitea-provider.d.ts.map +1 -1
  13. package/dist/providers/gitea-provider.js +1015 -1001
  14. package/dist/providers/gitea-provider.js.map +1 -1
  15. package/dist/providers/github-provider.d.ts +104 -104
  16. package/dist/providers/github-provider.d.ts.map +1 -1
  17. package/dist/providers/github-provider.js +1248 -1234
  18. package/dist/providers/github-provider.js.map +1 -1
  19. package/dist/providers/index.d.ts +12 -12
  20. package/dist/providers/index.js +40 -40
  21. package/dist/providers/provider-factory.d.ts +74 -74
  22. package/dist/providers/provider-factory.d.ts.map +1 -1
  23. package/dist/providers/provider-factory.js +318 -311
  24. package/dist/providers/provider-factory.js.map +1 -1
  25. package/dist/providers/types.d.ts +318 -318
  26. package/dist/providers/types.js +6 -6
  27. package/dist/server.d.ts +76 -76
  28. package/dist/server.js +306 -306
  29. package/dist/tools/git-archive.d.ts +165 -165
  30. package/dist/tools/git-archive.js +233 -233
  31. package/dist/tools/git-branches.d.ts +430 -430
  32. package/dist/tools/git-branches.js +627 -627
  33. package/dist/tools/git-commits.d.ts +485 -485
  34. package/dist/tools/git-commits.js +735 -735
  35. package/dist/tools/git-commits.js.map +1 -1
  36. package/dist/tools/git-config.d.ts +140 -140
  37. package/dist/tools/git-config.js +268 -268
  38. package/dist/tools/git-files.d.ts +486 -486
  39. package/dist/tools/git-files.js +607 -607
  40. package/dist/tools/git-files.js.map +1 -1
  41. package/dist/tools/git-issues.d.ts +574 -571
  42. package/dist/tools/git-issues.d.ts.map +1 -1
  43. package/dist/tools/git-issues.js +741 -740
  44. package/dist/tools/git-issues.js.map +1 -1
  45. package/dist/tools/git-pulls.d.ts +697 -694
  46. package/dist/tools/git-pulls.d.ts.map +1 -1
  47. package/dist/tools/git-pulls.js +733 -732
  48. package/dist/tools/git-pulls.js.map +1 -1
  49. package/dist/tools/git-releases.d.ts +490 -487
  50. package/dist/tools/git-releases.d.ts.map +1 -1
  51. package/dist/tools/git-releases.js +558 -557
  52. package/dist/tools/git-releases.js.map +1 -1
  53. package/dist/tools/git-remote.d.ts +138 -138
  54. package/dist/tools/git-remote.js +274 -274
  55. package/dist/tools/git-repositories.d.ts +483 -483
  56. package/dist/tools/git-repositories.js +640 -640
  57. package/dist/tools/git-repositories.js.map +1 -1
  58. package/dist/tools/git-reset.d.ts +130 -130
  59. package/dist/tools/git-reset.js +223 -223
  60. package/dist/tools/git-revert.d.ts +149 -149
  61. package/dist/tools/git-revert.js +198 -198
  62. package/dist/tools/git-stash.d.ts +140 -140
  63. package/dist/tools/git-stash.js +269 -269
  64. package/dist/tools/git-sync.d.ts +178 -178
  65. package/dist/tools/git-sync.js +312 -312
  66. package/dist/tools/git-tags.d.ts +414 -411
  67. package/dist/tools/git-tags.d.ts.map +1 -1
  68. package/dist/tools/git-tags.js +486 -485
  69. package/dist/tools/git-tags.js.map +1 -1
  70. package/dist/tools/git-webhooks.d.ts +473 -470
  71. package/dist/tools/git-webhooks.d.ts.map +1 -1
  72. package/dist/tools/git-webhooks.js +544 -543
  73. package/dist/tools/git-webhooks.js.map +1 -1
  74. package/dist/utils/terminal-controller.d.ts +80 -80
  75. package/dist/utils/terminal-controller.js +345 -345
  76. package/dist/utils/user-detection.d.ts +24 -24
  77. package/dist/utils/user-detection.js +53 -53
  78. package/package.json +2 -2
  79. package/dist/tools/gh-actions.d.ts +0 -253
  80. package/dist/tools/gh-actions.d.ts.map +0 -1
  81. package/dist/tools/gh-actions.js +0 -390
  82. package/dist/tools/gh-actions.js.map +0 -1
  83. package/dist/tools/gh-analytics.d.ts +0 -264
  84. package/dist/tools/gh-analytics.d.ts.map +0 -1
  85. package/dist/tools/gh-analytics.js +0 -402
  86. package/dist/tools/gh-analytics.js.map +0 -1
  87. package/dist/tools/gh-code-review.d.ts +0 -305
  88. package/dist/tools/gh-code-review.d.ts.map +0 -1
  89. package/dist/tools/gh-code-review.js +0 -513
  90. package/dist/tools/gh-code-review.js.map +0 -1
  91. package/dist/tools/gh-codespaces.d.ts +0 -139
  92. package/dist/tools/gh-codespaces.d.ts.map +0 -1
  93. package/dist/tools/gh-codespaces.js +0 -283
  94. package/dist/tools/gh-codespaces.js.map +0 -1
  95. package/dist/tools/gh-deployments.d.ts +0 -301
  96. package/dist/tools/gh-deployments.d.ts.map +0 -1
  97. package/dist/tools/gh-deployments.js +0 -368
  98. package/dist/tools/gh-deployments.js.map +0 -1
  99. package/dist/tools/gh-gists.d.ts +0 -175
  100. package/dist/tools/gh-gists.d.ts.map +0 -1
  101. package/dist/tools/gh-gists.js +0 -322
  102. package/dist/tools/gh-gists.js.map +0 -1
  103. package/dist/tools/gh-projects.d.ts +0 -206
  104. package/dist/tools/gh-projects.d.ts.map +0 -1
  105. package/dist/tools/gh-projects.js +0 -359
  106. package/dist/tools/gh-projects.js.map +0 -1
  107. package/dist/tools/gh-security.d.ts +0 -275
  108. package/dist/tools/gh-security.d.ts.map +0 -1
  109. package/dist/tools/gh-security.js +0 -396
  110. package/dist/tools/gh-security.js.map +0 -1
  111. package/dist/tools/gh-sync.d.ts +0 -214
  112. package/dist/tools/gh-sync.d.ts.map +0 -1
  113. package/dist/tools/gh-sync.js +0 -379
  114. package/dist/tools/gh-sync.js.map +0 -1
  115. package/dist/tools/gh-workflows.d.ts +0 -291
  116. package/dist/tools/gh-workflows.d.ts.map +0 -1
  117. package/dist/tools/gh-workflows.js +0 -433
  118. package/dist/tools/gh-workflows.js.map +0 -1
  119. package/dist/tools/git-bundle.d.ts +0 -172
  120. package/dist/tools/git-bundle.d.ts.map +0 -1
  121. package/dist/tools/git-bundle.js +0 -242
  122. package/dist/tools/git-bundle.js.map +0 -1
  123. package/dist/tools/git-cherry-pick.d.ts +0 -159
  124. package/dist/tools/git-cherry-pick.d.ts.map +0 -1
  125. package/dist/tools/git-cherry-pick.js +0 -225
  126. package/dist/tools/git-cherry-pick.js.map +0 -1
  127. package/dist/tools/git-rebase.d.ts +0 -138
  128. package/dist/tools/git-rebase.d.ts.map +0 -1
  129. package/dist/tools/git-rebase.js +0 -214
  130. package/dist/tools/git-rebase.js.map +0 -1
  131. package/dist/tools/git-submodule.d.ts +0 -153
  132. package/dist/tools/git-submodule.d.ts.map +0 -1
  133. package/dist/tools/git-submodule.js +0 -290
  134. package/dist/tools/git-submodule.js.map +0 -1
  135. package/dist/tools/git-worktree.d.ts +0 -160
  136. package/dist/tools/git-worktree.d.ts.map +0 -1
  137. package/dist/tools/git-worktree.js +0 -270
  138. package/dist/tools/git-worktree.js.map +0 -1
  139. package/dist/tools/repositories.d.ts +0 -406
  140. package/dist/tools/repositories.d.ts.map +0 -1
  141. package/dist/tools/repositories.js +0 -570
  142. package/dist/tools/repositories.js.map +0 -1
  143. package/dist/tools/users.d.ts +0 -373
  144. package/dist/tools/users.d.ts.map +0 -1
  145. package/dist/tools/users.js +0 -500
  146. package/dist/tools/users.js.map +0 -1
  147. package/dist/tools/validator.d.ts +0 -171
  148. package/dist/tools/validator.d.ts.map +0 -1
  149. package/dist/tools/validator.js +0 -195
  150. package/dist/tools/validator.js.map +0 -1
  151. package/dist/tools/version-control.d.ts +0 -137
  152. package/dist/tools/version-control.d.ts.map +0 -1
  153. package/dist/tools/version-control.js +0 -165
  154. package/dist/tools/version-control.js.map +0 -1
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