Feat/dataset support api service (#1240)

Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
zxhlyh
2023-09-27 16:06:49 +08:00
committed by GitHub
parent 46154c6705
commit 9dbb8acd4b
14 changed files with 1832 additions and 20 deletions

View File

@@ -22,6 +22,10 @@ import type {
createDocumentResponse,
} from '@/models/datasets'
import type { CommonResponse, DataSourceNotionWorkspace } from '@/models/common'
import type {
ApikeysListResponse,
CreateApiKeyResponse,
} from '@/models/app'
// apis for documents in a dataset
@@ -192,3 +196,19 @@ export const fetchFileIndexingEstimate: Fetcher<FileIndexingEstimateResponse, an
export const fetchNotionPagePreview: Fetcher<{ content: string }, { workspaceID: string; pageID: string; pageType: string }> = ({ workspaceID, pageID, pageType }) => {
return get<{ content: string }>(`notion/workspaces/${workspaceID}/pages/${pageID}/${pageType}/preview`)
}
export const fetchApiKeysList: Fetcher<ApikeysListResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
return get<ApikeysListResponse>(url, params)
}
export const delApikey: Fetcher<CommonResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
return del<CommonResponse>(url, params)
}
export const createApikey: Fetcher<CreateApiKeyResponse, { url: string; body: Record<string, any> }> = ({ url, body }) => {
return post<CreateApiKeyResponse>(url, body)
}
export const fetchDatasetApiBaseUrl: Fetcher<{ api_base_url: string }, string> = (url) => {
return get<{ api_base_url: string }>(url)
}