gitverse-api-sdk 5.1.0 → 5.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.
@@ -1,1069 +1,356 @@
1
+ import type { GitVerseClient } from "../client";
2
+ import type { AddCollaboratorParams, Branch, Collaborator, CollaboratorInvitation, Commit, CompareResponse, ContentsResponse, CreateCommitParams, CreateFileParams, CreateForkParams, CreateReferenceParams, CreateRepositoryParams, CreateTreeParams, DeleteFileParams, FileCreationResponse, FileDeleteResponse, GitTreeResponse, PullRequest, Reference, Repository, RepoTree, Secret, SecretList, UpdatePullRequestParams, UpdateRepositoryParams } from "../types";
1
3
  /**
2
- * Типы данных для GitVerse API
3
- * @generated Сгенерировано автоматически из OpenAPI спецификации
4
- */
5
- /**
6
- * Опции для выполнения HTTP-запросов
7
- */
8
- interface RequestOptions {
9
- /**
10
- * AbortSignal для отмены запроса
11
- * @example
12
- * const controller = new AbortController();
13
- * const promise = client.users.getCurrent({ signal: controller.signal });
14
- * controller.abort(); // Отменяет запрос
15
- */
16
- signal?: AbortSignal;
17
- }
18
- interface AddCollaboratorParams {
19
- /** enum: read,write,admin */
20
- permission?: string;
21
- }
22
- interface CommitUserParams {
23
- date?: string;
24
- email: string;
25
- name: string;
26
- }
27
- interface CreateCommitParams {
28
- author?: CommitUserParams;
29
- committer?: CommitUserParams;
30
- message: string;
31
- parents?: string[];
32
- tree: string;
33
- }
34
- interface CreateFileParams {
35
- /** ветка на которой будет базировать коммит, если пустая то будет использована ветка по умолчанию */
36
- branch?: string;
37
- /** content must be base64 encoded */
38
- content?: string;
39
- /** SHA string `json:"sha" binding:"Required"`
40
- from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL */
41
- from_path?: string;
42
- /** Сообщение для описания коммита, если пустое то будет использовано сообщение по умолчанию */
43
- message?: string;
44
- /** новая ветка которая будет отведена от указанной выше ветки и вней будет создан новый коммит */
45
- new_branch?: string;
46
- /** sha is the SHA for the file that already exists */
47
- sha?: string;
48
- /** Подписывать ли коммит */
49
- signoff?: boolean;
50
- }
51
- interface CreateReferenceParams {
52
- ref?: string;
53
- sha?: string;
54
- }
55
- interface CreateRepositoryParams {
56
- auto_init?: boolean;
57
- description?: string;
58
- gitignores?: string[];
59
- is_template?: boolean;
60
- name?: string;
61
- private?: boolean;
62
- }
63
- interface TreeItem {
64
- content?: string;
65
- mode?: string;
66
- path?: string;
67
- sha?: string;
68
- type?: string;
69
- }
70
- interface CreateTreeParams {
71
- base_tree?: string;
72
- tree?: TreeItem[];
73
- }
74
- interface DeleteFileParams {
75
- /** ветка на которой будет базировать коммит, если пустая то будет использована ветка по умолчанию */
76
- branch?: string;
77
- /** Сообщение для описания коммита, если пустое то будет использовано сообщение по умолчанию */
78
- message?: string;
79
- /** новая ветка которая будет отведена от указанной выше ветки и вней будет создан новый коммит */
80
- new_branch?: string;
81
- /** sha is the SHA for the file that already exists */
82
- sha?: string;
83
- /** Подписывать ли коммит */
84
- signoff?: boolean;
85
- }
86
- interface CreateForkParams {
87
- /** Описание */
88
- description?: string;
89
- /** Имя форкнутого репозитория */
90
- name?: string;
91
- /** Название организации, если форкаем в организацию */
92
- organization?: string;
93
- }
94
- interface UpdateRepositoryParams {
95
- allow_auto_merge?: boolean;
96
- allow_merge?: boolean;
97
- allow_rebase?: boolean;
98
- allow_rebase_merge?: boolean;
99
- allow_squash_merge?: boolean;
100
- allow_update_branch?: boolean;
101
- archived?: boolean;
102
- autodetect_manual_merge?: boolean;
103
- default_allow_maintainer_edit?: boolean;
104
- default_branch?: string;
105
- default_merge_style?: string;
106
- delete_branch_on_merge?: boolean;
107
- description?: string;
108
- homepage?: string;
109
- ignore_whitespace?: boolean;
110
- is_template?: boolean;
111
- /** обработаны */
112
- name?: string;
113
- private?: boolean;
114
- }
115
- interface UpdatePullRequestParams {
116
- /** ветка в которую происходит слияние */
117
- base?: string;
118
- /** тело запроса */
119
- body?: string;
120
- /** могут ли мэйнтейнеры изменять PR */
121
- maintainer_can_modify?: boolean;
122
- /** статус запроса */
123
- state?: string;
124
- /** заголовок запроса */
125
- title?: string;
126
- }
127
- interface CommitMeta {
128
- created?: string;
129
- html_url?: string;
130
- sha?: string;
131
- url?: string;
132
- }
133
- interface Branch {
134
- commit?: CommitMeta;
135
- name?: string;
136
- protected?: boolean;
137
- }
138
- interface Permissions {
139
- admin?: boolean;
140
- pull?: boolean;
141
- push?: boolean;
142
- }
143
- interface Collaborator {
144
- /** Адрес аватарки */
145
- avatar_url?: string;
146
- /** О себе */
147
- bio?: string;
148
- /** Почта */
149
- email?: string;
150
- /** Url для получения подписчиков пользователя */
151
- followers_url?: string;
152
- /** Url для получения подписок пользователя */
153
- following_url?: string;
154
- /** Полное имя */
155
- full_name?: string;
156
- /** Адрес страницы пользователя */
157
- html_url?: string;
158
- /** Идентификатор */
159
- id?: number;
160
- /** Логин пользователя */
161
- login?: string;
162
- /** Имя пользователя */
163
- name?: string;
164
- /** Url для получения организаций пользователя */
165
- organizations_url?: string;
166
- /** Полномочия */
167
- permissions?: Permissions;
168
- /** Url для получения репозиториев пользователя */
169
- repos_url?: string;
170
- /** Есть ли права админа */
171
- site_admin?: boolean;
172
- /** Url для получения репозиториев пользователя, которые были добавлены в избранное */
173
- starred_url?: string;
174
- /** Url для получения подписок пользователя */
175
- subscriptions_url?: string;
176
- /** Тип пользователя */
177
- type?: string;
178
- /** Url для получения пользователя */
179
- url?: string;
180
- /** Вебсайт */
181
- website?: string;
182
- }
183
- interface UserPublicInfo {
184
- avatar_url?: string;
185
- followers_url?: string;
186
- following_url?: string;
187
- html_url?: string;
188
- id?: number;
189
- login?: string;
190
- organizations_url?: string;
191
- repos_url?: string;
192
- site_admin?: boolean;
193
- type?: string;
194
- url?: string;
195
- }
196
- interface RepoPublicInfo {
197
- contents_url?: string;
198
- description?: string;
199
- fork?: boolean;
200
- forks_url?: string;
201
- full_name?: string;
202
- html_url?: string;
203
- id?: number;
204
- issue_comment_url?: string;
205
- issues_url?: string;
206
- languages_url?: string;
207
- name?: string;
208
- owner?: UserPublicInfo;
209
- private?: boolean;
210
- pulls_url?: string;
211
- url?: string;
212
- }
213
- interface CollaboratorInvitation {
214
- created_at?: string;
215
- id?: number;
216
- invitee?: UserPublicInfo;
217
- inviter?: UserPublicInfo;
218
- permissions?: string;
219
- repository?: RepoPublicInfo;
220
- }
221
- interface CommitFiles {
222
- additions?: number;
223
- blob_url?: string;
224
- changes?: number;
225
- contents_url?: string;
226
- deletions?: number;
227
- filename?: string;
228
- patch?: string;
229
- raw_url?: string;
230
- sha?: string;
231
- status?: string;
232
- }
233
- interface CommitUser {
234
- date?: string;
235
- email?: string;
236
- name?: string;
237
- }
238
- interface TreeMeta {
239
- created?: string;
240
- sha?: string;
241
- url?: string;
242
- }
243
- interface RepoCommit {
244
- author?: CommitUser;
245
- committer?: CommitUser;
246
- message?: string;
247
- tree?: TreeMeta;
248
- url?: string;
249
- }
250
- interface CommitStats {
251
- additions?: number;
252
- deletions?: number;
253
- total?: number;
254
- }
255
- interface Commit {
256
- author?: UserPublicInfo;
257
- branch?: string;
258
- commit?: RepoCommit;
259
- committer?: UserPublicInfo;
260
- created?: string;
261
- files?: CommitFiles[];
262
- html_url?: string;
263
- parents?: CommitMeta[];
264
- sha?: string;
265
- stats?: CommitStats;
266
- url?: string;
267
- }
268
- interface CommitVerification {
269
- payload?: string;
270
- reason?: string;
271
- signature?: string;
272
- verified?: boolean;
273
- verifiedAt?: string;
274
- }
275
- interface CompareResponse {
276
- ahead_by?: number;
277
- base_commit?: Commit;
278
- behind_by?: number;
279
- commits?: Commit[];
280
- files?: CommitFiles[];
281
- html_url?: string;
282
- merge_base_commit?: Commit;
283
- status?: string;
284
- total_commits?: number;
285
- url?: string;
286
- }
287
- interface FileLinksResponse {
288
- git?: string;
289
- html?: string;
290
- self?: string;
291
- }
292
- interface ContentsResponse {
293
- /** Ссылки */
294
- _links?: FileLinksResponse;
295
- /** `content` is populated when `type` is `file`, otherwise null */
296
- content?: string;
297
- /** DownloadURL ссылка на скачивание файла */
298
- download_url?: string;
299
- /** `encoding` is populated when `type` is `file`, otherwise null */
300
- encoding?: string;
301
- /** GitURL ссылка на получение файла */
302
- git_url?: string;
303
- /** HtmlURL ссылка на страницу с содержимым файла */
304
- html_url?: string;
305
- /** Язык программирования используемый в файле (если тип файл) */
306
- language?: string;
307
- name?: string;
308
- path?: string;
309
- sha?: string;
310
- size?: number;
311
- /** `submodule_git_url` is populated when `type` is `submodule`, otherwise null */
312
- submodule_git_url?: string;
313
- /** `target` is populated when `type` is `symlink`, otherwise null */
314
- target?: string;
315
- /** `type` will be `file`, `dir`, `symlink`, or `submodule` */
316
- type?: string;
317
- /** Url возвращает ссылку на получение такого же JSON */
318
- url?: string;
319
- }
320
- interface FileCommitResponse {
321
- author?: CommitUser;
322
- committer?: CommitUser;
323
- created?: string;
324
- html_url?: string;
325
- message?: string;
326
- parents?: CommitMeta[];
327
- sha?: string;
328
- tree?: CommitMeta;
329
- url?: string;
330
- verification?: CommitVerification;
331
- }
332
- interface FileCreationResponse {
333
- commit?: FileCommitResponse;
334
- content?: ContentsResponse;
335
- }
336
- interface FileDeleteResponse {
337
- commit?: FileCommitResponse;
338
- content?: unknown;
339
- }
340
- interface GitEntry {
341
- mode?: string;
342
- path?: string;
343
- sha?: string;
344
- size?: number;
345
- type?: string;
346
- url?: string;
347
- }
348
- interface GitObject {
349
- sha?: string;
350
- type?: string;
351
- url?: string;
352
- }
353
- interface GitTreeResponse {
354
- page?: number;
355
- sha?: string;
356
- total_count?: number;
357
- tree?: GitEntry[];
358
- truncated?: boolean;
359
- url?: string;
360
- }
361
- interface User {
362
- /** Адрес аватарки */
363
- avatar_url?: string;
364
- /** О себе */
365
- bio?: string;
366
- /** Дата создания учетной записи */
367
- created_at?: string;
368
- /** Почта */
369
- email?: string;
370
- /** Счетчики */
371
- followers?: number;
372
- /** Url для получения подписчиков пользователя */
373
- followers_url?: string;
374
- following?: number;
375
- /** Url для получения подписок пользователя */
376
- following_url?: string;
377
- /** Полное имя */
378
- full_name?: string;
379
- /** Адрес страницы пользователя */
380
- html_url?: string;
381
- /** Идентификатор */
382
- id?: number;
383
- /** Верифицирован? */
384
- is_verified?: boolean;
385
- /** Местоположение */
386
- location?: string;
387
- /** Логин пользователя */
388
- login?: string;
389
- /** Имя пользователя */
390
- name?: string;
391
- /** Url для получения организаций пользователя */
392
- organizations_url?: string;
393
- /** Публичные репозитории */
394
- public_repos?: number;
395
- /** Url для получения репозиториев пользователя */
396
- repos_url?: string;
397
- /** Есть ли права админа */
398
- site_admin?: boolean;
399
- /** Url для получения репозиториев пользователя, которые были добавлены в избранное */
400
- starred_url?: string;
401
- /** Количество репозиториев в избранном */
402
- stars_count?: number;
403
- /** Url для получения подписок пользователя */
404
- subscriptions_url?: string;
405
- /** Тип пользователя */
406
- type?: string;
407
- /** Дата изменения учетной записи */
408
- updated_at?: string;
409
- /** Url для получения пользователя */
410
- url?: string;
411
- /** Вебсайт */
412
- website?: string;
413
- }
414
- interface Label {
415
- /** example: 00aabb */
416
- color?: string;
417
- description?: string;
418
- /** example: false */
419
- exclusive?: boolean;
420
- id?: number;
421
- /** example: false */
422
- is_archived?: boolean;
423
- name?: string;
424
- url?: string;
425
- }
426
- interface Milestone {
427
- closed_at?: string;
428
- closed_issues?: number;
429
- created_at?: string;
430
- description?: string;
431
- due_on?: string;
432
- id?: number;
433
- open_issues?: number;
434
- state?: string;
435
- title?: string;
436
- updated_at?: string;
437
- }
438
- interface Repository {
439
- allow_merge_commit?: boolean;
440
- allow_rebase_merge?: boolean;
441
- allow_squash_merge?: boolean;
442
- archived?: boolean;
443
- clone_url?: string;
444
- contents_url?: string;
445
- created_at?: string;
446
- default_branch?: string;
447
- delete_branch_on_merge?: boolean;
448
- description?: string;
449
- disabled?: boolean;
450
- fork?: boolean;
451
- forks?: number;
452
- forks_count?: number;
453
- forks_url?: string;
454
- full_name?: string;
455
- has_issues?: boolean;
456
- has_wiki?: boolean;
457
- id?: number;
458
- is_template?: boolean;
459
- issue_comment_url?: string;
460
- issues_url?: string;
461
- language?: string;
462
- languages_url?: string;
463
- mirror_url?: string;
464
- name?: string;
465
- open_issues?: number;
466
- open_issues_count?: number;
467
- owner?: UserPublicInfo;
468
- parent?: Repository;
469
- permissions?: Permissions;
470
- private?: boolean;
471
- pulls_url?: string;
472
- pushed_at?: string;
473
- size?: number;
474
- ssh_url?: string;
475
- stargazers_count?: number;
476
- template_repository?: Repository;
477
- topics?: string[];
478
- updated_at?: string;
479
- url?: string;
480
- visibility?: string;
481
- watchers?: number;
482
- watchers_count?: number;
483
- }
484
- interface PRBranchInfo {
485
- label?: string;
486
- ref?: string;
487
- repo?: Repository;
488
- repo_id?: number;
489
- sha?: string;
490
- }
491
- interface Team {
492
- /** Полномочия на создание репозиториев */
493
- can_create_org_repo?: boolean;
494
- /** Описание команды */
495
- description?: string;
496
- /** Идентификатор */
497
- id?: number;
498
- /** Включает все репозитории */
499
- includes_all_repositories?: boolean;
500
- /** Название команды */
501
- name?: string;
502
- /** Количество участников */
503
- num_members?: number;
504
- /** Количество репозиториев */
505
- num_repos?: number;
506
- /** Полномочия */
507
- permission?: string;
508
- /** Полномочие на действия с ветками */
509
- permission_actions?: string;
510
- /** Код полномочия */
511
- permission_code?: string;
512
- /** Полномочие на пакеты */
513
- permission_packages?: string;
514
- /** Полномочие на отправку пулл-реквестов */
515
- permission_pulls?: string;
516
- /** Полномочие на релизы */
517
- permission_releases?: string;
518
- }
519
- interface PullRequest {
520
- assignee?: User;
521
- assignees?: User[];
522
- base?: PRBranchInfo;
523
- body?: string;
524
- closed_at?: string;
525
- comments?: number;
526
- created_at?: string;
527
- diff_url?: string;
528
- head?: PRBranchInfo;
529
- html_url?: string;
530
- id?: number;
531
- is_draft?: boolean;
532
- labels?: Label[];
533
- locked?: boolean;
534
- maintainer_can_modify?: boolean;
535
- merge_commit_sha?: string;
536
- mergeable?: boolean;
537
- merged?: boolean;
538
- merged_at?: string;
539
- merged_by?: User;
540
- milestone?: Milestone;
541
- number?: number;
542
- patch_url?: string;
543
- requested_reviewers?: User[];
544
- requested_teams?: Team[];
545
- state?: string;
546
- title?: string;
547
- updated_at?: string;
548
- url?: string;
549
- user?: User;
550
- }
551
- interface Reference {
552
- object?: GitObject;
553
- ref?: string;
554
- url?: string;
555
- }
556
- interface TreeEntry {
557
- mode?: string;
558
- path?: string;
559
- sha?: string;
560
- size?: number;
561
- /** "blob", "tree", "commit" */
562
- type?: string;
563
- }
564
- interface RepoTree {
565
- sha?: string;
566
- tree?: TreeEntry[];
567
- truncated?: boolean;
568
- url?: string;
569
- }
570
- interface Secret {
571
- created_at?: string;
572
- name?: string;
573
- }
574
- interface SecretList {
575
- secrets?: Secret[];
576
- total_count?: number;
577
- }
578
- /**
579
- * Предупреждение об устаревшей версии API
580
- */
581
- declare class ApiVersionWarning {
582
- /** Текущая используемая версия */
583
- readonly currentVersion: string;
584
- /** Последняя доступная версия */
585
- readonly latestVersion: string;
586
- /** Дата вывода из эксплуатации */
587
- readonly decommissioning?: string;
588
- constructor(currentVersion: string, latestVersion: string, decommissioning?: string);
589
- /**
590
- * Возвращает сообщение о предупреждении
591
- */
592
- getMessage(): string;
593
- }
594
- declare const HTTPMethods: {
595
- readonly DELETE: "DELETE"
596
- readonly GET: "GET"
597
- readonly PATCH: "PATCH"
598
- readonly POST: "POST"
599
- readonly PUT: "PUT"
600
- };
601
- type HTTPMethods = (typeof HTTPMethods)[keyof typeof HTTPMethods];
602
- /**
603
- * Параметры для конфигурации GitVerse клиента
604
- */
605
- interface GitVerseClientConfig {
606
- /**
607
- * Базовый URL API GitVerse
608
- * @default 'https://api.gitverse.ru'
609
- */
610
- baseUrl?: string;
611
- /**
612
- * Токен доступа для авторизации в API
613
- */
614
- token?: string;
615
- /**
616
- * Версия API
617
- * @default '1'
618
- */
619
- apiVersion?: string;
620
- }
621
- /**
622
- * Основной класс для работы с GitVerse API
623
- */
624
- declare class GitVerseClient {
625
- private baseUrl;
626
- private token?;
627
- private apiVersion;
628
- /**
629
- * Callback для обработки предупреждений об устаревшей версии API
630
- */
631
- onApiVersionWarning?: (warning: ApiVersionWarning) => void;
632
- /**
633
- * Создает новый экземпляр GitVerse клиента
634
- * @param config Конфигурация клиента
635
- */
636
- constructor(config?: GitVerseClientConfig);
637
- /**
638
- * Устанавливает токен авторизации
639
- * @param token Токен доступа
640
- */
641
- setToken(token: string): void;
642
- /**
643
- * Извлекает информацию о Rate Limit из заголовков ответа
644
- */
645
- private extractRateLimitInfo;
646
- /**
647
- * Извлекает информацию о версии API из заголовков ответа
648
- */
649
- private extractApiVersionInfo;
650
- /**
651
- * Извлекает метаданные из заголовков ответа
652
- */
653
- private extractMetadata;
654
- /**
655
- * Выполняет API-запрос с учетом авторизации и версии API
656
- * @param path Путь к API-ресурсу
657
- * @param method HTTP-метод
658
- * @param body Тело запроса (опционально)
659
- * @param options Опции запроса (опционально)
660
- * @returns Ответ от API
661
- * @throws {RateLimitError} При превышении лимита запросов (429)
662
- * @throws {GitVerseApiError} При других ошибках API
663
- */
664
- request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
665
- /**
666
- * Выполняет GET-запрос
667
- * @param path Путь к API-ресурсу
668
- * @param options Опции запроса (опционально)
669
- * @returns Ответ от API
670
- */
671
- get<T>(path: string, options?: RequestOptions): Promise<T>;
672
- /**
673
- * Выполняет POST-запрос
674
- * @param path Путь к API-ресурсу
675
- * @param body Тело запроса
676
- * @param options Опции запроса (опционально)
677
- * @returns Ответ от API
678
- */
679
- post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
680
- /**
681
- * Выполняет PUT-запрос
682
- * @param path Путь к API-ресурсу
683
- * @param body Тело запроса
684
- * @param options Опции запроса (опционально)
685
- * @returns Ответ от API
686
- */
687
- put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
688
- /**
689
- * Выполняет DELETE-запрос
690
- * @param path Путь к API-ресурсу
691
- * @param body Тело запроса (опционально)
692
- * @param options Опции запроса (опционально)
693
- * @returns Ответ от API
694
- */
695
- delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
696
- /**
697
- * Выполняет PATCH-запрос
698
- * @param path Путь к API-ресурсу
699
- * @param body Тело запроса
700
- * @param options Опции запроса (опционально)
701
- * @returns Ответ от API
702
- */
703
- patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
704
- /**
705
- * Выполняет загрузку файла через multipart/form-data
706
- * @param path Путь к API-ресурсу
707
- * @param fieldName Имя поля для файла
708
- * @param file Файл для загрузки (Blob или ArrayBuffer)
709
- * @param fileName Имя файла
710
- * @param options Опции запроса (опционально)
711
- * @returns Ответ от API
712
- */
713
- uploadFile<T>(path: string, fieldName: string, file: Blob | ArrayBuffer, fileName: string, options?: RequestOptions): Promise<T>;
714
- }
715
- /**
716
- * API для работы с репозиториями
717
- */
718
- declare class RepositoriesApi {
719
- private client;
720
- /**
721
- * Создает новый экземпляр API
722
- * @param client GitVerse клиент
723
- */
724
- constructor(client: GitVerseClient);
725
- /**
726
- * Get repository details
727
- * @param owner Repository owner
728
- * @param repo Repository name
729
- * @param options Опции запроса
730
- * @returns Repository
731
- */
732
- get(owner: string, repo: string, options?: {
733
- signal?: AbortSignal
734
- }): Promise<Repository>;
735
- /**
736
- * Update repository
737
- * @param owner Repository owner
738
- * @param repo Repository name
739
- * @param params New repository settings
740
- * @param options Опции запроса
741
- * @returns Repository
742
- */
743
- update(owner: string, repo: string, params: UpdateRepositoryParams, options?: {
744
- signal?: AbortSignal
745
- }): Promise<Repository>;
746
- /**
747
- * Delete repository
748
- * @param owner Repository owner
749
- * @param repo Repository name
750
- * @param options Опции запроса
751
- * @returns void
752
- */
753
- delete(owner: string, repo: string, options?: {
754
- signal?: AbortSignal
755
- }): Promise<void>;
756
- /**
757
- * Gets a list of repository secrets
758
- * @param owner Owner name
759
- * @param repo Repository name
760
- * @param queryParams Параметры запроса
761
- * @param options Опции запроса
762
- * @returns SecretList
763
- */
764
- listRepoSecrets(owner: string, repo: string, queryParams?: {
765
- per_page?: string
766
- page?: string
767
- }, options?: {
768
- signal?: AbortSignal
769
- }): Promise<SecretList>;
770
- /**
771
- * Gets secrets metadata (without values) in repositories.
772
- * @param owner Owner name
773
- * @param repo Repository name
774
- * @param secretname Secret name
775
- * @param options Опции запроса
776
- * @returns Secret
777
- */
778
- getRepoSecret(owner: string, repo: string, secretname: string, options?: {
779
- signal?: AbortSignal
780
- }): Promise<Secret>;
781
- /**
782
- * Creates or updates a secret in the repository, without encryption
783
- * @param owner Owner name
784
- * @param repo Repository name
785
- * @param secretname Secret name
786
- * @param queryParams Параметры запроса
787
- * @param options Опции запроса
788
- * @returns Secret
789
- */
790
- createOrUpdateRepoSecret(owner: string, repo: string, secretname: string, queryParams?: {
791
- encrypted_value: string
792
- }, options?: {
793
- signal?: AbortSignal
794
- }): Promise<Secret>;
795
- /**
796
- * Removes a secret from the repository
797
- * @param owner Owner name
798
- * @param repo Repository name
799
- * @param secretname Secret name
800
- * @param options Опции запроса
801
- * @returns void
802
- */
803
- deleteRepoSecret(owner: string, repo: string, secretname: string, options?: {
804
- signal?: AbortSignal
805
- }): Promise<void>;
806
- /**
807
- * List repository branches
808
- * @param owner Owner of the repository (username or organization)
809
- * @param repo Name of the repository without .git extension
810
- * @param queryParams Параметры запроса
811
- * @param options Опции запроса
812
- * @returns Branch[]
813
- */
814
- listBranches(owner: string, repo: string, queryParams?: {
815
- page?: number
816
- per_page?: number
817
- q?: string
818
- }, options?: {
819
- signal?: AbortSignal
820
- }): Promise<Branch[]>;
821
- /**
822
- * List repository collaborators
823
- * @param owner Repository owner
824
- * @param repo Repository name
825
- * @param queryParams Параметры запроса
826
- * @param options Опции запроса
827
- * @returns Collaborator[]
828
- */
829
- listCollaborators(owner: string, repo: string, queryParams?: {
830
- affiliation?: string
831
- permission?: string
832
- page?: number
833
- per_page?: number
834
- }, options?: {
835
- signal?: AbortSignal
836
- }): Promise<Collaborator[]>;
837
- /**
838
- * Add or update repository collaborator
839
- * @param owner Repository owner
840
- * @param repo Repository name
841
- * @param collaborator Username of the collaborator to add or update
842
- * @param params Collaborator permission settings
843
- * @param options Опции запроса
844
- * @returns CollaboratorInvitation
845
- */
846
- addCollaborator(owner: string, repo: string, collaborator: string, params: AddCollaboratorParams, options?: {
847
- signal?: AbortSignal
848
- }): Promise<CollaboratorInvitation>;
849
- /**
850
- * Retrieve a list of repository commits
851
- * @param owner Owner of the repository (owner or organization name)
852
- * @param repo Name of the repository without the .git extension
853
- * @param queryParams Параметры запроса
854
- * @param options Опции запроса
855
- * @returns Commit[]
856
- */
857
- listCommits(owner: string, repo: string, queryParams?: {
858
- page?: number
859
- per_page?: number
860
- sha?: string
861
- path?: string
862
- not?: string
863
- author?: string
864
- committer?: string
865
- since?: string
866
- until?: string
867
- }, options?: {
868
- signal?: AbortSignal
869
- }): Promise<Commit[]>;
870
- /**
871
- * Retrieve commit information
872
- * @param owner Owner of the repository (owner or organization name)
873
- * @param repo Name of the repository without the .git extension
874
- * @param sha Commit hash
875
- * @param options Опции запроса
876
- * @returns Commit
877
- */
878
- getCommit(owner: string, repo: string, sha: string, options?: {
879
- signal?: AbortSignal
880
- }): Promise<Commit>;
881
- /**
882
- * Compare two branches/tags/commits
883
- * @param owner Owner of the repository (username or organization name)
884
- * @param repo Name of the repository without the .git extension
885
- * @param basehead References to compare in BASE...HEAD format (e.g., main...feature)
886
- * @param queryParams Параметры запроса
887
- * @param options Опции запроса
888
- * @returns CompareResponse
889
- */
890
- compareCommits(owner: string, repo: string, basehead: string, queryParams?: {
891
- page?: number
892
- per_page?: number
893
- }, options?: {
894
- signal?: AbortSignal
895
- }): Promise<CompareResponse>;
896
- /**
897
- * Get file or directory contents
898
- * @param owner Repository owner
899
- * @param repo Repository name
900
- * @param filepath Path to file or directory in the repository
901
- * @param queryParams Параметры запроса
902
- * @param options Опции запроса
903
- * @returns Record<string, unknown>
904
- */
905
- getContent(owner: string, repo: string, filepath: string, queryParams?: {
906
- ref?: string
907
- scope?: string
908
- }, options?: {
909
- signal?: AbortSignal
910
- }): Promise<Record<string, unknown>>;
911
- /**
912
- * Create or update file in repository
913
- * @param owner Repository owner
914
- * @param repo Repository name
915
- * @param filepath Path to the file in the repository
916
- * @param params File creation or update options, including base64 content, branch, message, etc.
917
- * @param options Опции запроса
918
- * @returns FileCreationResponse
919
- */
920
- createOrUpdateFile(owner: string, repo: string, filepath: string, params: CreateFileParams, options?: {
921
- signal?: AbortSignal
922
- }): Promise<FileCreationResponse>;
923
- /**
924
- * Delete file in repository
925
- * @param owner Repository owner
926
- * @param repo Repository name
927
- * @param filepath Path to the file in the repository
928
- * @param params File deletion options, including SHA, branch, commit message, etc.
929
- * @param options Опции запроса
930
- * @returns FileDeleteResponse
931
- */
932
- deleteFile(owner: string, repo: string, filepath: string, params: DeleteFileParams, options?: {
933
- signal?: AbortSignal
934
- }): Promise<FileDeleteResponse>;
935
- /**
936
- * Fork a repository
937
- * @param owner Owner of the base repository
938
- * @param repo Name of the base repository
939
- * @param params Fork options, including target name and organization
940
- * @param options Опции запроса
941
- * @returns Repository
942
- */
943
- createFork(owner: string, repo: string, params: CreateForkParams, options?: {
944
- signal?: AbortSignal
945
- }): Promise<Repository>;
946
- /**
947
- * Create a Git commit
948
- * @param owner Owner of the repository (owner or organization name)
949
- * @param repo Name of the repository without the .git extension
950
- * @param params Parameters for creating the commit
951
- * @param options Опции запроса
952
- * @returns Commit
953
- */
954
- createCommit(owner: string, repo: string, params: CreateCommitParams, options?: {
955
- signal?: AbortSignal
956
- }): Promise<Commit>;
957
- /**
958
- * Create a Git reference
959
- * @param owner Owner of the repository (owner or organization name)
960
- * @param repo Name of the repository without the .git extension
961
- * @param params Parameters for creating the reference
962
- * @param options Опции запроса
963
- * @returns Reference
964
- */
965
- createRef(owner: string, repo: string, params: CreateReferenceParams, options?: {
966
- signal?: AbortSignal
967
- }): Promise<Reference>;
968
- /**
969
- * Creates new Git tree
970
- * @param owner owner
971
- * @param repo repo
972
- * @param params Параметры создания дерева
973
- * @param options Опции запроса
974
- * @returns RepoTree
975
- */
976
- createTree(owner: string, repo: string, params: CreateTreeParams, options?: {
977
- signal?: AbortSignal
978
- }): Promise<RepoTree>;
979
- /**
980
- * Get repository tree by SHA
981
- * @param owner Repository owner
982
- * @param repo Repository name
983
- * @param sha Commit SHA to list tree for
984
- * @param queryParams Параметры запроса
985
- * @param options Опции запроса
986
- * @returns GitTreeResponse
987
- */
988
- getTree(owner: string, repo: string, sha: string, queryParams?: {
989
- page?: number
990
- per_page?: number
991
- recursive?: boolean
992
- }, options?: {
993
- signal?: AbortSignal
994
- }): Promise<GitTreeResponse>;
995
- /**
996
- * Get repository languages
997
- * @param owner Repository owner
998
- * @param repo Repository name
999
- * @param options Опции запроса
1000
- * @returns Record<string, unknown>
1001
- */
1002
- listLanguages(owner: string, repo: string, options?: {
1003
- signal?: AbortSignal
1004
- }): Promise<Record<string, unknown>>;
1005
- /**
1006
- * List pull requests
1007
- * @param owner Repository owner
1008
- * @param repo Repository name
1009
- * @param queryParams Параметры запроса
1010
- * @param options Опции запроса
1011
- * @returns PullRequest[]
1012
- */
1013
- listPulls(owner: string, repo: string, queryParams?: {
1014
- state?: string
1015
- head?: string
1016
- base?: string
1017
- sort?: string
1018
- direction?: string
1019
- page?: number
1020
- per_page?: number
1021
- }, options?: {
1022
- signal?: AbortSignal
1023
- }): Promise<PullRequest[]>;
1024
- /**
1025
- * Pull request details.
1026
- * @param owner Repository owner
1027
- * @param repo Repository name
1028
- * @param pull_number The number that identifies the pull request..
1029
- * @param options Опции запроса
1030
- * @returns PullRequest
1031
- */
1032
- getPull(owner: string, repo: string, pull_number: number, options?: {
1033
- signal?: AbortSignal
1034
- }): Promise<PullRequest>;
1035
- /**
1036
- * Update a pull request.
1037
- * @param owner Repository owner
1038
- * @param repo Repository name
1039
- * @param pull_number The number that identifies the pull request.
1040
- * @param params Pull request update parameters
1041
- * @param options Опции запроса
1042
- * @returns PullRequest
1043
- */
1044
- updatePull(owner: string, repo: string, pull_number: number, params: UpdatePullRequestParams, options?: {
1045
- signal?: AbortSignal
1046
- }): Promise<PullRequest>;
1047
- /**
1048
- * Get authenticated user repositories
1049
- * @param queryParams Параметры запроса
1050
- * @param options Опции запроса
1051
- * @returns Repository[]
1052
- */
1053
- listForAuthenticatedUser(queryParams?: {
1054
- page?: number
1055
- per_page?: number
1056
- }, options?: {
1057
- signal?: AbortSignal
1058
- }): Promise<Repository[]>;
1059
- /**
1060
- * Create repository
1061
- * @param params Repository creation options
1062
- * @param options Опции запроса
1063
- * @returns Repository
1064
- */
1065
- createForAuthenticatedUser(params: CreateRepositoryParams, options?: {
1066
- signal?: AbortSignal
1067
- }): Promise<Repository>;
4
+ * API для работы с репозиториями
5
+ */
6
+ export declare class RepositoriesApi {
7
+ private client;
8
+ /**
9
+ * Создает новый экземпляр API
10
+ * @param client GitVerse клиент
11
+ */
12
+ constructor(client: GitVerseClient);
13
+ /**
14
+ * Get repository details
15
+ * @param owner Repository owner
16
+ * @param repo Repository name
17
+ * @param options Опции запроса
18
+ * @returns Repository
19
+ */
20
+ get(owner: string, repo: string, options?: {
21
+ signal?: AbortSignal;
22
+ }): Promise<Repository>;
23
+ /**
24
+ * Update repository
25
+ * @param owner Repository owner
26
+ * @param repo Repository name
27
+ * @param params New repository settings
28
+ * @param options Опции запроса
29
+ * @returns Repository
30
+ */
31
+ update(owner: string, repo: string, params: UpdateRepositoryParams, options?: {
32
+ signal?: AbortSignal;
33
+ }): Promise<Repository>;
34
+ /**
35
+ * Delete repository
36
+ * @param owner Repository owner
37
+ * @param repo Repository name
38
+ * @param options Опции запроса
39
+ * @returns void
40
+ */
41
+ delete(owner: string, repo: string, options?: {
42
+ signal?: AbortSignal;
43
+ }): Promise<void>;
44
+ /**
45
+ * Gets a list of repository secrets
46
+ * @param owner Owner name
47
+ * @param repo Repository name
48
+ * @param queryParams Параметры запроса
49
+ * @param options Опции запроса
50
+ * @returns SecretList
51
+ */
52
+ listRepoSecrets(owner: string, repo: string, queryParams?: {
53
+ per_page?: string;
54
+ page?: string;
55
+ }, options?: {
56
+ signal?: AbortSignal;
57
+ }): Promise<SecretList>;
58
+ /**
59
+ * Gets secrets metadata (without values) in repositories.
60
+ * @param owner Owner name
61
+ * @param repo Repository name
62
+ * @param secretname Secret name
63
+ * @param options Опции запроса
64
+ * @returns Secret
65
+ */
66
+ getRepoSecret(owner: string, repo: string, secretname: string, options?: {
67
+ signal?: AbortSignal;
68
+ }): Promise<Secret>;
69
+ /**
70
+ * Creates or updates a secret in the repository, without encryption
71
+ * @param owner Owner name
72
+ * @param repo Repository name
73
+ * @param secretname Secret name
74
+ * @param queryParams Параметры запроса
75
+ * @param options Опции запроса
76
+ * @returns Secret
77
+ */
78
+ createOrUpdateRepoSecret(owner: string, repo: string, secretname: string, queryParams?: {
79
+ encrypted_value: string;
80
+ }, options?: {
81
+ signal?: AbortSignal;
82
+ }): Promise<Secret>;
83
+ /**
84
+ * Removes a secret from the repository
85
+ * @param owner Owner name
86
+ * @param repo Repository name
87
+ * @param secretname Secret name
88
+ * @param options Опции запроса
89
+ * @returns void
90
+ */
91
+ deleteRepoSecret(owner: string, repo: string, secretname: string, options?: {
92
+ signal?: AbortSignal;
93
+ }): Promise<void>;
94
+ /**
95
+ * List repository branches
96
+ * @param owner Owner of the repository (username or organization)
97
+ * @param repo Name of the repository without .git extension
98
+ * @param queryParams Параметры запроса
99
+ * @param options Опции запроса
100
+ * @returns Branch[]
101
+ */
102
+ listBranches(owner: string, repo: string, queryParams?: {
103
+ page?: number;
104
+ per_page?: number;
105
+ q?: string;
106
+ }, options?: {
107
+ signal?: AbortSignal;
108
+ }): Promise<Branch[]>;
109
+ /**
110
+ * List repository collaborators
111
+ * @param owner Repository owner
112
+ * @param repo Repository name
113
+ * @param queryParams Параметры запроса
114
+ * @param options Опции запроса
115
+ * @returns Collaborator[]
116
+ */
117
+ listCollaborators(owner: string, repo: string, queryParams?: {
118
+ affiliation?: string;
119
+ permission?: string;
120
+ page?: number;
121
+ per_page?: number;
122
+ }, options?: {
123
+ signal?: AbortSignal;
124
+ }): Promise<Collaborator[]>;
125
+ /**
126
+ * Add or update repository collaborator
127
+ * @param owner Repository owner
128
+ * @param repo Repository name
129
+ * @param collaborator Username of the collaborator to add or update
130
+ * @param params Collaborator permission settings
131
+ * @param options Опции запроса
132
+ * @returns CollaboratorInvitation
133
+ */
134
+ addCollaborator(owner: string, repo: string, collaborator: string, params: AddCollaboratorParams, options?: {
135
+ signal?: AbortSignal;
136
+ }): Promise<CollaboratorInvitation>;
137
+ /**
138
+ * Retrieve a list of repository commits
139
+ * @param owner Owner of the repository (owner or organization name)
140
+ * @param repo Name of the repository without the .git extension
141
+ * @param queryParams Параметры запроса
142
+ * @param options Опции запроса
143
+ * @returns Commit[]
144
+ */
145
+ listCommits(owner: string, repo: string, queryParams?: {
146
+ page?: number;
147
+ per_page?: number;
148
+ sha?: string;
149
+ path?: string;
150
+ not?: string;
151
+ author?: string;
152
+ committer?: string;
153
+ since?: string;
154
+ until?: string;
155
+ }, options?: {
156
+ signal?: AbortSignal;
157
+ }): Promise<Commit[]>;
158
+ /**
159
+ * Retrieve commit information
160
+ * @param owner Owner of the repository (owner or organization name)
161
+ * @param repo Name of the repository without the .git extension
162
+ * @param sha Commit hash
163
+ * @param options Опции запроса
164
+ * @returns Commit
165
+ */
166
+ getCommit(owner: string, repo: string, sha: string, options?: {
167
+ signal?: AbortSignal;
168
+ }): Promise<Commit>;
169
+ /**
170
+ * Compare two branches/tags/commits
171
+ * @param owner Owner of the repository (username or organization name)
172
+ * @param repo Name of the repository without the .git extension
173
+ * @param basehead References to compare in BASE...HEAD format (e.g., main...feature)
174
+ * @param queryParams Параметры запроса
175
+ * @param options Опции запроса
176
+ * @returns CompareResponse
177
+ */
178
+ compareCommits(owner: string, repo: string, basehead: string, queryParams?: {
179
+ page?: number;
180
+ per_page?: number;
181
+ }, options?: {
182
+ signal?: AbortSignal;
183
+ }): Promise<CompareResponse>;
184
+ /**
185
+ * Get file or directory contents
186
+ * @param owner Repository owner
187
+ * @param repo Repository name
188
+ * @param filepath Path to file or directory in the repository
189
+ * @param queryParams Параметры запроса
190
+ * @param options Опции запроса
191
+ * @returns ContentsResponse
192
+ */
193
+ getContent(owner: string, repo: string, filepath: string, queryParams?: {
194
+ ref?: string;
195
+ scope?: string;
196
+ }, options?: {
197
+ signal?: AbortSignal;
198
+ }): Promise<ContentsResponse>;
199
+ /**
200
+ * Create or update file in repository
201
+ * @param owner Repository owner
202
+ * @param repo Repository name
203
+ * @param filepath Path to the file in the repository
204
+ * @param params File creation or update options, including base64 content, branch, message, etc.
205
+ * @param options Опции запроса
206
+ * @returns FileCreationResponse
207
+ */
208
+ createOrUpdateFile(owner: string, repo: string, filepath: string, params: CreateFileParams, options?: {
209
+ signal?: AbortSignal;
210
+ }): Promise<FileCreationResponse>;
211
+ /**
212
+ * Delete file in repository
213
+ * @param owner Repository owner
214
+ * @param repo Repository name
215
+ * @param filepath Path to the file in the repository
216
+ * @param params File deletion options, including SHA, branch, commit message, etc.
217
+ * @param options Опции запроса
218
+ * @returns FileDeleteResponse
219
+ */
220
+ deleteFile(owner: string, repo: string, filepath: string, params: DeleteFileParams, options?: {
221
+ signal?: AbortSignal;
222
+ }): Promise<FileDeleteResponse>;
223
+ /**
224
+ * Fork a repository
225
+ * @param owner Owner of the base repository
226
+ * @param repo Name of the base repository
227
+ * @param params Fork options, including target name and organization
228
+ * @param options Опции запроса
229
+ * @returns Repository
230
+ */
231
+ createFork(owner: string, repo: string, params: CreateForkParams, options?: {
232
+ signal?: AbortSignal;
233
+ }): Promise<Repository>;
234
+ /**
235
+ * Create a Git commit
236
+ * @param owner Owner of the repository (owner or organization name)
237
+ * @param repo Name of the repository without the .git extension
238
+ * @param params Parameters for creating the commit
239
+ * @param options Опции запроса
240
+ * @returns Commit
241
+ */
242
+ createCommit(owner: string, repo: string, params: CreateCommitParams, options?: {
243
+ signal?: AbortSignal;
244
+ }): Promise<Commit>;
245
+ /**
246
+ * Create a Git reference
247
+ * @param owner Owner of the repository (owner or organization name)
248
+ * @param repo Name of the repository without the .git extension
249
+ * @param params Parameters for creating the reference
250
+ * @param options Опции запроса
251
+ * @returns Reference
252
+ */
253
+ createRef(owner: string, repo: string, params: CreateReferenceParams, options?: {
254
+ signal?: AbortSignal;
255
+ }): Promise<Reference>;
256
+ /**
257
+ * Creates new Git tree
258
+ * @param owner owner
259
+ * @param repo repo
260
+ * @param params Параметры создания дерева
261
+ * @param options Опции запроса
262
+ * @returns RepoTree
263
+ */
264
+ createTree(owner: string, repo: string, params: CreateTreeParams, options?: {
265
+ signal?: AbortSignal;
266
+ }): Promise<RepoTree>;
267
+ /**
268
+ * Get repository tree by SHA
269
+ * @param owner Repository owner
270
+ * @param repo Repository name
271
+ * @param sha Commit SHA to list tree for
272
+ * @param queryParams Параметры запроса
273
+ * @param options Опции запроса
274
+ * @returns GitTreeResponse
275
+ */
276
+ getTree(owner: string, repo: string, sha: string, queryParams?: {
277
+ page?: number;
278
+ per_page?: number;
279
+ recursive?: boolean;
280
+ }, options?: {
281
+ signal?: AbortSignal;
282
+ }): Promise<GitTreeResponse>;
283
+ /**
284
+ * Get repository languages
285
+ * @param owner Repository owner
286
+ * @param repo Repository name
287
+ * @param options Опции запроса
288
+ * @returns Record<string, unknown>
289
+ */
290
+ listLanguages(owner: string, repo: string, options?: {
291
+ signal?: AbortSignal;
292
+ }): Promise<Record<string, unknown>>;
293
+ /**
294
+ * List pull requests
295
+ * @param owner Repository owner
296
+ * @param repo Repository name
297
+ * @param queryParams Параметры запроса
298
+ * @param options Опции запроса
299
+ * @returns PullRequest[]
300
+ */
301
+ listPulls(owner: string, repo: string, queryParams?: {
302
+ state?: string;
303
+ head?: string;
304
+ base?: string;
305
+ sort?: string;
306
+ direction?: string;
307
+ page?: number;
308
+ per_page?: number;
309
+ }, options?: {
310
+ signal?: AbortSignal;
311
+ }): Promise<PullRequest[]>;
312
+ /**
313
+ * Pull request details.
314
+ * @param owner Repository owner
315
+ * @param repo Repository name
316
+ * @param pull_number The number that identifies the pull request..
317
+ * @param options Опции запроса
318
+ * @returns PullRequest
319
+ */
320
+ getPull(owner: string, repo: string, pull_number: number, options?: {
321
+ signal?: AbortSignal;
322
+ }): Promise<PullRequest>;
323
+ /**
324
+ * Update a pull request.
325
+ * @param owner Repository owner
326
+ * @param repo Repository name
327
+ * @param pull_number The number that identifies the pull request.
328
+ * @param params Pull request update parameters
329
+ * @param options Опции запроса
330
+ * @returns PullRequest
331
+ */
332
+ updatePull(owner: string, repo: string, pull_number: number, params: UpdatePullRequestParams, options?: {
333
+ signal?: AbortSignal;
334
+ }): Promise<PullRequest>;
335
+ /**
336
+ * Get authenticated user repositories
337
+ * @param queryParams Параметры запроса
338
+ * @param options Опции запроса
339
+ * @returns Repository[]
340
+ */
341
+ listForAuthenticatedUser(queryParams?: {
342
+ page?: number;
343
+ per_page?: number;
344
+ }, options?: {
345
+ signal?: AbortSignal;
346
+ }): Promise<Repository[]>;
347
+ /**
348
+ * Create repository
349
+ * @param params Repository creation options
350
+ * @param options Опции запроса
351
+ * @returns Repository
352
+ */
353
+ createForAuthenticatedUser(params: CreateRepositoryParams, options?: {
354
+ signal?: AbortSignal;
355
+ }): Promise<Repository>;
1068
356
  }
1069
- export { RepositoriesApi };