datasource oauth
parent
a39d7e1f85
commit
2c52561060
@ -0,0 +1,22 @@
|
|||||||
|
export type DataSourceCredential = {
|
||||||
|
credential: Record<string, any>
|
||||||
|
type: string
|
||||||
|
name: string
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
export type DataSourceAuth = {
|
||||||
|
author: string
|
||||||
|
provider: string
|
||||||
|
plugin_id: string
|
||||||
|
plugin_unique_identifier: string
|
||||||
|
icon: any
|
||||||
|
name: string
|
||||||
|
label: any
|
||||||
|
description: any
|
||||||
|
credential_schema?: any[]
|
||||||
|
oauth_schema?: {
|
||||||
|
client_schema?: any[]
|
||||||
|
credentials_schema?: any[]
|
||||||
|
}
|
||||||
|
credentials_list: DataSourceCredential[]
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import { get } from './base'
|
||||||
|
import type { DataSourceAuth } from '@/app/components/header/account-setting/data-source-page-new/types'
|
||||||
|
|
||||||
|
const NAME_SPACE = 'data-source-auth'
|
||||||
|
|
||||||
|
export const useGetDataSourceListAuth = () => {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: [NAME_SPACE, 'list'],
|
||||||
|
queryFn: () => get<{ result: DataSourceAuth[] }>('/auth/plugin/datasource/list'),
|
||||||
|
retry: 0,
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue