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,230 +1,69 @@
1
+ import type { GitVerseClient } from "../client";
2
+ import type { Secret, SecretList } 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 Secret {
19
- created_at?: string;
20
- name?: string;
21
- }
22
- interface SecretList {
23
- secrets?: Secret[];
24
- total_count?: number;
25
- }
26
- /**
27
- * Предупреждение об устаревшей версии API
28
- */
29
- declare class ApiVersionWarning {
30
- /** Текущая используемая версия */
31
- readonly currentVersion: string;
32
- /** Последняя доступная версия */
33
- readonly latestVersion: string;
34
- /** Дата вывода из эксплуатации */
35
- readonly decommissioning?: string;
36
- constructor(currentVersion: string, latestVersion: string, decommissioning?: string);
37
- /**
38
- * Возвращает сообщение о предупреждении
39
- */
40
- getMessage(): string;
41
- }
42
- declare const HTTPMethods: {
43
- readonly DELETE: "DELETE"
44
- readonly GET: "GET"
45
- readonly PATCH: "PATCH"
46
- readonly POST: "POST"
47
- readonly PUT: "PUT"
48
- };
49
- type HTTPMethods = (typeof HTTPMethods)[keyof typeof HTTPMethods];
50
- /**
51
- * Параметры для конфигурации GitVerse клиента
52
- */
53
- interface GitVerseClientConfig {
54
- /**
55
- * Базовый URL API GitVerse
56
- * @default 'https://api.gitverse.ru'
57
- */
58
- baseUrl?: string;
59
- /**
60
- * Токен доступа для авторизации в API
61
- */
62
- token?: string;
63
- /**
64
- * Версия API
65
- * @default '1'
66
- */
67
- apiVersion?: string;
68
- }
69
- /**
70
- * Основной класс для работы с GitVerse API
71
- */
72
- declare class GitVerseClient {
73
- private baseUrl;
74
- private token?;
75
- private apiVersion;
76
- /**
77
- * Callback для обработки предупреждений об устаревшей версии API
78
- */
79
- onApiVersionWarning?: (warning: ApiVersionWarning) => void;
80
- /**
81
- * Создает новый экземпляр GitVerse клиента
82
- * @param config Конфигурация клиента
83
- */
84
- constructor(config?: GitVerseClientConfig);
85
- /**
86
- * Устанавливает токен авторизации
87
- * @param token Токен доступа
88
- */
89
- setToken(token: string): void;
90
- /**
91
- * Извлекает информацию о Rate Limit из заголовков ответа
92
- */
93
- private extractRateLimitInfo;
94
- /**
95
- * Извлекает информацию о версии API из заголовков ответа
96
- */
97
- private extractApiVersionInfo;
98
- /**
99
- * Извлекает метаданные из заголовков ответа
100
- */
101
- private extractMetadata;
102
- /**
103
- * Выполняет API-запрос с учетом авторизации и версии API
104
- * @param path Путь к API-ресурсу
105
- * @param method HTTP-метод
106
- * @param body Тело запроса (опционально)
107
- * @param options Опции запроса (опционально)
108
- * @returns Ответ от API
109
- * @throws {RateLimitError} При превышении лимита запросов (429)
110
- * @throws {GitVerseApiError} При других ошибках API
111
- */
112
- request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
113
- /**
114
- * Выполняет GET-запрос
115
- * @param path Путь к API-ресурсу
116
- * @param options Опции запроса (опционально)
117
- * @returns Ответ от API
118
- */
119
- get<T>(path: string, options?: RequestOptions): Promise<T>;
120
- /**
121
- * Выполняет POST-запрос
122
- * @param path Путь к API-ресурсу
123
- * @param body Тело запроса
124
- * @param options Опции запроса (опционально)
125
- * @returns Ответ от API
126
- */
127
- post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
128
- /**
129
- * Выполняет PUT-запрос
130
- * @param path Путь к API-ресурсу
131
- * @param body Тело запроса
132
- * @param options Опции запроса (опционально)
133
- * @returns Ответ от API
134
- */
135
- put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
136
- /**
137
- * Выполняет DELETE-запрос
138
- * @param path Путь к API-ресурсу
139
- * @param body Тело запроса (опционально)
140
- * @param options Опции запроса (опционально)
141
- * @returns Ответ от API
142
- */
143
- delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
144
- /**
145
- * Выполняет PATCH-запрос
146
- * @param path Путь к API-ресурсу
147
- * @param body Тело запроса
148
- * @param options Опции запроса (опционально)
149
- * @returns Ответ от API
150
- */
151
- patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
152
- /**
153
- * Выполняет загрузку файла через multipart/form-data
154
- * @param path Путь к API-ресурсу
155
- * @param fieldName Имя поля для файла
156
- * @param file Файл для загрузки (Blob или ArrayBuffer)
157
- * @param fileName Имя файла
158
- * @param options Опции запроса (опционально)
159
- * @returns Ответ от API
160
- */
161
- uploadFile<T>(path: string, fieldName: string, file: Blob | ArrayBuffer, fileName: string, options?: RequestOptions): Promise<T>;
162
- }
163
- /**
164
- * API для работы с организациями
165
- */
166
- declare class OrganizationsApi {
167
- private client;
168
- /**
169
- * Создает новый экземпляр API
170
- * @param client GitVerse клиент
171
- */
172
- constructor(client: GitVerseClient);
173
- /**
174
- * Gets a list of organization secrets
175
- * @param org Organization name
176
- * @param queryParams Параметры запроса
177
- * @param options Опции запроса
178
- * @returns SecretList
179
- */
180
- listOrgSecrets(org: string, queryParams?: {
181
- per_page?: string
182
- page?: string
183
- }, options?: {
184
- signal?: AbortSignal
185
- }): Promise<SecretList>;
186
- /**
187
- * Gets the metadata of a secret (without value) in an organization
188
- * @param org Organization name
189
- * @param secretname Secret name
190
- * @param options Опции запроса
191
- * @returns Secret
192
- */
193
- getOrgSecret(org: string, secretname: string, options?: {
194
- signal?: AbortSignal
195
- }): Promise<Secret>;
196
- /**
197
- * Creates or updates a secret in the organization, without encryption
198
- * @param org Organization name
199
- * @param secretname Secret name
200
- * @param queryParams Параметры запроса
201
- * @param options Опции запроса
202
- * @returns Secret
203
- */
204
- createOrUpdateOrgSecret(org: string, secretname: string, queryParams?: {
205
- encrypted_value: string
206
- }, options?: {
207
- signal?: AbortSignal
208
- }): Promise<Secret>;
209
- /**
210
- * Removes a secret from an organization
211
- * @param org Organization name
212
- * @param secretname Secret name
213
- * @param options Опции запроса
214
- * @returns void
215
- */
216
- deleteOrgSecret(org: string, secretname: string, options?: {
217
- signal?: AbortSignal
218
- }): Promise<void>;
219
- /**
220
- * Check organization membership for a user
221
- * @param org The organization name.
222
- * @param username Username of the member to check.
223
- * @param options Опции запроса
224
- * @returns void
225
- */
226
- isMember(org: string, username: string, options?: {
227
- signal?: AbortSignal
228
- }): Promise<void>;
4
+ * API для работы с организациями
5
+ */
6
+ export declare class OrganizationsApi {
7
+ private client;
8
+ /**
9
+ * Создает новый экземпляр API
10
+ * @param client GitVerse клиент
11
+ */
12
+ constructor(client: GitVerseClient);
13
+ /**
14
+ * Gets a list of organization secrets
15
+ * @param org Organization name
16
+ * @param queryParams Параметры запроса
17
+ * @param options Опции запроса
18
+ * @returns SecretList
19
+ */
20
+ listOrgSecrets(org: string, queryParams?: {
21
+ per_page?: string;
22
+ page?: string;
23
+ }, options?: {
24
+ signal?: AbortSignal;
25
+ }): Promise<SecretList>;
26
+ /**
27
+ * Gets the metadata of a secret (without value) in an organization
28
+ * @param org Organization name
29
+ * @param secretname Secret name
30
+ * @param options Опции запроса
31
+ * @returns Secret
32
+ */
33
+ getOrgSecret(org: string, secretname: string, options?: {
34
+ signal?: AbortSignal;
35
+ }): Promise<Secret>;
36
+ /**
37
+ * Creates or updates a secret in the organization, without encryption
38
+ * @param org Organization name
39
+ * @param secretname Secret name
40
+ * @param queryParams Параметры запроса
41
+ * @param options Опции запроса
42
+ * @returns Secret
43
+ */
44
+ createOrUpdateOrgSecret(org: string, secretname: string, queryParams?: {
45
+ encrypted_value: string;
46
+ }, options?: {
47
+ signal?: AbortSignal;
48
+ }): Promise<Secret>;
49
+ /**
50
+ * Removes a secret from an organization
51
+ * @param org Organization name
52
+ * @param secretname Secret name
53
+ * @param options Опции запроса
54
+ * @returns void
55
+ */
56
+ deleteOrgSecret(org: string, secretname: string, options?: {
57
+ signal?: AbortSignal;
58
+ }): Promise<void>;
59
+ /**
60
+ * Check organization membership for a user
61
+ * @param org The organization name.
62
+ * @param username Username of the member to check.
63
+ * @param options Опции запроса
64
+ * @returns void
65
+ */
66
+ isMember(org: string, username: string, options?: {
67
+ signal?: AbortSignal;
68
+ }): Promise<void>;
229
69
  }
230
- export { OrganizationsApi };
@@ -1,199 +1,35 @@
1
+ import type { GitVerseClient } from "../client";
2
+ import type { CreatePagesDeploymentParams, PagesDeployment, PagesDeploymentStatus } 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 CreatePagesDeploymentParams {
19
- artifact_id?: number;
20
- }
21
- interface PagesDeployment {
22
- id?: number;
23
- page_url?: string;
24
- status_url?: string;
25
- }
26
- interface PagesDeploymentStatus {
27
- status?: string;
28
- }
29
- /**
30
- * Предупреждение об устаревшей версии API
31
- */
32
- declare class ApiVersionWarning {
33
- /** Текущая используемая версия */
34
- readonly currentVersion: string;
35
- /** Последняя доступная версия */
36
- readonly latestVersion: string;
37
- /** Дата вывода из эксплуатации */
38
- readonly decommissioning?: string;
39
- constructor(currentVersion: string, latestVersion: string, decommissioning?: string);
40
- /**
41
- * Возвращает сообщение о предупреждении
42
- */
43
- getMessage(): string;
44
- }
45
- declare const HTTPMethods: {
46
- readonly DELETE: "DELETE"
47
- readonly GET: "GET"
48
- readonly PATCH: "PATCH"
49
- readonly POST: "POST"
50
- readonly PUT: "PUT"
51
- };
52
- type HTTPMethods = (typeof HTTPMethods)[keyof typeof HTTPMethods];
53
- /**
54
- * Параметры для конфигурации GitVerse клиента
55
- */
56
- interface GitVerseClientConfig {
57
- /**
58
- * Базовый URL API GitVerse
59
- * @default 'https://api.gitverse.ru'
60
- */
61
- baseUrl?: string;
62
- /**
63
- * Токен доступа для авторизации в API
64
- */
65
- token?: string;
66
- /**
67
- * Версия API
68
- * @default '1'
69
- */
70
- apiVersion?: string;
71
- }
72
- /**
73
- * Основной класс для работы с GitVerse API
74
- */
75
- declare class GitVerseClient {
76
- private baseUrl;
77
- private token?;
78
- private apiVersion;
79
- /**
80
- * Callback для обработки предупреждений об устаревшей версии API
81
- */
82
- onApiVersionWarning?: (warning: ApiVersionWarning) => void;
83
- /**
84
- * Создает новый экземпляр GitVerse клиента
85
- * @param config Конфигурация клиента
86
- */
87
- constructor(config?: GitVerseClientConfig);
88
- /**
89
- * Устанавливает токен авторизации
90
- * @param token Токен доступа
91
- */
92
- setToken(token: string): void;
93
- /**
94
- * Извлекает информацию о Rate Limit из заголовков ответа
95
- */
96
- private extractRateLimitInfo;
97
- /**
98
- * Извлекает информацию о версии API из заголовков ответа
99
- */
100
- private extractApiVersionInfo;
101
- /**
102
- * Извлекает метаданные из заголовков ответа
103
- */
104
- private extractMetadata;
105
- /**
106
- * Выполняет API-запрос с учетом авторизации и версии API
107
- * @param path Путь к API-ресурсу
108
- * @param method HTTP-метод
109
- * @param body Тело запроса (опционально)
110
- * @param options Опции запроса (опционально)
111
- * @returns Ответ от API
112
- * @throws {RateLimitError} При превышении лимита запросов (429)
113
- * @throws {GitVerseApiError} При других ошибках API
114
- */
115
- request<T>(path: string, method: HTTPMethods, body?: unknown, options?: RequestOptions): Promise<T>;
116
- /**
117
- * Выполняет GET-запрос
118
- * @param path Путь к API-ресурсу
119
- * @param options Опции запроса (опционально)
120
- * @returns Ответ от API
121
- */
122
- get<T>(path: string, options?: RequestOptions): Promise<T>;
123
- /**
124
- * Выполняет POST-запрос
125
- * @param path Путь к API-ресурсу
126
- * @param body Тело запроса
127
- * @param options Опции запроса (опционально)
128
- * @returns Ответ от API
129
- */
130
- post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
131
- /**
132
- * Выполняет PUT-запрос
133
- * @param path Путь к API-ресурсу
134
- * @param body Тело запроса
135
- * @param options Опции запроса (опционально)
136
- * @returns Ответ от API
137
- */
138
- put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
139
- /**
140
- * Выполняет DELETE-запрос
141
- * @param path Путь к API-ресурсу
142
- * @param body Тело запроса (опционально)
143
- * @param options Опции запроса (опционально)
144
- * @returns Ответ от API
145
- */
146
- delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
147
- /**
148
- * Выполняет PATCH-запрос
149
- * @param path Путь к API-ресурсу
150
- * @param body Тело запроса
151
- * @param options Опции запроса (опционально)
152
- * @returns Ответ от API
153
- */
154
- patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
155
- /**
156
- * Выполняет загрузку файла через multipart/form-data
157
- * @param path Путь к API-ресурсу
158
- * @param fieldName Имя поля для файла
159
- * @param file Файл для загрузки (Blob или ArrayBuffer)
160
- * @param fileName Имя файла
161
- * @param options Опции запроса (опционально)
162
- * @returns Ответ от API
163
- */
164
- uploadFile<T>(path: string, fieldName: string, file: Blob | ArrayBuffer, fileName: string, options?: RequestOptions): Promise<T>;
165
- }
166
- /**
167
- * API для работы с GitVerse Pages
168
- */
169
- declare class PagesApi {
170
- private client;
171
- /**
172
- * Создает новый экземпляр API
173
- * @param client GitVerse клиент
174
- */
175
- constructor(client: GitVerseClient);
176
- /**
177
- * Creates a deployment for GitVerse Pages
178
- * @param owner Owner of the repository (username or organization name)
179
- * @param repo Name of the repository without the .git extension
180
- * @param params Configuration parameters for the Pages deployment
181
- * @param options Опции запроса
182
- * @returns PagesDeployment
183
- */
184
- createDeployment(owner: string, repo: string, params: CreatePagesDeploymentParams, options?: {
185
- signal?: AbortSignal
186
- }): Promise<PagesDeployment>;
187
- /**
188
- * Gets the status of a GitVerse Pages deployment
189
- * @param owner Owner of the repository (username or organization name)
190
- * @param repo Name of the repository without the .git extension
191
- * @param pages_deployment_id Unique identifier of the Pages deployment
192
- * @param options Опции запроса
193
- * @returns PagesDeploymentStatus
194
- */
195
- getDeploymentStatus(owner: string, repo: string, pages_deployment_id: string, options?: {
196
- signal?: AbortSignal
197
- }): Promise<PagesDeploymentStatus>;
4
+ * API для работы с GitVerse Pages
5
+ */
6
+ export declare class PagesApi {
7
+ private client;
8
+ /**
9
+ * Создает новый экземпляр API
10
+ * @param client GitVerse клиент
11
+ */
12
+ constructor(client: GitVerseClient);
13
+ /**
14
+ * Creates a deployment for GitVerse Pages
15
+ * @param owner Owner of the repository (username or organization name)
16
+ * @param repo Name of the repository without the .git extension
17
+ * @param params Configuration parameters for the Pages deployment
18
+ * @param options Опции запроса
19
+ * @returns PagesDeployment
20
+ */
21
+ createDeployment(owner: string, repo: string, params: CreatePagesDeploymentParams, options?: {
22
+ signal?: AbortSignal;
23
+ }): Promise<PagesDeployment>;
24
+ /**
25
+ * Gets the status of a GitVerse Pages deployment
26
+ * @param owner Owner of the repository (username or organization name)
27
+ * @param repo Name of the repository without the .git extension
28
+ * @param pages_deployment_id Unique identifier of the Pages deployment
29
+ * @param options Опции запроса
30
+ * @returns PagesDeploymentStatus
31
+ */
32
+ getDeploymentStatus(owner: string, repo: string, pages_deployment_id: string, options?: {
33
+ signal?: AbortSignal;
34
+ }): Promise<PagesDeploymentStatus>;
198
35
  }
199
- export { PagesApi };