fix: 修改hub构建方式

This commit is contained in:
fawney19
2026-03-02 04:05:40 +08:00
parent b7ef900181
commit 5b9d9452c9
13 changed files with 1349 additions and 406 deletions

View File

@@ -28,6 +28,48 @@ export interface ProviderOAuthCompleteResponseWithKey {
email?: string | null
}
export interface OAuthBatchImportResultItem {
index: number
status: 'success' | 'error'
key_id?: string
key_name?: string
auth_method?: string
error?: string
replaced?: boolean
}
export type OAuthBatchImportTaskStatus = 'submitted' | 'processing' | 'completed' | 'failed'
export interface OAuthBatchImportTaskStartResponse {
task_id: string
status: OAuthBatchImportTaskStatus
total: number
processed: number
success: number
failed: number
progress_percent: number
message?: string | null
}
export interface OAuthBatchImportTaskStatusResponse {
task_id: string
provider_id: string
provider_type: string
status: OAuthBatchImportTaskStatus
total: number
processed: number
success: number
failed: number
progress_percent: number
message?: string | null
error?: string | null
error_samples: OAuthBatchImportResultItem[]
created_at: number
started_at?: number | null
finished_at?: number | null
updated_at: number
}
export async function refreshProviderOAuth(keyId: string): Promise<ProviderOAuthCompleteResponse> {
const resp = await client.post(`/api/admin/provider-oauth/keys/${keyId}/refresh`)
return resp.data
@@ -56,6 +98,26 @@ export async function importProviderRefreshToken(
return resp.data
}
export async function startBatchImportOAuthTask(
providerId: string,
credentials: string,
proxyNodeId?: string
): Promise<OAuthBatchImportTaskStartResponse> {
const resp = await client.post(`/api/admin/provider-oauth/providers/${providerId}/batch-import/tasks`, {
credentials,
proxy_node_id: proxyNodeId || undefined,
})
return resp.data
}
export async function getBatchImportOAuthTaskStatus(
providerId: string,
taskId: string
): Promise<OAuthBatchImportTaskStatusResponse> {
const resp = await client.get(`/api/admin/provider-oauth/providers/${providerId}/batch-import/tasks/${taskId}`)
return resp.data
}
// Device Authorization (AWS SSO OIDC)
export interface DeviceAuthorizeRequest {