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.
- package/README.md +112 -7
- package/dist/api/actions.d.ts +313 -544
- package/dist/api/emails.d.ts +41 -206
- package/dist/api/issues.d.ts +100 -480
- package/dist/api/organizations.d.ts +67 -228
- package/dist/api/pages.d.ts +33 -197
- package/dist/api/pulls.d.ts +75 -520
- package/dist/api/releases.d.ts +135 -384
- package/dist/api/repositories.d.ts +354 -1067
- package/dist/api/repositories.js.map +2 -2
- package/dist/api/stars.d.ts +55 -272
- package/dist/api/teams.d.ts +51 -288
- package/dist/api/users.d.ts +52 -263
- package/dist/client.d.ts +118 -150
- package/dist/enums.d.ts +47 -48
- package/dist/errors.d.ts +39 -73
- package/dist/index.d.ts +54 -2442
- package/dist/types.d.ts +1028 -904
- package/dist/utils.d.ts +72 -61
- package/package.json +1 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,155 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
/**
|
|
19
|
-
* Предупреждение об устаревшей версии API
|
|
20
|
-
*/
|
|
21
|
-
declare class ApiVersionWarning {
|
|
22
|
-
/** Текущая используемая версия */
|
|
23
|
-
readonly currentVersion: string;
|
|
24
|
-
/** Последняя доступная версия */
|
|
25
|
-
readonly latestVersion: string;
|
|
26
|
-
/** Дата вывода из эксплуатации */
|
|
27
|
-
readonly decommissioning?: string;
|
|
28
|
-
constructor(currentVersion: string, latestVersion: string, decommissioning?: string);
|
|
29
|
-
/**
|
|
30
|
-
* Возвращает сообщение о предупреждении
|
|
31
|
-
*/
|
|
32
|
-
getMessage(): string;
|
|
33
|
-
}
|
|
34
|
-
declare const HTTPMethods: {
|
|
35
|
-
readonly DELETE: "DELETE"
|
|
36
|
-
readonly GET: "GET"
|
|
37
|
-
readonly PATCH: "PATCH"
|
|
38
|
-
readonly POST: "POST"
|
|
39
|
-
readonly PUT: "PUT"
|
|
1
|
+
import { ApiVersionWarning } from "./errors";
|
|
2
|
+
import type { RequestOptions } from "./types";
|
|
3
|
+
export declare const HTTPMethods: {
|
|
4
|
+
readonly DELETE: "DELETE";
|
|
5
|
+
readonly GET: "GET";
|
|
6
|
+
readonly PATCH: "PATCH";
|
|
7
|
+
readonly POST: "POST";
|
|
8
|
+
readonly PUT: "PUT";
|
|
40
9
|
};
|
|
41
|
-
type HTTPMethods = (typeof HTTPMethods)[keyof typeof HTTPMethods];
|
|
10
|
+
export type HTTPMethods = (typeof HTTPMethods)[keyof typeof HTTPMethods];
|
|
42
11
|
/**
|
|
43
|
-
* Параметры для конфигурации GitVerse клиента
|
|
44
|
-
*/
|
|
45
|
-
interface GitVerseClientConfig {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
12
|
+
* Параметры для конфигурации GitVerse клиента
|
|
13
|
+
*/
|
|
14
|
+
export interface GitVerseClientConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Базовый URL API GitVerse
|
|
17
|
+
* @default 'https://api.gitverse.ru'
|
|
18
|
+
*/
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Токен доступа для авторизации в API
|
|
22
|
+
*/
|
|
23
|
+
token?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Версия API
|
|
26
|
+
* @default '1'
|
|
27
|
+
*/
|
|
28
|
+
apiVersion?: string;
|
|
60
29
|
}
|
|
61
30
|
/**
|
|
62
|
-
* Основной класс для работы с GitVerse API
|
|
63
|
-
*/
|
|
64
|
-
declare class GitVerseClient {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
31
|
+
* Основной класс для работы с GitVerse API
|
|
32
|
+
*/
|
|
33
|
+
export declare class GitVerseClient {
|
|
34
|
+
private baseUrl;
|
|
35
|
+
private token?;
|
|
36
|
+
private apiVersion;
|
|
37
|
+
/**
|
|
38
|
+
* Callback для обработки предупреждений об устаревшей версии API
|
|
39
|
+
*/
|
|
40
|
+
onApiVersionWarning?: (warning: ApiVersionWarning) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Создает новый экземпляр GitVerse клиента
|
|
43
|
+
* @param config Конфигурация клиента
|
|
44
|
+
*/
|
|
45
|
+
constructor(config?: GitVerseClientConfig);
|
|
46
|
+
/**
|
|
47
|
+
* Устанавливает токен авторизации
|
|
48
|
+
* @param token Токен доступа
|
|
49
|
+
*/
|
|
50
|
+
setToken(token: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Извлекает информацию о Rate Limit из заголовков ответа
|
|
53
|
+
*/
|
|
54
|
+
private extractRateLimitInfo;
|
|
55
|
+
/**
|
|
56
|
+
* Извлекает информацию о версии API из заголовков ответа
|
|
57
|
+
*/
|
|
58
|
+
private extractApiVersionInfo;
|
|
59
|
+
/**
|
|
60
|
+
* Извлекает метаданные из заголовков ответа
|
|
61
|
+
*/
|
|
62
|
+
private extractMetadata;
|
|
63
|
+
/**
|
|
64
|
+
* Выполняет API-запрос с учетом авторизации и версии API
|
|
65
|
+
* @param path Путь к API-ресурсу
|
|
66
|
+
* @param method HTTP-метод
|
|
67
|
+
* @param body Тело запроса (опционально)
|
|
68
|
+
* @param options Опции запроса (опционально)
|
|
69
|
+
* @returns Ответ от API
|
|
70
|
+
* @throws {RateLimitError} При превышении лимита запросов (429)
|
|
71
|
+
* @throws {GitVerseApiError} При других ошибках API
|
|
72
|
+
*/
|
|
73
|
+
request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
74
|
+
/**
|
|
75
|
+
* Выполняет GET-запрос
|
|
76
|
+
* @param path Путь к API-ресурсу
|
|
77
|
+
* @param options Опции запроса (опционально)
|
|
78
|
+
* @returns Ответ от API
|
|
79
|
+
*/
|
|
80
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
81
|
+
/**
|
|
82
|
+
* Выполняет POST-запрос
|
|
83
|
+
* @param path Путь к API-ресурсу
|
|
84
|
+
* @param body Тело запроса
|
|
85
|
+
* @param options Опции запроса (опционально)
|
|
86
|
+
* @returns Ответ от API
|
|
87
|
+
*/
|
|
88
|
+
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
89
|
+
/**
|
|
90
|
+
* Выполняет PUT-запрос
|
|
91
|
+
* @param path Путь к API-ресурсу
|
|
92
|
+
* @param body Тело запроса
|
|
93
|
+
* @param options Опции запроса (опционально)
|
|
94
|
+
* @returns Ответ от API
|
|
95
|
+
*/
|
|
96
|
+
put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
97
|
+
/**
|
|
98
|
+
* Выполняет DELETE-запрос
|
|
99
|
+
* @param path Путь к API-ресурсу
|
|
100
|
+
* @param body Тело запроса (опционально)
|
|
101
|
+
* @param options Опции запроса (опционально)
|
|
102
|
+
* @returns Ответ от API
|
|
103
|
+
*/
|
|
104
|
+
delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
105
|
+
/**
|
|
106
|
+
* Выполняет PATCH-запрос
|
|
107
|
+
* @param path Путь к API-ресурсу
|
|
108
|
+
* @param body Тело запроса
|
|
109
|
+
* @param options Опции запроса (опционально)
|
|
110
|
+
* @returns Ответ от API
|
|
111
|
+
*/
|
|
112
|
+
patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
113
|
+
/**
|
|
114
|
+
* Выполняет загрузку файла через multipart/form-data
|
|
115
|
+
* @param path Путь к API-ресурсу
|
|
116
|
+
* @param fieldName Имя поля для файла
|
|
117
|
+
* @param file Файл для загрузки (Blob или ArrayBuffer)
|
|
118
|
+
* @param fileName Имя файла
|
|
119
|
+
* @param options Опции запроса (опционально)
|
|
120
|
+
* @returns Ответ от API
|
|
121
|
+
*/
|
|
122
|
+
uploadFile<T>(path: string, fieldName: string, file: Blob | ArrayBuffer, fileName: string, options?: RequestOptions): Promise<T>;
|
|
154
123
|
}
|
|
155
|
-
export { HTTPMethods, GitVerseClientConfig, GitVerseClient };
|
package/dist/enums.d.ts
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Перечисления для GitVerse API
|
|
3
|
-
* @generated Сгенерировано автоматически из OpenAPI спецификации
|
|
4
|
-
*/
|
|
5
|
-
declare const ContentType: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
type ContentType = (typeof ContentType)[keyof typeof ContentType];
|
|
10
|
-
declare const IssueState: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
type IssueState = (typeof IssueState)[keyof typeof IssueState];
|
|
15
|
-
declare const PullRequestSortCriteria: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
type PullRequestSortCriteria = (typeof PullRequestSortCriteria)[keyof typeof PullRequestSortCriteria];
|
|
22
|
-
declare const PullRequestSortDirection: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
type PullRequestSortDirection = (typeof PullRequestSortDirection)[keyof typeof PullRequestSortDirection];
|
|
27
|
-
declare const PullRequestState: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
type PullRequestState = (typeof PullRequestState)[keyof typeof PullRequestState];
|
|
32
|
-
declare const PullRequestStateFilter: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
type PullRequestStateFilter = (typeof PullRequestStateFilter)[keyof typeof PullRequestStateFilter];
|
|
38
|
-
declare const UserType: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
type UserType = (typeof UserType)[keyof typeof UserType];
|
|
43
|
-
declare const VisibilityType: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
type VisibilityType = (typeof VisibilityType)[keyof typeof VisibilityType];
|
|
49
|
-
export { VisibilityType, UserType, PullRequestStateFilter, PullRequestState, PullRequestSortDirection, PullRequestSortCriteria, IssueState, ContentType };
|
|
2
|
+
* Перечисления для GitVerse API
|
|
3
|
+
* @generated Сгенерировано автоматически из OpenAPI спецификации
|
|
4
|
+
*/
|
|
5
|
+
export declare const ContentType: {
|
|
6
|
+
readonly Dir: "dir";
|
|
7
|
+
readonly File: "file";
|
|
8
|
+
};
|
|
9
|
+
export type ContentType = (typeof ContentType)[keyof typeof ContentType];
|
|
10
|
+
export declare const IssueState: {
|
|
11
|
+
readonly Closed: "closed";
|
|
12
|
+
readonly Open: "open";
|
|
13
|
+
};
|
|
14
|
+
export type IssueState = (typeof IssueState)[keyof typeof IssueState];
|
|
15
|
+
export declare const PullRequestSortCriteria: {
|
|
16
|
+
readonly Created: "created";
|
|
17
|
+
readonly LongRunning: "long-running";
|
|
18
|
+
readonly Popularity: "popularity";
|
|
19
|
+
readonly Updated: "updated";
|
|
20
|
+
};
|
|
21
|
+
export type PullRequestSortCriteria = (typeof PullRequestSortCriteria)[keyof typeof PullRequestSortCriteria];
|
|
22
|
+
export declare const PullRequestSortDirection: {
|
|
23
|
+
readonly Asc: "asc";
|
|
24
|
+
readonly Desc: "desc";
|
|
25
|
+
};
|
|
26
|
+
export type PullRequestSortDirection = (typeof PullRequestSortDirection)[keyof typeof PullRequestSortDirection];
|
|
27
|
+
export declare const PullRequestState: {
|
|
28
|
+
readonly Closed: "closed";
|
|
29
|
+
readonly Open: "open";
|
|
30
|
+
};
|
|
31
|
+
export type PullRequestState = (typeof PullRequestState)[keyof typeof PullRequestState];
|
|
32
|
+
export declare const PullRequestStateFilter: {
|
|
33
|
+
readonly All: "all";
|
|
34
|
+
readonly Closed: "closed";
|
|
35
|
+
readonly Open: "open";
|
|
36
|
+
};
|
|
37
|
+
export type PullRequestStateFilter = (typeof PullRequestStateFilter)[keyof typeof PullRequestStateFilter];
|
|
38
|
+
export declare const UserType: {
|
|
39
|
+
readonly Organization: "Organization";
|
|
40
|
+
readonly User: "User";
|
|
41
|
+
};
|
|
42
|
+
export type UserType = (typeof UserType)[keyof typeof UserType];
|
|
43
|
+
export declare const VisibilityType: {
|
|
44
|
+
readonly Limited: "limited";
|
|
45
|
+
readonly Private: "private";
|
|
46
|
+
readonly Public: "public";
|
|
47
|
+
};
|
|
48
|
+
export type VisibilityType = (typeof VisibilityType)[keyof typeof VisibilityType];
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,80 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/** Максимальное количество запросов */
|
|
6
|
-
limit: number;
|
|
7
|
-
/** Оставшееся количество запросов */
|
|
8
|
-
remaining: number;
|
|
9
|
-
/** Unix timestamp сброса лимита */
|
|
10
|
-
reset: number;
|
|
11
|
-
/** Секунд до сброса лимита */
|
|
12
|
-
retryAfter: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Информация о версии API
|
|
16
|
-
*/
|
|
17
|
-
interface ApiVersionInfo {
|
|
18
|
-
/** Текущая используемая версия */
|
|
19
|
-
version: string;
|
|
20
|
-
/** Последняя доступная версия */
|
|
21
|
-
latestVersion: string;
|
|
22
|
-
/** Версия помечена как устаревшая */
|
|
23
|
-
deprecated: boolean;
|
|
24
|
-
/** Дата вывода из эксплуатации */
|
|
25
|
-
decommissioning?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Метаданные ответа API
|
|
29
|
-
*/
|
|
30
|
-
interface ApiResponseMetadata {
|
|
31
|
-
/** Уникальный идентификатор запроса */
|
|
32
|
-
requestId?: string;
|
|
33
|
-
/** Информация о лимитах */
|
|
34
|
-
rateLimit?: RateLimitInfo;
|
|
35
|
-
/** Информация о версии API */
|
|
36
|
-
apiVersion?: ApiVersionInfo;
|
|
37
|
-
}
|
|
2
|
+
* Классы ошибок для GitVerse API
|
|
3
|
+
*/
|
|
4
|
+
import type { ApiResponseMetadata, RateLimitInfo } from "./types";
|
|
38
5
|
/**
|
|
39
|
-
* Базовая ошибка GitVerse API
|
|
40
|
-
*/
|
|
41
|
-
declare class GitVerseApiError extends Error {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
6
|
+
* Базовая ошибка GitVerse API
|
|
7
|
+
*/
|
|
8
|
+
export declare class GitVerseApiError extends Error {
|
|
9
|
+
/** HTTP статус код */
|
|
10
|
+
readonly status: number;
|
|
11
|
+
/** Метаданные ответа API */
|
|
12
|
+
readonly metadata?: ApiResponseMetadata;
|
|
13
|
+
constructor(status: number, message: string, metadata?: ApiResponseMetadata);
|
|
47
14
|
}
|
|
48
15
|
/**
|
|
49
|
-
* Ошибка превышения лимита запросов (429 Too Many Requests)
|
|
50
|
-
*/
|
|
51
|
-
declare class RateLimitError extends GitVerseApiError {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
16
|
+
* Ошибка превышения лимита запросов (429 Too Many Requests)
|
|
17
|
+
*/
|
|
18
|
+
export declare class RateLimitError extends GitVerseApiError {
|
|
19
|
+
/** Информация о лимитах */
|
|
20
|
+
readonly rateLimit: RateLimitInfo;
|
|
21
|
+
constructor(message: string, rateLimit: RateLimitInfo, metadata?: ApiResponseMetadata);
|
|
22
|
+
/**
|
|
23
|
+
* Возвращает количество секунд до сброса лимита
|
|
24
|
+
*/
|
|
25
|
+
getRetryAfterSeconds(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Возвращает дату/время сброса лимита
|
|
28
|
+
*/
|
|
29
|
+
getResetDate(): Date;
|
|
63
30
|
}
|
|
64
31
|
/**
|
|
65
|
-
* Предупреждение об устаревшей версии API
|
|
66
|
-
*/
|
|
67
|
-
declare class ApiVersionWarning {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
32
|
+
* Предупреждение об устаревшей версии API
|
|
33
|
+
*/
|
|
34
|
+
export declare class ApiVersionWarning {
|
|
35
|
+
/** Текущая используемая версия */
|
|
36
|
+
readonly currentVersion: string;
|
|
37
|
+
/** Последняя доступная версия */
|
|
38
|
+
readonly latestVersion: string;
|
|
39
|
+
/** Дата вывода из эксплуатации */
|
|
40
|
+
readonly decommissioning?: string;
|
|
41
|
+
constructor(currentVersion: string, latestVersion: string, decommissioning?: string);
|
|
42
|
+
/**
|
|
43
|
+
* Возвращает сообщение о предупреждении
|
|
44
|
+
*/
|
|
45
|
+
getMessage(): string;
|
|
79
46
|
}
|
|
80
|
-
export { RateLimitError, GitVerseApiError, ApiVersionWarning };
|