gitverse-api-sdk 3.0.0 → 3.2.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.
Files changed (55) hide show
  1. package/README.md +99 -2
  2. package/dist/api/actions.d.ts +58 -39
  3. package/dist/api/actions.js +3 -3
  4. package/dist/api/actions.js.map +3 -3
  5. package/dist/api/branches.d.ts +26 -7
  6. package/dist/api/branches.js +3 -3
  7. package/dist/api/branches.js.map +3 -3
  8. package/dist/api/collaborators.d.ts +27 -8
  9. package/dist/api/collaborators.js +3 -3
  10. package/dist/api/collaborators.js.map +3 -3
  11. package/dist/api/commits.d.ts +28 -9
  12. package/dist/api/commits.js +3 -3
  13. package/dist/api/commits.js.map +3 -3
  14. package/dist/api/contents.d.ts +29 -10
  15. package/dist/api/contents.js +3 -3
  16. package/dist/api/contents.js.map +3 -3
  17. package/dist/api/emails.d.ts +28 -9
  18. package/dist/api/emails.js +3 -3
  19. package/dist/api/emails.js.map +3 -3
  20. package/dist/api/forks.d.ts +26 -7
  21. package/dist/api/forks.js +3 -3
  22. package/dist/api/forks.js.map +3 -3
  23. package/dist/api/git.d.ts +28 -9
  24. package/dist/api/git.js +3 -3
  25. package/dist/api/git.js.map +3 -3
  26. package/dist/api/issues.d.ts +31 -12
  27. package/dist/api/issues.js +3 -3
  28. package/dist/api/issues.js.map +3 -3
  29. package/dist/api/organizations.d.ts +26 -7
  30. package/dist/api/organizations.js +3 -3
  31. package/dist/api/organizations.js.map +3 -3
  32. package/dist/api/pulls.d.ts +40 -13
  33. package/dist/api/pulls.js +3 -3
  34. package/dist/api/pulls.js.map +3 -3
  35. package/dist/api/releases.d.ts +35 -16
  36. package/dist/api/releases.js +3 -3
  37. package/dist/api/releases.js.map +3 -3
  38. package/dist/api/repositories.d.ts +32 -13
  39. package/dist/api/repositories.js +3 -3
  40. package/dist/api/repositories.js.map +3 -3
  41. package/dist/api/stars.d.ts +29 -10
  42. package/dist/api/stars.js +3 -3
  43. package/dist/api/stars.js.map +3 -3
  44. package/dist/api/teams.d.ts +29 -10
  45. package/dist/api/teams.js +3 -3
  46. package/dist/api/teams.js.map +3 -3
  47. package/dist/api/users.d.ts +27 -8
  48. package/dist/api/users.js +3 -3
  49. package/dist/api/users.js.map +3 -3
  50. package/dist/client.d.ts +25 -6
  51. package/dist/client.js +3 -3
  52. package/dist/client.js.map +3 -3
  53. package/dist/index.d.ts +124 -97
  54. package/dist/types.d.ts +14 -1
  55. package/package.json +1 -1
@@ -1,4 +1,17 @@
1
1
  /**
2
+ * Опции для выполнения HTTP-запросов
3
+ */
4
+ interface RequestOptions {
5
+ /**
6
+ * AbortSignal для отмены запроса
7
+ * @example
8
+ * const controller = new AbortController();
9
+ * const promise = client.users.getCurrent({ signal: controller.signal });
10
+ * controller.abort(); // Отменяет запрос
11
+ */
12
+ signal?: AbortSignal;
13
+ }
14
+ /**
2
15
  * Интерфейс ветки репозитория
3
16
  */
4
17
  interface Branch {
@@ -93,45 +106,51 @@ declare class GitVerseClient {
93
106
  * @param path Путь к API-ресурсу
94
107
  * @param method HTTP-метод
95
108
  * @param body Тело запроса (опционально)
109
+ * @param options Опции запроса (опционально)
96
110
  * @returns Ответ от API
97
111
  * @throws {RateLimitError} При превышении лимита запросов (429)
98
112
  * @throws {GitVerseApiError} При других ошибках API
99
113
  */
100
- request<T>(path: string, method: HTTPMethods, body?: unknown): Promise<T>;
114
+ request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
101
115
  /**
102
116
  * Выполняет GET-запрос
103
117
  * @param path Путь к API-ресурсу
118
+ * @param options Опции запроса (опционально)
104
119
  * @returns Ответ от API
105
120
  */
106
- get<T>(path: string): Promise<T>;
121
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
107
122
  /**
108
123
  * Выполняет POST-запрос
109
124
  * @param path Путь к API-ресурсу
110
125
  * @param body Тело запроса
126
+ * @param options Опции запроса (опционально)
111
127
  * @returns Ответ от API
112
128
  */
113
- post<T>(path: string, body?: unknown): Promise<T>;
129
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
114
130
  /**
115
131
  * Выполняет PUT-запрос
116
132
  * @param path Путь к API-ресурсу
117
133
  * @param body Тело запроса
134
+ * @param options Опции запроса (опционально)
118
135
  * @returns Ответ от API
119
136
  */
120
- put<T>(path: string, body?: unknown): Promise<T>;
137
+ put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
121
138
  /**
122
139
  * Выполняет DELETE-запрос
123
140
  * @param path Путь к API-ресурсу
124
141
  * @param body Тело запроса (опционально)
142
+ * @param options Опции запроса (опционально)
125
143
  * @returns Ответ от API
126
144
  */
127
- delete<T>(path: string, body?: unknown): Promise<T>;
145
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
128
146
  /**
129
147
  * Выполняет PATCH-запрос
130
148
  * @param path Путь к API-ресурсу
131
149
  * @param body Тело запроса
150
+ * @param options Опции запроса (опционально)
132
151
  * @returns Ответ от API
133
152
  */
134
- patch<T>(path: string, body?: unknown): Promise<T>;
153
+ patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
135
154
  }
136
155
  /**
137
156
  * API для работы с ветками репозитория
@@ -149,6 +168,6 @@ declare class BranchesApi {
149
168
  * @param repo Название репозитория
150
169
  * @returns Список веток
151
170
  */
152
- list(owner: string, repo: string): Promise<Branch[]>;
171
+ list(owner: string, repo: string, options?: RequestOptions): Promise<Branch[]>;
153
172
  }
154
173
  export { BranchesApi };
@@ -1,4 +1,4 @@
1
- class f{client;constructor(b){this.client=b}list(b,d){return this.client.get(`/repos/${b}/${d}/branches`)}}export{f as BranchesApi};
2
- export{f};
1
+ class g{client;constructor(b){this.client=b}list(b,d,f){return this.client.get(`/repos/${b}/${d}/branches`,f)}}export{g as BranchesApi};
2
+ export{g as f};
3
3
 
4
- //# debugId=FD830EC0D6616EE464756E2164756E21
4
+ //# debugId=79E99ECBC61D671C64756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/api/branches.ts"],
4
4
  "sourcesContent": [
5
- "import type { GitVerseClient } from \"../client\";\nimport type { Branch } from \"../types\";\n\n/**\n * API для работы с ветками репозитория\n */\nexport class BranchesApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с ветками\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список веток репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список веток\n */\n list(owner: string, repo: string): Promise<Branch[]> {\n return this.client.get<Branch[]>(`/repos/${owner}/${repo}/branches`);\n }\n}\n"
5
+ "import type { GitVerseClient } from \"../client\";\nimport type { Branch, RequestOptions } from \"../types\";\n\n/**\n * API для работы с ветками репозитория\n */\nexport class BranchesApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с ветками\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список веток репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список веток\n */\n list(owner: string, repo: string, options?: RequestOptions): Promise<Branch[]> {\n return this.client.get<Branch[]>(`/repos/${owner}/${repo}/branches`, options);\n }\n}\n"
6
6
  ],
7
- "mappings": "AAMO,MAAM,CAAY,CACf,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAAiC,CACnD,OAAO,KAAK,OAAO,IAAc,UAAU,KAAS,YAAe,EAEvE",
8
- "debugId": "FD830EC0D6616EE464756E2164756E21",
7
+ "mappings": "AAMO,MAAM,CAAY,CACf,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAAc,EAA6C,CAC7E,OAAO,KAAK,OAAO,IAAc,UAAU,KAAS,aAAiB,CAAO,EAEhF",
8
+ "debugId": "79E99ECBC61D671C64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -22,6 +22,19 @@ declare const VisibilityType: {
22
22
  */
23
23
  type VisibilityType = (typeof VisibilityType)[keyof typeof VisibilityType];
24
24
  /**
25
+ * Опции для выполнения HTTP-запросов
26
+ */
27
+ interface RequestOptions {
28
+ /**
29
+ * AbortSignal для отмены запроса
30
+ * @example
31
+ * const controller = new AbortController();
32
+ * const promise = client.users.getCurrent({ signal: controller.signal });
33
+ * controller.abort(); // Отменяет запрос
34
+ */
35
+ signal?: AbortSignal;
36
+ }
37
+ /**
25
38
  * Интерфейс пользователя
26
39
  */
27
40
  interface User2 {
@@ -155,45 +168,51 @@ declare class GitVerseClient {
155
168
  * @param path Путь к API-ресурсу
156
169
  * @param method HTTP-метод
157
170
  * @param body Тело запроса (опционально)
171
+ * @param options Опции запроса (опционально)
158
172
  * @returns Ответ от API
159
173
  * @throws {RateLimitError} При превышении лимита запросов (429)
160
174
  * @throws {GitVerseApiError} При других ошибках API
161
175
  */
162
- request<T>(path: string, method: HTTPMethods, body?: unknown): Promise<T>;
176
+ request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
163
177
  /**
164
178
  * Выполняет GET-запрос
165
179
  * @param path Путь к API-ресурсу
180
+ * @param options Опции запроса (опционально)
166
181
  * @returns Ответ от API
167
182
  */
168
- get<T>(path: string): Promise<T>;
183
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
169
184
  /**
170
185
  * Выполняет POST-запрос
171
186
  * @param path Путь к API-ресурсу
172
187
  * @param body Тело запроса
188
+ * @param options Опции запроса (опционально)
173
189
  * @returns Ответ от API
174
190
  */
175
- post<T>(path: string, body?: unknown): Promise<T>;
191
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
176
192
  /**
177
193
  * Выполняет PUT-запрос
178
194
  * @param path Путь к API-ресурсу
179
195
  * @param body Тело запроса
196
+ * @param options Опции запроса (опционально)
180
197
  * @returns Ответ от API
181
198
  */
182
- put<T>(path: string, body?: unknown): Promise<T>;
199
+ put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
183
200
  /**
184
201
  * Выполняет DELETE-запрос
185
202
  * @param path Путь к API-ресурсу
186
203
  * @param body Тело запроса (опционально)
204
+ * @param options Опции запроса (опционально)
187
205
  * @returns Ответ от API
188
206
  */
189
- delete<T>(path: string, body?: unknown): Promise<T>;
207
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
190
208
  /**
191
209
  * Выполняет PATCH-запрос
192
210
  * @param path Путь к API-ресурсу
193
211
  * @param body Тело запроса
212
+ * @param options Опции запроса (опционально)
194
213
  * @returns Ответ от API
195
214
  */
196
- patch<T>(path: string, body?: unknown): Promise<T>;
215
+ patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
197
216
  }
198
217
  /**
199
218
  * API для работы с коллабораторами репозитория
@@ -211,7 +230,7 @@ declare class CollaboratorsApi {
211
230
  * @param repo Название репозитория
212
231
  * @returns Список коллабораторов
213
232
  */
214
- list(owner: string, repo: string): Promise<User2[]>;
233
+ list(owner: string, repo: string, options?: RequestOptions): Promise<User2[]>;
215
234
  /**
216
235
  * Добавляет коллаборатора к репозиторию
217
236
  * @param owner Владелец репозитория
@@ -219,6 +238,6 @@ declare class CollaboratorsApi {
219
238
  * @param collaborator Имя пользователя коллаборатора
220
239
  * @returns Результат операции
221
240
  */
222
- add(owner: string, repo: string, collaborator: string): Promise<void>;
241
+ add(owner: string, repo: string, collaborator: string, options?: RequestOptions): Promise<void>;
223
242
  }
224
243
  export { CollaboratorsApi };
@@ -1,4 +1,4 @@
1
- class h{client;constructor(d){this.client=d}list(d,f){return this.client.get(`/repos/${d}/${f}/collaborators`)}add(d,f,g){return this.client.put(`/repos/${d}/${f}/collaborators/${g}`,{})}}export{h as CollaboratorsApi};
2
- export{h};
1
+ class j{client;constructor(d){this.client=d}list(d,f,g){return this.client.get(`/repos/${d}/${f}/collaborators`,g)}add(d,f,g,h){return this.client.put(`/repos/${d}/${f}/collaborators/${g}`,{},h)}}export{j as CollaboratorsApi};
2
+ export{j as h};
3
3
 
4
- //# debugId=38159AA44FAD0CBE64756E2164756E21
4
+ //# debugId=FF187BC34C8D596D64756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/api/collaborators.ts"],
4
4
  "sourcesContent": [
5
- "import type { GitVerseClient } from \"../client\";\nimport type { User } from \"../types\";\n\n/**\n * API для работы с коллабораторами репозитория\n */\nexport class CollaboratorsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с коллабораторами\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список коллабораторов репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список коллабораторов\n */\n list(owner: string, repo: string): Promise<User[]> {\n return this.client.get<User[]>(`/repos/${owner}/${repo}/collaborators`);\n }\n\n /**\n * Добавляет коллаборатора к репозиторию\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param collaborator Имя пользователя коллаборатора\n * @returns Результат операции\n */\n add(owner: string, repo: string, collaborator: string): Promise<void> {\n return this.client.put<void>(`/repos/${owner}/${repo}/collaborators/${collaborator}`, {});\n }\n}\n"
5
+ "import type { GitVerseClient } from \"../client\";\nimport type { RequestOptions, User } from \"../types\";\n\n/**\n * API для работы с коллабораторами репозитория\n */\nexport class CollaboratorsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с коллабораторами\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список коллабораторов репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список коллабораторов\n */\n list(owner: string, repo: string, options?: RequestOptions): Promise<User[]> {\n return this.client.get<User[]>(`/repos/${owner}/${repo}/collaborators`, options);\n }\n\n /**\n * Добавляет коллаборатора к репозиторию\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param collaborator Имя пользователя коллаборатора\n * @returns Результат операции\n */\n add(owner: string, repo: string, collaborator: string, options?: RequestOptions): Promise<void> {\n return this.client.put<void>(`/repos/${owner}/${repo}/collaborators/${collaborator}`, {}, options);\n }\n}\n"
6
6
  ],
7
- "mappings": "AAMO,MAAM,CAAiB,CACpB,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAA+B,CACjD,OAAO,KAAK,OAAO,IAAY,UAAU,KAAS,iBAAoB,EAUxE,GAAG,CAAC,EAAe,EAAc,EAAqC,CACpE,OAAO,KAAK,OAAO,IAAU,UAAU,KAAS,mBAAsB,IAAgB,CAAC,CAAC,EAE5F",
8
- "debugId": "38159AA44FAD0CBE64756E2164756E21",
7
+ "mappings": "AAMO,MAAM,CAAiB,CACpB,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAAc,EAA2C,CAC3E,OAAO,KAAK,OAAO,IAAY,UAAU,KAAS,kBAAsB,CAAO,EAUjF,GAAG,CAAC,EAAe,EAAc,EAAsB,EAAyC,CAC9F,OAAO,KAAK,OAAO,IAAU,UAAU,KAAS,mBAAsB,IAAgB,CAAC,EAAG,CAAO,EAErG",
8
+ "debugId": "FF187BC34C8D596D64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -22,6 +22,19 @@ declare const VisibilityType: {
22
22
  */
23
23
  type VisibilityType = (typeof VisibilityType)[keyof typeof VisibilityType];
24
24
  /**
25
+ * Опции для выполнения HTTP-запросов
26
+ */
27
+ interface RequestOptions {
28
+ /**
29
+ * AbortSignal для отмены запроса
30
+ * @example
31
+ * const controller = new AbortController();
32
+ * const promise = client.users.getCurrent({ signal: controller.signal });
33
+ * controller.abort(); // Отменяет запрос
34
+ */
35
+ signal?: AbortSignal;
36
+ }
37
+ /**
25
38
  * Интерфейс пользователя
26
39
  */
27
40
  interface User2 {
@@ -225,45 +238,51 @@ declare class GitVerseClient {
225
238
  * @param path Путь к API-ресурсу
226
239
  * @param method HTTP-метод
227
240
  * @param body Тело запроса (опционально)
241
+ * @param options Опции запроса (опционально)
228
242
  * @returns Ответ от API
229
243
  * @throws {RateLimitError} При превышении лимита запросов (429)
230
244
  * @throws {GitVerseApiError} При других ошибках API
231
245
  */
232
- request<T>(path: string, method: HTTPMethods, body?: unknown): Promise<T>;
246
+ request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
233
247
  /**
234
248
  * Выполняет GET-запрос
235
249
  * @param path Путь к API-ресурсу
250
+ * @param options Опции запроса (опционально)
236
251
  * @returns Ответ от API
237
252
  */
238
- get<T>(path: string): Promise<T>;
253
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
239
254
  /**
240
255
  * Выполняет POST-запрос
241
256
  * @param path Путь к API-ресурсу
242
257
  * @param body Тело запроса
258
+ * @param options Опции запроса (опционально)
243
259
  * @returns Ответ от API
244
260
  */
245
- post<T>(path: string, body?: unknown): Promise<T>;
261
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
246
262
  /**
247
263
  * Выполняет PUT-запрос
248
264
  * @param path Путь к API-ресурсу
249
265
  * @param body Тело запроса
266
+ * @param options Опции запроса (опционально)
250
267
  * @returns Ответ от API
251
268
  */
252
- put<T>(path: string, body?: unknown): Promise<T>;
269
+ put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
253
270
  /**
254
271
  * Выполняет DELETE-запрос
255
272
  * @param path Путь к API-ресурсу
256
273
  * @param body Тело запроса (опционально)
274
+ * @param options Опции запроса (опционально)
257
275
  * @returns Ответ от API
258
276
  */
259
- delete<T>(path: string, body?: unknown): Promise<T>;
277
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
260
278
  /**
261
279
  * Выполняет PATCH-запрос
262
280
  * @param path Путь к API-ресурсу
263
281
  * @param body Тело запроса
282
+ * @param options Опции запроса (опционально)
264
283
  * @returns Ответ от API
265
284
  */
266
- patch<T>(path: string, body?: unknown): Promise<T>;
285
+ patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
267
286
  }
268
287
  /**
269
288
  * API для работы с коммитами
@@ -281,7 +300,7 @@ declare class CommitsApi {
281
300
  * @param repo Название репозитория
282
301
  * @returns Список коммитов
283
302
  */
284
- list(owner: string, repo: string): Promise<Commit[]>;
303
+ list(owner: string, repo: string, options?: RequestOptions): Promise<Commit[]>;
285
304
  /**
286
305
  * Получает информацию о коммите по SHA
287
306
  * @param owner Владелец репозитория
@@ -289,7 +308,7 @@ declare class CommitsApi {
289
308
  * @param sha SHA-хеш коммита
290
309
  * @returns Информация о коммите
291
310
  */
292
- get(owner: string, repo: string, sha: string): Promise<Commit>;
311
+ get(owner: string, repo: string, sha: string, options?: RequestOptions): Promise<Commit>;
293
312
  /**
294
313
  * Создает новый коммит
295
314
  * @param owner Владелец репозитория
@@ -297,6 +316,6 @@ declare class CommitsApi {
297
316
  * @param params Параметры создания коммита
298
317
  * @returns Созданный коммит
299
318
  */
300
- create(owner: string, repo: string, params: CreateCommitParams): Promise<Commit>;
319
+ create(owner: string, repo: string, params: CreateCommitParams, options?: RequestOptions): Promise<Commit>;
301
320
  }
302
321
  export { CommitsApi };
@@ -1,4 +1,4 @@
1
- class g{client;constructor(b){this.client=b}list(b,d){return this.client.get(`/repos/${b}/${d}/commits`)}get(b,d,f){return this.client.get(`/repos/${b}/${d}/commits/${f}`)}create(b,d,f){return this.client.post(`/repos/${b}/${d}/git/commits`,f)}}export{g as CommitsApi};
2
- export{g as b};
1
+ class j{client;constructor(b){this.client=b}list(b,d,f){return this.client.get(`/repos/${b}/${d}/commits`,f)}get(b,d,f,g){return this.client.get(`/repos/${b}/${d}/commits/${f}`,g)}create(b,d,f,g){return this.client.post(`/repos/${b}/${d}/git/commits`,f,g)}}export{j as CommitsApi};
2
+ export{j as b};
3
3
 
4
- //# debugId=61215F457F0A502764756E2164756E21
4
+ //# debugId=F06CF184BC49D77864756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/api/commits.ts"],
4
4
  "sourcesContent": [
5
- "import type { GitVerseClient } from \"../client\";\nimport type { Commit, CreateCommitParams } from \"../types\";\n\n/**\n * API для работы с коммитами\n */\nexport class CommitsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с коммитами\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список коммитов в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список коммитов\n */\n list(owner: string, repo: string): Promise<Commit[]> {\n return this.client.get<Commit[]>(`/repos/${owner}/${repo}/commits`);\n }\n\n /**\n * Получает информацию о коммите по SHA\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param sha SHA-хеш коммита\n * @returns Информация о коммите\n */\n get(owner: string, repo: string, sha: string): Promise<Commit> {\n return this.client.get<Commit>(`/repos/${owner}/${repo}/commits/${sha}`);\n }\n\n /**\n * Создает новый коммит\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param params Параметры создания коммита\n * @returns Созданный коммит\n */\n create(owner: string, repo: string, params: CreateCommitParams): Promise<Commit> {\n return this.client.post<Commit>(`/repos/${owner}/${repo}/git/commits`, params);\n }\n}\n"
5
+ "import type { GitVerseClient } from \"../client\";\nimport type { Commit, CreateCommitParams, RequestOptions } from \"../types\";\n\n/**\n * API для работы с коммитами\n */\nexport class CommitsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с коммитами\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает список коммитов в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @returns Список коммитов\n */\n list(owner: string, repo: string, options?: RequestOptions): Promise<Commit[]> {\n return this.client.get<Commit[]>(`/repos/${owner}/${repo}/commits`, options);\n }\n\n /**\n * Получает информацию о коммите по SHA\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param sha SHA-хеш коммита\n * @returns Информация о коммите\n */\n get(owner: string, repo: string, sha: string, options?: RequestOptions): Promise<Commit> {\n return this.client.get<Commit>(`/repos/${owner}/${repo}/commits/${sha}`, options);\n }\n\n /**\n * Создает новый коммит\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param params Параметры создания коммита\n * @returns Созданный коммит\n */\n create(owner: string, repo: string, params: CreateCommitParams, options?: RequestOptions): Promise<Commit> {\n return this.client.post<Commit>(`/repos/${owner}/${repo}/git/commits`, params, options);\n }\n}\n"
6
6
  ],
7
- "mappings": "AAMO,MAAM,CAAW,CACd,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAAiC,CACnD,OAAO,KAAK,OAAO,IAAc,UAAU,KAAS,WAAc,EAUpE,GAAG,CAAC,EAAe,EAAc,EAA8B,CAC7D,OAAO,KAAK,OAAO,IAAY,UAAU,KAAS,aAAgB,GAAK,EAUzE,MAAM,CAAC,EAAe,EAAc,EAA6C,CAC/E,OAAO,KAAK,OAAO,KAAa,UAAU,KAAS,gBAAoB,CAAM,EAEjF",
8
- "debugId": "61215F457F0A502764756E2164756E21",
7
+ "mappings": "AAMO,MAAM,CAAW,CACd,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAShB,IAAI,CAAC,EAAe,EAAc,EAA6C,CAC7E,OAAO,KAAK,OAAO,IAAc,UAAU,KAAS,YAAgB,CAAO,EAU7E,GAAG,CAAC,EAAe,EAAc,EAAa,EAA2C,CACvF,OAAO,KAAK,OAAO,IAAY,UAAU,KAAS,aAAgB,IAAO,CAAO,EAUlF,MAAM,CAAC,EAAe,EAAc,EAA4B,EAA2C,CACzG,OAAO,KAAK,OAAO,KAAa,UAAU,KAAS,gBAAoB,EAAQ,CAAO,EAE1F",
8
+ "debugId": "F06CF184BC49D77864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -10,6 +10,19 @@ declare const ContentType: {
10
10
  */
11
11
  type ContentType = (typeof ContentType)[keyof typeof ContentType];
12
12
  /**
13
+ * Опции для выполнения HTTP-запросов
14
+ */
15
+ interface RequestOptions {
16
+ /**
17
+ * AbortSignal для отмены запроса
18
+ * @example
19
+ * const controller = new AbortController();
20
+ * const promise = client.users.getCurrent({ signal: controller.signal });
21
+ * controller.abort(); // Отменяет запрос
22
+ */
23
+ signal?: AbortSignal;
24
+ }
25
+ /**
13
26
  * Интерфейс информации о файле
14
27
  */
15
28
  interface FileContent {
@@ -256,45 +269,51 @@ declare class GitVerseClient {
256
269
  * @param path Путь к API-ресурсу
257
270
  * @param method HTTP-метод
258
271
  * @param body Тело запроса (опционально)
272
+ * @param options Опции запроса (опционально)
259
273
  * @returns Ответ от API
260
274
  * @throws {RateLimitError} При превышении лимита запросов (429)
261
275
  * @throws {GitVerseApiError} При других ошибках API
262
276
  */
263
- request<T>(path: string, method: HTTPMethods, body?: unknown): Promise<T>;
277
+ request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
264
278
  /**
265
279
  * Выполняет GET-запрос
266
280
  * @param path Путь к API-ресурсу
281
+ * @param options Опции запроса (опционально)
267
282
  * @returns Ответ от API
268
283
  */
269
- get<T>(path: string): Promise<T>;
284
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
270
285
  /**
271
286
  * Выполняет POST-запрос
272
287
  * @param path Путь к API-ресурсу
273
288
  * @param body Тело запроса
289
+ * @param options Опции запроса (опционально)
274
290
  * @returns Ответ от API
275
291
  */
276
- post<T>(path: string, body?: unknown): Promise<T>;
292
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
277
293
  /**
278
294
  * Выполняет PUT-запрос
279
295
  * @param path Путь к API-ресурсу
280
296
  * @param body Тело запроса
297
+ * @param options Опции запроса (опционально)
281
298
  * @returns Ответ от API
282
299
  */
283
- put<T>(path: string, body?: unknown): Promise<T>;
300
+ put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
284
301
  /**
285
302
  * Выполняет DELETE-запрос
286
303
  * @param path Путь к API-ресурсу
287
304
  * @param body Тело запроса (опционально)
305
+ * @param options Опции запроса (опционально)
288
306
  * @returns Ответ от API
289
307
  */
290
- delete<T>(path: string, body?: unknown): Promise<T>;
308
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
291
309
  /**
292
310
  * Выполняет PATCH-запрос
293
311
  * @param path Путь к API-ресурсу
294
312
  * @param body Тело запроса
313
+ * @param options Опции запроса (опционально)
295
314
  * @returns Ответ от API
296
315
  */
297
- patch<T>(path: string, body?: unknown): Promise<T>;
316
+ patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
298
317
  }
299
318
  /**
300
319
  * API для работы с содержимым репозитория (файлами и папками)
@@ -313,7 +332,7 @@ declare class ContentsApi {
313
332
  * @param path Путь к файлу или директории
314
333
  * @returns Содержимое файла или директории
315
334
  */
316
- get(owner: string, repo: string, path: string): Promise<Content>;
335
+ get(owner: string, repo: string, path: string, options?: RequestOptions): Promise<Content>;
317
336
  /**
318
337
  * Создает новый файл в репозитории
319
338
  * @param owner Владелец репозитория
@@ -322,7 +341,7 @@ declare class ContentsApi {
322
341
  * @param params Параметры создания файла
323
342
  * @returns Информация о созданном файле и коммите
324
343
  */
325
- createFile(owner: string, repo: string, path: string, params: CreateFileParams): Promise<FileCreationResponse>;
344
+ createFile(owner: string, repo: string, path: string, params: CreateFileParams, options?: RequestOptions): Promise<FileCreationResponse>;
326
345
  /**
327
346
  * Обновляет существующий файл в репозитории
328
347
  * @param owner Владелец репозитория
@@ -331,7 +350,7 @@ declare class ContentsApi {
331
350
  * @param params Параметры обновления файла
332
351
  * @returns Информация об обновленном файле и коммите
333
352
  */
334
- updateFile(owner: string, repo: string, path: string, params: UpdateFileParams): Promise<FileCreationResponse>;
353
+ updateFile(owner: string, repo: string, path: string, params: UpdateFileParams, options?: RequestOptions): Promise<FileCreationResponse>;
335
354
  /**
336
355
  * Удаляет файл из репозитория
337
356
  * @param owner Владелец репозитория
@@ -340,6 +359,6 @@ declare class ContentsApi {
340
359
  * @param params Параметры удаления файла
341
360
  * @returns Информация об удаленном файле и коммите
342
361
  */
343
- deleteFile(owner: string, repo: string, path: string, params: DeleteFileParams): Promise<FileDeletionResponse>;
362
+ deleteFile(owner: string, repo: string, path: string, params: DeleteFileParams, options?: RequestOptions): Promise<FileDeletionResponse>;
344
363
  }
345
364
  export { ContentsApi };
@@ -1,4 +1,4 @@
1
- class j{client;constructor(b){this.client=b}get(b,d,f){return this.client.get(`/repos/${b}/${d}/contents/${f}`)}createFile(b,d,f,g){return this.client.put(`/repos/${b}/${d}/contents/${f}`,g)}updateFile(b,d,f,g){return this.client.put(`/repos/${b}/${d}/contents/${f}`,g)}deleteFile(b,d,f,g){return this.client.delete(`/repos/${b}/${d}/contents/${f}`,g)}}export{j as ContentsApi};
2
- export{j as i};
1
+ class k{client;constructor(b){this.client=b}get(b,d,f,g){return this.client.get(`/repos/${b}/${d}/contents/${f}`,g)}createFile(b,d,f,g,j){return this.client.put(`/repos/${b}/${d}/contents/${f}`,g,j)}updateFile(b,d,f,g,j){return this.client.put(`/repos/${b}/${d}/contents/${f}`,g,j)}deleteFile(b,d,f,g,j){return this.client.delete(`/repos/${b}/${d}/contents/${f}`,g,j)}}export{k as ContentsApi};
2
+ export{k as i};
3
3
 
4
- //# debugId=01D3BAD20A257EBF64756E2164756E21
4
+ //# debugId=5E020A046617DEDA64756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/api/contents.ts"],
4
4
  "sourcesContent": [
5
- "import type { GitVerseClient } from \"../client\";\nimport type {\n Content,\n CreateFileParams,\n DeleteFileParams,\n FileCreationResponse,\n FileDeletionResponse,\n UpdateFileParams,\n} from \"../types\";\n\n/**\n * API для работы с содержимым репозитория (файлами и папками)\n */\nexport class ContentsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с содержимым репозитория\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает содержимое файла или список файлов в директории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу или директории\n * @returns Содержимое файла или директории\n */\n get(owner: string, repo: string, path: string): Promise<Content> {\n return this.client.get<Content>(`/repos/${owner}/${repo}/contents/${path}`);\n }\n\n /**\n * Создает новый файл в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет создан\n * @param params Параметры создания файла\n * @returns Информация о созданном файле и коммите\n */\n createFile(owner: string, repo: string, path: string, params: CreateFileParams): Promise<FileCreationResponse> {\n return this.client.put<FileCreationResponse>(`/repos/${owner}/${repo}/contents/${path}`, params);\n }\n\n /**\n * Обновляет существующий файл в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет обновлен\n * @param params Параметры обновления файла\n * @returns Информация об обновленном файле и коммите\n */\n updateFile(owner: string, repo: string, path: string, params: UpdateFileParams): Promise<FileCreationResponse> {\n return this.client.put<FileCreationResponse>(`/repos/${owner}/${repo}/contents/${path}`, params);\n }\n\n /**\n * Удаляет файл из репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет удален\n * @param params Параметры удаления файла\n * @returns Информация об удаленном файле и коммите\n */\n deleteFile(owner: string, repo: string, path: string, params: DeleteFileParams): Promise<FileDeletionResponse> {\n return this.client.delete<FileDeletionResponse>(`/repos/${owner}/${repo}/contents/${path}`, params);\n }\n}\n"
5
+ "import type { GitVerseClient } from \"../client\";\nimport type {\n Content,\n CreateFileParams,\n DeleteFileParams,\n FileCreationResponse,\n FileDeletionResponse,\n RequestOptions,\n UpdateFileParams,\n} from \"../types\";\n\n/**\n * API для работы с содержимым репозитория (файлами и папками)\n */\nexport class ContentsApi {\n private client: GitVerseClient;\n\n /**\n * Создает новый экземпляр API для работы с содержимым репозитория\n * @param client GitVerse клиент\n */\n constructor(client: GitVerseClient) {\n this.client = client;\n }\n\n /**\n * Получает содержимое файла или список файлов в директории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу или директории\n * @returns Содержимое файла или директории\n */\n get(owner: string, repo: string, path: string, options?: RequestOptions): Promise<Content> {\n return this.client.get<Content>(`/repos/${owner}/${repo}/contents/${path}`, options);\n }\n\n /**\n * Создает новый файл в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет создан\n * @param params Параметры создания файла\n * @returns Информация о созданном файле и коммите\n */\n createFile(\n owner: string,\n repo: string,\n path: string,\n params: CreateFileParams,\n options?: RequestOptions,\n ): Promise<FileCreationResponse> {\n return this.client.put<FileCreationResponse>(`/repos/${owner}/${repo}/contents/${path}`, params, options);\n }\n\n /**\n * Обновляет существующий файл в репозитории\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет обновлен\n * @param params Параметры обновления файла\n * @returns Информация об обновленном файле и коммите\n */\n updateFile(\n owner: string,\n repo: string,\n path: string,\n params: UpdateFileParams,\n options?: RequestOptions,\n ): Promise<FileCreationResponse> {\n return this.client.put<FileCreationResponse>(`/repos/${owner}/${repo}/contents/${path}`, params, options);\n }\n\n /**\n * Удаляет файл из репозитория\n * @param owner Владелец репозитория\n * @param repo Название репозитория\n * @param path Путь к файлу, который будет удален\n * @param params Параметры удаления файла\n * @returns Информация об удаленном файле и коммите\n */\n deleteFile(\n owner: string,\n repo: string,\n path: string,\n params: DeleteFileParams,\n options?: RequestOptions,\n ): Promise<FileDeletionResponse> {\n return this.client.delete<FileDeletionResponse>(`/repos/${owner}/${repo}/contents/${path}`, params, options);\n }\n}\n"
6
6
  ],
7
- "mappings": "AAaO,MAAM,CAAY,CACf,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAUhB,GAAG,CAAC,EAAe,EAAc,EAAgC,CAC/D,OAAO,KAAK,OAAO,IAAa,UAAU,KAAS,cAAiB,GAAM,EAW5E,UAAU,CAAC,EAAe,EAAc,EAAc,EAAyD,CAC7G,OAAO,KAAK,OAAO,IAA0B,UAAU,KAAS,cAAiB,IAAQ,CAAM,EAWjG,UAAU,CAAC,EAAe,EAAc,EAAc,EAAyD,CAC7G,OAAO,KAAK,OAAO,IAA0B,UAAU,KAAS,cAAiB,IAAQ,CAAM,EAWjG,UAAU,CAAC,EAAe,EAAc,EAAc,EAAyD,CAC7G,OAAO,KAAK,OAAO,OAA6B,UAAU,KAAS,cAAiB,IAAQ,CAAM,EAEtG",
8
- "debugId": "01D3BAD20A257EBF64756E2164756E21",
7
+ "mappings": "AAcO,MAAM,CAAY,CACf,OAMR,WAAW,CAAC,EAAwB,CAClC,KAAK,OAAS,EAUhB,GAAG,CAAC,EAAe,EAAc,EAAc,EAA4C,CACzF,OAAO,KAAK,OAAO,IAAa,UAAU,KAAS,cAAiB,IAAQ,CAAO,EAWrF,UAAU,CACR,EACA,EACA,EACA,EACA,EAC+B,CAC/B,OAAO,KAAK,OAAO,IAA0B,UAAU,KAAS,cAAiB,IAAQ,EAAQ,CAAO,EAW1G,UAAU,CACR,EACA,EACA,EACA,EACA,EAC+B,CAC/B,OAAO,KAAK,OAAO,IAA0B,UAAU,KAAS,cAAiB,IAAQ,EAAQ,CAAO,EAW1G,UAAU,CACR,EACA,EACA,EACA,EACA,EAC+B,CAC/B,OAAO,KAAK,OAAO,OAA6B,UAAU,KAAS,cAAiB,IAAQ,EAAQ,CAAO,EAE/G",
8
+ "debugId": "5E020A046617DEDA64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,17 @@
1
1
  /**
2
+ * Опции для выполнения HTTP-запросов
3
+ */
4
+ interface RequestOptions {
5
+ /**
6
+ * AbortSignal для отмены запроса
7
+ * @example
8
+ * const controller = new AbortController();
9
+ * const promise = client.users.getCurrent({ signal: controller.signal });
10
+ * controller.abort(); // Отменяет запрос
11
+ */
12
+ signal?: AbortSignal;
13
+ }
14
+ /**
2
15
  * Интерфейс email адреса
3
16
  */
4
17
  interface Email {
@@ -117,45 +130,51 @@ declare class GitVerseClient {
117
130
  * @param path Путь к API-ресурсу
118
131
  * @param method HTTP-метод
119
132
  * @param body Тело запроса (опционально)
133
+ * @param options Опции запроса (опционально)
120
134
  * @returns Ответ от API
121
135
  * @throws {RateLimitError} При превышении лимита запросов (429)
122
136
  * @throws {GitVerseApiError} При других ошибках API
123
137
  */
124
- request<T>(path: string, method: HTTPMethods, body?: unknown): Promise<T>;
138
+ request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
125
139
  /**
126
140
  * Выполняет GET-запрос
127
141
  * @param path Путь к API-ресурсу
142
+ * @param options Опции запроса (опционально)
128
143
  * @returns Ответ от API
129
144
  */
130
- get<T>(path: string): Promise<T>;
145
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
131
146
  /**
132
147
  * Выполняет POST-запрос
133
148
  * @param path Путь к API-ресурсу
134
149
  * @param body Тело запроса
150
+ * @param options Опции запроса (опционально)
135
151
  * @returns Ответ от API
136
152
  */
137
- post<T>(path: string, body?: unknown): Promise<T>;
153
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
138
154
  /**
139
155
  * Выполняет PUT-запрос
140
156
  * @param path Путь к API-ресурсу
141
157
  * @param body Тело запроса
158
+ * @param options Опции запроса (опционально)
142
159
  * @returns Ответ от API
143
160
  */
144
- put<T>(path: string, body?: unknown): Promise<T>;
161
+ put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
145
162
  /**
146
163
  * Выполняет DELETE-запрос
147
164
  * @param path Путь к API-ресурсу
148
165
  * @param body Тело запроса (опционально)
166
+ * @param options Опции запроса (опционально)
149
167
  * @returns Ответ от API
150
168
  */
151
- delete<T>(path: string, body?: unknown): Promise<T>;
169
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
152
170
  /**
153
171
  * Выполняет PATCH-запрос
154
172
  * @param path Путь к API-ресурсу
155
173
  * @param body Тело запроса
174
+ * @param options Опции запроса (опционально)
156
175
  * @returns Ответ от API
157
176
  */
158
- patch<T>(path: string, body?: unknown): Promise<T>;
177
+ patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
159
178
  }
160
179
  /**
161
180
  * Класс для работы с email адресами пользователя
@@ -167,18 +186,18 @@ declare class EmailsApi {
167
186
  * Получить список email адресов текущего пользователя
168
187
  * @returns {Promise<Email[]>} Массив email адресов
169
188
  */
170
- list(): Promise<Email[]>;
189
+ list(options?: RequestOptions): Promise<Email[]>;
171
190
  /**
172
191
  * Добавить email адреса к аккаунту пользователя
173
192
  * @param {AddEmailParams} params - Параметры для добавления email
174
193
  * @returns {Promise<EmailOperationResponse>} Результат операции
175
194
  */
176
- add(params: AddEmailParams): Promise<EmailOperationResponse>;
195
+ add(params: AddEmailParams, options?: RequestOptions): Promise<EmailOperationResponse>;
177
196
  /**
178
197
  * Удалить email адреса из аккаунта пользователя
179
198
  * @param {RemoveEmailParams} params - Параметры для удаления email
180
199
  * @returns {Promise<EmailOperationResponse>} Результат операции
181
200
  */
182
- remove(params: RemoveEmailParams): Promise<EmailOperationResponse>;
201
+ remove(params: RemoveEmailParams, options?: RequestOptions): Promise<EmailOperationResponse>;
183
202
  }
184
203
  export { EmailsApi };
@@ -1,4 +1,4 @@
1
- class c{client;constructor(b){this.client=b}list(){return this.client.get("/user/emails")}add(b){return this.client.post("/user/emails",b)}remove(b){return this.client.delete("/user/emails",b)}}export{c as EmailsApi};
2
- export{c as z};
1
+ class d{client;constructor(b){this.client=b}list(b){return this.client.get("/user/emails",b)}add(b,c){return this.client.post("/user/emails",b,c)}remove(b,c){return this.client.delete("/user/emails",b,c)}}export{d as EmailsApi};
2
+ export{d as z};
3
3
 
4
- //# debugId=1FE313BCACDA9D3264756E2164756E21
4
+ //# debugId=53308507E2AF986F64756E2164756E21