@redonvn/event-ws-cliproxyapi-sdk 0.1.0 → 0.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,557 +0,0 @@
1
- export class CliproxyApiClient {
2
- constructor(options) {
3
- this.baseUrl = options.baseUrl.replace(/\/+$/, '');
4
- this.accessKey = options.accessKey;
5
- this.managementKey = options.managementKey;
6
- this.localPassword = options.localPassword;
7
- this.fetchImpl = options.fetch ?? globalThis.fetch;
8
- if (!this.fetchImpl) {
9
- throw new Error('fetch is not available; pass options.fetch');
10
- }
11
- }
12
- setAccessKey(key) {
13
- this.accessKey = key;
14
- }
15
- setManagementKey(key) {
16
- this.managementKey = key;
17
- }
18
- setLocalPassword(value) {
19
- this.localPassword = value;
20
- }
21
- buildUrl(path, query) {
22
- const url = new URL(path, this.baseUrl);
23
- if (query) {
24
- for (const [key, value] of Object.entries(query)) {
25
- if (value === undefined)
26
- continue;
27
- url.searchParams.set(key, String(value));
28
- }
29
- }
30
- return url.toString();
31
- }
32
- async requestJson(method, path, body, options, auth) {
33
- const headers = {
34
- 'Content-Type': 'application/json',
35
- ...(options?.headers ?? {})
36
- };
37
- this.applyAuth(headers, auth);
38
- const res = await this.fetchImpl(this.buildUrl(path, options?.query), {
39
- method,
40
- headers,
41
- body: body === undefined ? undefined : JSON.stringify(body)
42
- });
43
- const text = await res.text();
44
- if (!text)
45
- return undefined;
46
- return JSON.parse(text);
47
- }
48
- async requestText(method, path, body, options, auth) {
49
- const headers = {
50
- ...(options?.headers ?? {})
51
- };
52
- this.applyAuth(headers, auth);
53
- const res = await this.fetchImpl(this.buildUrl(path, options?.query), {
54
- method,
55
- headers,
56
- body
57
- });
58
- return res.text();
59
- }
60
- async requestRaw(method, path, body, options, auth) {
61
- const headers = {
62
- ...(options?.headers ?? {})
63
- };
64
- this.applyAuth(headers, auth);
65
- return this.fetchImpl(this.buildUrl(path, options?.query), {
66
- method,
67
- headers,
68
- body
69
- });
70
- }
71
- applyAuth(headers, auth) {
72
- if (auth === 'access' && this.accessKey) {
73
- headers.Authorization = `Bearer ${this.accessKey}`;
74
- }
75
- if (auth === 'management' && this.managementKey) {
76
- headers.Authorization = `Bearer ${this.managementKey}`;
77
- }
78
- if (auth === 'local' && this.localPassword) {
79
- headers.Authorization = `Bearer ${this.localPassword}`;
80
- headers['X-Local-Password'] = this.localPassword;
81
- }
82
- }
83
- getWebsocketUrl(path = '/v1/ws') {
84
- const base = this.baseUrl.replace(/\/+$/, '');
85
- const wsBase = base.replace(/^http/, 'ws');
86
- const normalized = path.startsWith('/') ? path : `/${path}`;
87
- return `${wsBase}${normalized}`;
88
- }
89
- // Public
90
- getRoot() {
91
- return this.requestJson('GET', '/');
92
- }
93
- getManagementHtml() {
94
- return this.requestRaw('GET', '/management.html');
95
- }
96
- keepAlive() {
97
- return this.requestJson('GET', '/keep-alive', undefined, undefined, 'local');
98
- }
99
- anthropicCallback(query) {
100
- return this.requestRaw('GET', '/anthropic/callback', undefined, { query });
101
- }
102
- codexCallback(query) {
103
- return this.requestRaw('GET', '/codex/callback', undefined, { query });
104
- }
105
- googleCallback(query) {
106
- return this.requestRaw('GET', '/google/callback', undefined, { query });
107
- }
108
- iflowCallback(query) {
109
- return this.requestRaw('GET', '/iflow/callback', undefined, { query });
110
- }
111
- antigravityCallback(query) {
112
- return this.requestRaw('GET', '/antigravity/callback', undefined, { query });
113
- }
114
- // v1internal Gemini CLI handler (localhost only)
115
- postV1Internal(method, body, options) {
116
- return this.requestRaw('POST', `/v1internal:${method}`, JSON.stringify(body), options);
117
- }
118
- // OpenAI-compatible (/v1)
119
- getModels() {
120
- return this.requestJson('GET', '/v1/models', undefined, undefined, 'access');
121
- }
122
- postChatCompletions(body, options) {
123
- return this.requestRaw('POST', '/v1/chat/completions', JSON.stringify(body), options, 'access');
124
- }
125
- postCompletions(body, options) {
126
- return this.requestRaw('POST', '/v1/completions', JSON.stringify(body), options, 'access');
127
- }
128
- postMessages(body, options) {
129
- return this.requestRaw('POST', '/v1/messages', JSON.stringify(body), options, 'access');
130
- }
131
- postMessagesCountTokens(body, options) {
132
- return this.requestRaw('POST', '/v1/messages/count_tokens', JSON.stringify(body), options, 'access');
133
- }
134
- postResponses(body, options) {
135
- return this.requestRaw('POST', '/v1/responses', JSON.stringify(body), options, 'access');
136
- }
137
- postResponsesCompact(body, options) {
138
- return this.requestRaw('POST', '/v1/responses/compact', JSON.stringify(body), options, 'access');
139
- }
140
- // CLIProxy simplified (/v1/cliproxy)
141
- getCliproxyAuths(query) {
142
- return this.requestJson('GET', '/v1/cliproxy/auths', undefined, { query: query }, 'access');
143
- }
144
- getCliproxyModels(query) {
145
- return this.requestJson('GET', '/v1/cliproxy/models', undefined, { query: query }, 'access');
146
- }
147
- postCliproxyChat(body, options) {
148
- return this.requestRaw('POST', '/v1/cliproxy/chat', JSON.stringify(body), options, 'access');
149
- }
150
- // Gemini-compatible (/v1beta)
151
- getGeminiModels(options) {
152
- return this.requestRaw('GET', '/v1beta/models', undefined, options, 'access');
153
- }
154
- postGeminiModelsAction(action, body, options) {
155
- return this.requestRaw('POST', `/v1beta/models/${action}`, JSON.stringify(body), options, 'access');
156
- }
157
- getGeminiModelsAction(action, query, options) {
158
- return this.requestRaw('GET', `/v1beta/models/${action}`, undefined, { ...options, query }, 'access');
159
- }
160
- // Management
161
- getUsage() {
162
- return this.requestJson('GET', '/v0/management/usage', undefined, undefined, 'management');
163
- }
164
- exportUsage() {
165
- return this.requestJson('GET', '/v0/management/usage/export', undefined, undefined, 'management');
166
- }
167
- importUsage(body) {
168
- return this.requestJson('POST', '/v0/management/usage/import', body, undefined, 'management');
169
- }
170
- getConfig() {
171
- return this.requestJson('GET', '/v0/management/config', undefined, undefined, 'management');
172
- }
173
- getConfigYaml() {
174
- return this.requestText('GET', '/v0/management/config.yaml', undefined, undefined, 'management');
175
- }
176
- putConfigYaml(body) {
177
- return this.requestRaw('PUT', '/v0/management/config.yaml', body, { headers: { 'Content-Type': 'text/yaml' } }, 'management').then(async (res) => {
178
- const text = await res.text();
179
- return text ? JSON.parse(text) : { status: 'ok' };
180
- });
181
- }
182
- getLatestVersion() {
183
- return this.requestJson('GET', '/v0/management/latest-version', undefined, undefined, 'management');
184
- }
185
- getDebug() {
186
- return this.requestJson('GET', '/v0/management/debug', undefined, undefined, 'management');
187
- }
188
- putDebug(body) {
189
- return this.requestJson('PUT', '/v0/management/debug', body, undefined, 'management');
190
- }
191
- patchDebug(body) {
192
- return this.requestJson('PATCH', '/v0/management/debug', body, undefined, 'management');
193
- }
194
- getLoggingToFile() {
195
- return this.requestJson('GET', '/v0/management/logging-to-file', undefined, undefined, 'management');
196
- }
197
- putLoggingToFile(body) {
198
- return this.requestJson('PUT', '/v0/management/logging-to-file', body, undefined, 'management');
199
- }
200
- patchLoggingToFile(body) {
201
- return this.requestJson('PATCH', '/v0/management/logging-to-file', body, undefined, 'management');
202
- }
203
- getLogsMaxTotalSizeMB() {
204
- return this.requestJson('GET', '/v0/management/logs-max-total-size-mb', undefined, undefined, 'management');
205
- }
206
- putLogsMaxTotalSizeMB(body) {
207
- return this.requestJson('PUT', '/v0/management/logs-max-total-size-mb', body, undefined, 'management');
208
- }
209
- patchLogsMaxTotalSizeMB(body) {
210
- return this.requestJson('PATCH', '/v0/management/logs-max-total-size-mb', body, undefined, 'management');
211
- }
212
- getErrorLogsMaxFiles() {
213
- return this.requestJson('GET', '/v0/management/error-logs-max-files', undefined, undefined, 'management');
214
- }
215
- putErrorLogsMaxFiles(body) {
216
- return this.requestJson('PUT', '/v0/management/error-logs-max-files', body, undefined, 'management');
217
- }
218
- patchErrorLogsMaxFiles(body) {
219
- return this.requestJson('PATCH', '/v0/management/error-logs-max-files', body, undefined, 'management');
220
- }
221
- getUsageStatisticsEnabled() {
222
- return this.requestJson('GET', '/v0/management/usage-statistics-enabled', undefined, undefined, 'management');
223
- }
224
- putUsageStatisticsEnabled(body) {
225
- return this.requestJson('PUT', '/v0/management/usage-statistics-enabled', body, undefined, 'management');
226
- }
227
- patchUsageStatisticsEnabled(body) {
228
- return this.requestJson('PATCH', '/v0/management/usage-statistics-enabled', body, undefined, 'management');
229
- }
230
- getProxyUrl() {
231
- return this.requestJson('GET', '/v0/management/proxy-url', undefined, undefined, 'management');
232
- }
233
- putProxyUrl(body) {
234
- return this.requestJson('PUT', '/v0/management/proxy-url', body, undefined, 'management');
235
- }
236
- patchProxyUrl(body) {
237
- return this.requestJson('PATCH', '/v0/management/proxy-url', body, undefined, 'management');
238
- }
239
- deleteProxyUrl() {
240
- return this.requestJson('DELETE', '/v0/management/proxy-url', undefined, undefined, 'management');
241
- }
242
- apiCall(body) {
243
- return this.requestJson('POST', '/v0/management/api-call', body, undefined, 'management');
244
- }
245
- getSwitchProject() {
246
- return this.requestJson('GET', '/v0/management/quota-exceeded/switch-project', undefined, undefined, 'management');
247
- }
248
- putSwitchProject(body) {
249
- return this.requestJson('PUT', '/v0/management/quota-exceeded/switch-project', body, undefined, 'management');
250
- }
251
- patchSwitchProject(body) {
252
- return this.requestJson('PATCH', '/v0/management/quota-exceeded/switch-project', body, undefined, 'management');
253
- }
254
- getSwitchPreviewModel() {
255
- return this.requestJson('GET', '/v0/management/quota-exceeded/switch-preview-model', undefined, undefined, 'management');
256
- }
257
- putSwitchPreviewModel(body) {
258
- return this.requestJson('PUT', '/v0/management/quota-exceeded/switch-preview-model', body, undefined, 'management');
259
- }
260
- patchSwitchPreviewModel(body) {
261
- return this.requestJson('PATCH', '/v0/management/quota-exceeded/switch-preview-model', body, undefined, 'management');
262
- }
263
- getApiKeys() {
264
- return this.requestJson('GET', '/v0/management/api-keys', undefined, undefined, 'management');
265
- }
266
- putApiKeys(body) {
267
- return this.requestJson('PUT', '/v0/management/api-keys', body, undefined, 'management');
268
- }
269
- patchApiKeys(body) {
270
- return this.requestJson('PATCH', '/v0/management/api-keys', body, undefined, 'management');
271
- }
272
- deleteApiKeys(query) {
273
- return this.requestJson('DELETE', '/v0/management/api-keys', undefined, { query }, 'management');
274
- }
275
- getGeminiKeys() {
276
- return this.requestJson('GET', '/v0/management/gemini-api-key', undefined, undefined, 'management');
277
- }
278
- putGeminiKeys(body) {
279
- return this.requestJson('PUT', '/v0/management/gemini-api-key', body, undefined, 'management');
280
- }
281
- patchGeminiKey(body) {
282
- return this.requestJson('PATCH', '/v0/management/gemini-api-key', body, undefined, 'management');
283
- }
284
- deleteGeminiKey(query) {
285
- return this.requestJson('DELETE', '/v0/management/gemini-api-key', undefined, { query }, 'management');
286
- }
287
- getLogs(query) {
288
- return this.requestJson('GET', '/v0/management/logs', undefined, { query }, 'management');
289
- }
290
- deleteLogs() {
291
- return this.requestJson('DELETE', '/v0/management/logs', undefined, undefined, 'management');
292
- }
293
- getRequestErrorLogs() {
294
- return this.requestJson('GET', '/v0/management/request-error-logs', undefined, undefined, 'management');
295
- }
296
- downloadRequestErrorLog(name) {
297
- return this.requestRaw('GET', `/v0/management/request-error-logs/${encodeURIComponent(name)}`, undefined, undefined, 'management');
298
- }
299
- getRequestLogById(id) {
300
- return this.requestRaw('GET', `/v0/management/request-log-by-id/${encodeURIComponent(id)}`, undefined, undefined, 'management');
301
- }
302
- getRequestLog() {
303
- return this.requestJson('GET', '/v0/management/request-log', undefined, undefined, 'management');
304
- }
305
- putRequestLog(body) {
306
- return this.requestJson('PUT', '/v0/management/request-log', body, undefined, 'management');
307
- }
308
- patchRequestLog(body) {
309
- return this.requestJson('PATCH', '/v0/management/request-log', body, undefined, 'management');
310
- }
311
- getWebsocketAuth() {
312
- return this.requestJson('GET', '/v0/management/ws-auth', undefined, undefined, 'management');
313
- }
314
- putWebsocketAuth(body) {
315
- return this.requestJson('PUT', '/v0/management/ws-auth', body, undefined, 'management');
316
- }
317
- patchWebsocketAuth(body) {
318
- return this.requestJson('PATCH', '/v0/management/ws-auth', body, undefined, 'management');
319
- }
320
- getAmpCode() {
321
- return this.requestJson('GET', '/v0/management/ampcode', undefined, undefined, 'management');
322
- }
323
- getAmpUpstreamUrl() {
324
- return this.requestJson('GET', '/v0/management/ampcode/upstream-url', undefined, undefined, 'management');
325
- }
326
- putAmpUpstreamUrl(body) {
327
- return this.requestJson('PUT', '/v0/management/ampcode/upstream-url', body, undefined, 'management');
328
- }
329
- patchAmpUpstreamUrl(body) {
330
- return this.requestJson('PATCH', '/v0/management/ampcode/upstream-url', body, undefined, 'management');
331
- }
332
- deleteAmpUpstreamUrl() {
333
- return this.requestJson('DELETE', '/v0/management/ampcode/upstream-url', undefined, undefined, 'management');
334
- }
335
- getAmpUpstreamApiKey() {
336
- return this.requestJson('GET', '/v0/management/ampcode/upstream-api-key', undefined, undefined, 'management');
337
- }
338
- putAmpUpstreamApiKey(body) {
339
- return this.requestJson('PUT', '/v0/management/ampcode/upstream-api-key', body, undefined, 'management');
340
- }
341
- patchAmpUpstreamApiKey(body) {
342
- return this.requestJson('PATCH', '/v0/management/ampcode/upstream-api-key', body, undefined, 'management');
343
- }
344
- deleteAmpUpstreamApiKey() {
345
- return this.requestJson('DELETE', '/v0/management/ampcode/upstream-api-key', undefined, undefined, 'management');
346
- }
347
- getAmpRestrictManagementToLocalhost() {
348
- return this.requestJson('GET', '/v0/management/ampcode/restrict-management-to-localhost', undefined, undefined, 'management');
349
- }
350
- putAmpRestrictManagementToLocalhost(body) {
351
- return this.requestJson('PUT', '/v0/management/ampcode/restrict-management-to-localhost', body, undefined, 'management');
352
- }
353
- patchAmpRestrictManagementToLocalhost(body) {
354
- return this.requestJson('PATCH', '/v0/management/ampcode/restrict-management-to-localhost', body, undefined, 'management');
355
- }
356
- getAmpModelMappings() {
357
- return this.requestJson('GET', '/v0/management/ampcode/model-mappings', undefined, undefined, 'management');
358
- }
359
- putAmpModelMappings(body) {
360
- return this.requestJson('PUT', '/v0/management/ampcode/model-mappings', body, undefined, 'management');
361
- }
362
- patchAmpModelMappings(body) {
363
- return this.requestJson('PATCH', '/v0/management/ampcode/model-mappings', body, undefined, 'management');
364
- }
365
- deleteAmpModelMappings(query) {
366
- return this.requestJson('DELETE', '/v0/management/ampcode/model-mappings', undefined, { query }, 'management');
367
- }
368
- getAmpForceModelMappings() {
369
- return this.requestJson('GET', '/v0/management/ampcode/force-model-mappings', undefined, undefined, 'management');
370
- }
371
- putAmpForceModelMappings(body) {
372
- return this.requestJson('PUT', '/v0/management/ampcode/force-model-mappings', body, undefined, 'management');
373
- }
374
- patchAmpForceModelMappings(body) {
375
- return this.requestJson('PATCH', '/v0/management/ampcode/force-model-mappings', body, undefined, 'management');
376
- }
377
- getAmpUpstreamApiKeys() {
378
- return this.requestJson('GET', '/v0/management/ampcode/upstream-api-keys', undefined, undefined, 'management');
379
- }
380
- putAmpUpstreamApiKeys(body) {
381
- return this.requestJson('PUT', '/v0/management/ampcode/upstream-api-keys', body, undefined, 'management');
382
- }
383
- patchAmpUpstreamApiKeys(body) {
384
- return this.requestJson('PATCH', '/v0/management/ampcode/upstream-api-keys', body, undefined, 'management');
385
- }
386
- deleteAmpUpstreamApiKeys(query) {
387
- return this.requestJson('DELETE', '/v0/management/ampcode/upstream-api-keys', undefined, { query }, 'management');
388
- }
389
- getRequestRetry() {
390
- return this.requestJson('GET', '/v0/management/request-retry', undefined, undefined, 'management');
391
- }
392
- putRequestRetry(body) {
393
- return this.requestJson('PUT', '/v0/management/request-retry', body, undefined, 'management');
394
- }
395
- patchRequestRetry(body) {
396
- return this.requestJson('PATCH', '/v0/management/request-retry', body, undefined, 'management');
397
- }
398
- getMaxRetryInterval() {
399
- return this.requestJson('GET', '/v0/management/max-retry-interval', undefined, undefined, 'management');
400
- }
401
- putMaxRetryInterval(body) {
402
- return this.requestJson('PUT', '/v0/management/max-retry-interval', body, undefined, 'management');
403
- }
404
- patchMaxRetryInterval(body) {
405
- return this.requestJson('PATCH', '/v0/management/max-retry-interval', body, undefined, 'management');
406
- }
407
- getForceModelPrefix() {
408
- return this.requestJson('GET', '/v0/management/force-model-prefix', undefined, undefined, 'management');
409
- }
410
- putForceModelPrefix(body) {
411
- return this.requestJson('PUT', '/v0/management/force-model-prefix', body, undefined, 'management');
412
- }
413
- patchForceModelPrefix(body) {
414
- return this.requestJson('PATCH', '/v0/management/force-model-prefix', body, undefined, 'management');
415
- }
416
- getRoutingStrategy() {
417
- return this.requestJson('GET', '/v0/management/routing/strategy', undefined, undefined, 'management');
418
- }
419
- putRoutingStrategy(body) {
420
- return this.requestJson('PUT', '/v0/management/routing/strategy', body, undefined, 'management');
421
- }
422
- patchRoutingStrategy(body) {
423
- return this.requestJson('PATCH', '/v0/management/routing/strategy', body, undefined, 'management');
424
- }
425
- getClaudeKeys() {
426
- return this.requestJson('GET', '/v0/management/claude-api-key', undefined, undefined, 'management');
427
- }
428
- putClaudeKeys(body) {
429
- return this.requestJson('PUT', '/v0/management/claude-api-key', body, undefined, 'management');
430
- }
431
- patchClaudeKey(body) {
432
- return this.requestJson('PATCH', '/v0/management/claude-api-key', body, undefined, 'management');
433
- }
434
- deleteClaudeKey(query) {
435
- return this.requestJson('DELETE', '/v0/management/claude-api-key', undefined, { query }, 'management');
436
- }
437
- getCodexKeys() {
438
- return this.requestJson('GET', '/v0/management/codex-api-key', undefined, undefined, 'management');
439
- }
440
- putCodexKeys(body) {
441
- return this.requestJson('PUT', '/v0/management/codex-api-key', body, undefined, 'management');
442
- }
443
- patchCodexKey(body) {
444
- return this.requestJson('PATCH', '/v0/management/codex-api-key', body, undefined, 'management');
445
- }
446
- deleteCodexKey(query) {
447
- return this.requestJson('DELETE', '/v0/management/codex-api-key', undefined, { query }, 'management');
448
- }
449
- getOpenAICompatibility() {
450
- return this.requestJson('GET', '/v0/management/openai-compatibility', undefined, undefined, 'management');
451
- }
452
- putOpenAICompatibility(body) {
453
- return this.requestJson('PUT', '/v0/management/openai-compatibility', body, undefined, 'management');
454
- }
455
- patchOpenAICompatibility(body) {
456
- return this.requestJson('PATCH', '/v0/management/openai-compatibility', body, undefined, 'management');
457
- }
458
- deleteOpenAICompatibility(query) {
459
- return this.requestJson('DELETE', '/v0/management/openai-compatibility', undefined, { query }, 'management');
460
- }
461
- getVertexCompatKeys() {
462
- return this.requestJson('GET', '/v0/management/vertex-api-key', undefined, undefined, 'management');
463
- }
464
- putVertexCompatKeys(body) {
465
- return this.requestJson('PUT', '/v0/management/vertex-api-key', body, undefined, 'management');
466
- }
467
- patchVertexCompatKey(body) {
468
- return this.requestJson('PATCH', '/v0/management/vertex-api-key', body, undefined, 'management');
469
- }
470
- deleteVertexCompatKey(query) {
471
- return this.requestJson('DELETE', '/v0/management/vertex-api-key', undefined, { query }, 'management');
472
- }
473
- getOAuthExcludedModels() {
474
- return this.requestJson('GET', '/v0/management/oauth-excluded-models', undefined, undefined, 'management');
475
- }
476
- putOAuthExcludedModels(body) {
477
- return this.requestJson('PUT', '/v0/management/oauth-excluded-models', body, undefined, 'management');
478
- }
479
- patchOAuthExcludedModels(body) {
480
- return this.requestJson('PATCH', '/v0/management/oauth-excluded-models', body, undefined, 'management');
481
- }
482
- deleteOAuthExcludedModels(query) {
483
- return this.requestJson('DELETE', '/v0/management/oauth-excluded-models', undefined, { query }, 'management');
484
- }
485
- getOAuthModelAlias() {
486
- return this.requestJson('GET', '/v0/management/oauth-model-alias', undefined, undefined, 'management');
487
- }
488
- putOAuthModelAlias(body) {
489
- return this.requestJson('PUT', '/v0/management/oauth-model-alias', body, undefined, 'management');
490
- }
491
- patchOAuthModelAlias(body) {
492
- return this.requestJson('PATCH', '/v0/management/oauth-model-alias', body, undefined, 'management');
493
- }
494
- deleteOAuthModelAlias(query) {
495
- return this.requestJson('DELETE', '/v0/management/oauth-model-alias', undefined, { query }, 'management');
496
- }
497
- listAuthFiles(query) {
498
- return this.requestJson('GET', '/v0/management/auth-files', undefined, { query: query }, 'management');
499
- }
500
- getAuthFileModels(query) {
501
- return this.requestJson('GET', '/v0/management/auth-files/models', undefined, { query: query }, 'management');
502
- }
503
- getStaticModelDefinitions(channel) {
504
- return this.requestRaw('GET', `/v0/management/model-definitions/${encodeURIComponent(channel)}`, undefined, undefined, 'management');
505
- }
506
- downloadAuthFile(query) {
507
- return this.requestRaw('GET', '/v0/management/auth-files/download', undefined, { query }, 'management');
508
- }
509
- uploadAuthFile(file, name) {
510
- const form = new FormData();
511
- form.append('file', file);
512
- if (name)
513
- form.append('name', name);
514
- return this.requestRaw('POST', '/v0/management/auth-files', form, undefined, 'management');
515
- }
516
- deleteAuthFile(query) {
517
- return this.requestJson('DELETE', '/v0/management/auth-files', undefined, { query }, 'management');
518
- }
519
- patchAuthFileStatus(body) {
520
- return this.requestJson('PATCH', '/v0/management/auth-files/status', body, undefined, 'management');
521
- }
522
- importVertexCredential(file) {
523
- const form = new FormData();
524
- form.append('file', file);
525
- return this.requestRaw('POST', '/v0/management/vertex/import', form, undefined, 'management');
526
- }
527
- requestAnthropicAuthUrl() {
528
- return this.requestJson('GET', '/v0/management/anthropic-auth-url', undefined, undefined, 'management');
529
- }
530
- requestCodexAuthUrl() {
531
- return this.requestJson('GET', '/v0/management/codex-auth-url', undefined, undefined, 'management');
532
- }
533
- requestGeminiCliAuthUrl() {
534
- return this.requestJson('GET', '/v0/management/gemini-cli-auth-url', undefined, undefined, 'management');
535
- }
536
- requestAntigravityAuthUrl() {
537
- return this.requestJson('GET', '/v0/management/antigravity-auth-url', undefined, undefined, 'management');
538
- }
539
- requestQwenAuthUrl() {
540
- return this.requestJson('GET', '/v0/management/qwen-auth-url', undefined, undefined, 'management');
541
- }
542
- requestKimiAuthUrl() {
543
- return this.requestJson('GET', '/v0/management/kimi-auth-url', undefined, undefined, 'management');
544
- }
545
- requestIFlowAuthUrl() {
546
- return this.requestJson('GET', '/v0/management/iflow-auth-url', undefined, undefined, 'management');
547
- }
548
- requestIFlowCookieToken(body) {
549
- return this.requestJson('POST', '/v0/management/iflow-auth-url', body, undefined, 'management');
550
- }
551
- postOAuthCallback(body) {
552
- return this.requestJson('POST', '/v0/management/oauth-callback', body, undefined, 'management');
553
- }
554
- getAuthStatus(query) {
555
- return this.requestJson('GET', '/v0/management/get-auth-status', undefined, { query }, 'management');
556
- }
557
- }